From 5ca6cfe456d1a6ae630df4d1c568b0b742480e92 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 13 Jul 2010 18:26:57 +0200 Subject: dr77: #i113097# make Sequence(sal_Int32) explicit --- comphelper/inc/comphelper/sequenceasvector.hxx | 11 +++++++++++ toolkit/source/controls/grid/defaultgriddatamodel.cxx | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/comphelper/inc/comphelper/sequenceasvector.hxx b/comphelper/inc/comphelper/sequenceasvector.hxx index 263b68b24c7c..f850bff7ec25 100644 --- a/comphelper/inc/comphelper/sequenceasvector.hxx +++ b/comphelper/inc/comphelper/sequenceasvector.hxx @@ -85,6 +85,17 @@ class SequenceAsVector : public ::std::vector< TElementType > ~SequenceAsVector() {} + //--------------------------------------- + /** @short creates a new vector with the given length. + + @param nLength + the number of elements for the new vector. + */ + SequenceAsVector(sal_Int32 nLength) : + ::std::vector< TElementType >( static_cast< size_t >( nLength ) ) + { + } + //--------------------------------------- /** @short creates a new deque from the given uno sequence. diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx index 7ffafdf0ddb6..adc40b0426d7 100644 --- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx +++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx @@ -198,7 +198,7 @@ void SAL_CALL DefaultGridDataModel::removeRow(::sal_Int32 index) throw (::com::s ::rtl::OUString headerName( (::rtl::OUString) rowHeaders[index] ); rowHeaders.erase(rowHeaders.begin() + index); - Sequence< Any >& rowData ( (Sequence< Any >&)data[index] ); + Sequence< Any > rowData ( (Sequence< Any >&)data[index] ); data.erase(data.begin() + index); broadcast_remove( index, headerName, rowData); } @@ -241,7 +241,7 @@ void SAL_CALL DefaultGridDataModel::removeAll() throw (RuntimeException) { rowHeaders.clear(); data.clear(); - broadcast_remove( -1, ::rtl::OUString(), 0); + broadcast_remove( -1, ::rtl::OUString(), Sequence< Any >()); } //--------------------------------------------------------------------- void SAL_CALL DefaultGridDataModel::setRowHeaderWidth(sal_Int32 _value) throw (::com::sun::star::uno::RuntimeException) -- cgit From d34141e18e3f5d2054c491bbf70e65f6835bd7f7 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 13 Jul 2010 18:26:57 +0200 Subject: dr77: #i113097# make Sequence(sal_Int32) explicit --- sc/source/ui/view/drawview.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 1d2b797b3a9b..7a153ef15a73 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -530,19 +530,15 @@ void ScDrawView::MarkListHasChanged() SfxViewFrame* pViewFrame = pViewSh->GetViewFrame(); BOOL bOle = pViewSh->GetViewFrame()->GetFrame().IsInPlace(); + uno::Sequence< embed::VerbDescriptor > aVerbs; if ( pOle2Obj && !bOle ) { uno::Reference < embed::XEmbeddedObject > xObj = pOle2Obj->GetObjRef(); + DBG_ASSERT( xObj.is(), "SdrOle2Obj ohne ObjRef" ); if (xObj.is()) - pViewSh->SetVerbs( xObj->getSupportedVerbs() ); - else - { - DBG_ERROR("SdrOle2Obj ohne ObjRef"); - pViewSh->SetVerbs( 0 ); - } + aVerbs = xObj->getSupportedVerbs(); } - else - pViewSh->SetVerbs( 0 ); + pViewSh->SetVerbs( aVerbs ); // Image-Map Editor -- cgit From 16813a9d8b461ec6a78373aef29f1d9a74903ef7 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 13 Jul 2010 18:26:57 +0200 Subject: dr77: #i113097# make Sequence(sal_Int32) explicit --- cppu/inc/com/sun/star/uno/Sequence.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cppu/inc/com/sun/star/uno/Sequence.h b/cppu/inc/com/sun/star/uno/Sequence.h index da9906533583..71bb42c7413b 100644 --- a/cppu/inc/com/sun/star/uno/Sequence.h +++ b/cppu/inc/com/sun/star/uno/Sequence.h @@ -125,7 +125,7 @@ public: @param len initial sequence length */ - inline Sequence( sal_Int32 len ); + inline explicit Sequence( sal_Int32 len ); /** Destructor: Releases sequence handle. Last handle will destruct elements and free memory. -- cgit From 8dfe965a32b7d99d5bd70489f5f45652114ca889 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 13 Jul 2010 18:26:57 +0200 Subject: dr77: #i113097# make Sequence(sal_Int32) explicit --- fpicker/source/unx/gnome/SalGtkFilePicker.cxx | 2 +- svx/source/items/customshapeitem.cxx | 2 +- svx/source/sdr/contact/objectcontactofobjlistpainter.cxx | 2 +- svx/source/sdr/contact/objectcontactofpageview.cxx | 2 +- svx/source/sdr/contact/viewcontactofgraphic.cxx | 2 +- svx/source/sdr/overlay/overlaymanager.cxx | 2 +- svx/source/svdraw/svdobj.cxx | 6 +++--- svx/source/svdraw/svdotxtr.cxx | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx index c6b0acd6a33f..266748f8d792 100644 --- a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx @@ -1471,7 +1471,7 @@ uno::Sequence SAL_CALL SalGtkFilePicker::getSupportedImageFormats() t OSL_ASSERT( m_pDialog != NULL ); // TODO return m_pImpl->getSupportedImageFormats(); - return 0; + return uno::Sequence(); } sal_Int32 SAL_CALL SalGtkFilePicker::getTargetColorDepth() throw( uno::RuntimeException ) diff --git a/svx/source/items/customshapeitem.cxx b/svx/source/items/customshapeitem.cxx index c7a401ed4054..08eebe99b3df 100644 --- a/svx/source/items/customshapeitem.cxx +++ b/svx/source/items/customshapeitem.cxx @@ -60,7 +60,7 @@ size_t SdrCustomShapeGeometryItem::PropertyPairHash::operator()( const SdrCustom return (size_t)r1.first.hashCode() + r1.second.hashCode(); }; -TYPEINIT1_FACTORY( SdrCustomShapeGeometryItem, SfxPoolItem , new SdrCustomShapeGeometryItem(0)); +TYPEINIT1_FACTORY( SdrCustomShapeGeometryItem, SfxPoolItem , new SdrCustomShapeGeometryItem); SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem() : SfxPoolItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) {} diff --git a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx index da8518d7f1a1..c552af778e9e 100644 --- a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx +++ b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx @@ -121,7 +121,7 @@ namespace sdr aViewRange, GetXDrawPageForSdrPage(const_cast< SdrPage* >(mpProcessedPage)), 0.0, - 0); + com::sun::star::uno::Sequence()); updateViewInformation2D(aNewViewInformation2D); // collect primitive data in a sequence; this will already use the updated ViewInformation2D diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx index 1652855d84a8..f33790f82028 100644 --- a/svx/source/sdr/contact/objectcontactofpageview.cxx +++ b/svx/source/sdr/contact/objectcontactofpageview.cxx @@ -241,7 +241,7 @@ namespace sdr aViewRange, GetXDrawPageForSdrPage(GetSdrPage()), fCurrentTime, - 0); + uno::Sequence()); updateViewInformation2D(aNewViewInformation2D); // get whole Primitive2DSequence; this will already make use of updated ViewInformation2D diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 7172b0840476..80ffa916dbeb 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -296,7 +296,7 @@ namespace sdr // decompose immediately with neutral ViewInformation. This will // layout the text to more simple TextPrimitives from drawinglayer - const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0); + const drawinglayer::geometry::ViewInformation2D aViewInformation2D; drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence( xRetval, diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx index f52205d88e45..93e3b03d072d 100644 --- a/svx/source/sdr/overlay/overlaymanager.cxx +++ b/svx/source/sdr/overlay/overlaymanager.cxx @@ -138,7 +138,7 @@ namespace sdr mnStripeLengthPixel(5), maDrawinglayerOpt(), maViewTransformation(), - maViewInformation2D(0), + maViewInformation2D(), mfDiscreteOne(0.0) { // set Property 'ReducedDisplayQuality' to true to allow simpler interaction diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index b9d3e24592ee..d6d51f24a294 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -940,7 +940,7 @@ void SdrObject::RecalcBoundRect() if(xPrimitives.hasElements()) { // use neutral ViewInformation and get the range of the primitives - const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0); + const drawinglayer::geometry::ViewInformation2D aViewInformation2D; const basegfx::B2DRange aRange(drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xPrimitives, aViewInformation2D)); if(!aRange.isEmpty()) @@ -1202,7 +1202,7 @@ basegfx::B2DPolyPolygon SdrObject::TakeContour() const if(xSequence.hasElements()) { // use neutral ViewInformation - const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0); + const drawinglayer::geometry::ViewInformation2D aViewInformation2D; // create extractor, process and get result drawinglayer::processor2d::ContourExtractor2D aExtractor(aViewInformation2D); @@ -2431,7 +2431,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas if(xSequence.hasElements()) { // use neutral ViewInformation - const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0); + const drawinglayer::geometry::ViewInformation2D aViewInformation2D; // create extractor, process and get result drawinglayer::processor2d::LineGeometryExtractor2D aExtractor(aViewInformation2D); diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx index bd1564ab3f4e..56306721c85a 100644 --- a/svx/source/svdraw/svdotxtr.cxx +++ b/svx/source/svdraw/svdotxtr.cxx @@ -354,7 +354,7 @@ SdrObject* SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const if(xSequence.hasElements()) { // create an extractor with neutral ViewInformation - const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0); + const drawinglayer::geometry::ViewInformation2D aViewInformation2D; drawinglayer::processor2d::TextAsPolygonExtractor2D aExtractor(aViewInformation2D); // extract text as polygons -- cgit From e72da4ca152b7beb78b13531351e13a522e0772c Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 13 Jul 2010 18:26:57 +0200 Subject: dr77: #i113097# make Sequence(sal_Int32) explicit --- sw/source/ui/uiview/view.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 4396ff03807c..1832429b9ae1 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -184,7 +184,7 @@ void SwView::ImpSetVerb( int nSelType ) } if ( bResetVerbs ) { - SetVerbs( 0 ); + SetVerbs( Sequence< embed::VerbDescriptor >() ); bVerbsActive = sal_False; } } -- cgit From a0c28a33d1bb4a306d32318636e342156905b7b2 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 13 Jul 2010 18:26:57 +0200 Subject: dr77: #i113097# make Sequence(sal_Int32) explicit --- sd/source/ui/view/drviews1.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 98d0b7551705..44de8b4afbdd 100755 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -219,7 +219,7 @@ void DrawViewShell::SelectionHasChanged (void) } ViewShellBase& rBase = GetViewShellBase(); - rBase.SetVerbs(0); + rBase.SetVerbs( uno::Sequence< embed::VerbDescriptor >() ); try { -- cgit From 87b16cb9a3b4772a09598baf155fce51eb8ceff2 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 14 Jul 2010 14:32:47 +0200 Subject: dr77 #i113097# new c'tors should be explicit too, of course --- comphelper/inc/comphelper/sequenceasvector.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comphelper/inc/comphelper/sequenceasvector.hxx b/comphelper/inc/comphelper/sequenceasvector.hxx index f850bff7ec25..48dfe50b1645 100644 --- a/comphelper/inc/comphelper/sequenceasvector.hxx +++ b/comphelper/inc/comphelper/sequenceasvector.hxx @@ -91,7 +91,7 @@ class SequenceAsVector : public ::std::vector< TElementType > @param nLength the number of elements for the new vector. */ - SequenceAsVector(sal_Int32 nLength) : + explicit SequenceAsVector(sal_Int32 nLength) : ::std::vector< TElementType >( static_cast< size_t >( nLength ) ) { } -- cgit From ed1952aacdd021368e6bb22e66f6499676cc4569 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 15 Jul 2010 13:58:09 +0200 Subject: dr77: #i113097# 'NULL' is not a shortcut for empty UNO sequences --- .../xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx | 2 +- .../source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx index 71ff13fb3f82..d4bc76e627b5 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx @@ -895,7 +895,7 @@ Sequence< Reference < XCertificate > > SecurityEnvironment_MSCryptImpl :: buildC if (pChainContext) CertFreeCertificateChain(pChainContext); - return NULL ; + return Sequence< Reference < XCertificate > >(); } Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: createCertificateFromRaw( const Sequence< sal_Int8 >& rawCertificate ) throw( SecurityException , RuntimeException ) { diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx index 8f983dae05de..85478f8a4621 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx @@ -206,7 +206,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su return serial ; } else { - return NULL ; + return Sequence< sal_Int8 >(); } } @@ -367,7 +367,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su return issuerUid ; } else { - return NULL ; + return Sequence< sal_Int8 >(); } } @@ -379,7 +379,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su return subjectUid ; } else { - return NULL ; + return Sequence< sal_Int8 >(); } } @@ -403,7 +403,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su return xExtns ; } else { - return NULL ; + return Sequence< Reference< XCertificateExtension > >(); } } @@ -443,7 +443,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su return rawCert ; } else { - return NULL ; + return Sequence< sal_Int8 >(); } } @@ -548,7 +548,7 @@ X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl :: getImplementation( c } } - return NULL; + return Sequence< sal_Int8 >(); } ::rtl::OUString SAL_CALL X509Certificate_MSCryptImpl::getSubjectPublicKeyAlgorithm() @@ -582,7 +582,7 @@ X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl :: getImplementation( c } else { - return NULL ; + return Sequence< sal_Int8 >(); } } -- cgit From 5dc897e1c36d4162e9cdb9768284e5cec8daba57 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 29 Jul 2010 15:04:40 +0200 Subject: dr77: add import of tab color from BIFF8 in OOX filter --- oox/inc/oox/xls/worksheetsettings.hxx | 2 ++ oox/source/xls/chartsheetfragment.cxx | 1 + oox/source/xls/worksheetfragment.cxx | 1 + oox/source/xls/worksheetsettings.cxx | 35 ++++++++++++++++++++++------------- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/oox/inc/oox/xls/worksheetsettings.hxx b/oox/inc/oox/xls/worksheetsettings.hxx index 17e22dc5342c..990a463b3545 100644 --- a/oox/inc/oox/xls/worksheetsettings.hxx +++ b/oox/inc/oox/xls/worksheetsettings.hxx @@ -108,6 +108,8 @@ public: /** Imports phonetic settings from the PHONETICPR record. */ void importPhoneticPr( RecordInputStream& rStrm ); + /** Imports sheet properties from a SHEETEXT record. */ + void importSheetExt( BiffInputStream& rStrm ); /** Imports sheet properties from a SHEETPR record. */ void importSheetPr( BiffInputStream& rStrm ); /** Imports protection status from the PROTECT record. */ diff --git a/oox/source/xls/chartsheetfragment.cxx b/oox/source/xls/chartsheetfragment.cxx index 287518584cc3..fe1cdfa179bb 100644 --- a/oox/source/xls/chartsheetfragment.cxx +++ b/oox/source/xls/chartsheetfragment.cxx @@ -269,6 +269,7 @@ bool BiffChartsheetFragment::importFragment() case BIFF_ID_PICTURE: rPageSett.importPicture( mrStrm ); break; case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( mrStrm ); break; case BIFF_ID_SCL: rSheetViewSett.importScl( mrStrm ); break; + case BIFF_ID_SHEETEXT: rWorksheetSett.importSheetExt( mrStrm ); break; case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break; case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break; } diff --git a/oox/source/xls/worksheetfragment.cxx b/oox/source/xls/worksheetfragment.cxx index bee58fdbaff3..d75c92832994 100644 --- a/oox/source/xls/worksheetfragment.cxx +++ b/oox/source/xls/worksheetfragment.cxx @@ -898,6 +898,7 @@ bool BiffWorksheetFragment::importFragment() case BIFF_ID_SCENARIOS: importScenarios(); break; case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( mrStrm ); break; case BIFF_ID_SCL: rSheetViewSett.importScl( mrStrm ); break; + case BIFF_ID_SHEETEXT: rWorksheetSett.importSheetExt( mrStrm ); break; case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( mrStrm ); break; case BIFF_ID_SHAREDFEATHEAD: importSharedFeatHead(); break; case BIFF_ID_STANDARDWIDTH: importStandardWidth(); break; diff --git a/oox/source/xls/worksheetsettings.cxx b/oox/source/xls/worksheetsettings.cxx index 0cc9d5f17780..712a57803349 100644 --- a/oox/source/xls/worksheetsettings.cxx +++ b/oox/source/xls/worksheetsettings.cxx @@ -26,23 +26,20 @@ ************************************************************************/ #include "oox/xls/worksheetsettings.hxx" +#include #include "oox/helper/attributelist.hxx" #include "oox/helper/recordinputstream.hxx" +#include "oox/core/filterbase.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/pagesettings.hxx" #include "oox/xls/workbooksettings.hxx" -#include "oox/core/filterbase.hxx" #include "properties.hxx" -#include +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::util; using ::rtl::OUString; -using ::com::sun::star::beans::XPropertySet; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::util::XProtectable; using ::oox::core::CodecHelper; namespace oox { @@ -55,12 +52,14 @@ namespace { const sal_uInt8 OOBIN_SHEETPR_FILTERMODE = 0x01; const sal_uInt8 OOBIN_SHEETPR_EVAL_CF = 0x02; +const sal_uInt32 BIFF_SHEETEXT_NOTABCOLOR = 0x7F; + const sal_uInt16 BIFF_SHEETPR_DIALOGSHEET = 0x0010; const sal_uInt16 BIFF_SHEETPR_APPLYSTYLES = 0x0020; const sal_uInt16 BIFF_SHEETPR_SYMBOLSBELOW = 0x0040; const sal_uInt16 BIFF_SHEETPR_SYMBOLSRIGHT = 0x0080; const sal_uInt16 BIFF_SHEETPR_FITTOPAGES = 0x0100; -const sal_uInt16 BIFF_SHEETPR_SKIPEXT = 0x0200; /// BIFF3-BIFF4 +const sal_uInt16 BIFF_SHEETPR_SKIPEXT = 0x0200; // BIFF3-BIFF4 const sal_uInt32 BIFF_SHEETPROT_OBJECTS = 0x00000001; const sal_uInt32 BIFF_SHEETPROT_SCENARIOS = 0x00000002; @@ -236,6 +235,16 @@ void WorksheetSettings::importPhoneticPr( RecordInputStream& rStrm ) maPhoneticSett.importPhoneticPr( rStrm ); } +void WorksheetSettings::importSheetExt( BiffInputStream& rStrm ) +{ + rStrm.skip( 16 ); + sal_uInt32 nFlags; + rStrm >> nFlags; + sal_uInt8 nColorIdx = extractValue< sal_uInt8 >( nFlags, 0, 7 ); + if( nColorIdx != BIFF_SHEETEXT_NOTABCOLOR ) + maSheetSettings.maTabColor.setPaletteClr( nColorIdx ); +} + void WorksheetSettings::importSheetPr( BiffInputStream& rStrm ) { sal_uInt16 nFlags; @@ -324,10 +333,11 @@ void WorksheetSettings::finalizeImport() PropertySet aPropSet( getSheet() ); aPropSet.setProperty( PROP_CodeName, maSheetSettings.maCodeName ); - if (!maSheetSettings.maTabColor.isAuto()) + // sheet tab color + if( !maSheetSettings.maTabColor.isAuto() ) { - sal_Int32 nColor = maSheetSettings.maTabColor.getColor(getBaseFilter().getGraphicHelper()); - aPropSet.setProperty(PROP_TabColor, nColor); + sal_Int32 nColor = maSheetSettings.maTabColor.getColor( getBaseFilter().getGraphicHelper() ); + aPropSet.setProperty( PROP_TabColor, nColor ); } } @@ -335,4 +345,3 @@ void WorksheetSettings::finalizeImport() } // namespace xls } // namespace oox - -- cgit From 64f870b426c96776b0367b7a97dd9b3d70aead06 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 5 Aug 2010 16:01:52 +0200 Subject: dr77: code cleanup --- oox/inc/oox/drawingml/chart/axiscontext.hxx | 1 - oox/inc/oox/drawingml/chart/axisconverter.hxx | 1 - oox/inc/oox/drawingml/chart/axismodel.hxx | 1 - oox/inc/oox/drawingml/chart/chartcontextbase.hxx | 1 - oox/inc/oox/drawingml/chart/chartconverter.hxx | 1 - .../oox/drawingml/chart/chartdrawingfragment.hxx | 1 - .../oox/drawingml/chart/chartspaceconverter.hxx | 1 - oox/inc/oox/drawingml/chart/chartspacefragment.hxx | 1 - oox/inc/oox/drawingml/chart/chartspacemodel.hxx | 1 - oox/inc/oox/drawingml/chart/converterbase.hxx | 1 - oox/inc/oox/drawingml/chart/datasourcecontext.hxx | 1 - .../oox/drawingml/chart/datasourceconverter.hxx | 1 - oox/inc/oox/drawingml/chart/datasourcemodel.hxx | 1 - oox/inc/oox/drawingml/chart/modelbase.hxx | 1 - oox/inc/oox/drawingml/chart/objectformatter.hxx | 1 - oox/inc/oox/drawingml/chart/plotareacontext.hxx | 1 - oox/inc/oox/drawingml/chart/plotareaconverter.hxx | 1 - oox/inc/oox/drawingml/chart/plotareamodel.hxx | 1 - oox/inc/oox/drawingml/chart/seriescontext.hxx | 1 - oox/inc/oox/drawingml/chart/seriesconverter.hxx | 1 - oox/inc/oox/drawingml/chart/seriesmodel.hxx | 1 - oox/inc/oox/drawingml/chart/titlecontext.hxx | 1 - oox/inc/oox/drawingml/chart/titleconverter.hxx | 1 - oox/inc/oox/drawingml/chart/titlemodel.hxx | 1 - oox/inc/oox/drawingml/chart/typegroupcontext.hxx | 1 - oox/inc/oox/drawingml/chart/typegroupconverter.hxx | 1 - oox/inc/oox/drawingml/chart/typegroupmodel.hxx | 1 - oox/inc/oox/drawingml/textliststyle.hxx | 4 - oox/inc/oox/drawingml/textparagraphproperties.hxx | 4 - oox/inc/oox/helper/attributelist.hxx | 1 - oox/inc/oox/helper/binaryinputstream.hxx | 1 - oox/inc/oox/helper/binaryoutputstream.hxx | 1 - oox/inc/oox/helper/binarystreambase.hxx | 1 - oox/inc/oox/helper/containerhelper.hxx | 1 - oox/inc/oox/helper/graphichelper.hxx | 1 - oox/inc/oox/helper/helper.hxx | 1 - oox/inc/oox/helper/modelobjecthelper.hxx | 1 - oox/inc/oox/helper/progressbar.hxx | 1 - oox/inc/oox/helper/propertymap.hxx | 6 -- oox/inc/oox/helper/propertyset.hxx | 5 - oox/inc/oox/helper/recordinputstream.hxx | 1 - oox/inc/oox/helper/textinputstream.hxx | 1 - oox/inc/oox/vml/vmldrawing.hxx | 1 - oox/inc/oox/vml/vmldrawingfragment.hxx | 1 - oox/inc/oox/vml/vmlformatting.hxx | 1 - oox/inc/oox/vml/vmlinputstream.hxx | 1 - oox/inc/oox/vml/vmlshape.hxx | 1 - oox/inc/oox/vml/vmlshapecontainer.hxx | 1 - oox/inc/oox/vml/vmlshapecontext.hxx | 1 - oox/source/drawingml/chart/axiscontext.cxx | 12 ++- oox/source/drawingml/chart/axisconverter.cxx | 30 +++--- oox/source/drawingml/chart/axismodel.cxx | 1 - oox/source/drawingml/chart/chartcontextbase.cxx | 12 ++- oox/source/drawingml/chart/chartconverter.cxx | 24 ++--- .../drawingml/chart/chartdrawingfragment.cxx | 23 ++--- oox/source/drawingml/chart/chartspaceconverter.cxx | 26 +++--- oox/source/drawingml/chart/chartspacefragment.cxx | 12 ++- oox/source/drawingml/chart/chartspacemodel.cxx | 1 - oox/source/drawingml/chart/converterbase.cxx | 47 ++++------ oox/source/drawingml/chart/datasourcecontext.cxx | 11 ++- oox/source/drawingml/chart/datasourceconverter.cxx | 13 ++- oox/source/drawingml/chart/datasourcemodel.cxx | 1 - oox/source/drawingml/chart/modelbase.cxx | 8 +- oox/source/drawingml/chart/objectformatter.cxx | 44 ++++----- oox/source/drawingml/chart/plotareacontext.cxx | 10 +- oox/source/drawingml/chart/plotareaconverter.cxx | 26 +++--- oox/source/drawingml/chart/seriescontext.cxx | 14 +-- oox/source/drawingml/chart/seriesconverter.cxx | 25 ++--- oox/source/drawingml/chart/seriesmodel.cxx | 1 - oox/source/drawingml/chart/titlecontext.cxx | 12 ++- oox/source/drawingml/chart/titleconverter.cxx | 28 +++--- oox/source/drawingml/chart/titlemodel.cxx | 1 - oox/source/drawingml/chart/typegroupcontext.cxx | 10 +- oox/source/drawingml/chart/typegroupconverter.cxx | 27 ++---- oox/source/drawingml/chart/typegroupmodel.cxx | 1 - oox/source/drawingml/textliststyle.cxx | 11 --- oox/source/dump/biffdumper.cxx | 44 ++++----- oox/source/dump/biffdumper.ini | 1 - oox/source/dump/dffdumper.cxx | 7 +- oox/source/dump/dffdumper.ini | 1 - oox/source/dump/dumperbase.cxx | 43 ++++----- oox/source/dump/dumperbase.ini | 1 - oox/source/dump/oledumper.cxx | 24 ++--- oox/source/dump/oledumper.ini | 1 - oox/source/dump/pptxdumper.cxx | 23 +++-- oox/source/dump/pptxdumper.ini | 1 - oox/source/dump/xlsbdumper.cxx | 28 +++--- oox/source/dump/xlsbdumper.ini | 1 - oox/source/helper/attributelist.cxx | 16 ++-- oox/source/helper/binaryinputstream.cxx | 18 ++-- oox/source/helper/binaryoutputstream.cxx | 16 ++-- oox/source/helper/binarystreambase.cxx | 11 ++- oox/source/helper/containerhelper.cxx | 25 +++-- oox/source/helper/graphichelper.cxx | 36 +++----- oox/source/helper/modelobjecthelper.cxx | 21 +++-- oox/source/helper/progressbar.cxx | 11 ++- oox/source/helper/propertymap.cxx | 102 +++------------------ oox/source/helper/propertyset.cxx | 28 ++---- oox/source/helper/recordinputstream.cxx | 9 +- oox/source/helper/storagebase.cxx | 21 ++--- oox/source/helper/textinputstream.cxx | 8 +- oox/source/helper/zipstorage.cxx | 26 +++--- oox/source/vml/vmldrawing.cxx | 21 ++--- oox/source/vml/vmldrawingfragment.cxx | 17 ++-- oox/source/vml/vmlformatting.cxx | 23 +++-- oox/source/vml/vmlinputstream.cxx | 16 ++-- oox/source/vml/vmlshape.cxx | 36 +++----- oox/source/vml/vmlshapecontainer.cxx | 15 +-- oox/source/vml/vmlshapecontext.cxx | 14 ++- 109 files changed, 491 insertions(+), 669 deletions(-) diff --git a/oox/inc/oox/drawingml/chart/axiscontext.hxx b/oox/inc/oox/drawingml/chart/axiscontext.hxx index b80dd2e6f9ef..13c550e881d4 100644 --- a/oox/inc/oox/drawingml/chart/axiscontext.hxx +++ b/oox/inc/oox/drawingml/chart/axiscontext.hxx @@ -124,4 +124,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/axisconverter.hxx b/oox/inc/oox/drawingml/chart/axisconverter.hxx index 925fa1fe8b4f..9e083f69d253 100644 --- a/oox/inc/oox/drawingml/chart/axisconverter.hxx +++ b/oox/inc/oox/drawingml/chart/axisconverter.hxx @@ -68,4 +68,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/axismodel.hxx b/oox/inc/oox/drawingml/chart/axismodel.hxx index 8bab84257eee..23dc96037427 100644 --- a/oox/inc/oox/drawingml/chart/axismodel.hxx +++ b/oox/inc/oox/drawingml/chart/axismodel.hxx @@ -109,4 +109,3 @@ struct AxisModel } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/chartcontextbase.hxx b/oox/inc/oox/drawingml/chart/chartcontextbase.hxx index f034b4b6e6bb..76ddeafddb80 100644 --- a/oox/inc/oox/drawingml/chart/chartcontextbase.hxx +++ b/oox/inc/oox/drawingml/chart/chartcontextbase.hxx @@ -99,4 +99,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/chartconverter.hxx b/oox/inc/oox/drawingml/chart/chartconverter.hxx index f9d10388ce13..de8572ab168b 100644 --- a/oox/inc/oox/drawingml/chart/chartconverter.hxx +++ b/oox/inc/oox/drawingml/chart/chartconverter.hxx @@ -108,4 +108,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx index 0b5a7f6374a4..e43dc176c297 100644 --- a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx +++ b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx @@ -119,4 +119,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx b/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx index b4c40015f825..91e622552aa7 100644 --- a/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx +++ b/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx @@ -61,4 +61,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/chartspacefragment.hxx b/oox/inc/oox/drawingml/chart/chartspacefragment.hxx index 898bc2ea15e8..e51c1c1fcc1b 100644 --- a/oox/inc/oox/drawingml/chart/chartspacefragment.hxx +++ b/oox/inc/oox/drawingml/chart/chartspacefragment.hxx @@ -59,4 +59,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/chartspacemodel.hxx b/oox/inc/oox/drawingml/chart/chartspacemodel.hxx index ddfa57fb919c..37c39e315e3e 100644 --- a/oox/inc/oox/drawingml/chart/chartspacemodel.hxx +++ b/oox/inc/oox/drawingml/chart/chartspacemodel.hxx @@ -75,4 +75,3 @@ struct ChartSpaceModel } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/converterbase.hxx b/oox/inc/oox/drawingml/chart/converterbase.hxx index c937c6e94900..aec646d4c610 100644 --- a/oox/inc/oox/drawingml/chart/converterbase.hxx +++ b/oox/inc/oox/drawingml/chart/converterbase.hxx @@ -155,4 +155,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/datasourcecontext.hxx b/oox/inc/oox/drawingml/chart/datasourcecontext.hxx index 9b832a0209ab..e5183e64caa4 100644 --- a/oox/inc/oox/drawingml/chart/datasourcecontext.hxx +++ b/oox/inc/oox/drawingml/chart/datasourcecontext.hxx @@ -98,4 +98,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/datasourceconverter.hxx b/oox/inc/oox/drawingml/chart/datasourceconverter.hxx index 7cdd6ab4a175..9d16f4e85882 100644 --- a/oox/inc/oox/drawingml/chart/datasourceconverter.hxx +++ b/oox/inc/oox/drawingml/chart/datasourceconverter.hxx @@ -75,4 +75,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/datasourcemodel.hxx b/oox/inc/oox/drawingml/chart/datasourcemodel.hxx index 3de2278e5a71..04e79b831049 100644 --- a/oox/inc/oox/drawingml/chart/datasourcemodel.hxx +++ b/oox/inc/oox/drawingml/chart/datasourcemodel.hxx @@ -69,4 +69,3 @@ struct DataSourceModel } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/modelbase.hxx b/oox/inc/oox/drawingml/chart/modelbase.hxx index d34970025abd..065c45f3c2df 100644 --- a/oox/inc/oox/drawingml/chart/modelbase.hxx +++ b/oox/inc/oox/drawingml/chart/modelbase.hxx @@ -138,4 +138,3 @@ struct LayoutModel } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/objectformatter.hxx b/oox/inc/oox/drawingml/chart/objectformatter.hxx index 9f83a6bc0391..1b0f5f781044 100644 --- a/oox/inc/oox/drawingml/chart/objectformatter.hxx +++ b/oox/inc/oox/drawingml/chart/objectformatter.hxx @@ -170,4 +170,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/plotareacontext.hxx b/oox/inc/oox/drawingml/chart/plotareacontext.hxx index 75ebed545956..5d3358c1147c 100644 --- a/oox/inc/oox/drawingml/chart/plotareacontext.hxx +++ b/oox/inc/oox/drawingml/chart/plotareacontext.hxx @@ -87,4 +87,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/plotareaconverter.hxx b/oox/inc/oox/drawingml/chart/plotareaconverter.hxx index e35afb633b92..9089c0180024 100644 --- a/oox/inc/oox/drawingml/chart/plotareaconverter.hxx +++ b/oox/inc/oox/drawingml/chart/plotareaconverter.hxx @@ -107,4 +107,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/plotareamodel.hxx b/oox/inc/oox/drawingml/chart/plotareamodel.hxx index c5793717defc..ef29a72f4b09 100644 --- a/oox/inc/oox/drawingml/chart/plotareamodel.hxx +++ b/oox/inc/oox/drawingml/chart/plotareamodel.hxx @@ -91,4 +91,3 @@ struct PlotAreaModel } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/seriescontext.hxx b/oox/inc/oox/drawingml/chart/seriescontext.hxx index 024e9754781c..100e7755cdca 100644 --- a/oox/inc/oox/drawingml/chart/seriescontext.hxx +++ b/oox/inc/oox/drawingml/chart/seriescontext.hxx @@ -270,4 +270,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/seriesconverter.hxx b/oox/inc/oox/drawingml/chart/seriesconverter.hxx index fd3ca207d7c0..6874298487d4 100644 --- a/oox/inc/oox/drawingml/chart/seriesconverter.hxx +++ b/oox/inc/oox/drawingml/chart/seriesconverter.hxx @@ -171,4 +171,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/seriesmodel.hxx b/oox/inc/oox/drawingml/chart/seriesmodel.hxx index 2b72eb0f2bcf..d4b9ab3c9715 100644 --- a/oox/inc/oox/drawingml/chart/seriesmodel.hxx +++ b/oox/inc/oox/drawingml/chart/seriesmodel.hxx @@ -241,4 +241,3 @@ struct SeriesModel } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/titlecontext.hxx b/oox/inc/oox/drawingml/chart/titlecontext.hxx index b3fec5d93203..e3d274c1744b 100644 --- a/oox/inc/oox/drawingml/chart/titlecontext.hxx +++ b/oox/inc/oox/drawingml/chart/titlecontext.hxx @@ -87,4 +87,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/titleconverter.hxx b/oox/inc/oox/drawingml/chart/titleconverter.hxx index d153e9f3e760..2a452ae6c96b 100644 --- a/oox/inc/oox/drawingml/chart/titleconverter.hxx +++ b/oox/inc/oox/drawingml/chart/titleconverter.hxx @@ -110,4 +110,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/titlemodel.hxx b/oox/inc/oox/drawingml/chart/titlemodel.hxx index f80837249809..fc47d684c6dc 100644 --- a/oox/inc/oox/drawingml/chart/titlemodel.hxx +++ b/oox/inc/oox/drawingml/chart/titlemodel.hxx @@ -93,4 +93,3 @@ struct LegendModel } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/typegroupcontext.hxx b/oox/inc/oox/drawingml/chart/typegroupcontext.hxx index aa5f2a47c4a0..d58cb7e1c4f7 100644 --- a/oox/inc/oox/drawingml/chart/typegroupcontext.hxx +++ b/oox/inc/oox/drawingml/chart/typegroupcontext.hxx @@ -168,4 +168,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/typegroupconverter.hxx b/oox/inc/oox/drawingml/chart/typegroupconverter.hxx index 46018696baef..58375a4c2b1f 100644 --- a/oox/inc/oox/drawingml/chart/typegroupconverter.hxx +++ b/oox/inc/oox/drawingml/chart/typegroupconverter.hxx @@ -202,4 +202,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/typegroupmodel.hxx b/oox/inc/oox/drawingml/chart/typegroupmodel.hxx index b51b8e5d4a7c..9af01210d585 100644 --- a/oox/inc/oox/drawingml/chart/typegroupmodel.hxx +++ b/oox/inc/oox/drawingml/chart/typegroupmodel.hxx @@ -100,4 +100,3 @@ struct TypeGroupModel } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/textliststyle.hxx b/oox/inc/oox/drawingml/textliststyle.hxx index 1a8fca45bf25..6ba4cdf1d62a 100644 --- a/oox/inc/oox/drawingml/textliststyle.hxx +++ b/oox/inc/oox/drawingml/textliststyle.hxx @@ -50,10 +50,6 @@ public: inline const TextParagraphPropertiesVector& getAggregationListStyle() const { return maAggregationListStyle; }; inline TextParagraphPropertiesVector& getAggregationListStyle() { return maAggregationListStyle; }; -#if OSL_DEBUG_LEVEL > 0 - void dump( int nLevels=9 ); -#endif - protected: TextParagraphPropertiesVector maListStyle; diff --git a/oox/inc/oox/drawingml/textparagraphproperties.hxx b/oox/inc/oox/drawingml/textparagraphproperties.hxx index 310df83212a0..ef80af2d1c11 100644 --- a/oox/inc/oox/drawingml/textparagraphproperties.hxx +++ b/oox/inc/oox/drawingml/textparagraphproperties.hxx @@ -112,10 +112,6 @@ public: size can be zero and the default value is returned. */ float getCharHeightPoints( float fDefault ) const; -#if OSL_DEBUG_LEVEL > 0 - void dump() { maTextParagraphPropertyMap.dump(); OSL_TRACE("character height: %f", maTextCharacterProperties.getCharHeightPoints(-1)); } -#endif - protected: TextCharacterProperties maTextCharacterProperties; diff --git a/oox/inc/oox/helper/attributelist.hxx b/oox/inc/oox/helper/attributelist.hxx index 631d7ec4b66e..ad746771cab8 100644 --- a/oox/inc/oox/helper/attributelist.hxx +++ b/oox/inc/oox/helper/attributelist.hxx @@ -189,4 +189,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/helper/binaryinputstream.hxx b/oox/inc/oox/helper/binaryinputstream.hxx index 8f58e2de4d9e..52a3a4de9f0f 100644 --- a/oox/inc/oox/helper/binaryinputstream.hxx +++ b/oox/inc/oox/helper/binaryinputstream.hxx @@ -288,4 +288,3 @@ typedef ::boost::shared_ptr< RelativeInputStream > RelativeInputStreamRef; } // namespace oox #endif - diff --git a/oox/inc/oox/helper/binaryoutputstream.hxx b/oox/inc/oox/helper/binaryoutputstream.hxx index d2f0f8b36ffa..e24777c4f296 100644 --- a/oox/inc/oox/helper/binaryoutputstream.hxx +++ b/oox/inc/oox/helper/binaryoutputstream.hxx @@ -158,4 +158,3 @@ typedef ::boost::shared_ptr< SequenceOutputStream > SequenceOutputStreamRef; } // namespace oox #endif - diff --git a/oox/inc/oox/helper/binarystreambase.hxx b/oox/inc/oox/helper/binarystreambase.hxx index abe4c5f1c274..ba0f34b21f40 100644 --- a/oox/inc/oox/helper/binarystreambase.hxx +++ b/oox/inc/oox/helper/binarystreambase.hxx @@ -144,4 +144,3 @@ protected: } // namespace oox #endif - diff --git a/oox/inc/oox/helper/containerhelper.hxx b/oox/inc/oox/helper/containerhelper.hxx index f4f3717eac3f..ba93dc9ad60c 100644 --- a/oox/inc/oox/helper/containerhelper.hxx +++ b/oox/inc/oox/helper/containerhelper.hxx @@ -699,4 +699,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/helper/graphichelper.hxx b/oox/inc/oox/helper/graphichelper.hxx index 37002940cb17..5b9c5d945678 100644 --- a/oox/inc/oox/helper/graphichelper.hxx +++ b/oox/inc/oox/helper/graphichelper.hxx @@ -172,4 +172,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/helper/helper.hxx b/oox/inc/oox/helper/helper.hxx index c68fe9ce83f8..84c501fae2e5 100644 --- a/oox/inc/oox/helper/helper.hxx +++ b/oox/inc/oox/helper/helper.hxx @@ -322,4 +322,3 @@ inline void ByteOrderConverter::swap8( sal_uInt8* pnData ) } // namespace oox #endif - diff --git a/oox/inc/oox/helper/modelobjecthelper.hxx b/oox/inc/oox/helper/modelobjecthelper.hxx index a9ef27e8cb98..82d06bac1109 100644 --- a/oox/inc/oox/helper/modelobjecthelper.hxx +++ b/oox/inc/oox/helper/modelobjecthelper.hxx @@ -91,4 +91,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/helper/progressbar.hxx b/oox/inc/oox/helper/progressbar.hxx index f5ea98816915..847d16ea9231 100644 --- a/oox/inc/oox/helper/progressbar.hxx +++ b/oox/inc/oox/helper/progressbar.hxx @@ -142,4 +142,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/helper/propertymap.hxx b/oox/inc/oox/helper/propertymap.hxx index 150f5c3d9364..0bc16b3443ff 100644 --- a/oox/inc/oox/helper/propertymap.hxx +++ b/oox/inc/oox/helper/propertymap.hxx @@ -89,11 +89,6 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > makePropertySet() const; -#if OSL_DEBUG_LEVEL > 0 - static void dump( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet); - void dump(); -#endif - private: const PropertyList* mpPropNames; }; @@ -103,4 +98,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/helper/propertyset.hxx b/oox/inc/oox/helper/propertyset.hxx index 8ddfaff44421..bb8307ad39b1 100644 --- a/oox/inc/oox/helper/propertyset.hxx +++ b/oox/inc/oox/helper/propertyset.hxx @@ -127,10 +127,6 @@ public: @param rPropertyMap The property map. */ void setProperties( const PropertyMap& rPropertyMap ); -#if OSL_DEBUG_LEVEL > 0 - void dump(); -#endif - // ------------------------------------------------------------------------ private: /** Gets the specified property from the property set. @@ -167,4 +163,3 @@ inline void PropertySet::setProperty( sal_Int32 nPropId, const Type& rValue ) } // namespace oox #endif - diff --git a/oox/inc/oox/helper/recordinputstream.hxx b/oox/inc/oox/helper/recordinputstream.hxx index ee05ce480a75..0c5c1279a7c7 100644 --- a/oox/inc/oox/helper/recordinputstream.hxx +++ b/oox/inc/oox/helper/recordinputstream.hxx @@ -55,4 +55,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/helper/textinputstream.hxx b/oox/inc/oox/helper/textinputstream.hxx index 1e74825ee713..2e98d3fc8c84 100755 --- a/oox/inc/oox/helper/textinputstream.hxx +++ b/oox/inc/oox/helper/textinputstream.hxx @@ -55,4 +55,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmldrawing.hxx b/oox/inc/oox/vml/vmldrawing.hxx index c2f8432dca6f..7bbeaef2f50d 100644 --- a/oox/inc/oox/vml/vmldrawing.hxx +++ b/oox/inc/oox/vml/vmldrawing.hxx @@ -176,4 +176,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmldrawingfragment.hxx b/oox/inc/oox/vml/vmldrawingfragment.hxx index e0ffcd9c5203..0c961db1aabf 100644 --- a/oox/inc/oox/vml/vmldrawingfragment.hxx +++ b/oox/inc/oox/vml/vmldrawingfragment.hxx @@ -63,4 +63,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmlformatting.hxx b/oox/inc/oox/vml/vmlformatting.hxx index db67d7a85af4..b496fed6d2e0 100644 --- a/oox/inc/oox/vml/vmlformatting.hxx +++ b/oox/inc/oox/vml/vmlformatting.hxx @@ -187,4 +187,3 @@ struct FillModel } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmlinputstream.hxx b/oox/inc/oox/vml/vmlinputstream.hxx index 311fc17df960..a425425cd0cb 100644 --- a/oox/inc/oox/vml/vmlinputstream.hxx +++ b/oox/inc/oox/vml/vmlinputstream.hxx @@ -66,4 +66,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx index 7c770df28477..76599a787306 100644 --- a/oox/inc/oox/vml/vmlshape.hxx +++ b/oox/inc/oox/vml/vmlshape.hxx @@ -327,4 +327,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmlshapecontainer.hxx b/oox/inc/oox/vml/vmlshapecontainer.hxx index a878fda2b74c..d4f9ec7e7f8e 100644 --- a/oox/inc/oox/vml/vmlshapecontainer.hxx +++ b/oox/inc/oox/vml/vmlshapecontainer.hxx @@ -136,4 +136,3 @@ const ShapeBase* ShapeContainer::findShape( const Functor& rFunctor ) const } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmlshapecontext.hxx b/oox/inc/oox/vml/vmlshapecontext.hxx index bda7d90f34e2..92253e461227 100644 --- a/oox/inc/oox/vml/vmlshapecontext.hxx +++ b/oox/inc/oox/vml/vmlshapecontext.hxx @@ -145,4 +145,3 @@ private: } // namespace oox #endif - diff --git a/oox/source/drawingml/chart/axiscontext.cxx b/oox/source/drawingml/chart/axiscontext.cxx index 1066f91c0e19..cfcdd3ff0754 100644 --- a/oox/source/drawingml/chart/axiscontext.cxx +++ b/oox/source/drawingml/chart/axiscontext.cxx @@ -26,21 +26,24 @@ ************************************************************************/ #include "oox/drawingml/chart/axiscontext.hxx" + #include "oox/drawingml/shapepropertiescontext.hxx" #include "oox/drawingml/textbodycontext.hxx" #include "oox/drawingml/chart/axismodel.hxx" #include "oox/drawingml/chart/titlecontext.hxx" -using ::rtl::OUString; -using ::oox::core::ContextHandlerRef; -using ::oox::core::ContextHandler2Helper; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using ::oox::core::ContextHandlerRef; +using ::oox::core::ContextHandler2Helper; +using ::rtl::OUString; + +// ============================================================================ + AxisDispUnitsContext::AxisDispUnitsContext( ContextHandler2Helper& rParent, AxisDispUnitsModel& rModel ) : ContextBase< AxisDispUnitsModel >( rParent, rModel ) { @@ -315,4 +318,3 @@ ContextHandlerRef ValAxisContext::onCreateContext( sal_Int32 nElement, const Att } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx index da4fc3e5b83f..4c214aed857b 100644 --- a/oox/source/drawingml/chart/axisconverter.cxx +++ b/oox/source/drawingml/chart/axisconverter.cxx @@ -26,43 +26,36 @@ ************************************************************************/ #include "oox/drawingml/chart/axisconverter.hxx" + #include #include #include #include -#include #include +#include #include #include #include -#include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/chart/axismodel.hxx" #include "oox/drawingml/chart/titleconverter.hxx" #include "oox/drawingml/chart/typegroupconverter.hxx" +#include "oox/drawingml/lineproperties.hxx" #include "properties.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::beans::XPropertySet; -using ::com::sun::star::chart2::IncrementData; -using ::com::sun::star::chart2::ScaleData; -using ::com::sun::star::chart2::SubIncrement; -using ::com::sun::star::chart2::XAxis; -using ::com::sun::star::chart2::XCoordinateSystem; -using ::com::sun::star::chart2::XScaling; -using ::com::sun::star::chart2::XTitled; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + namespace { template< typename Type > @@ -330,4 +323,3 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/axismodel.cxx b/oox/source/drawingml/chart/axismodel.cxx index 9f1d52adc0d2..8736e8f6dcd5 100644 --- a/oox/source/drawingml/chart/axismodel.cxx +++ b/oox/source/drawingml/chart/axismodel.cxx @@ -78,4 +78,3 @@ AxisModel::~AxisModel() } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/chartcontextbase.cxx b/oox/source/drawingml/chart/chartcontextbase.cxx index d3746f07ba6c..69c1f2622b46 100644 --- a/oox/source/drawingml/chart/chartcontextbase.cxx +++ b/oox/source/drawingml/chart/chartcontextbase.cxx @@ -26,11 +26,9 @@ ************************************************************************/ #include "oox/drawingml/chart/chartcontextbase.hxx" -#include "oox/drawingml/shapepropertiescontext.hxx" -#include "oox/drawingml/chart/modelbase.hxx" -using ::oox::core::ContextHandler2Helper; -using ::oox::core::ContextHandlerRef; +#include "oox/drawingml/chart/modelbase.hxx" +#include "oox/drawingml/shapepropertiescontext.hxx" namespace oox { namespace drawingml { @@ -38,6 +36,11 @@ namespace chart { // ============================================================================ +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; + +// ============================================================================ + ShapePrWrapperContext::ShapePrWrapperContext( ContextHandler2Helper& rParent, Shape& rModel ) : ContextBase< Shape >( rParent, rModel ) { @@ -117,4 +120,3 @@ ContextHandlerRef LayoutContext::onCreateContext( sal_Int32 nElement, const Attr } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/chartconverter.cxx b/oox/source/drawingml/chart/chartconverter.cxx index efd8e6d021e1..02672088c763 100644 --- a/oox/source/drawingml/chart/chartconverter.cxx +++ b/oox/source/drawingml/chart/chartconverter.cxx @@ -26,27 +26,28 @@ ************************************************************************/ #include "oox/drawingml/chart/chartconverter.hxx" + #include #include "oox/drawingml/chart/chartspaceconverter.hxx" #include "oox/drawingml/chart/chartspacemodel.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::awt::Point; -using ::com::sun::star::awt::Size; -using ::com::sun::star::drawing::XShapes; -using ::com::sun::star::chart2::XChartDocument; -using ::com::sun::star::chart2::data::XDataProvider; -using ::com::sun::star::chart2::data::XDataSequence; -using ::oox::core::XmlFilterBase; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::chart2::data; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::uno; + +using ::oox::core::XmlFilterBase; +using ::rtl::OUString; + +// ============================================================================ + ChartConverter::ChartConverter() { } @@ -90,4 +91,3 @@ Reference< XDataSequence > ChartConverter::createDataSequence( const Reference< } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx index fcc350b583c3..dce6535c2f49 100644 --- a/oox/source/drawingml/chart/chartdrawingfragment.cxx +++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx @@ -26,28 +26,30 @@ ************************************************************************/ #include "oox/drawingml/chart/chartdrawingfragment.hxx" + #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/connectorshapecontext.hxx" #include "oox/drawingml/graphicshapecontext.hxx" #include "oox/drawingml/shapecontext.hxx" #include "oox/drawingml/shapegroupcontext.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::awt::Point; -using ::com::sun::star::awt::Rectangle; -using ::com::sun::star::awt::Size; -using ::com::sun::star::drawing::XShapes; -using ::oox::core::ContextHandlerRef; -using ::oox::core::FragmentHandler2; -using ::oox::core::XmlFilterBase; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::uno; + +using ::oox::core::ContextHandlerRef; +using ::oox::core::FragmentHandler2; +using ::oox::core::XmlFilterBase; +using ::rtl::OUString; + +// ============================================================================ + ShapeAnchor::ShapeAnchor( bool bRelSize ) : mbRelSize( bRelSize ) { @@ -232,4 +234,3 @@ void ChartDrawingFragment::onEndElement( const OUString& rChars ) } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx index 54212f1bdbda..8c05b0c8a53f 100644 --- a/oox/source/drawingml/chart/chartspaceconverter.cxx +++ b/oox/source/drawingml/chart/chartspaceconverter.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "oox/drawingml/chart/chartspaceconverter.hxx" + #include #include #include @@ -40,25 +41,23 @@ #include "oox/drawingml/chart/titleconverter.hxx" #include "properties.hxx" -using ::rtl::OUString; -using ::com::sun::star::awt::Point; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::util::XNumberFormatsSupplier; -using ::com::sun::star::drawing::XDrawPageSupplier; -using ::com::sun::star::drawing::XShapes; -using ::com::sun::star::chart2::XDiagram; -using ::com::sun::star::chart2::XTitled; -using ::com::sun::star::chart2::data::XDataReceiver; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::chart2::data; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::util; + +using ::rtl::OUString; + +// ============================================================================ + ChartSpaceConverter::ChartSpaceConverter( const ConverterRoot& rParent, ChartSpaceModel& rModel ) : ConverterBase< ChartSpaceModel >( rParent, rModel ) { @@ -206,4 +205,3 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index 75df94e95de7..f7aca001df5e 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -26,22 +26,25 @@ ************************************************************************/ #include "oox/drawingml/chart/chartspacefragment.hxx" + #include "oox/drawingml/shapepropertiescontext.hxx" #include "oox/drawingml/textbodycontext.hxx" #include "oox/drawingml/chart/chartspacemodel.hxx" #include "oox/drawingml/chart/plotareacontext.hxx" #include "oox/drawingml/chart/titlecontext.hxx" -using ::rtl::OUString; -using ::oox::core::ContextHandlerRef; -using ::oox::core::XmlFilterBase; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using ::oox::core::ContextHandlerRef; +using ::oox::core::XmlFilterBase; +using ::rtl::OUString; + +// ============================================================================ + ChartSpaceFragment::ChartSpaceFragment( XmlFilterBase& rFilter, const OUString& rFragmentPath, ChartSpaceModel& rModel ) : FragmentBase< ChartSpaceModel >( rFilter, rFragmentPath, rModel ) { @@ -124,4 +127,3 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/chartspacemodel.cxx b/oox/source/drawingml/chart/chartspacemodel.cxx index e386334160a8..3e2253a2ffc1 100644 --- a/oox/source/drawingml/chart/chartspacemodel.cxx +++ b/oox/source/drawingml/chart/chartspacemodel.cxx @@ -51,4 +51,3 @@ ChartSpaceModel::~ChartSpaceModel() } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx index b5a0511bf1b8..136025fa862e 100644 --- a/oox/source/drawingml/chart/converterbase.cxx +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -26,41 +26,21 @@ ************************************************************************/ #include "oox/drawingml/chart/converterbase.hxx" -#include -#include -#include -#include + #include #include #include #include #include #include +#include +#include +#include +#include #include // for F_PI180 -#include "properties.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/theme.hxx" - -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::XInterface; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::frame::XModel; -using ::com::sun::star::awt::Point; -using ::com::sun::star::awt::Rectangle; -using ::com::sun::star::awt::Size; -using ::com::sun::star::chart2::RelativePosition; -using ::com::sun::star::chart2::XChartDocument; -using ::com::sun::star::chart2::XTitle; -using ::com::sun::star::drawing::XShape; -using ::oox::core::XmlFilterBase; - -namespace cssc = ::com::sun::star::chart; +#include "properties.hxx" namespace oox { namespace drawingml { @@ -68,6 +48,20 @@ namespace chart { // ============================================================================ +namespace cssc = ::com::sun::star::chart; + +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::oox::core::XmlFilterBase; +using ::rtl::OUString; + +// ============================================================================ + namespace { struct TitleKey : public ::std::pair< ObjectType, ::std::pair< sal_Int32, sal_Int32 > > @@ -419,4 +413,3 @@ bool LayoutConverter::convertFromModel( const Reference< XShape >& rxShape, doub } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/datasourcecontext.cxx b/oox/source/drawingml/chart/datasourcecontext.cxx index d55b955d6e0d..6fd12c415a50 100644 --- a/oox/source/drawingml/chart/datasourcecontext.cxx +++ b/oox/source/drawingml/chart/datasourcecontext.cxx @@ -26,11 +26,8 @@ ************************************************************************/ #include "oox/drawingml/chart/datasourcecontext.hxx" -#include "oox/drawingml/chart/datasourcemodel.hxx" -using ::rtl::OUString; -using ::oox::core::ContextHandler2Helper; -using ::oox::core::ContextHandlerRef; +#include "oox/drawingml/chart/datasourcemodel.hxx" namespace oox { namespace drawingml { @@ -38,6 +35,12 @@ namespace chart { // ============================================================================ +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; +using ::rtl::OUString; + +// ============================================================================ + DoubleSequenceContext::DoubleSequenceContext( ContextHandler2Helper& rParent, DataSequenceModel& rModel ) : DataSequenceContextBase( rParent, rModel ), mnPtIndex( -1 ) diff --git a/oox/source/drawingml/chart/datasourceconverter.cxx b/oox/source/drawingml/chart/datasourceconverter.cxx index 2409f8e89962..abb9ad111a8a 100644 --- a/oox/source/drawingml/chart/datasourceconverter.cxx +++ b/oox/source/drawingml/chart/datasourceconverter.cxx @@ -26,21 +26,25 @@ ************************************************************************/ #include "oox/drawingml/chart/datasourceconverter.hxx" + #include #include "oox/drawingml/chart/chartconverter.hxx" #include "oox/drawingml/chart/datasourcemodel.hxx" #include "properties.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::chart2::data::XDataSequence; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using namespace ::com::sun::star::chart2::data; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + DataSequenceConverter::DataSequenceConverter( const ConverterRoot& rParent, DataSequenceModel& rModel ) : ConverterBase< DataSequenceModel >( rParent, rModel ) { @@ -89,4 +93,3 @@ Reference< XDataSequence > DataSourceConverter::createDataSequence( const OUStri } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/datasourcemodel.cxx b/oox/source/drawingml/chart/datasourcemodel.cxx index 1f5b15f3e809..aad5a1bff959 100644 --- a/oox/source/drawingml/chart/datasourcemodel.cxx +++ b/oox/source/drawingml/chart/datasourcemodel.cxx @@ -57,4 +57,3 @@ DataSourceModel::~DataSourceModel() } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/modelbase.cxx b/oox/source/drawingml/chart/modelbase.cxx index c182d8e3e410..f32a118c5589 100644 --- a/oox/source/drawingml/chart/modelbase.cxx +++ b/oox/source/drawingml/chart/modelbase.cxx @@ -26,9 +26,8 @@ ************************************************************************/ #include "oox/drawingml/chart/modelbase.hxx" -#include "oox/helper/attributelist.hxx" -using ::rtl::OUString; +#include "oox/helper/attributelist.hxx" namespace oox { namespace drawingml { @@ -36,6 +35,10 @@ namespace chart { // ============================================================================ +using ::rtl::OUString; + +// ============================================================================ + NumberFormat::NumberFormat() : mbSourceLinked( true ) { @@ -73,4 +76,3 @@ LayoutModel::~LayoutModel() } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index d96e2d43dd6f..c66b9a14c924 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -26,13 +26,11 @@ ************************************************************************/ #include "oox/drawingml/chart/objectformatter.hxx" -#include -#include + #include #include -#include "properties.hxx" -#include "tokens.hxx" -#include "oox/helper/modelobjecthelper.hxx" +#include +#include #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/fillproperties.hxx" #include "oox/drawingml/lineproperties.hxx" @@ -40,24 +38,9 @@ #include "oox/drawingml/textparagraph.hxx" #include "oox/drawingml/theme.hxx" #include "oox/drawingml/chart/chartspacemodel.hxx" - -using ::rtl::OStringBuffer; -using ::rtl::OUString; -using ::rtl::OUStringToOString; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::lang::Locale; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::frame::XModel; -using ::com::sun::star::chart2::XChartDocument; -using ::com::sun::star::graphic::XGraphic; -using ::com::sun::star::util::XNumberFormats; -using ::com::sun::star::util::XNumberFormatsSupplier; -using ::com::sun::star::util::XNumberFormatTypes; -using ::oox::core::XmlFilterBase; +#include "oox/helper/modelobjecthelper.hxx" +#include "properties.hxx" +#include "tokens.hxx" namespace oox { namespace drawingml { @@ -65,6 +48,20 @@ namespace chart { // ============================================================================ +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::graphic; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::util; + +using ::oox::core::XmlFilterBase; +using ::rtl::OStringBuffer; +using ::rtl::OUString; +using ::rtl::OUStringToOString; + +// ============================================================================ + namespace { struct AutoFormatPatternEntry @@ -1211,4 +1208,3 @@ void ObjectFormatter::convertAutomaticFill( PropertySet& rPropSet, ObjectType eO } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx index 4f8268f06d66..17c6487b59b4 100644 --- a/oox/source/drawingml/chart/plotareacontext.cxx +++ b/oox/source/drawingml/chart/plotareacontext.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "oox/drawingml/chart/plotareacontext.hxx" + #include "oox/drawingml/shapepropertiescontext.hxx" #include "oox/drawingml/chart/axiscontext.hxx" #include "oox/drawingml/chart/plotareamodel.hxx" @@ -33,15 +34,17 @@ #include "oox/drawingml/chart/titlecontext.hxx" #include "oox/drawingml/chart/typegroupcontext.hxx" -using ::oox::core::ContextHandler2Helper; -using ::oox::core::ContextHandlerRef; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; + +// ============================================================================ + View3DContext::View3DContext( ContextHandler2Helper& rParent, View3DModel& rModel ) : ContextBase< View3DModel >( rParent, rModel ) { @@ -182,4 +185,3 @@ ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const At } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx index c3f74899ed97..19556d16dbf5 100644 --- a/oox/source/drawingml/chart/plotareaconverter.cxx +++ b/oox/source/drawingml/chart/plotareaconverter.cxx @@ -26,35 +26,34 @@ ************************************************************************/ #include "oox/drawingml/chart/plotareaconverter.hxx" -#include -#include -#include + #include #include #include #include #include +#include +#include +#include #include "oox/drawingml/chart/axisconverter.hxx" #include "oox/drawingml/chart/plotareamodel.hxx" #include "oox/drawingml/chart/typegroupconverter.hxx" #include "properties.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::awt::Rectangle; -using ::com::sun::star::chart2::XCoordinateSystem; -using ::com::sun::star::chart2::XCoordinateSystemContainer; -using ::com::sun::star::chart2::XDiagram; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + namespace { /** Axes set model. This is a helper for the plot area converter collecting all @@ -452,4 +451,3 @@ void PlotAreaConverter::convertPositionFromModel() } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx index d06ca9716944..5412c97f0c91 100644 --- a/oox/source/drawingml/chart/seriescontext.cxx +++ b/oox/source/drawingml/chart/seriescontext.cxx @@ -26,23 +26,26 @@ ************************************************************************/ #include "oox/drawingml/chart/seriescontext.hxx" + #include "oox/drawingml/shapepropertiescontext.hxx" #include "oox/drawingml/textbodycontext.hxx" #include "oox/drawingml/chart/datasourcecontext.hxx" #include "oox/drawingml/chart/seriesmodel.hxx" #include "oox/drawingml/chart/titlecontext.hxx" -using ::rtl::OUString; -using ::oox::core::ContextHandler2; -using ::oox::core::ContextHandler2Helper; -using ::oox::core::ContextHandlerRef; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using ::oox::core::ContextHandler2; +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; +using ::rtl::OUString; + +// ============================================================================ + namespace { ContextHandlerRef lclDataLabelSharedCreateContext( @@ -757,4 +760,3 @@ ContextHandlerRef SurfaceSeriesContext::onCreateContext( sal_Int32 nElement, con } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 717a3972550e..0ff1aa2eaa12 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "oox/drawingml/chart/seriesconverter.hxx" + #include #include #include @@ -40,26 +41,21 @@ #include "oox/drawingml/chart/typegroupmodel.hxx" #include "properties.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::beans::XPropertySet; -using ::com::sun::star::chart2::DataPointLabel; -using ::com::sun::star::chart2::XDataSeries; -using ::com::sun::star::chart2::XRegressionCurve; -using ::com::sun::star::chart2::XRegressionCurveContainer; -using ::com::sun::star::chart2::data::XDataSequence; -using ::com::sun::star::chart2::data::XDataSink; -using ::com::sun::star::chart2::data::XLabeledDataSequence; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::chart2::data; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + namespace { Reference< XLabeledDataSequence > lclCreateLabeledDataSequence( @@ -621,4 +617,3 @@ Reference< XLabeledDataSequence > SeriesConverter::createLabeledDataSequence( } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/seriesmodel.cxx b/oox/source/drawingml/chart/seriesmodel.cxx index 01fff8e8d385..417d250caf77 100644 --- a/oox/source/drawingml/chart/seriesmodel.cxx +++ b/oox/source/drawingml/chart/seriesmodel.cxx @@ -154,4 +154,3 @@ SeriesModel::~SeriesModel() } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/titlecontext.cxx b/oox/source/drawingml/chart/titlecontext.cxx index 963ccdad595a..3954a9d5b08b 100644 --- a/oox/source/drawingml/chart/titlecontext.cxx +++ b/oox/source/drawingml/chart/titlecontext.cxx @@ -26,21 +26,24 @@ ************************************************************************/ #include "oox/drawingml/chart/titlecontext.hxx" + #include "oox/drawingml/shapepropertiescontext.hxx" #include "oox/drawingml/textbodycontext.hxx" #include "oox/drawingml/chart/datasourcecontext.hxx" #include "oox/drawingml/chart/titlemodel.hxx" -using ::rtl::OUString; -using ::oox::core::ContextHandler2Helper; -using ::oox::core::ContextHandlerRef; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; +using ::rtl::OUString; + +// ============================================================================ + TextContext::TextContext( ContextHandler2Helper& rParent, TextModel& rModel ) : ContextBase< TextModel >( rParent, rModel ) { @@ -160,4 +163,3 @@ ContextHandlerRef LegendContext::onCreateContext( sal_Int32 nElement, const Attr } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx index bca53f1a2c01..c1cd02e17378 100644 --- a/oox/source/drawingml/chart/titleconverter.cxx +++ b/oox/source/drawingml/chart/titleconverter.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "oox/drawingml/chart/titleconverter.hxx" + #include #include #include @@ -33,25 +34,11 @@ #include #include #include -#include "properties.hxx" #include "oox/drawingml/textbody.hxx" #include "oox/drawingml/textparagraph.hxx" #include "oox/drawingml/chart/datasourceconverter.hxx" #include "oox/drawingml/chart/titlemodel.hxx" - -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::awt::Rectangle; -using ::com::sun::star::chart2::XDiagram; -using ::com::sun::star::chart2::XFormattedString; -using ::com::sun::star::chart2::XLegend; -using ::com::sun::star::chart2::XTitle; -using ::com::sun::star::chart2::XTitled; -using ::com::sun::star::chart2::data::XDataSequence; -using ::oox::core::XmlFilterBase; +#include "properties.hxx" namespace oox { namespace drawingml { @@ -59,6 +46,16 @@ namespace chart { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::chart2::data; +using namespace ::com::sun::star::uno; + +using ::oox::core::XmlFilterBase; +using ::rtl::OUString; + +// ============================================================================ + TextConverter::TextConverter( const ConverterRoot& rParent, TextModel& rModel ) : ConverterBase< TextModel >( rParent, rModel ) { @@ -270,4 +267,3 @@ void LegendConverter::convertFromModel( const Reference< XDiagram >& rxDiagram ) } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/titlemodel.cxx b/oox/source/drawingml/chart/titlemodel.cxx index bb5501e05f32..d1dc2c664e8f 100644 --- a/oox/source/drawingml/chart/titlemodel.cxx +++ b/oox/source/drawingml/chart/titlemodel.cxx @@ -69,4 +69,3 @@ LegendModel::~LegendModel() } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx index 972295304593..781b2665d6f1 100644 --- a/oox/source/drawingml/chart/typegroupcontext.cxx +++ b/oox/source/drawingml/chart/typegroupcontext.cxx @@ -26,18 +26,21 @@ ************************************************************************/ #include "oox/drawingml/chart/typegroupcontext.hxx" + #include "oox/drawingml/chart/seriescontext.hxx" #include "oox/drawingml/chart/typegroupmodel.hxx" -using ::oox::core::ContextHandler2Helper; -using ::oox::core::ContextHandlerRef; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; + +// ============================================================================ + UpDownBarsContext::UpDownBarsContext( ContextHandler2Helper& rParent, UpDownBarsModel& rModel ) : ContextBase< UpDownBarsModel >( rParent, rModel ) { @@ -399,4 +402,3 @@ ContextHandlerRef SurfaceTypeGroupContext::onCreateContext( sal_Int32 nElement, } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx index 3746048074e9..7c1f1a56fe25 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "oox/drawingml/chart/typegroupconverter.hxx" + #include #include #include @@ -41,28 +42,21 @@ #include "oox/drawingml/chart/typegroupmodel.hxx" #include "properties.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::beans::XPropertySet; -using ::com::sun::star::chart2::XChartType; -using ::com::sun::star::chart2::XChartTypeContainer; -using ::com::sun::star::chart2::XCoordinateSystem; -using ::com::sun::star::chart2::XDataSeries; -using ::com::sun::star::chart2::XDataSeriesContainer; -using ::com::sun::star::chart2::XDiagram; -using ::com::sun::star::chart2::data::XDataSink; -using ::com::sun::star::chart2::data::XLabeledDataSequence; - namespace oox { namespace drawingml { namespace chart { // ============================================================================ +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::chart2::data; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + namespace { // chart type service names @@ -570,4 +564,3 @@ void TypeGroupConverter::insertDataSeries( const Reference< XChartType >& rxChar } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/typegroupmodel.cxx b/oox/source/drawingml/chart/typegroupmodel.cxx index 24f5420644e4..ee5eefc4d163 100644 --- a/oox/source/drawingml/chart/typegroupmodel.cxx +++ b/oox/source/drawingml/chart/typegroupmodel.cxx @@ -80,4 +80,3 @@ TypeGroupModel::~TypeGroupModel() } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/textliststyle.cxx b/oox/source/drawingml/textliststyle.cxx index 901db49802d9..8a491076909f 100644 --- a/oox/source/drawingml/textliststyle.cxx +++ b/oox/source/drawingml/textliststyle.cxx @@ -65,15 +65,4 @@ void TextListStyle::apply( const TextListStyle& rTextListStyle ) applyStyleList( rTextListStyle.getListStyle(), getListStyle() ); } -#if OSL_DEBUG_LEVEL > 0 -void TextListStyle::dump( int nLevels ) -{ - for ( int i = 0; i < nLevels; i++ ) - { - OSL_TRACE("level: %d", i); - maListStyle[ i ]->dump(); - } -} -#endif - } } diff --git a/oox/source/dump/biffdumper.cxx b/oox/source/dump/biffdumper.cxx index 30938f9ebbe6..7932ff2e6f4e 100644 --- a/oox/source/dump/biffdumper.cxx +++ b/oox/source/dump/biffdumper.cxx @@ -29,8 +29,8 @@ #include #include -#include "oox/dump/oledumper.hxx" #include "oox/core/filterbase.hxx" +#include "oox/dump/oledumper.hxx" #include "oox/ole/olestorage.hxx" #include "oox/xls/biffdetector.hxx" #include "oox/xls/biffinputstream.hxx" @@ -38,23 +38,27 @@ #if OOX_INCLUDE_DUMPER -using ::rtl::OUString; -using ::rtl::OUStringBuffer; +namespace oox { +namespace dump { +namespace biff { + +// ============================================================================ + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::util; +using namespace ::oox::xls; + +using ::comphelper::MediaDescriptor; +using ::oox::core::FilterBase; using ::rtl::OString; using ::rtl::OStringBuffer; using ::rtl::OStringToOUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::util::DateTime; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::io::XInputStream; -using ::comphelper::MediaDescriptor; -using ::oox::core::FilterBase; - -using namespace ::oox::xls; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; -namespace oox { -namespace dump { -namespace biff { +// ============================================================================ namespace { @@ -93,12 +97,7 @@ const sal_uInt16 BIFF_STYLE_BUILTIN = 0x8000; const sal_uInt16 BIFF_PT_NOSTRING = 0xFFFF; -} // namespace - -// ============================================================================ -// ============================================================================ - -namespace { +// ---------------------------------------------------------------------------- void lclDumpDffClientPos( const OutputRef& rxOut, const BinaryInputStreamRef& rxStrm, const String& rName, sal_uInt16 nSubScale ) { @@ -128,7 +127,8 @@ void lclDumpDffClientRect( const OutputRef& rxOut, const BinaryInputStreamRef& r } // namespace -// ---------------------------------------------------------------------------- +// ============================================================================ +// ============================================================================ BiffDffStreamObject::BiffDffStreamObject( const OutputObjectBase& rParent, const BinaryInputStreamRef& rxStrm ) { @@ -4361,6 +4361,7 @@ void Dumper::implDump() RootStorageObject( *this ).dump(); } +// ============================================================================ // ============================================================================ } // namespace biff @@ -4368,4 +4369,3 @@ void Dumper::implDump() } // namespace oox #endif - diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini index d4b862825b3c..881001cb05c9 100644 --- a/oox/source/dump/biffdumper.ini +++ b/oox/source/dump/biffdumper.ini @@ -2235,4 +2235,3 @@ multilist=XFEXT-SUBREC end # ============================================================================ - diff --git a/oox/source/dump/dffdumper.cxx b/oox/source/dump/dffdumper.cxx index 8730698561ce..01994865c69d 100644 --- a/oox/source/dump/dffdumper.cxx +++ b/oox/source/dump/dffdumper.cxx @@ -29,13 +29,15 @@ #if OOX_INCLUDE_DUMPER -using ::rtl::OUString; - namespace oox { namespace dump { // ============================================================================ +using ::rtl::OUString; + +// ============================================================================ + namespace { const sal_uInt16 DFF_ID_BSE = 0xF007; /// BLIP store entry. @@ -320,4 +322,3 @@ sal_uInt16 DffStreamObject::dumpDffOptPropHeader() } // namespace oox #endif - diff --git a/oox/source/dump/dffdumper.ini b/oox/source/dump/dffdumper.ini index c33d733c6bd8..5526663e0e15 100644 --- a/oox/source/dump/dffdumper.ini +++ b/oox/source/dump/dffdumper.ini @@ -648,4 +648,3 @@ combilist=DFFSPLITMENUC-RECORD-INST end # ============================================================================ - diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index 807a5ec74715..2a6cf61542f9 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -29,44 +29,44 @@ #include #include -#include #include #include #include #include -#include -#include +#include #include +#include +#include +#include "oox/core/filterbase.hxx" #include "oox/helper/binaryoutputstream.hxx" #include "oox/helper/textinputstream.hxx" -#include "oox/core/filterbase.hxx" #include "oox/xls/biffhelper.hxx" #if OOX_INCLUDE_DUMPER +namespace oox { +namespace dump { + +// ============================================================================ + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::ucb; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::util; + +using ::comphelper::MediaDescriptor; +using ::oox::core::FilterBase; using ::rtl::OString; using ::rtl::OStringBuffer; using ::rtl::OStringToOUString; using ::rtl::OUString; using ::rtl::OUStringBuffer; using ::rtl::OUStringToOString; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::util::DateTime; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::ucb::XSimpleFileAccess; -using ::com::sun::star::io::XActiveDataSink; -using ::com::sun::star::io::XActiveDataSource; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::io::XOutputStream; -using ::com::sun::star::io::XTextInputStream; -using ::com::sun::star::io::XTextOutputStream; -using ::comphelper::MediaDescriptor; -using ::oox::core::FilterBase; -namespace oox { -namespace dump { +// ============================================================================ + +namespace { const sal_Unicode OOX_DUMP_BOM = 0xFEFF; const sal_Int32 OOX_DUMP_MAXSTRLEN = 80; @@ -79,6 +79,8 @@ const sal_Unicode OOX_DUMP_ITEMSEP = '='; const sal_Int32 OOX_DUMP_BYTESPERLINE = 16; const sal_Int64 OOX_DUMP_MAXARRAY = 16; +} // namespace + // ============================================================================ // ============================================================================ @@ -3212,4 +3214,3 @@ void DumperBase::construct( const ConfigRef& rxConfig ) } // namespace oox #endif - diff --git a/oox/source/dump/dumperbase.ini b/oox/source/dump/dumperbase.ini index 34ef302c784c..28aa59a03b81 100644 --- a/oox/source/dump/dumperbase.ini +++ b/oox/source/dump/dumperbase.ini @@ -393,4 +393,3 @@ multilist=SYSTEMCOLOR end # ============================================================================ - diff --git a/oox/source/dump/oledumper.cxx b/oox/source/dump/oledumper.cxx index cc49ee050ea6..eb7abef6c29d 100644 --- a/oox/source/dump/oledumper.cxx +++ b/oox/source/dump/oledumper.cxx @@ -26,29 +26,32 @@ ************************************************************************/ #include "oox/dump/oledumper.hxx" + #include #include -#include #include +#include #include -#include "oox/helper/binaryoutputstream.hxx" #include "oox/core/filterbase.hxx" +#include "oox/helper/binaryoutputstream.hxx" #include "oox/ole/olestorage.hxx" #include "oox/ole/vbainputstream.hxx" #if OOX_INCLUDE_DUMPER -using ::rtl::OUString; -using ::rtl::OUStringBuffer; -using ::rtl::OString; -using ::rtl::OStringToOUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::io::XOutputStream; - namespace oox { namespace dump { +// ============================================================================ + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + +using ::rtl::OString; +using ::rtl::OStringToOUString; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + // ============================================================================ // ============================================================================ @@ -2312,4 +2315,3 @@ void ActiveXStorageObject::implDumpBaseStream( const BinaryInputStreamRef& rxStr } // namespace oox #endif - diff --git a/oox/source/dump/oledumper.ini b/oox/source/dump/oledumper.ini index 13478464e6b3..c8461d4b28a7 100644 --- a/oox/source/dump/oledumper.ini +++ b/oox/source/dump/oledumper.ini @@ -885,4 +885,3 @@ end shortlist=VBA-DIR-PROJECTSYSKIND-PLATFORM,0,16-bit-windows,32-bit-windows,macintosh # ============================================================================ - diff --git a/oox/source/dump/pptxdumper.cxx b/oox/source/dump/pptxdumper.cxx index e01d7d349855..39e0ccc2be55 100644 --- a/oox/source/dump/pptxdumper.cxx +++ b/oox/source/dump/pptxdumper.cxx @@ -26,27 +26,31 @@ ************************************************************************/ #include "oox/dump/pptxdumper.hxx" -#include "oox/helper/zipstorage.hxx" -#include "oox/ole/olestorage.hxx" + #include "oox/dump/biffdumper.hxx" #include "oox/dump/oledumper.hxx" #include "oox/dump/xlsbdumper.hxx" +#include "oox/helper/zipstorage.hxx" +#include "oox/ole/olestorage.hxx" #if OOX_INCLUDE_DUMPER -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::io::XInputStream; -using ::comphelper::MediaDescriptor; -using ::oox::core::FilterBase; - namespace oox { namespace dump { namespace pptx { // ============================================================================ +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::comphelper::MediaDescriptor; +using ::oox::core::FilterBase; +using ::rtl::OUString; + +// ============================================================================ + RootStorageObject::RootStorageObject( const DumperBase& rParent ) { StorageObjectBase::construct( rParent ); @@ -144,4 +148,3 @@ void Dumper::implDump() } // namespace oox #endif - diff --git a/oox/source/dump/pptxdumper.ini b/oox/source/dump/pptxdumper.ini index fa03953b7113..f3c058ecfbf5 100644 --- a/oox/source/dump/pptxdumper.ini +++ b/oox/source/dump/pptxdumper.ini @@ -16,4 +16,3 @@ include-config-file=dumperbase.ini # enable-import=1 # ============================================================================ - diff --git a/oox/source/dump/xlsbdumper.cxx b/oox/source/dump/xlsbdumper.cxx index dd78ac3c4e2e..8f249a909000 100644 --- a/oox/source/dump/xlsbdumper.cxx +++ b/oox/source/dump/xlsbdumper.cxx @@ -26,12 +26,13 @@ ************************************************************************/ #include "oox/dump/xlsbdumper.hxx" + #include +#include "oox/core/filterbase.hxx" #include "oox/dump/biffdumper.hxx" #include "oox/dump/oledumper.hxx" #include "oox/dump/pptxdumper.hxx" #include "oox/helper/zipstorage.hxx" -#include "oox/core/filterbase.hxx" #include "oox/ole/olestorage.hxx" #include "oox/xls/biffhelper.hxx" #include "oox/xls/formulabase.hxx" @@ -39,23 +40,25 @@ #if OOX_INCLUDE_DUMPER -using ::rtl::OUString; -using ::rtl::OUStringBuffer; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::util::DateTime; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::io::XInputStream; -using ::comphelper::MediaDescriptor; -using ::oox::core::FilterBase; - -using namespace ::oox::xls; - namespace oox { namespace dump { namespace xlsb { // ============================================================================ +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::util; +using namespace ::oox::xls; + +using ::comphelper::MediaDescriptor; +using ::oox::core::FilterBase; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +// ============================================================================ + namespace { const sal_uInt8 OOBIN_STRINGFLAG_FONTS = 0x01; @@ -2269,4 +2272,3 @@ void Dumper::implDump() } // namespace oox #endif - diff --git a/oox/source/dump/xlsbdumper.ini b/oox/source/dump/xlsbdumper.ini index f2ac3b49b4d6..b53870f09a15 100644 --- a/oox/source/dump/xlsbdumper.ini +++ b/oox/source/dump/xlsbdumper.ini @@ -1076,4 +1076,3 @@ flagslist=XF-USEDFLAGS end # ============================================================================ - diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx index 5479fae46f82..1f365a1fdacd 100644 --- a/oox/source/helper/attributelist.cxx +++ b/oox/source/helper/attributelist.cxx @@ -26,17 +26,20 @@ ************************************************************************/ #include "oox/helper/attributelist.hxx" + #include #include +namespace oox { + +// ============================================================================ + +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::util; +using namespace ::com::sun::star::xml::sax; + using ::rtl::OUString; using ::rtl::OUStringBuffer; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::util::DateTime; -using ::com::sun::star::xml::sax::XFastAttributeList; - -namespace oox { // ============================================================================ @@ -314,4 +317,3 @@ DateTime AttributeList::getDateTime( sal_Int32 nAttrToken, const DateTime& rDefa // ============================================================================ } // namespace oox - diff --git a/oox/source/helper/binaryinputstream.cxx b/oox/source/helper/binaryinputstream.cxx index a5a3cf9a2c30..2d547cdbf724 100644 --- a/oox/source/helper/binaryinputstream.cxx +++ b/oox/source/helper/binaryinputstream.cxx @@ -26,27 +26,32 @@ ************************************************************************/ #include "oox/helper/binaryinputstream.hxx" + #include #include #include #include #include "oox/helper/binaryoutputstream.hxx" +namespace oox { + +// ============================================================================ + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + using ::rtl::OString; using ::rtl::OStringBuffer; using ::rtl::OStringToOUString; using ::rtl::OUString; using ::rtl::OUStringBuffer; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::io::XSeekable; -namespace oox { +namespace { const sal_Int32 INPUTSTREAM_BUFFERSIZE = 0x8000; +} // namespace + // ============================================================================ OString BinaryInputStream::readNulCharArray() @@ -330,4 +335,3 @@ void RelativeInputStream::skip( sal_Int32 nBytes ) // ============================================================================ } // namespace oox - diff --git a/oox/source/helper/binaryoutputstream.cxx b/oox/source/helper/binaryoutputstream.cxx index f39ac9d8f1b2..f4ea9378aa90 100644 --- a/oox/source/helper/binaryoutputstream.cxx +++ b/oox/source/helper/binaryoutputstream.cxx @@ -26,19 +26,23 @@ ************************************************************************/ #include "oox/helper/binaryoutputstream.hxx" + #include #include -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::io::XOutputStream; -using ::com::sun::star::io::XSeekable; - namespace oox { +// ============================================================================ + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + +namespace { + const sal_Int32 OUTPUTSTREAM_BUFFERSIZE = 0x8000; +} // namespace + // ============================================================================ void BinaryOutputStream::writeAtom( const void* pMem, sal_uInt8 nSize ) diff --git a/oox/source/helper/binarystreambase.cxx b/oox/source/helper/binarystreambase.cxx index a8f9320ffc94..d1e11850a68c 100644 --- a/oox/source/helper/binarystreambase.cxx +++ b/oox/source/helper/binarystreambase.cxx @@ -26,16 +26,18 @@ ************************************************************************/ #include "oox/helper/binarystreambase.hxx" -#include -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::io::XSeekable; +#include namespace oox { // ============================================================================ +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + +// ============================================================================ + BinaryStreamBase::~BinaryStreamBase() { } @@ -158,4 +160,3 @@ void SequenceSeekableStream::seek( sal_Int64 nPos ) // ============================================================================ } // namespace oox - diff --git a/oox/source/helper/containerhelper.cxx b/oox/source/helper/containerhelper.cxx index 359bc87e09e9..4d41d9924326 100644 --- a/oox/source/helper/containerhelper.cxx +++ b/oox/source/helper/containerhelper.cxx @@ -26,25 +26,23 @@ ************************************************************************/ #include "oox/helper/containerhelper.hxx" -#include -#include + #include #include +#include +#include #include "oox/helper/helper.hxx" +namespace oox { + +// ============================================================================ + +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + using ::rtl::OUString; using ::rtl::OUStringBuffer; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::container::XIndexContainer; -using ::com::sun::star::container::XNameAccess; -using ::com::sun::star::container::XNameContainer; - -namespace oox { // ============================================================================ @@ -221,4 +219,3 @@ void ObjectContainer::createContainer() const // ============================================================================ } // namespace oox - diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx index 455778f939f7..a33f91359f2b 100644 --- a/oox/source/helper/graphichelper.cxx +++ b/oox/source/helper/graphichelper.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "oox/helper/graphichelper.hxx" + #include #include #include @@ -39,32 +40,22 @@ #include "tokens.hxx" #include "oox/helper/containerhelper.hxx" -using ::rtl::OUString; -using ::com::sun::star::awt::DeviceInfo; -using ::com::sun::star::awt::Point; -using ::com::sun::star::awt::Size; -using ::com::sun::star::awt::XDevice; -using ::com::sun::star::awt::XUnitConversion; -using ::com::sun::star::beans::PropertyValue; -using ::com::sun::star::frame::XFrame; -using ::com::sun::star::frame::XFramesSupplier; -using ::com::sun::star::graphic::GraphicObject; -using ::com::sun::star::graphic::XGraphic; -using ::com::sun::star::graphic::XGraphicObject; -using ::com::sun::star::graphic::XGraphicProvider; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; - namespace oox { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::graphic; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + namespace { inline sal_Int32 lclConvertScreenPixelToHmm( double fPixel, double fPixelPerHmm ) @@ -355,4 +346,3 @@ OUString GraphicHelper::importEmbeddedGraphicObject( const OUString& rStreamName // ============================================================================ } // namespace oox - diff --git a/oox/source/helper/modelobjecthelper.cxx b/oox/source/helper/modelobjecthelper.cxx index 6528fea5634d..f9b6b066230a 100644 --- a/oox/source/helper/modelobjecthelper.cxx +++ b/oox/source/helper/modelobjecthelper.cxx @@ -26,24 +26,26 @@ ************************************************************************/ #include "oox/helper/modelobjecthelper.hxx" -#include + #include #include #include +#include #include "oox/helper/helper.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::awt::Gradient; -using ::com::sun::star::drawing::LineDash; -using ::com::sun::star::drawing::PolyPolygonBezierCoords; - namespace oox { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + ModelObjectHelper::ModelObjectHelper( const Reference< XMultiServiceFactory >& rxModelFactory ) : maMarkerContainer( rxModelFactory, CREATE_OUSTRING( "com.sun.star.drawing.MarkerTable" ) ), maDashContainer( rxModelFactory, CREATE_OUSTRING( "com.sun.star.drawing.DashTable" ) ), @@ -88,4 +90,3 @@ OUString ModelObjectHelper::insertFillBitmap( const OUString& rGraphicUrl ) // ============================================================================ } // namespace oox - diff --git a/oox/source/helper/progressbar.cxx b/oox/source/helper/progressbar.cxx index 6934f2dcf8d3..1ef6531d3fb0 100644 --- a/oox/source/helper/progressbar.cxx +++ b/oox/source/helper/progressbar.cxx @@ -26,17 +26,19 @@ ************************************************************************/ #include "oox/helper/progressbar.hxx" + #include #include "oox/helper/helper.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::task::XStatusIndicator; - namespace oox { // ============================================================================ +using namespace ::com::sun::star::task; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + namespace { const sal_Int32 PROGRESS_RANGE = 1000000; @@ -182,4 +184,3 @@ ISegmentProgressBarRef SegmentProgressBar::createSegment( double fLength ) // ============================================================================ } // namespace oox - diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx index 31072fe449e5..49a3547682b4 100644 --- a/oox/source/helper/propertymap.cxx +++ b/oox/source/helper/propertymap.cxx @@ -26,44 +26,25 @@ ************************************************************************/ #include "oox/helper/propertymap.hxx" -#include -#include + #include #include #include +#include +#include #include "properties.hxx" #include "oox/token/propertylist.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::lang::IllegalArgumentException; -using ::com::sun::star::lang::WrappedTargetException; -using ::com::sun::star::beans::Property; -using ::com::sun::star::beans::PropertyValue; -using ::com::sun::star::beans::PropertyVetoException; -using ::com::sun::star::beans::UnknownPropertyException; -using ::com::sun::star::beans::XPropertyChangeListener; -using ::com::sun::star::beans::XPropertySet; -using ::com::sun::star::beans::XPropertySetInfo; -using ::com::sun::star::beans::XVetoableChangeListener; - -#if OSL_DEBUG_LEVEL > 0 -#include -#include -#include -#include -#define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr() -using namespace ::com::sun::star; +namespace oox { + +// ============================================================================ + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; -using ::rtl::OString; -using ::com::sun::star::style::LineSpacing; -using ::com::sun::star::text::WritingMode; -#endif -namespace oox { +using ::rtl::OString; +using ::rtl::OUString; // ============================================================================ @@ -241,67 +222,6 @@ Reference< XPropertySet > PropertyMap::makePropertySet() const return new GenericPropertySet( *this ); } -#if OSL_DEBUG_LEVEL > 0 -void PropertyMap::dump( Reference< XPropertySet > rXPropSet ) -{ - Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo (); - Sequence< beans::Property > props = info->getProperties (); - - OSL_TRACE("dump props, len: %d", props.getLength ()); - - for (int i=0; i < props.getLength (); i++) { - OString name = OUStringToOString( props [i].Name, RTL_TEXTENCODING_UTF8); - fprintf (stderr,"%30s = ", name.getStr() ); - - try { - Any value = rXPropSet->getPropertyValue( props [i].Name ); - - OUString strValue; - sal_Int32 intValue = 0; - sal_uInt32 uintValue = 0; - sal_Int16 int16Value = 0; - sal_uInt16 uint16Value = 0; - bool boolValue = false; - LineSpacing spacing; -// RectanglePoint pointValue; - WritingMode aWritingMode; - - if( value >>= strValue ) - fprintf (stderr,"\"%s\"\n", USS( strValue ) ); - else if( value >>= intValue ) - fprintf (stderr,"%"SAL_PRIdINT32" (hex: %"SAL_PRIxUINT32")\n", intValue, intValue); - else if( value >>= uintValue ) - fprintf (stderr,"%"SAL_PRIdINT32" (hex: %"SAL_PRIxUINT32")\n", uintValue, uintValue); - else if( value >>= int16Value ) - fprintf (stderr,"%d (hex: %x)\n", int16Value, int16Value); - else if( value >>= uint16Value ) - fprintf (stderr,"%d (hex: %x)\n", uint16Value, uint16Value); - else if( value >>= boolValue ) - fprintf (stderr,"%d (bool)\n", boolValue); - else if( value >>= aWritingMode ) - fprintf (stderr, "%d writing mode\n", aWritingMode); - else if( value >>= spacing ) { - fprintf (stderr, "mode: %d value: %d\n", spacing.Mode, spacing.Height); - } else if( value.isExtractableTo(::getCppuType((const sal_Int32*)0))) { - fprintf (stderr,"is extractable to int32\n"); - } -// else if( value >>= pointValue ) -// fprintf (stderr,"%d (RectanglePoint)\n", pointValue); - else - fprintf (stderr,"??? \n", USS(value.getValueTypeName())); - } catch(Exception e) { - fprintf (stderr,"unable to get '%s' value\n", USS(props [i].Name)); - } - } -} - -void PropertyMap::dump() -{ - dump( Reference< XPropertySet >( makePropertySet(), UNO_QUERY ) ); -} -#endif - // ============================================================================ } // namespace oox - diff --git a/oox/source/helper/propertyset.cxx b/oox/source/helper/propertyset.cxx index e7071ba402a2..4812fdf35aa5 100644 --- a/oox/source/helper/propertyset.cxx +++ b/oox/source/helper/propertyset.cxx @@ -26,21 +26,21 @@ ************************************************************************/ #include "oox/helper/propertyset.hxx" -#include + #include +#include #include "oox/helper/propertymap.hxx" -using ::rtl::OUString; +namespace oox { + +// ============================================================================ + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::uno; + using ::rtl::OStringBuffer; +using ::rtl::OUString; using ::rtl::OUStringToOString; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::beans::XPropertySet; - -namespace oox { // ============================================================================ @@ -172,14 +172,6 @@ void PropertySet::setAnyProperty( const OUString& rPropName, const Any& rValue ) } } -#if OSL_DEBUG_LEVEL > 0 -void PropertySet::dump() -{ - PropertyMap::dump( Reference< XPropertySet >( getXPropertySet(), UNO_QUERY ) ); -} -#endif - // ============================================================================ } // namespace oox - diff --git a/oox/source/helper/recordinputstream.cxx b/oox/source/helper/recordinputstream.cxx index 617e7f95876e..a746eef47d73 100644 --- a/oox/source/helper/recordinputstream.cxx +++ b/oox/source/helper/recordinputstream.cxx @@ -26,15 +26,17 @@ ************************************************************************/ #include "oox/helper/recordinputstream.hxx" -#include -#include -using ::rtl::OUString; +#include namespace oox { // ============================================================================ +using ::rtl::OUString; + +// ============================================================================ + RecordInputStream::RecordInputStream( const StreamDataSequence& rData ) : SequenceInputStream( rData ) { @@ -68,4 +70,3 @@ OUString RecordInputStream::readString( bool b32BitLen ) // ============================================================================ } // namespace oox - diff --git a/oox/source/helper/storagebase.cxx b/oox/source/helper/storagebase.cxx index 4a05f66db81b..eee2b5c5d9b2 100644 --- a/oox/source/helper/storagebase.cxx +++ b/oox/source/helper/storagebase.cxx @@ -26,24 +26,23 @@ ************************************************************************/ #include "oox/helper/storagebase.hxx" -#include + #include +#include #include #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/binaryoutputstream.hxx" +namespace oox { + +// ============================================================================ + +using namespace ::com::sun::star::embed; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + using ::rtl::OUString; using ::rtl::OUStringBuffer; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_SET_THROW; -using ::com::sun::star::embed::XStorage; -using ::com::sun::star::embed::XTransactedObject; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::io::XOutputStream; -using ::com::sun::star::io::XStream; - -namespace oox { // ============================================================================ diff --git a/oox/source/helper/textinputstream.cxx b/oox/source/helper/textinputstream.cxx index d6d4736f3ca2..d590781c6fd3 100755 --- a/oox/source/helper/textinputstream.cxx +++ b/oox/source/helper/textinputstream.cxx @@ -26,17 +26,20 @@ ************************************************************************/ #include "oox/helper/textinputstream.hxx" + #include #include #include "oox/helper/binaryinputstream.hxx" +namespace oox { + +// ============================================================================ + using ::rtl::OStringBuffer; using ::rtl::OStringToOUString; using ::rtl::OUString; using ::rtl::OUStringBuffer; -namespace oox { - // ============================================================================ namespace { @@ -125,4 +128,3 @@ OUString TextInputStream::readLine() // ============================================================================ } // namespace oox - diff --git a/oox/source/helper/zipstorage.cxx b/oox/source/helper/zipstorage.cxx index 384870430c39..8145e7c4e5ce 100644 --- a/oox/source/helper/zipstorage.cxx +++ b/oox/source/helper/zipstorage.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "oox/helper/zipstorage.hxx" + #include #include #include @@ -35,25 +36,20 @@ #include #include "oox/helper/helper.hxx" -using ::rtl::OUString; -using ::com::sun::star::container::NoSuchElementException; -using ::com::sun::star::embed::XStorage; -using ::com::sun::star::embed::XTransactedObject; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::io::XOutputStream; -using ::com::sun::star::io::XStream; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; - namespace oox { // ============================================================================ +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::embed; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + ZipStorage::ZipStorage( const Reference< XMultiServiceFactory >& rxFactory, const Reference< XInputStream >& rxInStream ) : diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index 1cc74c32aa2d..358803b63a13 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "oox/vml/vmldrawing.hxx" + #include #include "tokens.hxx" #include "oox/core/xmlfilterbase.hxx" @@ -33,21 +34,20 @@ #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::awt::Rectangle; -using ::com::sun::star::awt::XControlModel; -using ::com::sun::star::drawing::XDrawPage; -using ::com::sun::star::drawing::XShape; -using ::com::sun::star::drawing::XShapes; -using ::oox::core::XmlFilterBase; - namespace oox { namespace vml { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::uno; + +using ::oox::core::XmlFilterBase; +using ::rtl::OUString; + +// ============================================================================ + namespace { /** Returns the textual representation of a numeric VML shape identifier. */ @@ -164,4 +164,3 @@ void Drawing::notifyShapeInserted( const Reference< XShape >& /*rxShape*/, const } // namespace vml } // namespave oox - diff --git a/oox/source/vml/vmldrawingfragment.cxx b/oox/source/vml/vmldrawingfragment.cxx index 333df72bbaf7..60ed554c2cb6 100644 --- a/oox/source/vml/vmldrawingfragment.cxx +++ b/oox/source/vml/vmldrawingfragment.cxx @@ -26,19 +26,23 @@ ************************************************************************/ #include "oox/vml/vmldrawingfragment.hxx" + #include "oox/vml/vmldrawing.hxx" #include "oox/vml/vmlinputstream.hxx" #include "oox/vml/vmlshapecontext.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::io::XInputStream; +namespace oox { +namespace vml { + +// ============================================================================ + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + using ::oox::core::ContextHandlerRef; using ::oox::core::FragmentHandler2; using ::oox::core::XmlFilterBase; - -namespace oox { -namespace vml { +using ::rtl::OUString; // ============================================================================ @@ -90,4 +94,3 @@ void DrawingFragment::finalizeImport() } // namespace vml } // namespace oox - diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index 827930c22496..e82f78cf7210 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -26,26 +26,30 @@ ************************************************************************/ #include "oox/vml/vmlformatting.hxx" + #include #include "tokens.hxx" -#include "oox/token/tokenmap.hxx" -#include "oox/helper/graphichelper.hxx" -#include "oox/helper/propertymap.hxx" #include "oox/drawingml/color.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/fillproperties.hxx" #include "oox/drawingml/lineproperties.hxx" +#include "oox/helper/graphichelper.hxx" +#include "oox/helper/propertymap.hxx" +#include "oox/token/tokenmap.hxx" + +namespace oox { +namespace vml { + +// ============================================================================ + +using namespace ::com::sun::star::geometry; -using ::rtl::OStringBuffer; -using ::rtl::OUString; -using ::com::sun::star::geometry::IntegerRectangle2D; using ::oox::drawingml::Color; using ::oox::drawingml::FillProperties; using ::oox::drawingml::LineArrowProperties; using ::oox::drawingml::LineProperties; - -namespace oox { -namespace vml { +using ::rtl::OStringBuffer; +using ::rtl::OUString; // ============================================================================ @@ -600,4 +604,3 @@ void FillModel::pushToPropMap( PropertyMap& rPropMap, } // namespace vml } // namespace oox - diff --git a/oox/source/vml/vmlinputstream.cxx b/oox/source/vml/vmlinputstream.cxx index a6d50e193bc4..27776c66ca0b 100644 --- a/oox/source/vml/vmlinputstream.cxx +++ b/oox/source/vml/vmlinputstream.cxx @@ -26,22 +26,25 @@ ************************************************************************/ #include "oox/vml/vmlinputstream.hxx" + #include #include #include #include "oox/helper/helper.hxx" -using ::rtl::OString; -using ::rtl::OStringBuffer; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::io::XInputStream; - namespace oox { namespace vml { // ============================================================================ +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + +using ::rtl::OString; +using ::rtl::OStringBuffer; + +// ============================================================================ + namespace { inline const sal_Char* lclFindCharacter( const sal_Char* pcBeg, const sal_Char* pcEnd, sal_Char cChar ) @@ -277,4 +280,3 @@ InputStream::~InputStream() } // namespace vml } // namespave oox - diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index d557a7f50354..290e624698f4 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -26,7 +26,7 @@ ************************************************************************/ #include "oox/vml/vmlshape.hxx" -#include + #include #include #include @@ -35,41 +35,34 @@ #include #include #include +#include #include "properties.hxx" +#include "oox/core/xmlfilterbase.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/core/xmlfilterbase.hxx" #include "oox/ole/axcontrol.hxx" #include "oox/ole/axcontrolfragment.hxx" #include "oox/ole/oleobjecthelper.hxx" #include "oox/vml/vmldrawing.hxx" #include "oox/vml/vmlshapecontainer.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::awt::Point; -using ::com::sun::star::awt::Rectangle; -using ::com::sun::star::awt::Size; -using ::com::sun::star::awt::XControlModel; -using ::com::sun::star::graphic::XGraphic; -using ::com::sun::star::drawing::PointSequenceSequence; -using ::com::sun::star::drawing::XControlShape; -using ::com::sun::star::drawing::XEnhancedCustomShapeDefaulter; -using ::com::sun::star::drawing::XShape; -using ::com::sun::star::drawing::XShapes; -using ::oox::core::XmlFilterBase; - namespace oox { namespace vml { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::graphic; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::oox::core::XmlFilterBase; +using ::rtl::OUString; + +// ============================================================================ + namespace { Point lclGetAbsPoint( const Point& rRelPoint, const Rectangle& rShapeRect, const Rectangle& rCoordSys ) @@ -552,4 +545,3 @@ Reference< XShape > GroupShape::implConvertAndInsert( const Reference< XShapes > } // namespace vml } // namespace oox - diff --git a/oox/source/vml/vmlshapecontainer.cxx b/oox/source/vml/vmlshapecontainer.cxx index a3bdfdb217d7..9589549be0d9 100644 --- a/oox/source/vml/vmlshapecontainer.cxx +++ b/oox/source/vml/vmlshapecontainer.cxx @@ -26,19 +26,23 @@ ************************************************************************/ #include "oox/vml/vmlshapecontainer.hxx" + #include "oox/vml/vmldrawing.hxx" #include "oox/vml/vmlshape.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::awt::Rectangle; -using ::com::sun::star::drawing::XShapes; - namespace oox { namespace vml { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + namespace { template< typename ShapeType > @@ -130,4 +134,3 @@ void ShapeContainer::convertAndInsert( const Reference< XShapes >& rxShapes, con } // namespace vml } // namespace oox - diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index ec7da1d4d900..ac08c1836c2d 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -26,17 +26,21 @@ ************************************************************************/ #include "oox/vml/vmlshapecontext.hxx" + #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" -using ::rtl::OUString; -using ::com::sun::star::awt::Point; +namespace oox { +namespace vml { + +// ============================================================================ + +using namespace ::com::sun::star::awt; + using ::oox::core::ContextHandler2; using ::oox::core::ContextHandler2Helper; using ::oox::core::ContextHandlerRef; - -namespace oox { -namespace vml { +using ::rtl::OUString; // ============================================================================ -- cgit From 466f141b3fbe4818f34fc69aef9deacef67e42d7 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Mon, 9 Aug 2010 14:24:58 +0200 Subject: dr77: #i113737# return correct UNO type --- sc/source/filter/xml/XMLCodeNameProvider.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 sc/source/filter/xml/XMLCodeNameProvider.cxx diff --git a/sc/source/filter/xml/XMLCodeNameProvider.cxx b/sc/source/filter/xml/XMLCodeNameProvider.cxx old mode 100755 new mode 100644 index ca4bac7eb511..646d245c13f1 --- a/sc/source/filter/xml/XMLCodeNameProvider.cxx +++ b/sc/source/filter/xml/XMLCodeNameProvider.cxx @@ -156,7 +156,7 @@ uno::Sequence< OUString > SAL_CALL XMLCodeNameProvider::getElementNames( ) uno::Type SAL_CALL XMLCodeNameProvider::getElementType( ) throw (uno::RuntimeException) { - return uno::Type(); + return getCppuType( static_cast< uno::Sequence< beans::PropertyValue >* >( 0 ) ); } ::sal_Bool SAL_CALL XMLCodeNameProvider::hasElements() -- cgit From 76ec9b6d37ec0b572f0fed83fbbfda9efab59983 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Mon, 9 Aug 2010 17:05:10 +0200 Subject: dr77: #i113046# create sheet modules even if codename is missing, ported from CWS container_controls --- oox/inc/oox/ole/vbamodule.hxx | 19 +++++- oox/inc/oox/ole/vbaproject.hxx | 21 +++++- oox/inc/oox/xls/excelvbaproject.hxx | 4 ++ oox/source/ole/vbamodule.cxx | 128 +++++++++++++++++++++--------------- oox/source/ole/vbaproject.cxx | 105 ++++++++++++++++++----------- oox/source/xls/excelvbaproject.cxx | 103 +++++++++++++++++++++++++---- 6 files changed, 269 insertions(+), 111 deletions(-) diff --git a/oox/inc/oox/ole/vbamodule.hxx b/oox/inc/oox/ole/vbamodule.hxx index 3b529ceee129..377c7abc335a 100755 --- a/oox/inc/oox/ole/vbamodule.hxx +++ b/oox/inc/oox/ole/vbamodule.hxx @@ -68,11 +68,26 @@ public: /** Imports all records for this module until the MODULEEND record. */ void importDirRecords( BinaryInputStream& rDirStrm ); - /** Imports the Basic source code into the passed Basic library. */ - void importSourceCode( + + /** Imports the VBA source code into the passed Basic library. */ + void createAndImportModule( StorageBase& rVbaStrg, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& rxDocObjectNA ) const; + /** Creates an empty Basic module in the passed Basic library. */ + void createEmptyModule( + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib, + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& rxDocObjectNA ) const; + +private: + /** Reads and returns the VBA source code from the passed storage. */ + ::rtl::OUString readSourceCode( StorageBase& rVbaStrg ) const; + + /** Creates a new Basic module and inserts it into the passed Basic library. */ + void createModule( + const ::rtl::OUString& rVBASourceCode, + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib, + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& rxDocObjectNA ) const; private: ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > diff --git a/oox/inc/oox/ole/vbaproject.hxx b/oox/inc/oox/ole/vbaproject.hxx index 0422ccbd0cf8..cb4562a2b7c5 100755 --- a/oox/inc/oox/ole/vbaproject.hxx +++ b/oox/inc/oox/ole/vbaproject.hxx @@ -28,8 +28,9 @@ #ifndef OOX_OLE_VBAPROJECT_HXX #define OOX_OLE_VBAPROJECT_HXX -#include "oox/helper/storagebase.hxx" +#include #include +#include "oox/helper/storagebase.hxx" #include "oox/dllapi.h" namespace com { namespace sun { namespace star { @@ -248,6 +249,14 @@ public: const ::rtl::OUString& rProxyType, const ::rtl::OUString& rProxyCode ); +protected: + /** Registers a dummy module that will be created when the VBA project is + imported. */ + void addDummyModule( const ::rtl::OUString& rName, sal_Int32 nType ); + + /** Called when the import process of the VBA code modules starts. */ + virtual void prepareModuleImport(); + private: VbaProject( const VbaProject& ); VbaProject& operator=( const VbaProject& ); @@ -264,12 +273,19 @@ private: /** Creates and returns the dialog library of the document used for import. */ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createDialogLibrary(); + /** Imports the VBA code modules and forms. */ - void importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ); + void importVba( + StorageBase& rVbaPrjStrg, + const GraphicHelper& rGraphicHelper, + bool bDefaultColorBgr ); + /** Copies the entire VBA project storage to the passed document model. */ void copyStorage( StorageBase& rVbaPrjStrg ); private: + typedef ::std::map< ::rtl::OUString, sal_Int32 > DummyModuleMap; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxGlobalFactory; /// Global service factory. ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > @@ -278,6 +294,7 @@ private: mxBasicLib; /// The Basic library of the document used for import. ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxDialogLib; /// The dialog library of the document used for import. + DummyModuleMap maDummyModules; /// Additional empty modules created on import. const ::rtl::OUString maLibName; /// Name for Basic and dialog library used for import. }; diff --git a/oox/inc/oox/xls/excelvbaproject.hxx b/oox/inc/oox/xls/excelvbaproject.hxx index 6a517d13cd88..9726cbdc923c 100755 --- a/oox/inc/oox/xls/excelvbaproject.hxx +++ b/oox/inc/oox/xls/excelvbaproject.hxx @@ -51,6 +51,10 @@ public: /** Attaches all document and sheet events to existing VBA macros. */ void attachToEvents(); +protected: + /** Adds dummy modules for sheets without imported code name. */ + virtual void prepareModuleImport(); + private: /** Attaches VBA macros to all supported document events. */ void attachToDocumentEvents( const ::rtl::OUString& rCodeName ); diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx index e9388e54215a..69fc8a011c04 100755 --- a/oox/source/ole/vbamodule.cxx +++ b/oox/source/ole/vbamodule.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "oox/ole/vbamodule.hxx" + #include #include #include @@ -36,31 +37,27 @@ #include "oox/ole/vbahelper.hxx" #include "oox/ole/vbainputstream.hxx" -using ::rtl::OUString; -using ::rtl::OUStringBuffer; -using ::com::sun::star::container::XNameAccess; -using ::com::sun::star::container::XNameContainer; -using ::com::sun::star::frame::XModel; -using ::com::sun::star::script::ModuleInfo; -using ::com::sun::star::script::XVBAModuleInfo; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; - -namespace ApiModuleType = ::com::sun::star::script::ModuleType; - namespace oox { namespace ole { // ============================================================================ +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::script; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +// ============================================================================ + VbaModule::VbaModule( const Reference< XModel >& rxDocModel, const OUString& rName, rtl_TextEncoding eTextEnc, bool bExecutable ) : mxDocModel( rxDocModel ), maName( rName ), meTextEnc( eTextEnc ), - mnType( ApiModuleType::UNKNOWN ), + mnType( ModuleType::UNKNOWN ), mnOffset( SAL_MAX_UINT32 ), mbReadOnly( false ), mbPrivate( false ), @@ -107,13 +104,13 @@ void VbaModule::importDirRecords( BinaryInputStream& rDirStrm ) break; case VBA_ID_MODULETYPEPROCEDURAL: OOX_ENSURE_RECORDSIZE( nRecSize == 0 ); - OSL_ENSURE( mnType == ApiModuleType::UNKNOWN, "VbaModule::importDirRecords - multiple module type records" ); - mnType = ApiModuleType::NORMAL; + OSL_ENSURE( mnType == ModuleType::UNKNOWN, "VbaModule::importDirRecords - multiple module type records" ); + mnType = ModuleType::NORMAL; break; case VBA_ID_MODULETYPEDOCUMENT: OOX_ENSURE_RECORDSIZE( nRecSize == 0 ); - OSL_ENSURE( mnType == ApiModuleType::UNKNOWN, "VbaModule::importDirRecords - multiple module type records" ); - mnType = ApiModuleType::DOCUMENT; + OSL_ENSURE( mnType == ModuleType::UNKNOWN, "VbaModule::importDirRecords - multiple module type records" ); + mnType = ModuleType::DOCUMENT; break; case VBA_ID_MODULEREADONLY: OOX_ENSURE_RECORDSIZE( nRecSize == 0 ); @@ -130,22 +127,60 @@ void VbaModule::importDirRecords( BinaryInputStream& rDirStrm ) } OSL_ENSURE( maName.getLength() > 0, "VbaModule::importDirRecords - missing module name" ); OSL_ENSURE( maStreamName.getLength() > 0, "VbaModule::importDirRecords - missing module stream name" ); - OSL_ENSURE( mnType != ApiModuleType::UNKNOWN, "VbaModule::importDirRecords - missing module type" ); + OSL_ENSURE( mnType != ModuleType::UNKNOWN, "VbaModule::importDirRecords - missing module type" ); OSL_ENSURE( mnOffset < SAL_MAX_UINT32, "VbaModule::importDirRecords - missing module stream offset" ); } -void VbaModule::importSourceCode( StorageBase& rVbaStrg, - const Reference< XNameContainer >& rxBasicLib, const Reference< XNameAccess >& rxDocObjectNA ) const +void VbaModule::createAndImportModule( StorageBase& rVbaStrg, const Reference< XNameContainer >& rxBasicLib, + const Reference< XNameAccess >& rxDocObjectNA ) const { - if( (maName.getLength() == 0) || (maStreamName.getLength() == 0) || (mnOffset == SAL_MAX_UINT32) ) - return; + OUString aVBASourceCode = readSourceCode( rVbaStrg ); + createModule( aVBASourceCode, rxBasicLib, rxDocObjectNA ); +} + +void VbaModule::createEmptyModule( const Reference< XNameContainer >& rxBasicLib, const Reference< XNameAccess >& rxDocObjectNA ) const +{ + createModule( OUString(), rxBasicLib, rxDocObjectNA ); +} + +// private -------------------------------------------------------------------- - BinaryXInputStream aInStrm( rVbaStrg.openInputStream( maStreamName ), true ); - OSL_ENSURE( !aInStrm.isEof(), "VbaModule::importSourceCode - cannot open module stream" ); - // skip the 'performance cache' stored before the actual source code - aInStrm.seek( mnOffset ); - // if stream is still valid, load the source code - if( aInStrm.isEof() ) +OUString VbaModule::readSourceCode( StorageBase& rVbaStrg ) const +{ + OUStringBuffer aSourceCode; + if( (maStreamName.getLength() > 0) && (mnOffset != SAL_MAX_UINT32) ) + { + BinaryXInputStream aInStrm( rVbaStrg.openInputStream( maStreamName ), true ); + OSL_ENSURE( !aInStrm.isEof(), "VbaModule::readSourceCode - cannot open module stream" ); + // skip the 'performance cache' stored before the actual source code + aInStrm.seek( mnOffset ); + // if stream is still valid, load the source code + if( !aInStrm.isEof() ) + { + // decompression starts at current stream position of aInStrm + VbaInputStream aVbaStrm( aInStrm ); + // load the source code line-by-line, with some more processing + TextInputStream aVbaTextStrm( aVbaStrm, meTextEnc ); + while( !aVbaTextStrm.isEof() ) + { + OUString aCodeLine = aVbaTextStrm.readLine(); + if( !aCodeLine.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "Attribute " ) ) ) + { + // normal source code line + if( !mbExecutable ) + aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Rem " ) ); + aSourceCode.append( aCodeLine ).append( sal_Unicode( '\n' ) ); + } + } + } + } + return aSourceCode.makeStringAndClear(); +} + +void VbaModule::createModule( const OUString& rVBASourceCode, + const Reference< XNameContainer >& rxBasicLib, const Reference< XNameAccess >& rxDocObjectNA ) const +{ + if( maName.getLength() == 0 ) return; // prepare the Basic module @@ -155,20 +190,20 @@ void VbaModule::importSourceCode( StorageBase& rVbaStrg, aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Rem Attribute VBA_ModuleType=" ) ); switch( mnType ) { - case ApiModuleType::NORMAL: + case ModuleType::NORMAL: aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VBAModule" ) ); break; - case ApiModuleType::CLASS: + case ModuleType::CLASS: aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VBAClassModule" ) ); break; - case ApiModuleType::FORM: + case ModuleType::FORM: aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VBAFormModule" ) ); // hack from old filter, document Basic should know the XModel, but it doesn't aModuleInfo.ModuleObject.set( mxDocModel, UNO_QUERY ); break; - case ApiModuleType::DOCUMENT: + case ModuleType::DOCUMENT: aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VBADocumentModule" ) ); - // get the VBA object associated to the document module + // get the VBA implementation object associated to the document module if( rxDocObjectNA.is() ) try { aModuleInfo.ModuleObject.set( rxDocObjectNA->getByName( maName ), UNO_QUERY ); @@ -184,7 +219,7 @@ void VbaModule::importSourceCode( StorageBase& rVbaStrg, if( mbExecutable ) { aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Option VBASupport 1\n" ) ); - if( mnType == ApiModuleType::CLASS ) + if( mnType == ModuleType::CLASS ) aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Option ClassModule\n" ) ); } else @@ -194,21 +229,8 @@ void VbaModule::importSourceCode( StorageBase& rVbaStrg, append( maName.replace( ' ', '_' ) ).append( sal_Unicode( '\n' ) ); } - // decompression starts at current stream position of aInStrm - VbaInputStream aVbaStrm( aInStrm ); - // load the source code line-by-line, with some more processing - TextInputStream aVbaTextStrm( aVbaStrm, meTextEnc ); - while( !aVbaTextStrm.isEof() ) - { - OUString aCodeLine = aVbaTextStrm.readLine(); - // skip all 'Attribute' statements - if( !aCodeLine.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "Attribute " ) ) ) - { - if( !mbExecutable ) - aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Rem " ) ); - aSourceCode.append( aCodeLine ).append( sal_Unicode( '\n' ) ); - } - } + // append passed VBA source code + aSourceCode.append( rVBASourceCode ); // close the subroutine named after the module if( !mbExecutable ) @@ -231,7 +253,7 @@ void VbaModule::importSourceCode( StorageBase& rVbaStrg, } catch( Exception& ) { - OSL_ENSURE( false, "VbaModule::importSourceCode - cannot insert module into library" ); + OSL_ENSURE( false, "VbaModule::createModule - cannot insert module into library" ); } } diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index a370fb3d168e..9edcb61538ca 100755 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "oox/ole/vbaproject.hxx" + #include #include #include @@ -34,12 +35,10 @@ #include #include #include -#include -#include #include #include -#include "properties.hxx" -#include "tokens.hxx" +#include +#include #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" @@ -49,36 +48,29 @@ #include "oox/ole/vbahelper.hxx" #include "oox/ole/vbainputstream.hxx" #include "oox/ole/vbamodule.hxx" - -using ::rtl::OUString; -using ::rtl::OUStringBuffer; -using ::com::sun::star::container::XNameAccess; -using ::com::sun::star::container::XNameContainer; -using ::com::sun::star::document::XEventsSupplier; -using ::com::sun::star::document::XStorageBasedDocument; -using ::com::sun::star::embed::XStorage; -using ::com::sun::star::embed::XTransactedObject; -using ::com::sun::star::frame::XModel; -using ::com::sun::star::io::XStream; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::script::XLibraryContainer; -using ::com::sun::star::script::XVBACompat; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; -using ::com::sun::star::uno::XInterface; -using ::comphelper::ConfigurationHelper; - -namespace ApiModuleType = ::com::sun::star::script::ModuleType; +#include "properties.hxx" +#include "tokens.hxx" namespace oox { namespace ole { // ============================================================================ +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::document; +using namespace ::com::sun::star::embed; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::script; +using namespace ::com::sun::star::uno; + +using ::comphelper::ConfigurationHelper; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +// ============================================================================ + namespace { bool lclReadConfigItem( const Reference< XInterface >& rxConfigAccess, const OUString& rItemName ) @@ -248,6 +240,18 @@ bool VbaProject::attachMacroToDocumentEvent( return attachMacroToEvent( xEventsSupp, rEventName, rModuleName, rMacroName, rProxyArgs, rProxyType, rProxyCode ); } +// protected ------------------------------------------------------------------ + +void VbaProject::addDummyModule( const OUString& rName, sal_Int32 nType ) +{ + OSL_ENSURE( rName.getLength() > 0, "VbaProject::addDummyModule - missing module name" ); + maDummyModules[ rName ] = nType; +} + +void VbaProject::prepareModuleImport() +{ +} + // private -------------------------------------------------------------------- Reference< XLibraryContainer > VbaProject::getLibraryContainer( sal_Int32 nPropId ) @@ -306,6 +310,9 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap if( aDirStrm.isEof() ) return; + // virtual call, derived classes may do some preparations + prepareModuleImport(); + // read all records of the directory rtl_TextEncoding eTextEnc = RTL_TEXTENCODING_MS_1252; sal_uInt16 nModuleCount = 0; @@ -394,23 +401,23 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap bExitLoop = (nLineLen >= 2) && (aLine[ 0 ] == '[') && (aLine[ nLineLen - 1 ] == ']'); if( !bExitLoop && VbaHelper::extractKeyValue( aKey, aValue, aLine ) ) { - sal_Int32 nType = ApiModuleType::UNKNOWN; + sal_Int32 nType = ModuleType::UNKNOWN; if( aKey.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "Document" ) ) ) { - nType = ApiModuleType::DOCUMENT; + nType = ModuleType::DOCUMENT; // strip automation server version from module names sal_Int32 nSlashPos = aValue.indexOf( '/' ); if( nSlashPos >= 0 ) aValue = aValue.copy( 0, nSlashPos ); } else if( aKey.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "Module" ) ) ) - nType = ApiModuleType::NORMAL; + nType = ModuleType::NORMAL; else if( aKey.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "Class" ) ) ) - nType = ApiModuleType::CLASS; + nType = ModuleType::CLASS; else if( aKey.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "BaseClass" ) ) ) - nType = ApiModuleType::FORM; + nType = ModuleType::FORM; - if( (nType != ApiModuleType::UNKNOWN) && (aValue.getLength() > 0) ) + if( (nType != ModuleType::UNKNOWN) && (aValue.getLength() > 0) ) { OSL_ENSURE( aModules.has( aValue ), "VbaProject::importVba - module not found" ); if( VbaModule* pModule = aModules.get( aValue ).get() ) @@ -420,11 +427,21 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap } } + // create empty dummy modules + VbaModuleMap aDummyModules; + for( DummyModuleMap::iterator aIt = maDummyModules.begin(), aEnd = maDummyModules.end(); aIt != aEnd; ++aIt ) + { + OSL_ENSURE( !aModules.has( aIt->first ) && !!aDummyModules.has( aIt->first ), "VbaProject::importVba - multiple modules with the same name" ); + VbaModuleMap::mapped_type& rxModule = aDummyModules[ aIt->first ]; + rxModule.reset( new VbaModule( mxDocModel, aIt->first, eTextEnc, bExecutable ) ); + rxModule->setType( aIt->second ); + } + /* Now it is time to load the source code. All modules will be inserted into the Basic library of the document specified by the 'maLibName' member. Do not create the Basic library, if there are no modules specified. */ - if( !aModules.empty() ) try + if( !aModules.empty() && !aDummyModules.empty() ) try { // get the basic library Reference< XNameContainer > xBasicLib( createBasicLibrary(), UNO_SET_THROW ); @@ -432,7 +449,8 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap // set library container to VBA compatibility mode try { - Reference< XVBACompat >( getLibraryContainer( PROP_BasicLibraries ), UNO_QUERY_THROW )->setVBACompatModeOn( sal_True ); + Reference< XVBACompat > xVBACompat( getLibraryContainer( PROP_BasicLibraries ), UNO_QUERY_THROW ); + xVBACompat->setVBACompatModeOn( sal_True ); } catch( Exception& ) { @@ -450,10 +468,17 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap // not all documents support this } - // call Basic source code import for each module, boost::[c]ref enforces pass-by-ref if( xBasicLib.is() ) - aModules.forEachMem( &VbaModule::importSourceCode, - ::boost::ref( *xVbaStrg ), ::boost::cref( xBasicLib ), ::boost::cref( xDocObjectNA ) ); + { + // call Basic source code import for each module, boost::[c]ref enforces pass-by-ref + aModules.forEachMem( &VbaModule::createAndImportModule, + ::boost::ref( *xVbaStrg ), ::boost::cref( xBasicLib ), + ::boost::cref( xDocObjectNA ) ); + + // create empty dummy modules + aDummyModules.forEachMem( &VbaModule::createEmptyModule, + ::boost::cref( xBasicLib ), ::boost::cref( xDocObjectNA ) ); + } } catch( Exception& ) { @@ -475,7 +500,7 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap { // resolve module name from storage name (which equals the module stream name) VbaModule* pModule = aModulesByStrm.get( *aIt ).get(); - OSL_ENSURE( pModule && (pModule->getType() == ApiModuleType::FORM), + OSL_ENSURE( pModule && (pModule->getType() == ModuleType::FORM), "VbaProject::importVba - form substorage without form module" ); OUString aModuleName; if( pModule ) diff --git a/oox/source/xls/excelvbaproject.cxx b/oox/source/xls/excelvbaproject.cxx index fc3caf7e59aa..859dd8c733ba 100755 --- a/oox/source/xls/excelvbaproject.cxx +++ b/oox/source/xls/excelvbaproject.cxx @@ -26,33 +26,36 @@ ************************************************************************/ #include "oox/xls/excelvbaproject.hxx" + +#include +#include #include #include #include #include #include -#include "properties.hxx" +#include #include "oox/helper/helper.hxx" #include "oox/helper/propertyset.hxx" - -using ::rtl::OUString; -using ::com::sun::star::container::XEnumeration; -using ::com::sun::star::container::XEnumerationAccess; -using ::com::sun::star::document::XEventsSupplier; -using ::com::sun::star::frame::XModel; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::sheet::XSpreadsheetDocument; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; +#include "properties.hxx" namespace oox { namespace xls { // ============================================================================ +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::document; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::sheet; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +// ============================================================================ + VbaProject::VbaProject( const Reference< XMultiServiceFactory >& rxGlobalFactory, const Reference< XSpreadsheetDocument >& rxDocument ) : ::oox::ole::VbaProject( rxGlobalFactory, Reference< XModel >( rxDocument, UNO_QUERY ), CREATE_OUSTRING( "Calc" ) ), mxDocument( rxDocument ) @@ -94,6 +97,78 @@ void VbaProject::attachToEvents() } } +// protected ------------------------------------------------------------------ + +namespace { + +typedef ::std::set< OUString > CodeNameSet; +typedef ::std::list< PropertySet > SheetPropertySetList; + +void lclGenerateMissingCodeNames( CodeNameSet& rUsedCodeNames, SheetPropertySetList& rSheetsWithout, const OUString& rCodeNamePrefix ) +{ + sal_Int32 nCounter = 1; + for( SheetPropertySetList::iterator aIt = rSheetsWithout.begin(), aEnd = rSheetsWithout.end(); aIt != aEnd; ++aIt ) + { + // search for an unused codename + OUString aCodeName; + do + { + aCodeName = OUStringBuffer( rCodeNamePrefix ).append( nCounter++ ).makeStringAndClear(); + } + while( rUsedCodeNames.count( aCodeName ) > 0 ); + rUsedCodeNames.insert( aCodeName ); + + // set codename at sheet + aIt->setProperty( PROP_CodeName, aCodeName ); + } +} + +} // namespace + +void VbaProject::prepareModuleImport() +{ + /* Check if the sheets have imported codenames. Generate new unused + codenames if not. */ + if( mxDocument.is() ) try + { + // collect existing codenames (do not use them when creating new codenames) + CodeNameSet aUsedCodeNames; + + // collect common sheets and chart sheets without codenames + SheetPropertySetList aSheetsWithout, aChartsWithout; + + // iterate over all imported sheets + Reference< XEnumerationAccess > xSheetsEA( mxDocument->getSheets(), UNO_QUERY_THROW ); + Reference< XEnumeration > xSheetsEnum( xSheetsEA->createEnumeration(), UNO_SET_THROW ); + // own try/catch for every sheet + while( xSheetsEnum->hasMoreElements() ) try + { + PropertySet aSheetProp( xSheetsEnum->nextElement() ); + OUString aCodeName; + aSheetProp.getProperty( aCodeName, PROP_CodeName ); + if( aCodeName.getLength() > 0 ) + { + aUsedCodeNames.insert( aCodeName ); + } + else + { + // TODO: once we have chart sheets we need a switch/case on sheet type ('SheetNNN' vs. 'ChartNNN') + aSheetsWithout.push_back( aSheetProp ); + } + } + catch( Exception& ) + { + } + + // create new codenames if sheets do not have one + lclGenerateMissingCodeNames( aUsedCodeNames, aSheetsWithout, CREATE_OUSTRING( "Sheet" ) ); + lclGenerateMissingCodeNames( aUsedCodeNames, aChartsWithout, CREATE_OUSTRING( "Chart" ) ); + } + catch( Exception& ) + { + } +} + // private -------------------------------------------------------------------- void VbaProject::attachToDocumentEvents( const OUString& rCodeName ) -- cgit From 4d9f54e9f020c91c7fda048bcf3f7549d58bc2b4 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 11 Aug 2010 14:24:53 +0200 Subject: dr77: move code that binds controls to sheet source, ported from cws container_controls --- oox/inc/oox/ole/axcontrol.hxx | 16 +++- oox/inc/oox/ole/vbacontrol.hxx | 15 ++- oox/inc/oox/xls/drawingfragment.hxx | 4 + oox/source/ole/axcontrol.cxx | 182 +++++++++++++++++++++++++++++++----- oox/source/ole/vbacontrol.cxx | 53 ++++++----- oox/source/ole/vbaproject.cxx | 2 +- oox/source/token/properties.txt | 3 + oox/source/vml/vmldrawing.cxx | 2 +- oox/source/xls/drawingfragment.cxx | 110 ++++------------------ 9 files changed, 243 insertions(+), 144 deletions(-) diff --git a/oox/inc/oox/ole/axcontrol.hxx b/oox/inc/oox/ole/axcontrol.hxx index 8df45ece6065..8638a4869d72 100644 --- a/oox/inc/oox/ole/axcontrol.hxx +++ b/oox/inc/oox/ole/axcontrol.hxx @@ -30,6 +30,7 @@ #include #include "oox/helper/binarystreambase.hxx" +#include "oox/helper/propertyset.hxx" #include "oox/ole/axbinaryreader.hxx" #include "oox/ole/olehelper.hxx" @@ -37,6 +38,7 @@ namespace com { namespace sun { namespace star { namespace awt { class XControlModel; } namespace container { class XIndexContainer; } namespace drawing { class XDrawPage; } + namespace frame { class XModel; } namespace form { class XFormsSupplier; } namespace lang { class XMultiServiceFactory; } } } } @@ -147,6 +149,7 @@ class ControlConverter { public: explicit ControlConverter( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr = true ); virtual ~ControlConverter(); @@ -185,6 +188,14 @@ public: sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nPosition, sal_Int32 nSmallChange, sal_Int32 nLargeChange, bool bAwtModel ) const; + /** Binds the passed control model to the passed data sources. The + implementation will check which source types are supported. */ + void bindToSources( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel, + const ::rtl::OUString& rCtrlSource, + const ::rtl::OUString& rRowSource, + sal_Int32 nRefSheet = 0 ) const; + // ActiveX (Forms 2.0) specific conversion -------------------------------- /** Converts the Forms 2.0 background formatting to UNO properties. */ @@ -238,7 +249,10 @@ public: sal_Int32 nOrientation ) const; private: + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxDocModel; const GraphicHelper& mrGraphicHelper; + mutable PropertySet maAddressConverter; + mutable PropertySet maRangeConverter; bool mbDefaultColorBgr; }; @@ -804,7 +818,7 @@ class EmbeddedForm : public ControlConverter { public: explicit EmbeddedForm( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr = true ); diff --git a/oox/inc/oox/ole/vbacontrol.hxx b/oox/inc/oox/ole/vbacontrol.hxx index c2490b3506bf..8d0b5e825eb9 100755 --- a/oox/inc/oox/ole/vbacontrol.hxx +++ b/oox/inc/oox/ole/vbacontrol.hxx @@ -82,12 +82,18 @@ public: ApiControlType eCtrlType, sal_Int32 nCtrlIndex ) const; + /** Binds the passed control model to the data sources. The implementation + will check which source types are supported. */ + void bindToSources( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel, + const ControlConverter& rConv ) const; + protected: ::rtl::OUString maName; /// Name of the control. ::rtl::OUString maTag; /// User defined tag. ::rtl::OUString maToolTip; /// Tool tip for the control. - ::rtl::OUString maLinkedCell; /// Linked cell for the control value in a spreadsheet. - ::rtl::OUString maSourceRange; /// Source data for the control in a spreadsheet. + ::rtl::OUString maControlSource; /// Linked cell for the control value in a spreadsheet. + ::rtl::OUString maRowSource; /// Source data for the control in a spreadsheet. AxPairData maPos; /// Position in parent container. sal_Int32 mnId; /// Control identifier. sal_Int32 mnHelpContextId; /// Help context identifier. @@ -181,11 +187,12 @@ private: // ============================================================================ -class VbaUserForm : public VbaFormControl, public ControlConverter +class VbaUserForm : public VbaFormControl { public: explicit VbaUserForm( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr = true ); @@ -199,6 +206,8 @@ public: private: ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxGlobalFactory; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxDocModel; + ControlConverter maConverter; }; // ============================================================================ diff --git a/oox/inc/oox/xls/drawingfragment.hxx b/oox/inc/oox/xls/drawingfragment.hxx index 66d716220b8a..95973e55c655 100644 --- a/oox/inc/oox/xls/drawingfragment.hxx +++ b/oox/inc/oox/xls/drawingfragment.hxx @@ -31,6 +31,7 @@ #include #include #include "oox/drawingml/shape.hxx" +#include "oox/ole/axcontrol.hxx" #include "oox/vml/vmldrawing.hxx" #include "oox/vml/vmldrawingfragment.hxx" #include "oox/xls/excelhandlers.hxx" @@ -182,6 +183,9 @@ public: virtual void notifyShapeInserted( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape, const ::com::sun::star::awt::Rectangle& rShapeRect ); + +private: + ::oox::ole::ControlConverter maControlConv; }; // ============================================================================ diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index 82616026a505..73da2edea7d1 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -26,7 +26,7 @@ ************************************************************************/ #include "oox/ole/axcontrol.hxx" -#include + #include #include #include @@ -39,42 +39,50 @@ #include #include #include +#include #include #include #include #include +#include +#include +#include +#include #include +#include +#include #include -#include "properties.hxx" -#include "tokens.hxx" +#include +#include +#include #include "oox/helper/attributelist.hxx" #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/helper/propertyset.hxx" - -using ::rtl::OUString; -using ::com::sun::star::awt::Point; -using ::com::sun::star::awt::Size; -using ::com::sun::star::awt::XControlModel; -using ::com::sun::star::container::XIndexContainer; -using ::com::sun::star::container::XNameContainer; -using ::com::sun::star::drawing::XDrawPage; -using ::com::sun::star::form::XForm; -using ::com::sun::star::form::XFormComponent; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; +#include "properties.hxx" +#include "tokens.hxx" namespace oox { namespace ole { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::form::binding; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::sheet; +using namespace ::com::sun::star::table; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + namespace { const sal_uInt32 COMCTL_ID_SIZE = 0x12344321; @@ -220,14 +228,70 @@ const sal_Int16 API_STATE_UNCHECKED = 0; const sal_Int16 API_STATE_CHECKED = 1; const sal_Int16 API_STATE_DONTKNOW = 2; +// ---------------------------------------------------------------------------- + +/** Tries to extract a range address from a defined name. */ +bool lclExtractRangeFromName( CellRangeAddress& orRangeAddr, const Reference< XModel >& rxDocModel, const OUString& rAddressString ) +{ + try + { + PropertySet aPropSet( rxDocModel ); + Reference< XNameAccess > xRangesNA( aPropSet.getAnyProperty( PROP_NamedRanges ), UNO_QUERY_THROW ); + Reference< XCellRangeReferrer > xReferrer( xRangesNA->getByName( rAddressString ), UNO_QUERY_THROW ); + Reference< XCellRangeAddressable > xAddressable( xReferrer->getReferredCells(), UNO_QUERY_THROW ); + orRangeAddr = xAddressable->getRangeAddress(); + return true; + } + catch( Exception& ) + { + } + return false; +} + +bool lclExtractAddressFromName( CellAddress& orAddress, const Reference< XModel >& rxDocModel, const OUString& rAddressString ) +{ + CellRangeAddress aRangeAddr; + if( lclExtractRangeFromName( aRangeAddr, rxDocModel, rAddressString ) && + (aRangeAddr.StartColumn == aRangeAddr.EndColumn) && + (aRangeAddr.StartRow == aRangeAddr.EndRow) ) + { + orAddress.Sheet = aRangeAddr.Sheet; + orAddress.Column = aRangeAddr.StartColumn; + orAddress.Row = aRangeAddr.StartRow; + return true; + } + return false; +} + +void lclPrepareConverter( PropertySet& rConverter, const Reference< XModel >& rxDocModel, + const OUString& rAddressString, sal_Int32 nRefSheet, bool bRange ) +{ + if( !rConverter.is() ) try + { + Reference< XMultiServiceFactory > xFactory( rxDocModel, UNO_QUERY_THROW ); + OUString aServiceName = bRange ? + CREATE_OUSTRING( "com.sun.star.table.CellRangeAddressConversion" ) : + CREATE_OUSTRING( "com.sun.star.table.CellAddressConversion" ); + rConverter.set( xFactory->createInstance( aServiceName ) ); + } + catch( Exception& ) + { + } + rConverter.setProperty( PROP_XLA1Representation, rAddressString ); + rConverter.setProperty( PROP_ReferenceSheet, nRefSheet ); +} + } // namespace // ============================================================================ -ControlConverter::ControlConverter( const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) : +ControlConverter::ControlConverter( const Reference< XModel >& rxDocModel, + const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) : + mxDocModel( rxDocModel ), mrGraphicHelper( rGraphicHelper ), mbDefaultColorBgr( bDefaultColorBgr ) { + OSL_ENSURE( mxDocModel.is(), "ControlConverter::ControlConverter - missing document model" ); } ControlConverter::~ControlConverter() @@ -285,6 +349,74 @@ void ControlConverter::convertScrollBar( PropertyMap& rPropMap, rPropMap.setProperty( bAwtModel ? PROP_ScrollValue : PROP_DefaultScrollValue, nPosition ); } +void ControlConverter::bindToSources( const Reference< XControlModel >& rxCtrlModel, + const OUString& rCtrlSource, const OUString& rRowSource, sal_Int32 nRefSheet ) const +{ + // value binding + if( rCtrlSource.getLength() > 0 ) try + { + // first check if the XBindableValue interface is supported + Reference< XBindableValue > xBindable( rxCtrlModel, UNO_QUERY_THROW ); + + // convert address string to cell address struct + CellAddress aAddress; + if( !lclExtractAddressFromName( aAddress, mxDocModel, rCtrlSource ) ) + { + lclPrepareConverter( maAddressConverter, mxDocModel, rCtrlSource, nRefSheet, false ); + if( !maAddressConverter.getProperty( aAddress, PROP_Address ) ) + throw RuntimeException(); + } + + // create argument sequence + NamedValue aValue; + aValue.Name = CREATE_OUSTRING( "BoundCell" ); + aValue.Value <<= aAddress; + Sequence< Any > aArgs( 1 ); + aArgs[ 0 ] <<= aValue; + + // create the CellValueBinding instance and set at the control model + Reference< XMultiServiceFactory > xFactory( mxDocModel, UNO_QUERY_THROW ); + Reference< XValueBinding > xBinding( xFactory->createInstanceWithArguments( + CREATE_OUSTRING( "com.sun.star.table.CellValueBinding" ), aArgs ), UNO_QUERY_THROW ); + xBindable->setValueBinding( xBinding ); + } + catch( Exception& ) + { + } + + // list entry source + if( rRowSource.getLength() > 0 ) try + { + // first check if the XListEntrySink interface is supported + Reference< XListEntrySink > xEntrySink( rxCtrlModel, UNO_QUERY_THROW ); + + // convert address string to cell range address struct + CellRangeAddress aRangeAddr; + if( !lclExtractRangeFromName( aRangeAddr, mxDocModel, rRowSource ) ) + { + lclPrepareConverter( maRangeConverter, mxDocModel, rRowSource, nRefSheet, true ); + if( !maRangeConverter.getProperty( aRangeAddr, PROP_Address ) ) + throw RuntimeException(); + } + + // create argument sequence + NamedValue aValue; + aValue.Name = CREATE_OUSTRING( "CellRange" ); + aValue.Value <<= aRangeAddr; + Sequence< Any > aArgs( 1 ); + aArgs[ 0 ] <<= aValue; + + // create the EntrySource instance and set at the control model + Reference< XMultiServiceFactory > xFactory( mxDocModel, UNO_QUERY_THROW ); + Reference< XListEntrySource > xEntrySource( xFactory->createInstanceWithArguments( + CREATE_OUSTRING( "com.sun.star.table.CellRangeListSource" ), aArgs ), UNO_QUERY_THROW ); + xEntrySink->setListEntrySource( xEntrySource ); + } + catch( Exception& ) + { + } +} + // ActiveX (Forms 2.0) specific conversion ------------------------------------ void ControlConverter::convertAxBackground( PropertyMap& rPropMap, @@ -1683,10 +1815,10 @@ bool EmbeddedControl::convertProperties( const Reference< XControlModel >& rxCtr // ============================================================================ -EmbeddedForm::EmbeddedForm( const Reference< XMultiServiceFactory >& rxModelFactory, +EmbeddedForm::EmbeddedForm( const Reference< XModel >& rxDocModel, const Reference< XDrawPage >& rxDrawPage, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) : - ControlConverter( rGraphicHelper, bDefaultColorBgr ), - mxModelFactory( rxModelFactory ), + ControlConverter( rxDocModel, rGraphicHelper, bDefaultColorBgr ), + mxModelFactory( rxDocModel, UNO_QUERY ), mxFormsSupp( rxDrawPage, UNO_QUERY ) { OSL_ENSURE( mxModelFactory.is(), "EmbeddedForm::EmbeddedForm - missing service factory" ); diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx index 6ea28f424a83..206bff087e00 100755 --- a/oox/source/ole/vbacontrol.cxx +++ b/oox/source/ole/vbacontrol.cxx @@ -26,17 +26,16 @@ ************************************************************************/ #include "oox/ole/vbacontrol.hxx" + #include #include -#include #include #include #include #include #include +#include #include -#include "properties.hxx" -#include "tokens.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/propertymap.hxx" @@ -44,25 +43,26 @@ #include "oox/helper/storagebase.hxx" #include "oox/helper/textinputstream.hxx" #include "oox/ole/vbahelper.hxx" - -using ::rtl::OUString; -using ::rtl::OUStringBuffer; -using ::com::sun::star::awt::XControlModel; -using ::com::sun::star::container::XNameContainer; -using ::com::sun::star::io::XInputStreamProvider; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; -using ::com::sun::star::uno::XComponentContext; +#include "properties.hxx" +#include "tokens.hxx" namespace oox { namespace ole { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +// ============================================================================ + namespace { const sal_uInt16 VBA_SITE_CLASSIDINDEX = 0x8000; @@ -220,8 +220,8 @@ bool VbaSiteModel::importBinaryModel( BinaryInputStream& rInStrm ) aReader.skipUndefinedProperty(); aReader.readStringProperty( maToolTip ); aReader.skipStringProperty(); // license key - aReader.readStringProperty( maLinkedCell ); - aReader.readStringProperty( maSourceRange ); + aReader.readStringProperty( maControlSource ); + aReader.readStringProperty( maRowSource ); return aReader.finalizeImport(); } @@ -337,6 +337,11 @@ void VbaSiteModel::convertProperties( PropertyMap& rPropMap, } } +void VbaSiteModel::bindToSources( const Reference< XControlModel >& rxCtrlModel, const ControlConverter& rConv ) const +{ + rConv.bindToSources( rxCtrlModel, maControlSource, maRowSource ); +} + // ============================================================================ VbaFormControl::VbaFormControl() @@ -727,18 +732,20 @@ OUString lclGetQuotedString( const OUString& rCodeLine ) // ---------------------------------------------------------------------------- VbaUserForm::VbaUserForm( const Reference< XMultiServiceFactory >& rxGlobalFactory, - const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) : - ControlConverter( rGraphicHelper, bDefaultColorBgr ), - mxGlobalFactory( rxGlobalFactory ) + const Reference< XModel >& rxDocModel, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) : + mxGlobalFactory( rxGlobalFactory ), + mxDocModel( rxDocModel ), + maConverter( rxDocModel, rGraphicHelper, bDefaultColorBgr ) { OSL_ENSURE( mxGlobalFactory.is(), "VbaUserForm::VbaUserForm - missing service factory" ); + OSL_ENSURE( mxDocModel.is(), "VbaUserForm::VbaUserForm - missing document model" ); } void VbaUserForm::importForm( const Reference< XNameContainer >& rxDialogLib, StorageBase& rVbaFormStrg, const OUString& rModuleName, rtl_TextEncoding eTextEnc ) { OSL_ENSURE( rxDialogLib.is(), "VbaUserForm::importForm - missing dialog library" ); - if( !mxGlobalFactory.is() || !rxDialogLib.is() ) + if( !mxGlobalFactory.is() || !mxDocModel.is() || !rxDialogLib.is() ) return; // check that the '03VBFrame' stream exists, this is required for forms @@ -800,7 +807,7 @@ void VbaUserForm::importForm( const Reference< XNameContainer >& rxDialogLib, Reference< XNameContainer > xDialogNC( xDialogModel, UNO_QUERY_THROW ); // convert properties and embedded controls - if( convertProperties( xDialogModel, *this, 0 ) ) + if( convertProperties( xDialogModel, maConverter, 0 ) ) { // export the dialog to XML and insert it into the dialog library PropertySet aFactoryProps( mxGlobalFactory ); diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index 9edcb61538ca..fbc5306763a6 100755 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -508,7 +508,7 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap // create and import the form Reference< XNameContainer > xDialogLib( createDialogLibrary(), UNO_SET_THROW ); - VbaUserForm aForm( mxGlobalFactory, rGraphicHelper, bDefaultColorBgr ); + VbaUserForm aForm( mxGlobalFactory, mxDocModel, rGraphicHelper, bDefaultColorBgr ); aForm.importForm( xDialogLib, *xSubStrg, aModuleName, eTextEnc ); } catch( Exception& ) diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index da1aeb2ed265..243351cff050 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -2,6 +2,7 @@ AbsoluteName Action ActiveSplitRange ActiveTable +Address Adjust AdjustContrast AdjustLuminance @@ -330,6 +331,7 @@ RefX RefY Reference ReferenceDevice +ReferenceSheet RegularExpressions RelId RelativeHorizontalTabbarWidth @@ -457,5 +459,6 @@ Weight WhiteDay Width WritingMode +XLA1Representation ZoomType ZoomValue diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index 358803b63a13..56afb8cf76e9 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -102,7 +102,7 @@ Drawing::~Drawing() { if( !mxCtrlForm.get() ) mxCtrlForm.reset( new ::oox::ole::EmbeddedForm( - mrFilter.getModelFactory(), mxDrawPage, mrFilter.getGraphicHelper() ) ); + mrFilter.getModel(), mxDrawPage, mrFilter.getGraphicHelper() ) ); return *mxCtrlForm; } diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx index 172530692923..7b52b986750a 100644 --- a/oox/source/xls/drawingfragment.cxx +++ b/oox/source/xls/drawingfragment.cxx @@ -26,45 +26,32 @@ ************************************************************************/ #include "oox/xls/drawingfragment.hxx" + #include -#include -#include -#include -#include -#include -#include "properties.hxx" -#include "oox/helper/attributelist.hxx" -#include "oox/helper/propertyset.hxx" #include "oox/drawingml/connectorshapecontext.hxx" #include "oox/drawingml/graphicshapecontext.hxx" #include "oox/drawingml/shapecontext.hxx" #include "oox/drawingml/shapegroupcontext.hxx" +#include "oox/helper/attributelist.hxx" +#include "oox/helper/propertyset.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" #include "oox/xls/formulaparser.hxx" #include "oox/xls/stylesbuffer.hxx" #include "oox/xls/themebuffer.hxx" #include "oox/xls/unitconverter.hxx" +#include "properties.hxx" + +namespace oox { +namespace xls { + +// ============================================================================ + +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::table; +using namespace ::com::sun::star::uno; -using ::rtl::OUString; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::beans::NamedValue; -using ::com::sun::star::awt::Point; -using ::com::sun::star::awt::Rectangle; -using ::com::sun::star::awt::Size; -using ::com::sun::star::awt::XControlModel; -using ::com::sun::star::form::binding::XBindableValue; -using ::com::sun::star::form::binding::XListEntrySink; -using ::com::sun::star::form::binding::XListEntrySource; -using ::com::sun::star::form::binding::XValueBinding; -using ::com::sun::star::drawing::XShape; -using ::com::sun::star::table::CellAddress; -using ::com::sun::star::table::CellRangeAddress; using ::oox::core::ContextHandlerRef; using ::oox::drawingml::ConnectorShapeContext; using ::oox::drawingml::GraphicalObjectFrameContext; @@ -73,11 +60,9 @@ using ::oox::drawingml::Shape; using ::oox::drawingml::ShapePtr; using ::oox::drawingml::ShapeContext; using ::oox::drawingml::ShapeGroupContext; +using ::rtl::OUString; // no using's for ::oox::vml, that may clash with ::oox::drawingml types -namespace oox { -namespace xls { - // ============================================================================ namespace { @@ -556,7 +541,8 @@ bool VmlFindNoteFunc::operator()( const ::oox::vml::ShapeBase& rShape ) const VmlDrawing::VmlDrawing( const WorksheetHelper& rHelper ) : ::oox::vml::Drawing( rHelper.getOoxFilter(), rHelper.getDrawPage(), ::oox::vml::VMLDRAWING_EXCEL ), - WorksheetHelper( rHelper ) + WorksheetHelper( rHelper ), + maControlConv( rHelper.getBaseFilter().getModel(), rHelper.getBaseFilter().getGraphicHelper() ) { } @@ -591,65 +577,9 @@ void VmlDrawing::convertControlClientData( const Reference< XControlModel >& rxC // printable aPropSet.setProperty( PROP_Printable, rClientData.mbPrintObject ); - // linked cell - if( rClientData.maLinkedCell.getLength() > 0 ) try - { - Reference< XBindableValue > xBindable( rxCtrlModel, UNO_QUERY_THROW ); - - // convert formula string to cell address - FormulaParser& rParser = getFormulaParser(); - TokensFormulaContext aContext( true, false ); - aContext.setBaseAddress( CellAddress( getSheetIndex(), 0, 0 ) ); - rParser.importFormula( aContext, rClientData.maLinkedCell ); - CellAddress aAddress; - if( rParser.extractCellAddress( aAddress, aContext.getTokens(), true ) ) - { - // create argument sequence for createInstanceWithArguments() - NamedValue aValue; - aValue.Name = CREATE_OUSTRING( "BoundCell" ); - aValue.Value <<= aAddress; - Sequence< Any > aArgs( 1 ); - aArgs[ 0 ] <<= aValue; - - // create the CellValueBinding instance and set at the control model - Reference< XValueBinding > xBinding( getDocumentFactory()->createInstanceWithArguments( - CREATE_OUSTRING( "com.sun.star.table.CellValueBinding" ), aArgs ), UNO_QUERY_THROW ); - xBindable->setValueBinding( xBinding ); - } - } - catch( Exception& ) - { - } - - // source range - if( rClientData.maSourceRange.getLength() > 0 ) try - { - Reference< XListEntrySink > xEntrySink( rxCtrlModel, UNO_QUERY_THROW ); - - // convert formula string to cell range - FormulaParser& rParser = getFormulaParser(); - TokensFormulaContext aContext( true, false ); - aContext.setBaseAddress( CellAddress( getSheetIndex(), 0, 0 ) ); - rParser.importFormula( aContext, rClientData.maSourceRange ); - CellRangeAddress aRange; - if( rParser.extractCellRange( aRange, aContext.getTokens(), true ) ) - { - // create argument sequence for createInstanceWithArguments() - NamedValue aValue; - aValue.Name = CREATE_OUSTRING( "CellRange" ); - aValue.Value <<= aRange; - Sequence< Any > aArgs( 1 ); - aArgs[ 0 ] <<= aValue; - - // create the EntrySource instance and set at the control model - Reference< XListEntrySource > xEntrySource( getDocumentFactory()->createInstanceWithArguments( - CREATE_OUSTRING( "com.sun.star.table.CellRangeListSource" ), aArgs ), UNO_QUERY_THROW ); - xEntrySink->setListEntrySource( xEntrySource ); - } - } - catch( Exception& ) - { - } + // control sources + if( (rClientData.maLinkedCell.getLength() > 0) || (rClientData.maSourceRange.getLength() > 0) ) + maControlConv.bindToSources( rxCtrlModel, rClientData.maLinkedCell, rClientData.maSourceRange, getSheetIndex() ); } } -- cgit From 6c42cf77670557590186cea665b6f84db42f5137 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 11 Aug 2010 14:24:53 +0200 Subject: dr77: move code that binds controls to sheet source, ported from cws container_controls --- sc/inc/addruno.hxx | 2 +- sc/inc/unonames.hxx | 1 + sc/source/ui/unoobj/addruno.cxx | 27 +++++++++++++++++++-------- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/sc/inc/addruno.hxx b/sc/inc/addruno.hxx index d6df571a29aa..6e71230b21d4 100644 --- a/sc/inc/addruno.hxx +++ b/sc/inc/addruno.hxx @@ -47,7 +47,7 @@ private: sal_Int32 nRefSheet; sal_Bool bIsRange; - sal_Bool ParseUIString( const String& rUIString ); + sal_Bool ParseUIString( const String& rUIString, ::formula::FormulaGrammar::AddressConvention eConv = ::formula::FormulaGrammar::CONV_OOO ); public: diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 2d011f425398..406c30ae0736 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -609,6 +609,7 @@ #define SC_UNONAME_ADDRESS "Address" #define SC_UNONAME_UIREPR "UserInterfaceRepresentation" #define SC_UNONAME_PERSREPR "PersistentRepresentation" +#define SC_UNONAME_XLA1REPR "XLA1Representation" #define SC_UNONAME_REFSHEET "ReferenceSheet" // --> PB 2004-08-23 #i33095# Security Options diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx index 10627222be80..9b3ce8e3d4bc 100644 --- a/sc/source/ui/unoobj/addruno.cxx +++ b/sc/source/ui/unoobj/addruno.cxx @@ -69,7 +69,7 @@ void ScAddressConversionObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) } } -sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString ) +sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString, ::formula::FormulaGrammar::AddressConvention eConv ) { if (!pDocShell) return sal_False; @@ -78,7 +78,7 @@ sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString ) sal_Bool bSuccess = sal_False; if ( bIsRange ) { - USHORT nResult = aRange.ParseAny( rUIString, pDoc ); + USHORT nResult = aRange.ParseAny( rUIString, pDoc, eConv ); if ( nResult & SCA_VALID ) { if ( ( nResult & SCA_TAB_3D ) == 0 ) @@ -92,7 +92,7 @@ sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString ) } else { - USHORT nResult = aRange.aStart.Parse( rUIString, pDoc ); + USHORT nResult = aRange.aStart.Parse( rUIString, pDoc, eConv ); if ( nResult & SCA_VALID ) { if ( ( nResult & SCA_TAB_3D ) == 0 ) @@ -118,6 +118,7 @@ uno::Reference SAL_CALL ScAddressConversionObj::getProp {MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNONAME_XLA1REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, {0,0,0,0,0,0} }; static uno::Reference aRef(new SfxItemPropertySetInfo( aPropertyMap )); @@ -131,6 +132,7 @@ uno::Reference SAL_CALL ScAddressConversionObj::getProp {MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNONAME_XLA1REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, {0,0,0,0,0,0} }; static uno::Reference aRef(new SfxItemPropertySetInfo( aPropertyMap )); @@ -190,8 +192,11 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr bSuccess = ParseUIString( aUIString ); } } - else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) ) + else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ) { + ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ? + ::formula::FormulaGrammar::CONV_OOO : ::formula::FormulaGrammar::CONV_XL_A1; + // parse the file format string rtl::OUString sRepresentation; if (aValue >>= sRepresentation) @@ -212,7 +217,7 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr } // parse the rest like a UI string - bSuccess = ParseUIString( aUIString ); + bSuccess = ParseUIString( aUIString, eConv ); } } else @@ -265,17 +270,23 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const rtl::OUString& aRange.aStart.Format( aFormatStr, nFlags, pDoc ); aRet <<= rtl::OUString( aFormatStr ); } - else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) ) + else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ) { + ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ? + ::formula::FormulaGrammar::CONV_OOO : ::formula::FormulaGrammar::CONV_XL_A1; + // generate file format string - always include sheet String aFormatStr; - aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc ); + aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc, eConv ); if ( bIsRange ) { // manually concatenate range so both parts always have the sheet name aFormatStr.Append( (sal_Unicode) ':' ); String aSecond; - aRange.aEnd.Format( aSecond, SCA_VALID | SCA_TAB_3D, pDoc ); + USHORT nFlags = SCA_VALID; + if( eConv != ::formula::FormulaGrammar::CONV_XL_A1 ) + nFlags |= SCA_TAB_3D; + aRange.aEnd.Format( aSecond, nFlags, pDoc, eConv ); aFormatStr.Append( aSecond ); } aRet <<= rtl::OUString( aFormatStr ); -- cgit From 04c272eb8396e58376d2b61baee01c4a95f993b4 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 26 Aug 2010 18:37:44 +0200 Subject: dr77: #i114128# import legacy drawing controls --- filter/inc/filter/msfilter/msvbahelper.hxx | 94 +++- filter/source/msfilter/makefile.mk | 13 +- filter/source/msfilter/msvbahelper.cxx | 336 ++++++++---- filter/source/msfilter/services.cxx | 176 +++++++ oox/inc/oox/core/binarycodec.hxx | 1 - oox/inc/oox/core/binaryfilterbase.hxx | 1 - oox/inc/oox/core/contexthandler.hxx | 5 +- oox/inc/oox/core/contexthandler2.hxx | 121 +++-- oox/inc/oox/core/fasttokenhandler.hxx | 1 - oox/inc/oox/core/filterbase.hxx | 24 +- oox/inc/oox/core/filterdetect.hxx | 1 - oox/inc/oox/core/fragmenthandler.hxx | 1 - oox/inc/oox/core/fragmenthandler2.hxx | 6 +- oox/inc/oox/core/recordparser.hxx | 2 - oox/inc/oox/core/relations.hxx | 3 +- oox/inc/oox/core/relationshandler.hxx | 1 - oox/inc/oox/core/xmlfilterbase.hxx | 21 +- .../oox/drawingml/chart/chartdrawingfragment.hxx | 3 +- oox/inc/oox/drawingml/chart/datasourcecontext.hxx | 4 +- oox/inc/oox/drawingml/chart/seriescontext.hxx | 6 +- oox/inc/oox/drawingml/chart/titlecontext.hxx | 2 +- oox/inc/oox/drawingml/graphicshapecontext.hxx | 4 +- oox/inc/oox/drawingml/shape.hxx | 79 +-- oox/inc/oox/helper/attributelist.hxx | 3 + oox/inc/oox/ole/axbinaryreader.hxx | 3 + oox/inc/oox/ole/axcontrol.hxx | 139 ++++- oox/inc/oox/ole/olehelper.hxx | 4 + oox/inc/oox/ole/vbahelper.hxx | 1 + oox/inc/oox/ole/vbaproject.hxx | 63 ++- oox/inc/oox/ppt/pptimport.hxx | 1 + oox/inc/oox/ppt/pptshape.hxx | 2 +- oox/inc/oox/ppt/slidepersist.hxx | 2 +- oox/inc/oox/vml/vmldrawing.hxx | 70 ++- oox/inc/oox/vml/vmlformatting.hxx | 30 ++ oox/inc/oox/vml/vmlshape.hxx | 68 ++- oox/inc/oox/vml/vmlshapecontainer.hxx | 3 + oox/inc/oox/vml/vmlshapecontext.hxx | 50 +- oox/inc/oox/vml/vmltextbox.hxx | 95 ++++ oox/inc/oox/vml/vmltextboxcontext.hxx | 82 +++ oox/inc/oox/xls/autofiltercontext.hxx | 2 +- oox/inc/oox/xls/chartsheetfragment.hxx | 2 +- oox/inc/oox/xls/commentsfragment.hxx | 3 +- oox/inc/oox/xls/condformatcontext.hxx | 2 +- oox/inc/oox/xls/defnamesbuffer.hxx | 3 +- oox/inc/oox/xls/drawingfragment.hxx | 136 ++++- oox/inc/oox/xls/excelfilter.hxx | 3 +- oox/inc/oox/xls/excelvbaproject.hxx | 8 +- oox/inc/oox/xls/externallinkbuffer.hxx | 7 +- oox/inc/oox/xls/externallinkfragment.hxx | 5 +- oox/inc/oox/xls/formulaparser.hxx | 4 +- oox/inc/oox/xls/richstringcontext.hxx | 2 +- oox/inc/oox/xls/sheetdatacontext.hxx | 3 +- oox/inc/oox/xls/workbookfragment.hxx | 2 +- oox/inc/oox/xls/worksheetfragment.hxx | 5 +- oox/source/core/binarycodec.cxx | 2 +- oox/source/core/binaryfilterbase.cxx | 16 +- oox/source/core/contexthandler.cxx | 17 +- oox/source/core/contexthandler2.cxx | 108 ++-- oox/source/core/facreg.cxx | 4 +- oox/source/core/fasttokenhandler.cxx | 16 +- oox/source/core/filterbase.cxx | 57 +- oox/source/core/filterdetect.cxx | 47 +- oox/source/core/fragmenthandler.cxx | 19 +- oox/source/core/fragmenthandler2.cxx | 30 +- oox/source/core/recordparser.cxx | 22 +- oox/source/core/relations.cxx | 10 +- oox/source/core/relationshandler.cxx | 17 +- oox/source/core/xmlfilterbase.cxx | 61 +-- .../drawingml/chart/chartdrawingfragment.cxx | 36 +- oox/source/drawingml/chart/datasourcecontext.cxx | 5 +- oox/source/drawingml/chart/seriescontext.cxx | 36 +- oox/source/drawingml/chart/titlecontext.cxx | 114 ++-- oox/source/drawingml/graphicshapecontext.cxx | 139 +---- oox/source/drawingml/shape.cxx | 160 ++++-- oox/source/drawingml/shapegroupcontext.cxx | 2 +- oox/source/drawingml/table/tablecontext.cxx | 3 +- oox/source/helper/attributelist.cxx | 6 + oox/source/ole/axbinaryreader.cxx | 7 +- oox/source/ole/axcontrol.cxx | 240 ++++----- oox/source/ole/axcontrolfragment.cxx | 6 +- oox/source/ole/olehelper.cxx | 13 +- oox/source/ole/vbaproject.cxx | 85 ++- oox/source/ppt/pptimport.cxx | 6 + oox/source/ppt/pptshape.cxx | 2 +- oox/source/ppt/slidepersist.cxx | 2 +- oox/source/shape/ShapeContextHandler.cxx | 2 +- oox/source/shape/ShapeFilterBase.cxx | 6 + oox/source/shape/ShapeFilterBase.hxx | 5 +- oox/source/token/properties.txt | 4 + oox/source/token/tokens.txt | 15 + oox/source/vml/makefile.mk | 16 +- oox/source/vml/vmldrawing.cxx | 123 ++++- oox/source/vml/vmldrawingfragment.cxx | 6 +- oox/source/vml/vmlformatting.cxx | 92 ++-- oox/source/vml/vmlinputstream.cxx | 49 +- oox/source/vml/vmlshape.cxx | 203 +++---- oox/source/vml/vmlshapecontext.cxx | 134 +++-- oox/source/vml/vmltextbox.cxx | 82 +++ oox/source/vml/vmltextboxcontext.cxx | 146 ++++++ oox/source/xls/autofiltercontext.cxx | 2 +- oox/source/xls/chartsheetfragment.cxx | 4 +- oox/source/xls/commentsbuffer.cxx | 5 +- oox/source/xls/commentsfragment.cxx | 29 +- oox/source/xls/condformatcontext.cxx | 10 +- oox/source/xls/drawingfragment.cxx | 583 +++++++++++++++++++-- oox/source/xls/excelfilter.cxx | 44 +- oox/source/xls/excelvbaproject.cxx | 15 +- oox/source/xls/externallinkbuffer.cxx | 52 +- oox/source/xls/externallinkfragment.cxx | 80 ++- oox/source/xls/formulaparser.cxx | 109 +++- oox/source/xls/richstringcontext.cxx | 36 +- oox/source/xls/sheetdatacontext.cxx | 61 +-- oox/source/xls/workbookfragment.cxx | 10 +- oox/source/xls/workbookhelper.cxx | 73 +-- oox/source/xls/worksheetfragment.cxx | 24 +- 115 files changed, 3520 insertions(+), 1496 deletions(-) create mode 100755 filter/source/msfilter/services.cxx create mode 100755 oox/inc/oox/vml/vmltextbox.hxx create mode 100755 oox/inc/oox/vml/vmltextboxcontext.hxx mode change 100644 => 100755 oox/source/core/filterbase.cxx create mode 100755 oox/source/vml/vmltextbox.cxx create mode 100755 oox/source/vml/vmltextboxcontext.cxx diff --git a/filter/inc/filter/msfilter/msvbahelper.hxx b/filter/inc/filter/msfilter/msvbahelper.hxx index 81607c9b296c..94ece293ee20 100644 --- a/filter/inc/filter/msfilter/msvbahelper.hxx +++ b/filter/inc/filter/msfilter/msvbahelper.hxx @@ -28,29 +28,81 @@ #define _MSVBAHELPER_HXX #include +#include +#include +#include +#include #include "filter/msfilter/msfilterdllapi.h" -namespace ooo { namespace vba +namespace ooo { +namespace vba { + +// ============================================================================ + +struct MSFILTER_DLLPUBLIC MacroResolvedInfo +{ + SfxObjectShell* mpDocContext; + String msResolvedMacro; + bool mbFound; + + inline explicit MacroResolvedInfo( SfxObjectShell* pDocContext = 0 ) : mpDocContext( pDocContext ), mbFound( false ) {} +}; + +MSFILTER_DLLPUBLIC String makeMacroURL( const String& sMacroName ); +MSFILTER_DLLPUBLIC ::rtl::OUString extractMacroName( const ::rtl::OUString& rMacroUrl ); +MSFILTER_DLLPUBLIC MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const ::rtl::OUString& rMacroName, bool bSearchGlobalTemplates = false ); +MSFILTER_DLLPUBLIC sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArgs, com::sun::star::uno::Any& aRet, const com::sun::star::uno::Any& aCaller ); + +// ============================================================================ + +typedef ::cppu::WeakImplHelper3< + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XInitialization, + ::com::sun::star::script::vba::XVBAMacroResolver > VBAMacroResolverBase; + +class VBAMacroResolver : public VBAMacroResolverBase { - class MSFILTER_DLLPUBLIC VBAMacroResolvedInfo - { - SfxObjectShell* mpDocContext; - bool mbFound; - String msResolvedMacro; - public: - VBAMacroResolvedInfo() : mpDocContext(NULL), mbFound( false ){} - void SetResolved( bool bRes ) { mbFound = bRes; } - bool IsResolved() { return mbFound; } - void SetMacroDocContext(SfxObjectShell* pShell ) { mpDocContext = pShell; } - SfxObjectShell* MacroDocContext() { return mpDocContext; } - String ResolvedMacro() { return msResolvedMacro; } - void SetResolvedMacro(const String& sMacro ) { msResolvedMacro = sMacro; } - }; - - MSFILTER_DLLPUBLIC String makeMacroURL( const String& sMacroName ); - MSFILTER_DLLPUBLIC ::rtl::OUString extractMacroName( const ::rtl::OUString& rMacroUrl ); - MSFILTER_DLLPUBLIC VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& sMod, bool bSearchGlobalTemplates = false ); - MSFILTER_DLLPUBLIC sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArgs, com::sun::star::uno::Any& aRet, const com::sun::star::uno::Any& aCaller ); -} } +public: + explicit VBAMacroResolver(); + virtual ~VBAMacroResolver(); + + // com.sun.star.lang.XServiceInfo interface ------------------------------- + + virtual ::rtl::OUString SAL_CALL + getImplementationName() throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL + supportsService( const ::rtl::OUString& rService ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // com.sun.star.lang.XInitialization interface ---------------------------- + + virtual void SAL_CALL initialize( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rArgs ) + throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + + // com.sun.star.script.vba.XVBAMacroResolver interface -------------------- + + virtual ::rtl::OUString SAL_CALL + resolveVBAMacroToScriptURL( const ::rtl::OUString& rVBAMacroName ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + virtual ::rtl::OUString SAL_CALL + resolveScriptURLtoVBAMacro( const ::rtl::OUString& rScriptURL ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel; + SfxObjectShell* mpObjShell; + ::rtl::OUString maProjectName; +}; + +// ============================================================================ + +} // namespace vba +} // namespace ooo #endif diff --git a/filter/source/msfilter/makefile.mk b/filter/source/msfilter/makefile.mk index 7780529b5580..1a8d27d85097 100644 --- a/filter/source/msfilter/makefile.mk +++ b/filter/source/msfilter/makefile.mk @@ -43,16 +43,17 @@ SLOFILES= \ $(SLO)$/countryid.obj \ $(SLO)$/escherex.obj \ $(SLO)$/eschesdo.obj \ + $(SLO)$/mscodec.obj \ $(SLO)$/msdffimp.obj \ + $(SLO)$/msfiltertracer.obj \ + $(SLO)$/msocximex.obj \ $(SLO)$/msoleexp.obj \ + $(SLO)$/msvbahelper.obj \ $(SLO)$/msvbasic.obj \ - $(SLO)$/svxmsbas.obj \ - $(SLO)$/msocximex.obj \ - $(SLO)$/mscodec.obj \ - $(SLO)$/msfiltertracer.obj \ + $(SLO)$/services.obj \ $(SLO)$/svdfppt.obj \ - $(SLO)$/svxmsbas2.obj \ - $(SLO)$/msvbahelper.obj \ + $(SLO)$/svxmsbas.obj \ + $(SLO)$/svxmsbas2.obj SHL1TARGET= msfilter$(DLLPOSTFIX) SHL1IMPLIB= i$(TARGET) diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx index 18ecc5ae6530..11cb07618821 100644 --- a/filter/source/msfilter/msvbahelper.cxx +++ b/filter/source/msfilter/msvbahelper.cxx @@ -36,12 +36,14 @@ #include #include #include +#include #include #include using namespace ::com::sun::star; -namespace ooo { namespace vba { +namespace ooo { +namespace vba { const static rtl::OUString sUrlPart0 = rtl::OUString::createFromAscii( "vnd.sun.star.script:"); const static rtl::OUString sUrlPart1 = rtl::OUString::createFromAscii( "?language=Basic&location=document"); @@ -62,6 +64,16 @@ String makeMacroURL( const String& sMacroName ) return ::rtl::OUString(); } +::rtl::OUString trimMacroName( const ::rtl::OUString& rMacroName ) +{ + // the name may contain whitespaces and may be enclosed in apostrophs + ::rtl::OUString aMacroName = rMacroName.trim(); + sal_Int32 nMacroLen = aMacroName.getLength(); + if( (nMacroLen >= 2) && (aMacroName[ 0 ] == '\'') && (aMacroName[ nMacroLen - 1 ] == '\'') ) + aMacroName = aMacroName.copy( 1, nMacroLen - 2 ).trim(); + return aMacroName; +} + SfxObjectShell* findShellForUrl( const rtl::OUString& sMacroURLOrPath ) { SfxObjectShell* pFoundShell=NULL; @@ -191,26 +203,16 @@ void parseMacro( const rtl::OUString& sMacro, String& sContainer, String& sModul sProcedure = sMacro; } -VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& MacroName, bool bSearchGlobalTemplates ) +MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& MacroName, bool bSearchGlobalTemplates ) { - VBAMacroResolvedInfo aRes; - if ( !pShell ) - return aRes; - aRes.SetMacroDocContext( pShell ); + if( !pShell ) + return MacroResolvedInfo(); // the name may be enclosed in apostrophs - ::rtl::OUString sMacroUrl = MacroName; - sal_Int32 nMacroLen = MacroName.getLength(); - if( (nMacroLen >= 2) && (MacroName[0] == '\'') && (MacroName[nMacroLen-1] == '\'') ) - sMacroUrl = MacroName.copy( 1, nMacroLen - 2 ); + ::rtl::OUString aMacroName = trimMacroName( MacroName ); // parse the macro name - sal_Int32 nDocSepIndex = sMacroUrl.indexOf( '!' ); - - String sContainer; - String sModule; - String sProcedure; - + sal_Int32 nDocSepIndex = aMacroName.indexOf( '!' ); if( nDocSepIndex > 0 ) { // macro specified by document name @@ -218,127 +220,123 @@ VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUStrin // recursively // assume for now that the document name is *this* document - String sDocUrlOrPath = sMacroUrl.copy( 0, nDocSepIndex ); - sMacroUrl = sMacroUrl.copy( nDocSepIndex + 1 ); + String sDocUrlOrPath = aMacroName.copy( 0, nDocSepIndex ); + aMacroName = aMacroName.copy( nDocSepIndex + 1 ); OSL_TRACE("doc search, current shell is 0x%x", pShell ); SfxObjectShell* pFoundShell = findShellForUrl( sDocUrlOrPath ); OSL_TRACE("doc search, after find, found shell is 0x%x", pFoundShell ); - aRes = resolveVBAMacro( pFoundShell, sMacroUrl ); + return resolveVBAMacro( pFoundShell, aMacroName ); } - else - { - // macro is contained in 'this' document ( or code imported from a template - // where that template is a global template or perhaps the template this - // document is created from ) - // macro format = Container.Module.Procedure - parseMacro( sMacroUrl, sContainer, sModule, sProcedure ); - uno::Reference< lang::XMultiServiceFactory> xSF( pShell->GetModel(), uno::UNO_QUERY); - uno::Reference< container::XNameContainer > xPrjNameCache; - if ( xSF.is() ) - xPrjNameCache.set( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAProjectNameProvider" ) ) ), uno::UNO_QUERY ); + // macro is contained in 'this' document ( or code imported from a template + // where that template is a global template or perhaps the template this + // document is created from ) + + MacroResolvedInfo aRes( pShell ); - std::vector< rtl::OUString > sSearchList; + // macro format = Container.Module.Procedure + String sContainer, sModule, sProcedure; + parseMacro( aMacroName, sContainer, sModule, sProcedure ); + uno::Reference< lang::XMultiServiceFactory> xSF( pShell->GetModel(), uno::UNO_QUERY); + uno::Reference< container::XNameContainer > xPrjNameCache; + if ( xSF.is() ) + xPrjNameCache.set( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAProjectNameProvider" ) ) ), uno::UNO_QUERY ); - if ( sContainer.Len() > 0 ) + std::vector< rtl::OUString > sSearchList; + + if ( sContainer.Len() > 0 ) + { + // get the Project associated with the Container + if ( xPrjNameCache.is() ) { - // get the Project associated with the Container - if ( xPrjNameCache.is() ) + if ( xPrjNameCache->hasByName( sContainer ) ) { - if ( xPrjNameCache->hasByName( sContainer ) ) - { - rtl::OUString sProject; - xPrjNameCache->getByName( sContainer ) >>= sProject; - sContainer = sProject; - } + rtl::OUString sProject; + xPrjNameCache->getByName( sContainer ) >>= sProject; + sContainer = sProject; } - sSearchList.push_back( sContainer ); // First Lib to search } - else + sSearchList.push_back( sContainer ); // First Lib to search + } + else + { + // Ok, if we have no Container specified then we need to search them in order, this document, template this document created from, global templates, + // get the name of Project/Library for 'this' document + rtl::OUString sThisProject; + BasicManager* pBasicMgr = pShell-> GetBasicManager(); + if ( pBasicMgr ) { - // Ok, if we have no Container specified then we need to search them in order, this document, template this document created from, global templates, - // get the name of Project/Library for 'this' document - rtl::OUString sThisProject; - BasicManager* pBasicMgr = pShell-> GetBasicManager(); - if ( pBasicMgr ) - { - if ( pBasicMgr->GetName().Len() ) - sThisProject = pBasicMgr->GetName(); - else // cater for the case where VBA is not enabled - sThisProject = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") ); - } - sSearchList.push_back( sThisProject ); // First Lib to search - if ( xPrjNameCache.is() ) - { - // is this document created from a template? - uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( pShell->GetModel(), uno::UNO_QUERY_THROW ); - uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW ); - uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW ); + if ( pBasicMgr->GetName().Len() ) + sThisProject = pBasicMgr->GetName(); + else // cater for the case where VBA is not enabled + sThisProject = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") ); + } + sSearchList.push_back( sThisProject ); // First Lib to search + if ( xPrjNameCache.is() ) + { + // is this document created from a template? + uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( pShell->GetModel(), uno::UNO_QUERY_THROW ); + uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW ); + uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW ); - rtl::OUString sCreatedFrom = xDocProps->getTemplateURL(); - if ( sCreatedFrom.getLength() ) + rtl::OUString sCreatedFrom = xDocProps->getTemplateURL(); + if ( sCreatedFrom.getLength() ) + { + INetURLObject aObj; + aObj.SetURL( sCreatedFrom ); + bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + rtl::OUString aURL; + if ( bIsURL ) + aURL = sCreatedFrom; + else { - INetURLObject aObj; - aObj.SetURL( sCreatedFrom ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; - rtl::OUString aURL; - if ( bIsURL ) - aURL = sCreatedFrom; - else - { - osl::FileBase::getFileURLFromSystemPath( sCreatedFrom, aURL ); - aObj.SetURL( aURL ); - } - sCreatedFrom = aObj.GetLastName(); + osl::FileBase::getFileURLFromSystemPath( sCreatedFrom, aURL ); + aObj.SetURL( aURL ); } + sCreatedFrom = aObj.GetLastName(); + } - sal_Int32 nIndex = sCreatedFrom.lastIndexOf( '.' ); - if ( nIndex != -1 ) - sCreatedFrom = sCreatedFrom.copy( 0, nIndex ); + sal_Int32 nIndex = sCreatedFrom.lastIndexOf( '.' ); + if ( nIndex != -1 ) + sCreatedFrom = sCreatedFrom.copy( 0, nIndex ); - rtl::OUString sPrj; - if ( sCreatedFrom.getLength() && xPrjNameCache->hasByName( sCreatedFrom ) ) - { - xPrjNameCache->getByName( sCreatedFrom ) >>= sPrj; - // Make sure we don't double up with this project - if ( !sPrj.equals( sThisProject ) ) - sSearchList.push_back( sPrj ); - } + rtl::OUString sPrj; + if ( sCreatedFrom.getLength() && xPrjNameCache->hasByName( sCreatedFrom ) ) + { + xPrjNameCache->getByName( sCreatedFrom ) >>= sPrj; + // Make sure we don't double up with this project + if ( !sPrj.equals( sThisProject ) ) + sSearchList.push_back( sPrj ); + } - // get list of global template Names - uno::Sequence< rtl::OUString > sTemplateNames = xPrjNameCache->getElementNames(); - sal_Int32 nLen = sTemplateNames.getLength(); - for ( sal_Int32 index = 0; ( bSearchGlobalTemplates && index < nLen ); ++index ) - { + // get list of global template Names + uno::Sequence< rtl::OUString > sTemplateNames = xPrjNameCache->getElementNames(); + sal_Int32 nLen = sTemplateNames.getLength(); + for ( sal_Int32 index = 0; ( bSearchGlobalTemplates && index < nLen ); ++index ) + { - if ( !sCreatedFrom.equals( sTemplateNames[ index ] ) ) + if ( !sCreatedFrom.equals( sTemplateNames[ index ] ) ) + { + if ( xPrjNameCache->hasByName( sTemplateNames[ index ] ) ) { - if ( xPrjNameCache->hasByName( sTemplateNames[ index ] ) ) - { - xPrjNameCache->getByName( sTemplateNames[ index ] ) >>= sPrj; - // Make sure we don't double up with this project - if ( !sPrj.equals( sThisProject ) ) - sSearchList.push_back( sPrj ); - } + xPrjNameCache->getByName( sTemplateNames[ index ] ) >>= sPrj; + // Make sure we don't double up with this project + if ( !sPrj.equals( sThisProject ) ) + sSearchList.push_back( sPrj ); } - } - } - } - std::vector< rtl::OUString >::iterator it_end = sSearchList.end(); - for ( std::vector< rtl::OUString >::iterator it = sSearchList.begin(); it != it_end; ++it ) - { - bool bRes = hasMacro( pShell, *it, sModule, sProcedure ); - if ( bRes ) - { - aRes.SetResolved( true ); - aRes.SetMacroDocContext( pShell ); - sContainer = *it; - break; + } } } - aRes.SetResolvedMacro( sProcedure.Insert( '.', 0 ).Insert( sModule, 0).Insert( '.', 0 ).Insert( sContainer, 0 ) ); + std::vector< rtl::OUString >::iterator it_end = sSearchList.end(); + for ( std::vector< rtl::OUString >::iterator it = sSearchList.begin(); !aRes.mbFound && (it != it_end); ++it ) + { + aRes.mbFound = hasMacro( pShell, *it, sModule, sProcedure ); + if ( aRes.mbFound ) + sContainer = *it; + } + aRes.msResolvedMacro = sProcedure.Insert( '.', 0 ).Insert( sModule, 0).Insert( '.', 0 ).Insert( sContainer, 0 ); return aRes; } @@ -396,4 +394,116 @@ sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, uno::Se } return bRes; } -} } // vba // ooo +// ============================================================================ + +uno::Sequence< ::rtl::OUString > VBAMacroResolver_getSupportedServiceNames() +{ + uno::Sequence< ::rtl::OUString > aServiceNames( 1 ); + aServiceNames[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.vba.VBAMacroResolver" ) ); + return aServiceNames; +} + +::rtl::OUString VBAMacroResolver_getImplementationName() +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAMacroResolver" ) ); +} + +uno::Reference< uno::XInterface > SAL_CALL VBAMacroResolver_createInstance( const uno::Reference< lang::XMultiServiceFactory >& ) throw (uno::Exception) +{ + return static_cast< ::cppu::OWeakObject* >( new VBAMacroResolver ); +} + +// ============================================================================ + +VBAMacroResolver::VBAMacroResolver() : + mpObjShell( 0 ) +{ +} + +VBAMacroResolver::~VBAMacroResolver() +{ +} + +// com.sun.star.lang.XServiceInfo interface ----------------------------------- + +::rtl::OUString SAL_CALL VBAMacroResolver::getImplementationName() throw (uno::RuntimeException) +{ + return VBAMacroResolver_getImplementationName(); +} + +sal_Bool SAL_CALL VBAMacroResolver::supportsService( const ::rtl::OUString& rService ) throw (uno::RuntimeException) +{ + uno::Sequence< ::rtl::OUString > aServices = VBAMacroResolver_getSupportedServiceNames(); + const ::rtl::OUString* pArray = aServices.getConstArray(); + const ::rtl::OUString* pArrayEnd = pArray + aServices.getLength(); + return ::std::find( pArray, pArrayEnd, rService ) != pArrayEnd; +} + +uno::Sequence< ::rtl::OUString > SAL_CALL VBAMacroResolver::getSupportedServiceNames() throw (uno::RuntimeException) +{ + return VBAMacroResolver_getSupportedServiceNames(); +} + +// com.sun.star.lang.XInitialization interface -------------------------------- + +void SAL_CALL VBAMacroResolver::initialize( const uno::Sequence< uno::Any >& rArgs ) throw (uno::Exception, uno::RuntimeException) +{ + OSL_ENSURE( rArgs.getLength() < 2, "VBAMacroResolver::initialize - missing arguments" ); + if( rArgs.getLength() < 2 ) + throw uno::RuntimeException(); + + // first argument: document model + mxModel.set( rArgs[ 0 ], uno::UNO_QUERY_THROW ); + uno::Reference< lang::XUnoTunnel > xUnoTunnel( mxModel, uno::UNO_QUERY_THROW ); + mpObjShell = reinterpret_cast< SfxObjectShell* >( xUnoTunnel->getSomething( SfxObjectShell::getUnoTunnelId() ) ); + if( !mpObjShell ) + throw uno::RuntimeException(); + + // second argument: VBA project name + if( !(rArgs[ 1 ] >>= maProjectName) || (maProjectName.getLength() == 0) ) + throw uno::RuntimeException(); +} + +// com.sun.star.script.vba.XVBAMacroResolver interface ------------------------ + +::rtl::OUString SAL_CALL VBAMacroResolver::resolveVBAMacroToScriptURL( const ::rtl::OUString& rVBAMacroName ) throw (lang::IllegalArgumentException, uno::RuntimeException) +{ + if( !mpObjShell ) + throw uno::RuntimeException(); + + // the name may be enclosed in apostrophs + ::rtl::OUString aMacroName = trimMacroName( rVBAMacroName ); + if( aMacroName.getLength() == 0 ) + throw lang::IllegalArgumentException(); + + // external references not supported here (syntax is "url!macroname" or "[url]!macroname" or "[url]macroname") + if( (aMacroName[ 0 ] == '[') || (aMacroName.indexOf( '!' ) >= 0) ) + throw lang::IllegalArgumentException(); + + // check if macro name starts with project name, replace with "Standard" + // TODO: adjust this when custom VBA project name is supported + sal_Int32 nDotPos = aMacroName.indexOf( '.' ); + if( (nDotPos == 0) || (nDotPos + 1 == aMacroName.getLength()) ) + throw lang::IllegalArgumentException(); + if( (nDotPos > 0) && aMacroName.matchIgnoreAsciiCase( maProjectName ) ) + aMacroName = aMacroName.copy( nDotPos + 1 ); + + // try to find the macro + MacroResolvedInfo aInfo = resolveVBAMacro( mpObjShell, aMacroName, false ); + if( !aInfo.mbFound ) + throw lang::IllegalArgumentException(); + + // build and return the script URL + return makeMacroURL( aInfo.msResolvedMacro ); +} + +::rtl::OUString SAL_CALL VBAMacroResolver::resolveScriptURLtoVBAMacro( const ::rtl::OUString& /*rScriptURL*/ ) throw (lang::IllegalArgumentException, uno::RuntimeException) +{ + OSL_ENSURE( false, "VBAMacroResolver::resolveScriptURLtoVBAMacro - not implemented" ); + throw uno::RuntimeException(); +} + +// ============================================================================ + +} // namespace vba +} // namespace ooo diff --git a/filter/source/msfilter/services.cxx b/filter/source/msfilter/services.cxx new file mode 100755 index 000000000000..e34862ca0d13 --- /dev/null +++ b/filter/source/msfilter/services.cxx @@ -0,0 +1,176 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include + +using ::rtl::OUString; +using namespace ::com::sun::star; + +// ============================================================================ + +/* Steps to add an implementation 'MyClass' as a service: + + Step 1: Implement the static functions MyClass_getSupportedServiceNames(), + MyClass_getImplementationName(), and MyClass_createInstance() in the cxx + file of MyClass (see other examples in this module). + + Step 2: Add the line 'DECL_STATIC_FUNCS_???( MyClass )' below in this file. + If the service will be instanciated without component context, use + DECL_STATIC_FUNCS_FACTORY. If the service will be instanciated with + component context, use DECL_STATIC_FUNCS_COMPCONTEXT. + + Step 3: Add 'WRITE_SERVICE_INFO( MyClass )' in function + component_writeInfo() below in this file. + + Step 4: Add 'IMPLEMENT_SINGLEFACTORY( MyClass )' (instanciation without + component context) or 'IMPLEMENT_SINGLECOMPFACTORY( MyClass )' + (instanciation with component context) in function component_getFactory() + below in this file. + */ + +// ============================================================================ + +// Declare static functions providing service information --------------------- + +#define DECL_STATIC_FUNCS_FACTORY( className ) \ +extern OUString SAL_CALL className##_getImplementationName() throw(); \ +extern uno::Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \ +extern uno::Reference< uno::XInterface > SAL_CALL className##_createInstance( \ + const uno::Reference< lang::XMultiServiceFactory >& rxFactory ) throw (uno::Exception) + +#define DECL_STATIC_FUNCS_COMPCONTEXT( className ) \ +extern OUString SAL_CALL className##_getImplementationName() throw(); \ +extern uno::Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \ +extern uno::Reference< uno::XInterface > SAL_CALL className##_createInstance( \ + const uno::Reference< uno::XComponentContext >& rxContext ) throw (uno::Exception) + +// step 2: add new classes in this list +namespace ooo { namespace vba { DECL_STATIC_FUNCS_FACTORY( VBAMacroResolver ); } } + +#undef DECL_STATIC_FUNCS_FACTORY +#undef DECL_STATIC_FUNCS_COMPCONTEXT + +// ---------------------------------------------------------------------------- + +extern "C" { + +// ---------------------------------------------------------------------------- + +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char **ppEnvironmentTypeName, uno_Environment ** /*ppEnvironment*/ ) +{ + *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +// Write service information to registry -------------------------------------- + +void SAL_CALL writeInfo( registry::XRegistryKey* pRegistryKey, const OUString& rImplementationName, const uno::Sequence< OUString >& rServices ) +{ + uno::Reference< registry::XRegistryKey > xNewKey( pRegistryKey->createKey( + OUString( sal_Unicode( '/' ) ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" ) ) ) ); + for( sal_Int32 i = 0; i < rServices.getLength(); ++i ) + xNewKey->createKey( rServices[i] ); +} + +#define WRITE_SERVICE_INFO( className ) \ + writeInfo( pKey, className##_getImplementationName(), className##_getSupportedServiceNames() ) + +SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) +{ + if( pRegistryKey ) try + { + registry::XRegistryKey* pKey = reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ); + + // step 3: add new classes in this list + WRITE_SERVICE_INFO( ::ooo::vba::VBAMacroResolver ); + } + catch( registry::InvalidRegistryException& ) + { + OSL_ENSURE( sal_False, "so_vba - component_writeInfo - InvalidRegistryException" ); + } + return sal_True; +} + +#undef WRITE_SERVICE_INFO + +// Create a factory for the service instances --------------------------------- + +#define IMPLEMENT_SINGLEFACTORY( className ) \ +if( !bFound && className##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) ) \ +{ \ + xFactory = ::cppu::createSingleFactory( xMSF, className##_getImplementationName(), \ + className##_createInstance, className##_getSupportedServiceNames() ); \ + bFound = true; \ +} + +#define IMPLEMENT_SINGLECOMPFACTORY( className ) \ +if( !bFound && className##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) ) \ +{ \ + xCompFactory = ::cppu::createSingleComponentFactory( className##_createInstance, \ + className##_getImplementationName(), className##_getSupportedServiceNames() ); \ + bFound = true; \ +} + +SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /*pRegistryKey*/ ) +{ + void* pReturn = 0; + if( pImplName && pServiceManager ) + { + uno::Reference< lang::XMultiServiceFactory > xMSF( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ) ); + + // define variables which are used in the macros + uno::Reference< lang::XSingleServiceFactory > xFactory; + uno::Reference< lang::XSingleComponentFactory > xCompFactory; + const sal_Int32 nImplNameLen = strlen( pImplName ); + bool bFound = false; + + // Step 4: add new class in this list + IMPLEMENT_SINGLEFACTORY( ::ooo::vba::VBAMacroResolver ) + + // factory is valid -> service was found + if( xFactory.is()) + { + xFactory->acquire(); + pReturn = xFactory.get(); + } + else if( xCompFactory.is() ) + { + xCompFactory->acquire(); + pReturn = xCompFactory.get(); + } + } + return pReturn; +} + +#undef IMPLEMENT_SINGLEFACTORY +#undef IMPLEMENT_SINGLECOMPFACTORY + +// ---------------------------------------------------------------------------- + +} // extern "C" + +// ============================================================================ diff --git a/oox/inc/oox/core/binarycodec.hxx b/oox/inc/oox/core/binarycodec.hxx index 8abafffa2481..1e9dba07c388 100644 --- a/oox/inc/oox/core/binarycodec.hxx +++ b/oox/inc/oox/core/binarycodec.hxx @@ -289,4 +289,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/core/binaryfilterbase.hxx b/oox/inc/oox/core/binaryfilterbase.hxx index bf249cdfab9b..f1cc7b399bce 100644 --- a/oox/inc/oox/core/binaryfilterbase.hxx +++ b/oox/inc/oox/core/binaryfilterbase.hxx @@ -59,4 +59,3 @@ typedef ::rtl::Reference< BinaryFilterBase > BinaryFilterRef; } // namespace oox #endif - diff --git a/oox/inc/oox/core/contexthandler.hxx b/oox/inc/oox/core/contexthandler.hxx index dd9ac686ff46..c5c198c34c23 100644 --- a/oox/inc/oox/core/contexthandler.hxx +++ b/oox/inc/oox/core/contexthandler.hxx @@ -29,9 +29,9 @@ #define OOX_CORE_CONTEXTHANDLER_HXX #include -#include -#include #include +#include +#include namespace com { namespace sun { namespace star { namespace xml { namespace sax { class XLocator; } } @@ -114,4 +114,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/core/contexthandler2.hxx b/oox/inc/oox/core/contexthandler2.hxx index 48f11c962e38..61c4ad9aa2da 100644 --- a/oox/inc/oox/core/contexthandler2.hxx +++ b/oox/inc/oox/core/contexthandler2.hxx @@ -41,28 +41,30 @@ namespace core { // ============================================================================ -struct ContextInfo; +struct ElementInfo; -/** Helper class that provides a context identifier stack. +/** Helper class that provides a context stack. Fragment handlers and context handlers derived from this helper class will - track the identifiers of the current context in a stack. The idea is to use - the same instance of a fragment handler or context handler to process + track the identifiers of the visited elements in a stack. The idea is to + use the same instance of a fragment handler or context handler to process several nested elements in an XML stream. For that, the abstract function - onCreateContext() has to return 'true' for the passed element. + onCreateContext() has to return 'this' for the passed element. Derived classes have to implement the createFastChildContext(), startFastElement(), characters(), and endFastElement() functions from the com.sun.star.xml.sax.XFastContextHandler interface by simply forwarding - them to the respective implCreateChildContext(), implStartCurrentContext(), - implCharacters(), and implEndCurrentContext() functions of this helper. The - new abstract functions have to be implemented according to the elements to - be processed. + them to the respective implCreateChildContext(), implStartElement(), + implCharacters(), and implEndElement() functions of this helper. This is + implemented already in the classes ContextHandler2 and FragmentHandler2. + The new abstract functions have to be implemented according to the elements + to be processed. Similarly, for binary import, derived classes have to forward the createRecordContext(), startRecord(), and endRecord() functions from the ContextHandler class to the implCreateRecordContext(), implStartRecord(), - and implEndRecord() functions of this helper. + and implEndRecord() functions of this helper. Again, this is implemented + already in the classes ContextHandler2 and FragmentHandler2. */ class ContextHandler2Helper { @@ -71,78 +73,97 @@ public: explicit ContextHandler2Helper( const ContextHandler2Helper& rParent ); virtual ~ContextHandler2Helper(); + // allow instances to be stored in ::rtl::Reference virtual void SAL_CALL acquire() throw() = 0; virtual void SAL_CALL release() throw() = 0; - virtual ContextHandler& queryContextHandler() = 0; - // interface -------------------------------------------------------------- - /** Will be called if a new context can be created for the passed element. + /** Will be called to create a context handler for the passed element. - Usually 'true' should be returned to improve performance by reusing the + Usually 'this' can be returned to improve performance by reusing the same instance to process several elements. Used by OOXML import only. */ virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) = 0; - /** Will be called if a new context element has been started. + /** Will be called when a new element has been started. + + This function is called at the context handler returned from + onCreateContext(), or, for root elements of an XML stream, at the + fragment handler itself. - The current element identifier can be accessed by using - getCurrentContext() or isCurrentContext(). Used by OOXML import only. + The current element identifier can be accessed with getCurrentElement() + or isCurrentElement(). Used by OOXML import only. */ virtual void onStartElement( const AttributeList& rAttribs ) = 0; - /** Will be called if the current context element is about to be left. + /** Will be called before a new child element starts, or if the current + element is about to be left. - The current element identifier can be accessed by using - getCurrentContext() or isCurrentContext(). Used by OOXML import only. + This helper function collects all text fragments received by the + characters() function (such as encoded characters which are passed in + separate calls to the characters() function), and passes the + concatenated and trimmed string. - @param rChars The characters collected in this element. + The current element identifier can be accessed with getCurrentElement() + or isCurrentElement(). Used by OOXML import only. */ - virtual void onEndElement( const ::rtl::OUString& rChars ) = 0; + virtual void onCharacters( const ::rtl::OUString& rChars ) = 0; - /** Will be called if a new context can be created for the passed element. + /** Will be called when the current element is about to be left. - Usually 'true' should be returned to improve performance by reusing the - same instance to process several elements. Used by OOBIN import only. + The current element identifier can be accessed with getCurrentElement() + or isCurrentElement(). Used by OOXML import only. + */ + virtual void onEndElement() = 0; + + /** Will be called to create a context handler for the passed record. + + Usually 'this' can be returned to improve performance by reusing the + same instance to process several records. Used by OOBIN import only. */ virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) = 0; - /** Will be called if a new record in a binary stream has been started. + /** Will be called when a new record block in a binary stream has been + started. - The current record identifier can be accessed by using - getCurrentContext() or isCurrentContext(). Used by OOBIN import only. + The current record identifier can be accessed with getCurrentElement() + or isCurrentElement(). Used by OOBIN import only. */ virtual void onStartRecord( RecordInputStream& rStrm ) = 0; - /** Will be called if the current context record is about to be left. + /** Will be called when the current record block is about to be left. - The current record identifier can be accessed by using - getCurrentContext() or isCurrentContext(). Used by OOBIN import only. + The current record identifier can be accessed with getCurrentElement() + or isCurrentElement(). Used by OOBIN import only. */ virtual void onEndRecord() = 0; // helpers ---------------------------------------------------------------- - /** Returns the element identifier of the current topmost context. */ + /** Returns the identifier of the currently processed element. */ sal_Int32 getCurrentElement() const; - /** Returns true, if nElement contains the current topmost context. */ + /** Returns true, if nElement contains the identifier of the currently + processed element. */ inline bool isCurrentElement( sal_Int32 nElement ) const { return getCurrentElement() == nElement; } - /** Returns true, if either nElement1 or nElement2 contain the current topmost context. */ + /** Returns true, if either nElement1 or nElement2 contain the identifier + of the currently processed element. */ inline bool isCurrentElement( sal_Int32 nElement1, sal_Int32 nElement2 ) const { return isCurrentElement( nElement1 ) || isCurrentElement( nElement2 ); } - /** Returns the element identifier of the specified parent context. */ - sal_Int32 getPreviousElement( sal_Int32 nCountBack = 1 ) const; + /** Returns the identifier of the specified parent element. */ + sal_Int32 getParentElement( sal_Int32 nCountBack = 1 ) const; - /** Returns the element identifier of the specified parent context. */ - inline sal_Int32 isPreviousElement( sal_Int32 nElement, sal_Int32 nCountBack = 1 ) const - { return getPreviousElement( nCountBack ) == nElement; } + /** Returns true, if nElement contains the identifier of the specified + parent element. */ + inline sal_Int32 isParentElement( sal_Int32 nElement, sal_Int32 nCountBack = 1 ) const + { return getParentElement( nCountBack ) == nElement; } - /** Returns true, if the current element is the root element. */ + /** Returns true, if the element currently processed is the root element of + the context or fragment handler. */ bool isRootElement() const; // implementation --------------------------------------------------------- @@ -155,7 +176,7 @@ protected: const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs ); /** Must be called from startFastElement() in derived classes. */ - void implStartCurrentContext( + void implStartElement( sal_Int32 nElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs ); @@ -163,7 +184,7 @@ protected: void implCharacters( const ::rtl::OUString& rChars ); /** Must be called from endFastElement() in derived classes. */ - void implEndCurrentContext( sal_Int32 nElement ); + void implEndElement( sal_Int32 nElement ); /** Must be called from createRecordContext() in derived classes. */ ContextHandlerRef implCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); @@ -177,15 +198,15 @@ protected: private: ContextHandler2Helper& operator=( const ContextHandler2Helper& ); - ContextInfo& pushContextInfo( sal_Int32 nElement ); - void popContextInfo(); - void appendCollectedChars(); + ElementInfo& pushElementInfo( sal_Int32 nElement ); + void popElementInfo(); + void processCollectedChars(); private: - typedef ::std::vector< ContextInfo > ContextStack; + typedef ::std::vector< ElementInfo > ContextStack; typedef ::boost::shared_ptr< ContextStack > ContextStackRef; - ContextStackRef mxContextStack; /// Stack of processed contexts. + ContextStackRef mxContextStack; /// Stack of all processed elements. size_t mnRootStackSize; /// Stack size on construction time. bool mbEnableTrimSpace; /// True = trim whitespace in characters(). }; @@ -202,8 +223,6 @@ public: virtual void SAL_CALL acquire() throw() { ContextHandler::acquire(); } virtual void SAL_CALL release() throw() { ContextHandler::release(); } - virtual ContextHandler& queryContextHandler(); - // com.sun.star.xml.sax.XFastContextHandler interface --------------------- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL @@ -237,7 +256,8 @@ public: virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); + virtual void onEndElement(); virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); virtual void onStartRecord( RecordInputStream& rStrm ); @@ -250,4 +270,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/core/fasttokenhandler.hxx b/oox/inc/oox/core/fasttokenhandler.hxx index 84baccabdc67..01422aebc3ea 100644 --- a/oox/inc/oox/core/fasttokenhandler.hxx +++ b/oox/inc/oox/core/fasttokenhandler.hxx @@ -62,4 +62,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/core/filterbase.hxx b/oox/inc/oox/core/filterbase.hxx index 1757b2be4334..0371768d02a7 100644 --- a/oox/inc/oox/core/filterbase.hxx +++ b/oox/inc/oox/core/filterbase.hxx @@ -29,14 +29,14 @@ #define OOX_CORE_FILTERBASE_HXX #include -#include -#include -#include #include #include +#include #include #include #include +#include +#include #include #include #include "oox/helper/binarystreambase.hxx" @@ -44,16 +44,16 @@ #include "oox/dllapi.h" namespace com { namespace sun { namespace star { - namespace lang { class XMultiServiceFactory; } namespace awt { struct DeviceInfo; } - namespace frame { class XModel; } - namespace task { class XStatusIndicator; } - namespace task { class XInteractionHandler; } namespace frame { class XFrame; } + namespace frame { class XModel; } + namespace graphic { class XGraphic; } namespace io { class XInputStream; } namespace io { class XOutputStream; } namespace io { class XStream; } - namespace graphic { class XGraphic; } + namespace lang { class XMultiServiceFactory; } + namespace task { class XInteractionHandler; } + namespace task { class XStatusIndicator; } } } } namespace comphelper { @@ -68,6 +68,7 @@ namespace oox { namespace oox { namespace ole { class OleObjectHelper; + class VbaProject; } } namespace oox { @@ -194,6 +195,9 @@ public: /** Returns a helper for the handling of OLE obejcts. */ ::oox::ole::OleObjectHelper& getOleObjectHelper() const; + /** Returns the VBA project manager. */ + ::oox::ole::VbaProject& getVbaProject() const; + /** Requests a password from the media descriptor or from the user. On success, the password will be inserted into the media descriptor. */ ::rtl::OUString requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier ) const; @@ -271,6 +275,9 @@ private: resolving palette colors. */ virtual GraphicHelper* implCreateGraphicHelper() const; + /** Derived classes create a VBA project manager object. */ + virtual ::oox::ole::VbaProject* implCreateVbaProject() const = 0; + virtual ::rtl::OUString implGetImplementationName() const = 0; virtual StorageRef implCreateStorage( @@ -288,4 +295,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/core/filterdetect.hxx b/oox/inc/oox/core/filterdetect.hxx index 76e46050c24a..70c35ff26076 100644 --- a/oox/inc/oox/core/filterdetect.hxx +++ b/oox/inc/oox/core/filterdetect.hxx @@ -163,4 +163,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/core/fragmenthandler.hxx b/oox/inc/oox/core/fragmenthandler.hxx index 26d2ac540a7a..ba3164a74da8 100644 --- a/oox/inc/oox/core/fragmenthandler.hxx +++ b/oox/inc/oox/core/fragmenthandler.hxx @@ -134,4 +134,3 @@ typedef ::rtl::Reference< FragmentHandler > FragmentHandlerRef; } // namespace oox #endif - diff --git a/oox/inc/oox/core/fragmenthandler2.hxx b/oox/inc/oox/core/fragmenthandler2.hxx index 9b864260b853..2473b9e91436 100644 --- a/oox/inc/oox/core/fragmenthandler2.hxx +++ b/oox/inc/oox/core/fragmenthandler2.hxx @@ -49,8 +49,6 @@ public: virtual void SAL_CALL acquire() throw() { FragmentHandler::acquire(); } virtual void SAL_CALL release() throw() { FragmentHandler::release(); } - virtual ContextHandler& queryContextHandler(); - // com.sun.star.xml.sax.XFastContextHandler interface --------------------- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL @@ -94,7 +92,8 @@ public: virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); + virtual void onEndElement(); virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); virtual void onStartRecord( RecordInputStream& rStrm ); @@ -112,4 +111,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/core/recordparser.hxx b/oox/inc/oox/core/recordparser.hxx index e499195c52f8..4600be3ff832 100644 --- a/oox/inc/oox/core/recordparser.hxx +++ b/oox/inc/oox/core/recordparser.hxx @@ -29,7 +29,6 @@ #define OOX_CORE_RECORDPARSER_HXX #include -#include #include #include #include @@ -95,4 +94,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/core/relations.hxx b/oox/inc/oox/core/relations.hxx index 4ca8ca3899e7..6abb48c361a0 100644 --- a/oox/inc/oox/core/relations.hxx +++ b/oox/inc/oox/core/relations.hxx @@ -35,6 +35,8 @@ namespace oox { namespace core { +// ============================================================================ + /** Expands to an OUString containing an officeDocument relation type created from the passed literal(!) ASCII(!) character array. */ #define CREATE_OFFICEDOC_RELATIONSTYPE( ascii ) \ @@ -99,4 +101,3 @@ private: } // namespace oox #endif // OOX_CORE_RELATIONS - diff --git a/oox/inc/oox/core/relationshandler.hxx b/oox/inc/oox/core/relationshandler.hxx index 3211888ecc9f..b2da8d59c39f 100644 --- a/oox/inc/oox/core/relationshandler.hxx +++ b/oox/inc/oox/core/relationshandler.hxx @@ -58,4 +58,3 @@ private: } // namespace oox #endif // OOX_CORE_RELATIONSHANDLER - diff --git a/oox/inc/oox/core/xmlfilterbase.hxx b/oox/inc/oox/core/xmlfilterbase.hxx index 30efeb0e9440..796cd82781c0 100644 --- a/oox/inc/oox/core/xmlfilterbase.hxx +++ b/oox/inc/oox/core/xmlfilterbase.hxx @@ -28,16 +28,16 @@ #ifndef OOX_CORE_XMLFILTERBASE_HXX #define OOX_CORE_XMLFILTERBASE_HXX +#include +#include +#include #include #include #include -#include "oox/drawingml/table/tablestylelist.hxx" #include "oox/core/filterbase.hxx" #include "oox/core/relations.hxx" -#include -#include -#include -#include +#include "oox/drawingml/table/tablestylelist.hxx" +#include "oox/dllapi.h" namespace com { namespace sun { namespace star { namespace container { class XNameContainer; } @@ -46,9 +46,11 @@ namespace com { namespace sun { namespace star { namespace xml { namespace sax { class XFastDocumentHandler; } } } } } -namespace oox { namespace drawingml { class Theme; } } -namespace oox { namespace drawingml { namespace chart { class ChartConverter; } } } -namespace oox { namespace vml { class Drawing; } } +namespace oox { + namespace drawingml { class Theme; } + namespace drawingml { namespace chart { class ChartConverter; } } + namespace vml { class Drawing; } +} namespace sax_fastparser { class FastSerializerHelper; @@ -61,6 +63,8 @@ namespace core { class FragmentHandler; +// ============================================================================ + struct TextField { com::sun::star::uno::Reference< com::sun::star::text::XText > xText; com::sun::star::uno::Reference< com::sun::star::text::XTextCursor > xTextCursor; @@ -222,4 +226,3 @@ typedef ::rtl::Reference< XmlFilterBase > XmlFilterRef; } // namespace oox #endif - diff --git a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx index e43dc176c297..3ff545cda295 100644 --- a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx +++ b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx @@ -101,7 +101,8 @@ public: virtual ~ChartDrawingFragment(); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); + virtual void onEndElement(); private: ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > diff --git a/oox/inc/oox/drawingml/chart/datasourcecontext.hxx b/oox/inc/oox/drawingml/chart/datasourcecontext.hxx index e5183e64caa4..1cffa32e382a 100644 --- a/oox/inc/oox/drawingml/chart/datasourcecontext.hxx +++ b/oox/inc/oox/drawingml/chart/datasourcecontext.hxx @@ -51,7 +51,7 @@ public: virtual ~DoubleSequenceContext(); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); private: sal_Int32 mnPtIndex; /// Current data point index. @@ -69,7 +69,7 @@ public: virtual ~StringSequenceContext(); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); private: sal_Int32 mnPtIndex; /// Current data point index. diff --git a/oox/inc/oox/drawingml/chart/seriescontext.hxx b/oox/inc/oox/drawingml/chart/seriescontext.hxx index 100e7755cdca..ef50bc94866c 100644 --- a/oox/inc/oox/drawingml/chart/seriescontext.hxx +++ b/oox/inc/oox/drawingml/chart/seriescontext.hxx @@ -47,7 +47,7 @@ public: virtual ~DataLabelContext(); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); }; // ============================================================================ @@ -63,7 +63,7 @@ public: virtual ~DataLabelsContext(); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); }; // ============================================================================ @@ -124,7 +124,7 @@ public: virtual ~TrendlineContext(); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); }; // ============================================================================ diff --git a/oox/inc/oox/drawingml/chart/titlecontext.hxx b/oox/inc/oox/drawingml/chart/titlecontext.hxx index e3d274c1744b..45969bf150c2 100644 --- a/oox/inc/oox/drawingml/chart/titlecontext.hxx +++ b/oox/inc/oox/drawingml/chart/titlecontext.hxx @@ -47,7 +47,7 @@ public: virtual ~TextContext(); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); }; // ============================================================================ diff --git a/oox/inc/oox/drawingml/graphicshapecontext.hxx b/oox/inc/oox/drawingml/graphicshapecontext.hxx index d515a4553936..5f27efdf15e7 100644 --- a/oox/inc/oox/drawingml/graphicshapecontext.hxx +++ b/oox/inc/oox/drawingml/graphicshapecontext.hxx @@ -68,7 +68,7 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); private: - ::boost::shared_ptr< ::oox::vml::OleObjectInfo > mxOleObjectInfo; + ::oox::vml::OleObjectInfo& mrOleObjectInfo; }; // ==================================================================== @@ -106,7 +106,7 @@ public: throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); private: - bool mbEmbedShapes; + ChartShapeInfo& mrChartShapeInfo; }; // ==================================================================== diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx index d6cab48f6bb5..2114f8d9cf02 100644 --- a/oox/inc/oox/drawingml/shape.hxx +++ b/oox/inc/oox/drawingml/shape.hxx @@ -40,6 +40,10 @@ #include #include +namespace oox { namespace vml { + struct OleObjectInfo; +} } + namespace oox { namespace drawingml { class CustomShapeProperties; @@ -57,37 +61,15 @@ typedef ::std::map< sal_Int32, ShapeStyleRef > ShapeStyleRefMap; // ============================================================================ -/** A callback that will be called before and after the API shape is created - from the imported shape. - - An instance of a derived class of this callback can be set at every - ::oox::drawingml::Shape instance to implement anything that needs a created - and inserted XShape. - */ -class CreateShapeCallback +/** Additional information for a chart embedded in a drawing shape. */ +struct ChartShapeInfo { -public: - virtual ::rtl::OUString onCreateXShape( - const ::rtl::OUString& rServiceName, - const ::com::sun::star::awt::Rectangle& rShapeRect ); + ::rtl::OUString maFragmentPath; /// Path to related XML stream, e.g. for charts. + bool mbEmbedShapes; /// True = load chart shapes into chart, false = load into parent drawpage. - virtual void onXShapeCreated( - const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape, - const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes ) const; - - inline const PropertyMap& getShapeProperties() const { return maShapeProps; } - -protected: - explicit CreateShapeCallback( ::oox::core::XmlFilterBase& rFilter ); - virtual ~CreateShapeCallback(); - -protected: - ::oox::core::XmlFilterBase& mrFilter; - PropertyMap maShapeProps; + inline explicit ChartShapeInfo( bool bEmbedShapes ) : mbEmbedShapes( bEmbedShapes ) {} }; -typedef ::boost::shared_ptr< CreateShapeCallback > CreateShapeCallbackRef; - // ============================================================================ class Shape @@ -95,7 +77,7 @@ class Shape { public: - Shape( const sal_Char* pServiceType = NULL ); + explicit Shape( const sal_Char* pServiceType = 0 ); virtual ~Shape(); rtl::OUString& getServiceName(){ return msServiceName; } @@ -136,6 +118,11 @@ public: // setDefaults has to be called if styles are imported (OfficeXML is not storing properties having the default value) void setDefaults(); + ::oox::vml::OleObjectInfo& setOleObjectType(); + ChartShapeInfo& setChartType( bool bEmbedShapes ); + void setDiagramType(); + void setTableType(); + void setTextBody(const TextBodyPtr & pTextBody); TextBodyPtr getTextBody(); void setMasterTextListStyle( const TextListStylePtr& pMasterTextListStyle ); @@ -145,11 +132,9 @@ public: inline const ShapeStyleRefMap& getShapeStyleRefs() const { return maShapeStyleRefs; } const ShapeStyleRef* getShapeStyleRef( sal_Int32 nRefType ) const; - inline void setCreateShapeCallback( CreateShapeCallbackRef xCallback ) { mxCreateCallback = xCallback; } - // addShape is creating and inserting the corresponding XShape. void addShape( - const oox::core::XmlFilterBase& rFilterBase, + ::oox::core::XmlFilterBase& rFilterBase, const Theme* pTheme, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, const ::com::sun::star::awt::Rectangle* pShapeRect = 0, @@ -166,7 +151,7 @@ protected: ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createAndInsert( - const ::oox::core::XmlFilterBase& rFilterBase, + ::oox::core::XmlFilterBase& rFilterBase, const ::rtl::OUString& rServiceName, const Theme* pTheme, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, @@ -174,13 +159,22 @@ protected: sal_Bool bClearText ); void addChildren( - const ::oox::core::XmlFilterBase& rFilterBase, + ::oox::core::XmlFilterBase& rFilterBase, Shape& rMaster, const Theme* pTheme, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, const ::com::sun::star::awt::Rectangle& rClientRect, ShapeIdMap* pShapeMap ); + virtual ::rtl::OUString finalizeServiceName( + ::oox::core::XmlFilterBase& rFilter, + const ::rtl::OUString& rServiceName, + const ::com::sun::star::awt::Rectangle& rShapeRect ); + + virtual void finalizeXShape( + ::oox::core::XmlFilterBase& rFilter, + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes ); + std::vector< ShapePtr > maChildren; // only used for group shapes TextBodyPtr mpTextBody; LinePropertiesPtr mpLinePropertiesPtr; @@ -204,7 +198,22 @@ protected: com::sun::star::awt::Point maPosition; private: - CreateShapeCallbackRef mxCreateCallback; + enum FrameType + { + FRAMETYPE_GENERIC, /// Generic shape, no special type. + FRAMETYPE_OLEOBJECT, /// OLE object embedded in a shape. + FRAMETYPE_CHART, /// Chart embedded in a shape. + FRAMETYPE_DIAGRAM, /// Complex diagram drawing shape. + FRAMETYPE_TABLE /// A table embedded in a shape. + }; + + typedef ::boost::shared_ptr< ::oox::vml::OleObjectInfo > OleObjectInfoRef; + typedef ::boost::shared_ptr< ChartShapeInfo > ChartShapeInfoRef; + + FrameType meFrameType; /// Type for graphic frame shapes. + OleObjectInfoRef mxOleObjectInfo; /// Additional data for OLE objects. + ChartShapeInfoRef mxChartShapeInfo; /// Additional data for chart shapes. + sal_Int32 mnRotation; sal_Bool mbFlipH; sal_Bool mbFlipV; @@ -213,6 +222,8 @@ private: ::rtl::OUString GetShapeType( sal_Int32 nType ); +// ============================================================================ + } } #endif // OOX_DRAWINGML_SHAPE_HXX diff --git a/oox/inc/oox/helper/attributelist.hxx b/oox/inc/oox/helper/attributelist.hxx index ad746771cab8..f2919e889994 100644 --- a/oox/inc/oox/helper/attributelist.hxx +++ b/oox/inc/oox/helper/attributelist.hxx @@ -43,6 +43,9 @@ namespace oox { class AttributeConversion { public: + /** Returns the XML token identifier from the passed string. */ + static sal_Int32 decodeToken( const ::rtl::OUString& rValue ); + /** Returns the decoded string value. All characters in the format '_xHHHH_' (H being a hexadecimal digit), will be decoded. */ static ::rtl::OUString decodeXString( const ::rtl::OUString& rValue ); diff --git a/oox/inc/oox/ole/axbinaryreader.hxx b/oox/inc/oox/ole/axbinaryreader.hxx index e3f102716e17..9b3cfae723b8 100755 --- a/oox/inc/oox/ole/axbinaryreader.hxx +++ b/oox/inc/oox/ole/axbinaryreader.hxx @@ -92,6 +92,8 @@ typedef ::std::vector< ::rtl::OUString > AxStringArray; // ============================================================================ +const sal_Char* const AX_GUID_CFONT = "{AFC20920-DA4E-11CE-B943-00AA006887B4}"; + const sal_uInt32 AX_FONTDATA_BOLD = 0x00000001; const sal_uInt32 AX_FONTDATA_ITALIC = 0x00000002; const sal_uInt32 AX_FONTDATA_UNDERLINE = 0x00000004; @@ -111,6 +113,7 @@ struct AxFontData sal_Int32 mnFontHeight; /// Height of the font (not really twips, see code). sal_Int32 mnFontCharSet; /// Windows character set of the font. sal_Int32 mnHorAlign; /// Horizontal text alignment. + bool mbDblUnderline; /// True = double underline style (legacy VML drawing controls only). explicit AxFontData(); diff --git a/oox/inc/oox/ole/axcontrol.hxx b/oox/inc/oox/ole/axcontrol.hxx index 8638a4869d72..8bc9cd622b2b 100644 --- a/oox/inc/oox/ole/axcontrol.hxx +++ b/oox/inc/oox/ole/axcontrol.hxx @@ -58,6 +58,9 @@ const sal_Char* const COMCTL_GUID_SCROLLBAR_60 = "{FE38753A-44A3-11D1-B5B7- const sal_Char* const COMCTL_GUID_PROGRESSBAR_50 = "{0713E8D2-850A-101B-AFC0-4210102A8DA7}"; const sal_Char* const COMCTL_GUID_PROGRESSBAR_60 = "{35053A22-8589-11D1-B16A-00C0F0283628}"; +const sal_uInt16 COMCTL_VERSION_50 = 5; +const sal_uInt16 COMCTL_VERSION_60 = 6; + // ---------------------------------------------------------------------------- const sal_Char* const AX_GUID_COMMANDBUTTON = "{D7053240-CE69-11CD-A777-00DD01143C57}"; @@ -79,6 +82,28 @@ const sal_uInt32 AX_SYSCOLOR_WINDOWTEXT = 0x80000008; const sal_uInt32 AX_SYSCOLOR_BUTTONFACE = 0x8000000F; const sal_uInt32 AX_SYSCOLOR_BUTTONTEXT = 0x80000012; +const sal_uInt32 AX_FLAGS_ENABLED = 0x00000002; +const sal_uInt32 AX_FLAGS_LOCKED = 0x00000004; +const sal_uInt32 AX_FLAGS_OPAQUE = 0x00000008; +const sal_uInt32 AX_FLAGS_COLUMNHEADS = 0x00000400; +const sal_uInt32 AX_FLAGS_ENTIREROWS = 0x00000800; +const sal_uInt32 AX_FLAGS_EXISTINGENTRIES = 0x00001000; +const sal_uInt32 AX_FLAGS_CAPTIONLEFT = 0x00002000; +const sal_uInt32 AX_FLAGS_EDITABLE = 0x00004000; +const sal_uInt32 AX_FLAGS_IMEMODE_MASK = 0x00078000; +const sal_uInt32 AX_FLAGS_DRAGENABLED = 0x00080000; +const sal_uInt32 AX_FLAGS_ENTERASNEWLINE = 0x00100000; +const sal_uInt32 AX_FLAGS_KEEPSELECTION = 0x00200000; +const sal_uInt32 AX_FLAGS_TABASCHARACTER = 0x00400000; +const sal_uInt32 AX_FLAGS_WORDWRAP = 0x00800000; +const sal_uInt32 AX_FLAGS_BORDERSSUPPRESSED = 0x02000000; +const sal_uInt32 AX_FLAGS_SELECTLINE = 0x04000000; +const sal_uInt32 AX_FLAGS_SINGLECHARSELECT = 0x08000000; +const sal_uInt32 AX_FLAGS_AUTOSIZE = 0x10000000; +const sal_uInt32 AX_FLAGS_HIDESELECTION = 0x20000000; +const sal_uInt32 AX_FLAGS_MAXLENAUTOTAB = 0x40000000; +const sal_uInt32 AX_FLAGS_MULTILINE = 0x80000000; + const sal_Int32 AX_BORDERSTYLE_NONE = 0; const sal_Int32 AX_BORDERSTYLE_SINGLE = 1; @@ -98,6 +123,26 @@ const sal_Int32 AX_PICALIGN_CENTER = 2; const sal_Int32 AX_PICALIGN_BOTTOMLEFT = 3; const sal_Int32 AX_PICALIGN_BOTTOMRIGHT = 4; +const sal_Int32 AX_DISPLAYSTYLE_TEXT = 1; +const sal_Int32 AX_DISPLAYSTYLE_LISTBOX = 2; +const sal_Int32 AX_DISPLAYSTYLE_COMBOBOX = 3; +const sal_Int32 AX_DISPLAYSTYLE_CHECKBOX = 4; +const sal_Int32 AX_DISPLAYSTYLE_OPTBUTTON = 5; +const sal_Int32 AX_DISPLAYSTYLE_TOGGLE = 6; +const sal_Int32 AX_DISPLAYSTYLE_DROPDOWN = 7; + +const sal_Int32 AX_SELCTION_SINGLE = 0; +const sal_Int32 AX_SELCTION_MULTI = 1; +const sal_Int32 AX_SELCTION_EXTENDED = 2; + +const sal_Int32 AX_SHOWDROPBUTTON_NEVER = 0; +const sal_Int32 AX_SHOWDROPBUTTON_FOCUS = 1; +const sal_Int32 AX_SHOWDROPBUTTON_ALWAYS = 2; + +const sal_Int32 AX_SCROLLBAR_NONE = 0x00; +const sal_Int32 AX_SCROLLBAR_HORIZONTAL = 0x01; +const sal_Int32 AX_SCROLLBAR_VERTICAL = 0x02; + // ---------------------------------------------------------------------------- /** Enumerates all UNO API control types supported by these filters. */ @@ -109,6 +154,7 @@ enum ApiControlType API_CONTROL_CHECKBOX, API_CONTROL_RADIOBUTTON, API_CONTROL_EDIT, + API_CONTROL_NUMERIC, API_CONTROL_LISTBOX, API_CONTROL_COMBOBOX, API_CONTROL_SPINBUTTON, @@ -182,6 +228,11 @@ public: PropertyMap& rPropMap, bool bHorizontal ) const; + /** Converts the vertical alignment to UNO properties. */ + void convertVerticalAlign( + PropertyMap& rPropMap, + sal_Int32 nVerticalAlign ) const; + /** Converts common scrollbar settings to UNO properties. */ void convertScrollBar( PropertyMap& rPropMap, @@ -289,8 +340,10 @@ public: /** Converts the control size to UNO properties. */ void convertSize( PropertyMap& rPropMap, const ControlConverter& rConv ) const; -protected: +public: // direct access needed for legacy VML drawing controls AxPairData maSize; /// Size of the control in 1/100 mm. + +protected: bool mbAwtModel; /// True = AWT control model, false = form component. }; @@ -410,8 +463,10 @@ public: /** Returns the font height in points. */ inline sal_Int16 getFontHeight() const { return maFontData.getHeightPoints(); } -protected: +public: // direct access needed for legacy VML drawing controls AxFontData maFontData; /// The font settings. + +private: bool mbSupportsAlign; /// True = UNO model supports Align property. }; @@ -430,13 +485,14 @@ public: virtual ApiControlType getControlType() const; virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const; -private: +public: // direct access needed for legacy VML drawing controls StreamDataSequence maPictureData; /// Binary picture stream. ::rtl::OUString maCaption; /// Visible caption of the button. sal_uInt32 mnTextColor; /// Text color. sal_uInt32 mnBackColor; /// Fill color. sal_uInt32 mnFlags; /// Various flags. sal_uInt32 mnPicturePos; /// Position of the picture relative to text. + sal_Int32 mnVerticalAlign; /// Vertical alignment (legacy VML drawing controls only). bool mbFocusOnClick; /// True = take focus on click. }; @@ -454,7 +510,7 @@ public: virtual ApiControlType getControlType() const; virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const; -private: +public: // direct access needed for legacy VML drawing controls ::rtl::OUString maCaption; /// Visible caption of the button. sal_uInt32 mnTextColor; /// Text color. sal_uInt32 mnBackColor; /// Fill color. @@ -462,6 +518,7 @@ private: sal_uInt32 mnBorderColor; /// Flat border color. sal_Int32 mnBorderStyle; /// Flat border style. sal_Int32 mnSpecialEffect; /// 3D border effect. + sal_Int32 mnVerticalAlign; /// Vertical alignment (legacy VML drawing controls only). }; // ============================================================================ @@ -504,7 +561,7 @@ public: virtual bool importBinaryModel( BinaryInputStream& rInStrm ); virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const; -protected: +public: // direct access needed for legacy VML drawing controls StreamDataSequence maPictureData; /// Binary picture stream. ::rtl::OUString maCaption; /// Visible caption of the button. ::rtl::OUString maValue; /// Current value of the control. @@ -524,6 +581,7 @@ protected: sal_Int32 mnMaxLength; /// Maximum character count. sal_Int32 mnPasswordChar; /// Password character in edit fields. sal_Int32 mnListRows; /// Number of rows in dropdown box. + sal_Int32 mnVerticalAlign; /// Vertical alignment (legacy VML drawing controls only). }; // ============================================================================ @@ -579,6 +637,18 @@ public: // ============================================================================ +/** Model for a numeric field (legacy drawing controls only). */ +class AxNumericFieldModel : public AxMorphDataModelBase +{ +public: + explicit AxNumericFieldModel(); + + virtual ApiControlType getControlType() const; + virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const; +}; + +// ============================================================================ + /** Model for a Forms 2.0 list box. */ class AxListBoxModel : public AxMorphDataModelBase { @@ -615,7 +685,7 @@ public: virtual ApiControlType getControlType() const; virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const; -private: +public: // direct access needed for legacy VML drawing controls sal_uInt32 mnArrowColor; /// Button arrow color. sal_uInt32 mnBackColor; /// Fill color. sal_uInt32 mnFlags; /// Various flags. @@ -641,7 +711,7 @@ public: virtual ApiControlType getControlType() const; virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const; -private: +public: // direct access needed for legacy VML drawing controls sal_uInt32 mnArrowColor; /// Button arrow color. sal_uInt32 mnBackColor; /// Fill color. sal_uInt32 mnFlags; /// Various flags. @@ -705,7 +775,7 @@ public: model from the 'f' stream. */ bool importClassTable( BinaryInputStream& rInStrm, AxClassTable& orClassTable ); -protected: +public: // direct access needed for legacy VML drawing controls StreamDataSequence maPictureData; /// Binary picture stream. ::rtl::OUString maCaption; /// Visible caption of the form. AxPairData maLogicalSize; /// Logical form size (scroll area). @@ -790,14 +860,27 @@ class EmbeddedControl { public: explicit EmbeddedControl( const ::rtl::OUString& rName ); - ~EmbeddedControl(); + virtual ~EmbeddedControl(); + + /** Creates and returns the internal control model of the specified type. */ + template< typename ModelType > + inline ModelType& createModel(); + + /** Creates and returns the internal control model of the specified type. */ + template< typename ModelType, typename ParamType > + inline ModelType& createModel( const ParamType& rParam ); /** Creates and returns the internal control model according to the passed MS class identifier. */ - ControlModelRef createModel( const ::rtl::OUString& rClassId ); + ControlModelBase* createModelFromGuid( const ::rtl::OUString& rClassId ); /** Returns true, if the internal control model exists. */ inline bool hasModel() const { return mxModel.get() != 0; } + /** Returns read-only access to the internal control model. */ + inline const ControlModelBase* getModel() const { return mxModel.get(); } + /** Returns read/write access to the internal control model. */ + inline ControlModelBase* getModel() { return mxModel.get(); } + /** Returns the UNO service name needed to construct the control model. */ ::rtl::OUString getServiceName() const; @@ -811,10 +894,30 @@ private: ::rtl::OUString maName; /// Name of the control. }; +// ---------------------------------------------------------------------------- + +template< typename ModelType > +inline ModelType& EmbeddedControl::createModel() +{ + ::boost::shared_ptr< ModelType > xModel( new ModelType ); + mxModel = xModel; + xModel->setFormComponentMode(); + return *xModel; +} + +template< typename ModelType, typename ParamType > +inline ModelType& EmbeddedControl::createModel( const ParamType& rParam ) +{ + ::boost::shared_ptr< ModelType > xModel( new ModelType( rParam ) ); + mxModel = xModel; + xModel->setFormComponentMode(); + return *xModel; +} + // ============================================================================ /** A wrapper for a control form embedded directly in a draw page. */ -class EmbeddedForm : public ControlConverter +class EmbeddedForm { public: explicit EmbeddedForm( @@ -823,20 +926,22 @@ public: const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr = true ); - /** Converts the passed ActiveX control and inserts it into the form. + /** Converts the passed control and inserts the control model into the form. @return The API control model, if conversion was successful. */ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > - convertAndInsert( const EmbeddedControl& rControl ); + convertAndInsert( const EmbeddedControl& rControl, sal_Int32& rnCtrlIndex ); -private: - /** Tries to insert the passed control model into the form. */ - bool insertControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel ); + /** Returns the XIndexContainer interface of the UNO control form, if existing. */ + inline ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > + getXForm() const { return mxFormIC; } +private: /** Creates the form that will hold the form controls. */ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > - createForm(); + createXForm(); private: + ControlConverter maControlConv; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxModelFactory; ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormsSupplier > mxFormsSupp; ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > mxFormIC; diff --git a/oox/inc/oox/ole/olehelper.hxx b/oox/inc/oox/ole/olehelper.hxx index ba46d3baf6df..f19efa835f4e 100644 --- a/oox/inc/oox/ole/olehelper.hxx +++ b/oox/inc/oox/ole/olehelper.hxx @@ -100,6 +100,10 @@ public: sal_uInt32 nOleColor, bool bDefaultColorBgr = true ); + /** Returns the OLE color from the passed UNO RGB color. + */ + static sal_uInt32 encodeOleColor( sal_Int32 nRgbColor ); + /** Imports a GUID from the passed binary stream and returns its string representation (in uppercase characters). */ diff --git a/oox/inc/oox/ole/vbahelper.hxx b/oox/inc/oox/ole/vbahelper.hxx index 76dc1c736025..a62a6bd06765 100755 --- a/oox/inc/oox/ole/vbahelper.hxx +++ b/oox/inc/oox/ole/vbahelper.hxx @@ -59,6 +59,7 @@ const sal_uInt16 VBA_ID_MODULETYPEPROCEDURAL = 0x0021; const sal_uInt16 VBA_ID_PROJECTCODEPAGE = 0x0003; const sal_uInt16 VBA_ID_PROJECTEND = 0x0010; const sal_uInt16 VBA_ID_PROJECTMODULES = 0x000F; +const sal_uInt16 VBA_ID_PROJECTNAME = 0x0004; const sal_uInt16 VBA_ID_PROJECTVERSION = 0x0009; // ============================================================================ diff --git a/oox/inc/oox/ole/vbaproject.hxx b/oox/inc/oox/ole/vbaproject.hxx index cb4562a2b7c5..6834fa08f252 100755 --- a/oox/inc/oox/ole/vbaproject.hxx +++ b/oox/inc/oox/ole/vbaproject.hxx @@ -37,8 +37,9 @@ namespace com { namespace sun { namespace star { namespace container { class XNameContainer; } namespace document { class XEventsSupplier; } namespace frame { class XModel; } - namespace script { class XLibraryContainer; } namespace lang { class XMultiServiceFactory; } + namespace script { class XLibraryContainer; } + namespace script { namespace vba { class XVBAMacroResolver; } } } } } namespace oox { class GraphicHelper; } @@ -70,6 +71,47 @@ private: // ============================================================================ +/** Base class for objects that attach a amcro to a specific action. + + Purpose is to collect objects that need to attach a VBA macro to an action. + The VBA project will be loaded at a very late point of the document import + process, because it depends on an initialized core document model (e.g. + spreadsheet codenames). Some objects that want to attach a VBA macro to an + action (e.g. mouse click action for drawing shapes) are loaded long before + the VBA project. The drawback is that in most cases macros are specified + without module name, or the VBA project name is part of the macro name. + In the former case, all code modules have to be scanned for the macro to be + able to create a valid script URL. + + The import code will register these requests to attach a VBA macro with an + instance of a class derived from this base class. The derived class will + store all information needed to finally attach the macro to the action, + once the VBA project has been imported. + */ +class VbaMacroAttacherBase +{ +public: + explicit VbaMacroAttacherBase( const ::rtl::OUString& rMacroName ); + virtual ~VbaMacroAttacherBase(); + + /** Resolves the internal macro name to the related macro URL, and attaches + the macro to the object. */ + void resolveAndAttachMacro( + const ::com::sun::star::uno::Reference< ::com::sun::star::script::vba::XVBAMacroResolver >& rxResolver ); + +private: + /** Called after the VBA project has been imported. Derived classes will + attach the passed script to the object represented by this instance. */ + virtual void attachMacro( const ::rtl::OUString& rScriptUrl ) = 0; + +private: + ::rtl::OUString maMacroName; +}; + +typedef ::boost::shared_ptr< VbaMacroAttacherBase > VbaMacroAttacherRef; + +// ============================================================================ + class OOX_DLLPUBLIC VbaProject : public VbaFilterConfig { public: @@ -88,6 +130,10 @@ public: const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr = true ); + /** Registers a macro atatcher object. For details, see description of the + VbaMacroAttacherBase class. */ + void registerMacroAttacher( const VbaMacroAttacherRef& rxAttacher ); + /** Returns true, if the document contains at least one code module. */ bool hasModules() const; /** Returns true, if the document contains the specified code module. */ @@ -254,8 +300,10 @@ protected: imported. */ void addDummyModule( const ::rtl::OUString& rName, sal_Int32 nType ); - /** Called when the import process of the VBA code modules starts. */ - virtual void prepareModuleImport(); + /** Called when the import process of the VBA project has been started. */ + virtual void prepareImport(); + /** Called when the import process of the VBA project is finished. */ + virtual void finalizeImport(); private: VbaProject( const VbaProject& ); @@ -280,11 +328,15 @@ private: const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ); + /** Attaches VBA macros to objects registered via registerMacroAttacher(). */ + void attachMacros(); + /** Copies the entire VBA project storage to the passed document model. */ void copyStorage( StorageBase& rVbaPrjStrg ); private: - typedef ::std::map< ::rtl::OUString, sal_Int32 > DummyModuleMap; + typedef RefVector< VbaMacroAttacherBase > MacroAttacherVector; + typedef ::std::map< ::rtl::OUString, sal_Int32 > DummyModuleMap; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxGlobalFactory; /// Global service factory. @@ -294,8 +346,9 @@ private: mxBasicLib; /// The Basic library of the document used for import. ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxDialogLib; /// The dialog library of the document used for import. + MacroAttacherVector maMacroAttachers; /// Objects that want to attach a VBA macro to an action. DummyModuleMap maDummyModules; /// Additional empty modules created on import. - const ::rtl::OUString maLibName; /// Name for Basic and dialog library used for import. + ::rtl::OUString maPrjName; /// Name of the VBA project. }; // ============================================================================ diff --git a/oox/inc/oox/ppt/pptimport.hxx b/oox/inc/oox/ppt/pptimport.hxx index c4ee29447c64..cb87d07329e3 100644 --- a/oox/inc/oox/ppt/pptimport.hxx +++ b/oox/inc/oox/ppt/pptimport.hxx @@ -68,6 +68,7 @@ public: private: virtual GraphicHelper* implCreateGraphicHelper() const; + virtual ::oox::ole::VbaProject* implCreateVbaProject() const; virtual ::rtl::OUString implGetImplementationName() const; private: diff --git a/oox/inc/oox/ppt/pptshape.hxx b/oox/inc/oox/ppt/pptshape.hxx index 3376e5bb1ace..be200859c6e6 100644 --- a/oox/inc/oox/ppt/pptshape.hxx +++ b/oox/inc/oox/ppt/pptshape.hxx @@ -48,7 +48,7 @@ public: using oox::drawingml::Shape::addShape; // addShape is creating and inserting the corresponding XShape. void addShape( - const oox::core::XmlFilterBase& rFilterBase, + oox::core::XmlFilterBase& rFilterBase, const SlidePersist& rPersist, const oox::drawingml::Theme* pTheme, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, diff --git a/oox/inc/oox/ppt/slidepersist.hxx b/oox/inc/oox/ppt/slidepersist.hxx index 31156a56ee84..e8c5d21448ce 100644 --- a/oox/inc/oox/ppt/slidepersist.hxx +++ b/oox/inc/oox/ppt/slidepersist.hxx @@ -111,7 +111,7 @@ public: oox::vml::Drawing* getDrawing() { return mpDrawingPtr.get(); } - void createXShapes( const oox::core::XmlFilterBase& rFilterBase ); + void createXShapes( oox::core::XmlFilterBase& rFilterBase ); void createBackground( const oox::core::XmlFilterBase& rFilterBase ); void applyTextStyles( const oox::core::XmlFilterBase& rFilterBase ); diff --git a/oox/inc/oox/vml/vmldrawing.hxx b/oox/inc/oox/vml/vmldrawing.hxx index 7bbeaef2f50d..0d87dae3138b 100644 --- a/oox/inc/oox/vml/vmldrawing.hxx +++ b/oox/inc/oox/vml/vmldrawing.hxx @@ -30,6 +30,7 @@ #include #include +#include #include "oox/ole/oleobjecthelper.hxx" namespace com { namespace sun { namespace star { @@ -37,17 +38,21 @@ namespace com { namespace sun { namespace star { namespace awt { class XControlModel; } namespace drawing { class XDrawPage; } namespace drawing { class XShape; } + namespace drawing { class XShapes; } } } } -namespace oox { namespace core { class XmlFilterBase; } } -namespace oox { namespace ole { class EmbeddedForm; } } +namespace oox { + namespace core { class XmlFilterBase; } + namespace ole { class EmbeddedControl; } + namespace ole { class EmbeddedForm; } +} namespace oox { namespace vml { class ShapeBase; class ShapeContainer; -struct ShapeClientData; +struct ClientData; // ============================================================================ @@ -114,6 +119,9 @@ public: /** Returns the form object used to process ActiveX form controls. */ ::oox::ole::EmbeddedForm& getControlForm() const; + /** Registers a block of shape identifiers reserved by this drawing. Block + size is 1024, shape identifiers are one-based (block 1 => 1025-2048). */ + void registerBlockId( sal_Int32 nBlockId ); /** Registers the passed embedded OLE object. The related shape will then load the OLE object data from the specified fragment. */ void registerOleObject( const OleObjectInfo& rOleObject ); @@ -125,36 +133,65 @@ public: void finalizeFragmentImport(); /** Creates and inserts all UNO shapes into the passed container. The virtual - function notifyShapeInserted() will be called for each new shape. */ + function notifyXShapeInserted() will be called for each new shape. */ void convertAndInsert() const; + /** Returns the local shape index from the passed global shape identifier. */ + sal_Int32 getLocalShapeIndex( const ::rtl::OUString& rShapeId ) const; /** Returns the registered info structure for an OLE object, if extant. */ const OleObjectInfo* getOleObjectInfo( const ::rtl::OUString& rShapeId ) const; /** Returns the registered info structure for a form control, if extant. */ const ControlInfo* getControlInfo( const ::rtl::OUString& rShapeId ) const; + /** Creates a new UNO shape object, inserts it into the passed UNO shape + container, and sets the shape position and size. */ + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createAndInsertXShape( + const ::rtl::OUString& rService, + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, + const ::com::sun::star::awt::Rectangle& rShapeRect ) const; + + /** Creates a new UNO shape object for a form control, inserts the control + model into the form, and the shape into the passed UNO shape container. */ + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createAndInsertXControlShape( + const ::oox::ole::EmbeddedControl& rControl, + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, + const ::com::sun::star::awt::Rectangle& rShapeRect, + sal_Int32& rnCtrlIndex ) const; + /** Derived classes may disable conversion of specific shapes. */ virtual bool isShapeSupported( const ShapeBase& rShape ) const; + /** Derived classes may return additional base names for automatic shape + name creation. */ + virtual ::rtl::OUString getShapeBaseName( const ShapeBase& rShape ) const; + /** Derived classes may calculate the shape rectangle from a non-standard anchor information string. */ - virtual bool convertShapeClientAnchor( + virtual bool convertClientAnchor( ::com::sun::star::awt::Rectangle& orShapeRect, const ::rtl::OUString& rShapeAnchor ) const; - /** Derived classes may convert additional form control properties from the - passed VML shape client data. */ - virtual void convertControlClientData( - const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel, - const ShapeClientData& rClientData ) const; - - /** Derived classes may want to know that a shape has been inserted. Will - be called from the convertAndInsert() implementation. */ - virtual void notifyShapeInserted( + /** Derived classes create a UNO shape according to the passed shape model. + Called for shape models that specify being under host control. */ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createAndInsertClientXShape( + const ShapeBase& rShape, + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, + const ::com::sun::star::awt::Rectangle& rShapeRect ) const; + + /** Derived classes may want to know that a UNO shape has been inserted. + Will be called from the convertAndInsert() implementation. + @param bGroupChild True = inserted into a group shape, + false = inserted directly into this drawing. */ + virtual void notifyXShapeInserted( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape, - const ::com::sun::star::awt::Rectangle& rShapeRect ); + const ::com::sun::star::awt::Rectangle& rShapeRect, + const ShapeBase& rShape, bool bGroupChild ); private: + typedef ::std::vector< sal_Int32 > BlockIdVector; typedef ::std::auto_ptr< ::oox::ole::EmbeddedForm > EmbeddedFormPtr; typedef ::std::auto_ptr< ShapeContainer > ShapeContainerPtr; typedef ::std::map< ::rtl::OUString, OleObjectInfo > OleObjectInfoMap; @@ -163,7 +200,8 @@ private: ::oox::core::XmlFilterBase& mrFilter; /// Filter object that imports/exports the VML drawing. ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mxDrawPage; /// UNO draw page used to insert the shapes. - mutable EmbeddedFormPtr mxCtrlForm; /// The control form used to process ActiveX controls. + mutable EmbeddedFormPtr mxCtrlForm; /// The control form used to process embedded controls. + mutable BlockIdVector maBlockIds; /// Block identifiers used by this drawing. ShapeContainerPtr mxShapes; /// All shapes and shape templates. OleObjectInfoMap maOleObjects; /// Info about all embedded OLE objects, mapped by shape id. ControlInfoMap maControls; /// Info about all embedded form controls, mapped by control name. diff --git a/oox/inc/oox/vml/vmlformatting.hxx b/oox/inc/oox/vml/vmlformatting.hxx index b496fed6d2e0..934be61e5a65 100644 --- a/oox/inc/oox/vml/vmlformatting.hxx +++ b/oox/inc/oox/vml/vmlformatting.hxx @@ -34,6 +34,7 @@ namespace oox { class GraphicHelper; class ModelObjectHelper; class PropertyMap; + namespace drawingml { class Color; } } namespace oox { @@ -112,6 +113,35 @@ public: bool bPixelX, bool bDefaultAsPixel ); + /** Converts VML color attributes to a DrawingML color. + + @param roVmlColor The VML string representation of the color. If + existing, this can be a 3-digit or 6-digit hexadecimal RGB value + with leading '#' character, a predefined color name (e.g. 'black', + 'red', etc.), the index into an application defined color palette + in brackets with leading color name (e.g. 'red [9]' or + 'windowColor [64]'), or a color modifier used in one-color + gradients (e.g. 'fill darken(128)' or 'fill lighten(0)'). + + @param roVmlOpacity The opacity of the color. If existing, this should + be a floating-point value in the range [0.0;1.0]. + + @param nDefaultRgb Deafult RGB color used if the parameter roVmlColor + is empty. + + @param nPrimaryRgb If set to something else than API_RGB_TRANSPARENT, + specifies the color to be used to resolve the color modifiers used + in one-color gradients. + + @return The resulting DrawingML color. + */ + static ::oox::drawingml::Color decodeColor( + const GraphicHelper& rGraphicHelper, + const OptValue< ::rtl::OUString >& roVmlColor, + const OptValue< double >& roVmlOpacity, + sal_Int32 nDefaultRgb, + sal_Int32 nPrimaryRgb = API_RGB_TRANSPARENT ); + private: ConversionHelper(); ~ConversionHelper(); diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx index 76599a787306..ee95c6b61e29 100644 --- a/oox/inc/oox/vml/vmlshape.hxx +++ b/oox/inc/oox/vml/vmlshape.hxx @@ -45,6 +45,19 @@ namespace vml { class Drawing; struct ShapeParentAnchor; class ShapeContainer; +class TextBox; + +// ============================================================================ + +const sal_Int32 VML_CLIENTDATA_UNCHECKED = 0; +const sal_Int32 VML_CLIENTDATA_CHECKED = 1; +const sal_Int32 VML_CLIENTDATA_MIXED = 2; + +const sal_Int32 VML_CLIENTDATA_TEXT = 0; +const sal_Int32 VML_CLIENTDATA_INTEGER = 1; +const sal_Int32 VML_CLIENTDATA_NUMBER = 2; +const sal_Int32 VML_CLIENTDATA_REFERENCE = 3; +const sal_Int32 VML_CLIENTDATA_FORMULA = 4; // ============================================================================ @@ -52,7 +65,7 @@ class ShapeContainer; struct ShapeTypeModel { ::rtl::OUString maShapeId; /// Unique identifier of the shape. - ::rtl::OUString maName; /// Name of the shape, if present. + ::rtl::OUString maShapeName; /// Name of the shape, if present. OptValue< sal_Int32 > moShapeType; /// Builtin shape type identifier. OptValue< Int32Pair > moCoordPos; /// Top-left position of coordinate system for children scaling. @@ -93,6 +106,8 @@ public: /** Returns the shape identifier (which is unique through the containing drawing). */ inline const ::rtl::OUString& getShapeId() const { return maTypeModel.maShapeId; } + /** Returns the application defined shape type. */ + sal_Int32 getShapeType() const; /** Returns the fragment path to the embedded graphic used by this shape. */ ::rtl::OUString getGraphicPath() const; @@ -116,19 +131,39 @@ protected: // ============================================================================ /** Excel specific shape client data (such as cell anchor). */ -struct ShapeClientData +struct ClientData { ::rtl::OUString maAnchor; /// Cell anchor as comma-separated string. - ::rtl::OUString maPictureLink; /// Target cell range of picture links. - ::rtl::OUString maLinkedCell; /// Link to value cell associated to the control. - ::rtl::OUString maSourceRange; /// Link to cell range used as data source for the control. + ::rtl::OUString maFmlaMacro; /// Link to macro associated to the control. + ::rtl::OUString maFmlaPict; /// Target cell range of picture links. + ::rtl::OUString maFmlaLink; /// Link to value cell associated to the control. + ::rtl::OUString maFmlaRange; /// Link to cell range used as data source for the control. + ::rtl::OUString maFmlaGroup; /// Link to value cell associated to a group of option buttons. sal_Int32 mnObjType; /// Type of the shape. + sal_Int32 mnTextHAlign; /// Horizontal text alignment. + sal_Int32 mnTextVAlign; /// Vertical text alignment. sal_Int32 mnCol; /// Column index for spreadsheet cell note. sal_Int32 mnRow; /// Row index for spreadsheet cell note. + sal_Int32 mnChecked; /// State for checkboxes and option buttons. + sal_Int32 mnDropStyle; /// Drop down box style (read-only or editable). + sal_Int32 mnDropLines; /// Number of lines in drop down box. + sal_Int32 mnVal; /// Current value of spin buttons and scroll bars. + sal_Int32 mnMin; /// Minimum value of spin buttons and scroll bars. + sal_Int32 mnMax; /// Maximum value of spin buttons and scroll bars. + sal_Int32 mnInc; /// Small increment of spin buttons and scroll bars. + sal_Int32 mnPage; /// Large increment of spin buttons and scroll bars. + sal_Int32 mnSelType; /// Listbox selection type. + sal_Int32 mnVTEdit; /// Data type of the textbox. bool mbPrintObject; /// True = print the object. bool mbVisible; /// True = cell note is visible. - - explicit ShapeClientData(); + bool mbDde; /// True = object is linked through DDE. + bool mbNo3D; /// True = flat style, false = 3D style. + bool mbNo3D2; /// True = flat style, false = 3D style (listboxes and dropdowns). + bool mbMultiLine; /// True = textbox allows line breaks. + bool mbVScroll; /// True = textbox has a vertical scrollbar. + bool mbSecretEdit; /// True = textbox is a password edit field. + + explicit ClientData(); }; // ---------------------------------------------------------------------------- @@ -136,16 +171,21 @@ struct ShapeClientData struct ShapeModel { typedef ::std::vector< ::com::sun::star::awt::Point > PointVector; - typedef ::std::auto_ptr< ShapeClientData > ShapeClientDataPtr; + typedef ::std::auto_ptr< TextBox > TextBoxPtr; + typedef ::std::auto_ptr< ClientData > ClientDataPtr; ::rtl::OUString maType; /// Shape template with default properties. PointVector maPoints; /// Points for the polyline shape. - ShapeClientDataPtr mxClientData; /// Excel specific shape client data. + TextBoxPtr mxTextBox; /// Text contents and properties. + ClientDataPtr mxClientData; /// Excel specific client data. explicit ShapeModel(); + ~ShapeModel(); + /** Creates and returns a new shape textbox structure. */ + TextBox& createTextBox(); /** Creates and returns a new shape client data structure. */ - ShapeClientData& createClientData(); + ClientData& createClientData(); }; // ---------------------------------------------------------------------------- @@ -160,9 +200,17 @@ public: /** Returns read access to the shape model structure. */ inline const ShapeModel& getShapeModel() const { return maShapeModel; } + /** Returns read access to the shape textbox. */ + inline const TextBox* getTextBox() const { return maShapeModel.mxTextBox.get(); } + /** Returns read access to the shape client data structure. */ + inline const ClientData* getClientData() const { return maShapeModel.mxClientData.get(); } + /** Final processing after import of the drawing fragment. */ virtual void finalizeFragmentImport(); + /** Returns the real shape name if existing, or a generated shape name. */ + ::rtl::OUString getShapeName() const; + /** Returns the shape template with the passed identifier from the child shapes. */ virtual const ShapeType* getChildTypeById( const ::rtl::OUString& rShapeId ) const; /** Returns the shape with the passed identifier from the child shapes. */ diff --git a/oox/inc/oox/vml/vmlshapecontainer.hxx b/oox/inc/oox/vml/vmlshapecontainer.hxx index d4f9ec7e7f8e..e1df24a9a6f8 100644 --- a/oox/inc/oox/vml/vmlshapecontainer.hxx +++ b/oox/inc/oox/vml/vmlshapecontainer.hxx @@ -59,6 +59,9 @@ public: explicit ShapeContainer( Drawing& rDrawing ); ~ShapeContainer(); + /** Returns the drawing this shape container is part of. */ + inline Drawing& getDrawing() { return mrDrawing; } + /** Creates and returns a new shape template object. */ ShapeType& createShapeType(); /** Creates and returns a new shape object of the specified type. */ diff --git a/oox/inc/oox/vml/vmlshapecontext.hxx b/oox/inc/oox/vml/vmlshapecontext.hxx index 92253e461227..7236fe7fef2c 100644 --- a/oox/inc/oox/vml/vmlshapecontext.hxx +++ b/oox/inc/oox/vml/vmlshapecontext.hxx @@ -33,10 +33,12 @@ namespace oox { namespace vml { +class Drawing; + struct ShapeTypeModel; class ShapeType; -struct ShapeClientData; +struct ClientData; struct ShapeModel; class ShapeBase; class GroupShape; @@ -45,20 +47,38 @@ class ShapeContainer; // ============================================================================ -class ShapeClientDataContext : public ::oox::core::ContextHandler2 +class ShapeLayoutContext : public ::oox::core::ContextHandler2 +{ +public: + explicit ShapeLayoutContext( + ::oox::core::ContextHandler2Helper& rParent, + Drawing& rDrawing ); + + virtual ::oox::core::ContextHandlerRef + onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); + +private: + Drawing& mrDrawing; +}; + +// ============================================================================ + +class ClientDataContext : public ::oox::core::ContextHandler2 { public: - explicit ShapeClientDataContext( + explicit ClientDataContext( ::oox::core::ContextHandler2Helper& rParent, - const AttributeList& rAttribs, - ShapeClientData& rClientData ); + ClientData& rClientData, + const AttributeList& rAttribs ); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); + virtual void onEndElement(); private: - ShapeClientData& mrClientData; + ClientData& mrClientData; + ::rtl::OUString maElementText; }; // ============================================================================ @@ -69,9 +89,9 @@ public: static ::oox::core::ContextHandlerRef createShapeContext( ::oox::core::ContextHandler2Helper& rParent, + ShapeContainer& rShapes, sal_Int32 nElement, - const AttributeList& rAttribs, - ShapeContainer& rShapes ); + const AttributeList& rAttribs ); protected: explicit ShapeContextBase( ::oox::core::ContextHandler2Helper& rParent ); @@ -84,8 +104,8 @@ class ShapeTypeContext : public ShapeContextBase public: explicit ShapeTypeContext( ::oox::core::ContextHandler2Helper& rParent, - const AttributeList& rAttribs, - ShapeType& rShapeType ); + ShapeType& rShapeType, + const AttributeList& rAttribs ); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); @@ -108,8 +128,8 @@ class ShapeContext : public ShapeTypeContext public: explicit ShapeContext( ::oox::core::ContextHandler2Helper& rParent, - const AttributeList& rAttribs, - ShapeBase& rShape ); + ShapeBase& rShape, + const AttributeList& rAttribs ); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); @@ -129,8 +149,8 @@ class GroupShapeContext : public ShapeContext public: explicit GroupShapeContext( ::oox::core::ContextHandler2Helper& rParent, - const AttributeList& rAttribs, - GroupShape& rShape ); + GroupShape& rShape, + const AttributeList& rAttribs ); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); diff --git a/oox/inc/oox/vml/vmltextbox.hxx b/oox/inc/oox/vml/vmltextbox.hxx new file mode 100755 index 000000000000..5aedaf86bc74 --- /dev/null +++ b/oox/inc/oox/vml/vmltextbox.hxx @@ -0,0 +1,95 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_VML_VMLTEXTBOX_HXX +#define OOX_VML_VMLTEXTBOX_HXX + +#include +#include +#include "oox/helper/helper.hxx" + +namespace oox { +namespace vml { + +// ============================================================================ + +/** Font settings for a text portion in a textbox. */ +struct TextFontModel +{ + OptValue< ::rtl::OUString > moName; /// Font name. + OptValue< ::rtl::OUString > moColor; /// Font color, HTML encoded, sort of. + OptValue< sal_Int32 > monSize; /// Font size in twips. + OptValue< sal_Int32 > monUnderline; /// Single or double underline. + OptValue< sal_Int32 > monEscapement; /// Subscript or superscript. + OptValue< bool > mobBold; + OptValue< bool > mobItalic; + OptValue< bool > mobStrikeout; + + explicit TextFontModel(); +}; + +// ============================================================================ + +/** A text portion in a textbox with the same formatting for all characters. */ +struct TextPortionModel +{ + TextFontModel maFont; + ::rtl::OUString maText; + + explicit TextPortionModel( const TextFontModel& rFont, const ::rtl::OUString& rText ); +}; + +// ============================================================================ + +/** The textbox contains all text contents and properties. */ +class TextBox +{ +public: + explicit TextBox(); + + /** Appends a new text portion to the textbox. */ + void appendPortion( const TextFontModel& rFont, const ::rtl::OUString& rText ); + + /** Returns the current number of text portions. */ + inline size_t getPortionCount() const { return maPortions.size(); } + /** Returns the font settings of the first text portion. */ + const TextFontModel* getFirstFont() const; + /** Returns the entire text of all text portions. */ + ::rtl::OUString getText() const; + +private: + typedef ::std::vector< TextPortionModel > PortionVector; + + PortionVector maPortions; +}; + +// ============================================================================ + +} // namespace vml +} // namespace oox + +#endif diff --git a/oox/inc/oox/vml/vmltextboxcontext.hxx b/oox/inc/oox/vml/vmltextboxcontext.hxx new file mode 100755 index 000000000000..1dc8832f9cc4 --- /dev/null +++ b/oox/inc/oox/vml/vmltextboxcontext.hxx @@ -0,0 +1,82 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_VML_VMLTEXTBOXCONTEXT_HXX +#define OOX_VML_VMLTEXTBOXCONTEXT_HXX + +#include "oox/core/contexthandler2.hxx" +#include "oox/vml/vmltextbox.hxx" + +namespace oox { +namespace vml { + +// ============================================================================ + +class TextPortionContext : public ::oox::core::ContextHandler2 +{ +public: + explicit TextPortionContext( + ::oox::core::ContextHandler2Helper& rParent, + TextBox& rTextBox, + const TextFontModel& rParentFont, + sal_Int32 nElement, + const AttributeList& rAttribs ); + + virtual ::oox::core::ContextHandlerRef + onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); + virtual void onCharacters( const ::rtl::OUString& rChars ); + virtual void onEndElement(); + +private: + TextBox& mrTextBox; + TextFontModel maFont; + size_t mnInitialPortions; +}; + +// ============================================================================ + +class TextBoxContext : public ::oox::core::ContextHandler2 +{ +public: + explicit TextBoxContext( + ::oox::core::ContextHandler2Helper& rParent, + TextBox& rTextBox, + const AttributeList& rAttribs ); + + virtual ::oox::core::ContextHandlerRef + onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); + +private: + TextBox& mrTextBox; +}; + +// ============================================================================ + +} // namespace vml +} // namespace oox + +#endif diff --git a/oox/inc/oox/xls/autofiltercontext.hxx b/oox/inc/oox/xls/autofiltercontext.hxx index ccef6972e871..83b1f4ff0ee8 100644 --- a/oox/inc/oox/xls/autofiltercontext.hxx +++ b/oox/inc/oox/xls/autofiltercontext.hxx @@ -85,7 +85,7 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onEndElement(); private: /** Initializes data members to prepare for autofilter parsing. Call this diff --git a/oox/inc/oox/xls/chartsheetfragment.hxx b/oox/inc/oox/xls/chartsheetfragment.hxx index dc8e0f85fd13..58a6fdb5b54a 100644 --- a/oox/inc/oox/xls/chartsheetfragment.hxx +++ b/oox/inc/oox/xls/chartsheetfragment.hxx @@ -48,7 +48,7 @@ protected: // oox.core.ContextHandler2Helper interface ------------------------------- virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); diff --git a/oox/inc/oox/xls/commentsfragment.hxx b/oox/inc/oox/xls/commentsfragment.hxx index 584c6a2bb340..97788d635c15 100644 --- a/oox/inc/oox/xls/commentsfragment.hxx +++ b/oox/inc/oox/xls/commentsfragment.hxx @@ -46,7 +46,8 @@ protected: // oox.core.ContextHandler2Helper interface ------------------------------- virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); + virtual void onEndElement(); virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); virtual void onEndRecord(); diff --git a/oox/inc/oox/xls/condformatcontext.hxx b/oox/inc/oox/xls/condformatcontext.hxx index 799e3127b7a3..492c1db1beb7 100644 --- a/oox/inc/oox/xls/condformatcontext.hxx +++ b/oox/inc/oox/xls/condformatcontext.hxx @@ -46,7 +46,7 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); virtual void onStartRecord( RecordInputStream& rStrm ); diff --git a/oox/inc/oox/xls/defnamesbuffer.hxx b/oox/inc/oox/xls/defnamesbuffer.hxx index 45208f0ac344..fa9715022c9f 100644 --- a/oox/inc/oox/xls/defnamesbuffer.hxx +++ b/oox/inc/oox/xls/defnamesbuffer.hxx @@ -138,6 +138,8 @@ public: inline bool isBuiltinName() const { return mcBuiltinId != OOX_DEFNAME_UNKNOWN; } /** Returns true, if this defined name is a macro function call. */ inline bool isMacroFunction() const { return maModel.mbMacro && maModel.mbFunction; } + /** Returns true, if this defined name is a reference to a VBA macro. */ + inline bool isVBName() const { return maModel.mbMacro && maModel.mbVBName; } /** Returns true, if this defined name is global in the document. */ inline bool isGlobalName() const { return mnCalcSheet < 0; } @@ -218,4 +220,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/drawingfragment.hxx b/oox/inc/oox/xls/drawingfragment.hxx index 95973e55c655..0b4dba0bbd53 100644 --- a/oox/inc/oox/xls/drawingfragment.hxx +++ b/oox/inc/oox/xls/drawingfragment.hxx @@ -31,14 +31,24 @@ #include #include #include "oox/drawingml/shape.hxx" +#include "oox/drawingml/shapegroupcontext.hxx" #include "oox/ole/axcontrol.hxx" +#include "oox/ole/vbaproject.hxx" #include "oox/vml/vmldrawing.hxx" #include "oox/vml/vmldrawingfragment.hxx" +#include "oox/vml/vmltextbox.hxx" #include "oox/xls/excelhandlers.hxx" +namespace oox { namespace ole { + struct AxFontData; + class AxMorphDataModelBase; +} } + namespace oox { namespace xls { +// ============================================================================ +// DrawingML // ============================================================================ /** Absolute position in spreadsheet (in EMUs) independent from cells. */ @@ -101,6 +111,7 @@ public: void importClientData( const AttributeList& rAttribs ); /** Sets an attribute of the cell-dependent anchor position from xdr:from and xdr:to elements. */ void setCellPos( sal_Int32 nElement, sal_Int32 nParentContext, const ::rtl::OUString& rValue ); + /** Imports and converts the VML specific client anchor. */ void importVmlAnchor( const ::rtl::OUString& rAnchor ); /** Returns true, if the anchor contains valid position and size settings. */ @@ -132,6 +143,67 @@ typedef ::boost::shared_ptr< ShapeAnchor > ShapeAnchorRef; // ============================================================================ +class ShapeMacroAttacher : public ::oox::ole::VbaMacroAttacherBase +{ +public: + explicit ShapeMacroAttacher( const ::rtl::OUString& rMacroName, + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape ); + +private: + virtual void attachMacro( const ::rtl::OUString& rMacroUrl ); + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxShape; +}; + +// ============================================================================ + +class Shape : public ::oox::drawingml::Shape, public WorksheetHelper +{ +public: + explicit Shape( + const WorksheetHelper& rHelper, + const AttributeList& rAttribs, + const sal_Char* pcServiceName = 0 ); + +protected: + virtual void finalizeXShape( + ::oox::core::XmlFilterBase& rFilter, + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes ); + +private: + ::rtl::OUString maMacroName; +}; + +// ============================================================================ + +/** Context handler for creation of shapes embedded in group shapes. */ +class OoxGroupShapeContext : public ::oox::drawingml::ShapeGroupContext, public WorksheetHelper +{ +public: + explicit OoxGroupShapeContext( + ::oox::core::ContextHandler& rParent, + const WorksheetHelper& rHelper, + const ::oox::drawingml::ShapePtr& rxShape ); + + static ::oox::core::ContextHandlerRef + createShapeContext( + ::oox::core::ContextHandler& rParent, + const WorksheetHelper& rHelper, + sal_Int32 nElement, + const AttributeList& rAttribs, + ::oox::drawingml::ShapePtr* pxShape = 0 ); + +protected: + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL + createFastChildContext( + sal_Int32 nElement, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs ) + throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); +}; + +// ============================================================================ + /** Fragment handler for a complete sheet drawing. */ class OoxDrawingFragment : public OoxWorksheetFragmentBase { @@ -144,7 +216,8 @@ protected: // oox.core.ContextHandler2Helper interface ------------------------------- virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); + virtual void onEndElement(); private: ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > @@ -155,6 +228,27 @@ private: ShapeAnchorRef mxAnchor; /// Current anchor of top-level shape. }; +// ============================================================================ +// VML +// ============================================================================ + +class VmlControlMacroAttacher : public ::oox::ole::VbaMacroAttacherBase +{ +public: + explicit VmlControlMacroAttacher( const ::rtl::OUString& rMacroName, + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& rxCtrlFormIC, + sal_Int32 nCtrlIndex, sal_Int32 nCtrlType, sal_Int32 nDropStyle ); + +private: + virtual void attachMacro( const ::rtl::OUString& rMacroUrl ); + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > mxCtrlFormIC; + sal_Int32 mnCtrlIndex; + sal_Int32 mnCtrlType; + sal_Int32 mnDropStyle; +}; + // ============================================================================ class VmlDrawing : public ::oox::vml::Drawing, public WorksheetHelper @@ -168,24 +262,47 @@ public: /** Filters cell note shapes. */ virtual bool isShapeSupported( const ::oox::vml::ShapeBase& rShape ) const; + /** Returns additional base names for automatic shape name creation. */ + virtual ::rtl::OUString getShapeBaseName( const ::oox::vml::ShapeBase& rShape ) const; + /** Calculates the shape rectangle from a cell anchor string. */ - virtual bool convertShapeClientAnchor( + virtual bool convertClientAnchor( ::com::sun::star::awt::Rectangle& orShapeRect, const ::rtl::OUString& rShapeAnchor ) const; - /** Converts additional form control properties from the passed VML shape - client data. */ - virtual void convertControlClientData( - const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel, - const ::oox::vml::ShapeClientData& rClientData ) const; + /** Creates a UNO control shape for legacy drawing controls. */ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createAndInsertClientXShape( + const ::oox::vml::ShapeBase& rShape, + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, + const ::com::sun::star::awt::Rectangle& rShapeRect ) const; /** Updates the bounding box covering all shapes of this drawing. */ - virtual void notifyShapeInserted( + virtual void notifyXShapeInserted( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape, - const ::com::sun::star::awt::Rectangle& rShapeRect ); + const ::com::sun::star::awt::Rectangle& rShapeRect, + const ::oox::vml::ShapeBase& rShape, bool bGroupChild ); + +private: + /** Converts the passed VML textbox text color to an OLE color. */ + sal_uInt32 convertControlTextColor( const ::rtl::OUString& rTextColor ) const; + /** Converts the passed VML textbox font to an ActiveX form control font. */ + void convertControlFontData( + ::oox::ole::AxFontData& rAxFontData, sal_uInt32& rnOleTextColor, + const ::oox::vml::TextFontModel& rFontModel ) const; + /** Converts the caption, the font settings, and the horizontal alignment + from the passed VML textbox to ActiveX form control settings. */ + void convertControlText( + ::oox::ole::AxFontData& rAxFontData, sal_uInt32& rnOleTextColor, ::rtl::OUString& rCaption, + const ::oox::vml::TextBox* pTextBox, sal_Int32 nTextHAlign ) const; + /** Converts the passed VML shape background formatting to ActiveX control formatting. */ + void convertControlBackground( + ::oox::ole::AxMorphDataModelBase& rAxModel, + const ::oox::vml::ShapeBase& rShape ) const; private: ::oox::ole::ControlConverter maControlConv; + ::oox::vml::TextFontModel maListBoxFont; }; // ============================================================================ @@ -207,4 +324,3 @@ protected: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/excelfilter.hxx b/oox/inc/oox/xls/excelfilter.hxx index b5d7a97f33b5..0b293cf57193 100644 --- a/oox/inc/oox/xls/excelfilter.hxx +++ b/oox/inc/oox/xls/excelfilter.hxx @@ -72,6 +72,7 @@ public: private: virtual GraphicHelper* implCreateGraphicHelper() const; + virtual ::oox::ole::VbaProject* implCreateVbaProject() const; virtual ::rtl::OUString implGetImplementationName() const; }; @@ -89,6 +90,7 @@ public: private: virtual GraphicHelper* implCreateGraphicHelper() const; + virtual ::oox::ole::VbaProject* implCreateVbaProject() const; virtual ::rtl::OUString implGetImplementationName() const; }; @@ -98,4 +100,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/excelvbaproject.hxx b/oox/inc/oox/xls/excelvbaproject.hxx index 9726cbdc923c..f2a9aebd988a 100755 --- a/oox/inc/oox/xls/excelvbaproject.hxx +++ b/oox/inc/oox/xls/excelvbaproject.hxx @@ -41,10 +41,10 @@ namespace xls { // ============================================================================ /** Special implementation of the VBA project for the Excel filters. */ -class OOX_DLLPUBLIC VbaProject : public ::oox::ole::VbaProject +class OOX_DLLPUBLIC ExcelVbaProject : public ::oox::ole::VbaProject { public: - explicit VbaProject( + explicit ExcelVbaProject( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory, const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument >& rxDocument ); @@ -53,7 +53,9 @@ public: protected: /** Adds dummy modules for sheets without imported code name. */ - virtual void prepareModuleImport(); + virtual void prepareImport(); + /** Attaches document and sheet events to macros. */ + virtual void finalizeImport(); private: /** Attaches VBA macros to all supported document events. */ diff --git a/oox/inc/oox/xls/externallinkbuffer.hxx b/oox/inc/oox/xls/externallinkbuffer.hxx index b9980cc21e2f..7a4cf26fecb2 100644 --- a/oox/inc/oox/xls/externallinkbuffer.hxx +++ b/oox/inc/oox/xls/externallinkbuffer.hxx @@ -248,6 +248,9 @@ public: /** Imports the EXTERNALNAME record from the passed stream. */ void importExternalName( BiffInputStream& rStrm ); + /** Sets the link type to 'self reference'. */ + inline void setSelfLinkType() { meLinkType = LINKTYPE_SELF; } + /** Returns the type of this external link. */ inline ExternalLinkType getLinkType() const { return meLinkType; } /** Returns true, if the link refers to the current workbook. */ @@ -368,7 +371,7 @@ public: getLinkInfos() const; /** Returns the external link for the passed reference identifier. */ - ExternalLinkRef getExternalLink( sal_Int32 nRefId ) const; + ExternalLinkRef getExternalLink( sal_Int32 nRefId, bool bUseRefSheets = true ) const; /** Returns the sheet range for the specified reference (BIFF2-BIFF5 only). */ LinkSheetRange getSheetRange( sal_Int32 nRefId, sal_Int16 nTabId1, sal_Int16 nTabId2 ) const; @@ -386,6 +389,7 @@ private: typedef RefVector< ExternalLink > ExternalLinkVec; typedef ::std::vector< RefSheetsModel > RefSheetsModelVec; + ExternalLinkRef mxSelfRef; /// Implicit self reference at index 0. ExternalLinkVec maLinks; /// List of link structures for all kinds of links. ExternalLinkVec maExtLinks; /// Real external links needed for formula parser. RefSheetsModelVec maRefSheets; /// Sheet indexes for reference ids. @@ -398,4 +402,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/externallinkfragment.hxx b/oox/inc/oox/xls/externallinkfragment.hxx index ec310974818a..c651f4f2f0a5 100644 --- a/oox/inc/oox/xls/externallinkfragment.hxx +++ b/oox/inc/oox/xls/externallinkfragment.hxx @@ -54,7 +54,7 @@ protected: // oox.core.ContextHandler2Helper interface ------------------------------- virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); @@ -97,7 +97,8 @@ protected: // oox.core.ContextHandler2Helper interface ------------------------------- virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); + virtual void onEndElement(); virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); diff --git a/oox/inc/oox/xls/formulaparser.hxx b/oox/inc/oox/xls/formulaparser.hxx index 0227e8efee6d..599a8af7bf46 100644 --- a/oox/inc/oox/xls/formulaparser.hxx +++ b/oox/inc/oox/xls/formulaparser.hxx @@ -157,6 +157,9 @@ public: BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize = 0 ) const; + /** Converts the passed formula to a macro name for a drawing shape. */ + ::rtl::OUString importMacroName( const ::rtl::OUString& rFormulaString ); + private: ::std::auto_ptr< FormulaParserImpl > mxImpl; }; @@ -167,4 +170,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/richstringcontext.hxx b/oox/inc/oox/xls/richstringcontext.hxx index 53882641df7e..7b5992db2871 100644 --- a/oox/inc/oox/xls/richstringcontext.hxx +++ b/oox/inc/oox/xls/richstringcontext.hxx @@ -46,7 +46,7 @@ protected: // oox.core.ContextHandler2Helper interface ------------------------------- virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); private: RichStringRef mxString; /// Processed string. diff --git a/oox/inc/oox/xls/sheetdatacontext.hxx b/oox/inc/oox/xls/sheetdatacontext.hxx index a77f4b285fa4..7fd7c9b915b5 100644 --- a/oox/inc/oox/xls/sheetdatacontext.hxx +++ b/oox/inc/oox/xls/sheetdatacontext.hxx @@ -54,7 +54,8 @@ protected: // oox.core.ContextHandler2Helper interface ------------------------------- virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); + virtual void onEndElement(); virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); diff --git a/oox/inc/oox/xls/workbookfragment.hxx b/oox/inc/oox/xls/workbookfragment.hxx index f9f0bb25c78f..b499704e62cb 100644 --- a/oox/inc/oox/xls/workbookfragment.hxx +++ b/oox/inc/oox/xls/workbookfragment.hxx @@ -49,7 +49,7 @@ protected: // oox.core.ContextHandler2Helper interface ------------------------------- virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); diff --git a/oox/inc/oox/xls/worksheetfragment.hxx b/oox/inc/oox/xls/worksheetfragment.hxx index 7234153d7dd3..6b3b5357bb44 100644 --- a/oox/inc/oox/xls/worksheetfragment.hxx +++ b/oox/inc/oox/xls/worksheetfragment.hxx @@ -44,7 +44,8 @@ protected: // oox.core.ContextHandler2Helper interface ------------------------------- virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); + virtual void onEndElement(); virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); @@ -74,7 +75,7 @@ protected: // oox.core.ContextHandler2Helper interface ------------------------------- virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); diff --git a/oox/source/core/binarycodec.cxx b/oox/source/core/binarycodec.cxx index 6127524c2aae..b2c117a12d90 100644 --- a/oox/source/core/binarycodec.cxx +++ b/oox/source/core/binarycodec.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "oox/core/binarycodec.hxx" + #include #include #include "oox/helper/attributelist.hxx" @@ -387,4 +388,3 @@ bool BinaryCodec_RCF::skip( sal_Int32 nBytes ) } // namespace core } // namespace oox - diff --git a/oox/source/core/binaryfilterbase.cxx b/oox/source/core/binaryfilterbase.cxx index f308f02ac9dc..9eb476920a4b 100644 --- a/oox/source/core/binaryfilterbase.cxx +++ b/oox/source/core/binaryfilterbase.cxx @@ -26,19 +26,22 @@ ************************************************************************/ #include "oox/core/binaryfilterbase.hxx" -#include "oox/ole/olestorage.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::io::XStream; +#include "oox/ole/olestorage.hxx" namespace oox { namespace core { // ============================================================================ +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + BinaryFilterBase::BinaryFilterBase( const Reference< XMultiServiceFactory >& rxGlobalFactory ) : FilterBase( rxGlobalFactory ) { @@ -64,4 +67,3 @@ StorageRef BinaryFilterBase::implCreateStorage( const Reference< XStream >& rxOu } // namespace core } // namespace oox - diff --git a/oox/source/core/contexthandler.cxx b/oox/source/core/contexthandler.cxx index b9c7cb48377e..c2d6fa928576 100644 --- a/oox/source/core/contexthandler.cxx +++ b/oox/source/core/contexthandler.cxx @@ -26,21 +26,21 @@ ************************************************************************/ #include "oox/core/contexthandler.hxx" -#include "oox/core/fragmenthandler.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::xml::sax::SAXException; -using ::com::sun::star::xml::sax::XFastAttributeList; -using ::com::sun::star::xml::sax::XFastContextHandler; -using ::com::sun::star::xml::sax::XLocator; +#include "oox/core/fragmenthandler.hxx" namespace oox { namespace core { // ============================================================================ +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +using ::rtl::OUString; + +// ============================================================================ + ContextHandler::ContextHandler( ContextHandler& rParent ) : ContextHandlerImplBase(), mxBaseData( rParent.mxBaseData ) @@ -150,4 +150,3 @@ void ContextHandler::endRecord( sal_Int32 ) } // namespace core } // namespace oox - diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx index 0f39ba313e6b..0cb7017372da 100644 --- a/oox/source/core/contexthandler2.cxx +++ b/oox/source/core/contexthandler2.cxx @@ -28,36 +28,29 @@ #include "oox/core/contexthandler2.hxx" #include -using ::rtl::OUString; -using ::rtl::OUStringBuffer; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::xml::sax::SAXException; -using ::com::sun::star::xml::sax::XFastAttributeList; -using ::com::sun::star::xml::sax::XFastContextHandler; - namespace oox { namespace core { // ============================================================================ -/** Information about a processed context element. */ -struct ContextInfo +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +// ============================================================================ + +/** Information about a processed element. */ +struct ElementInfo { - OUStringBuffer maCurrChars; /// Collected characters from context. - OUStringBuffer maFinalChars; /// Finalized (stipped) characters. + OUStringBuffer maChars; /// Collected element characters. sal_Int32 mnElement; /// The element identifier. bool mbTrimSpaces; /// True = trims leading/trailing spaces from text data. - explicit ContextInfo(); + inline explicit ElementInfo() : mnElement( XML_TOKEN_INVALID ), mbTrimSpaces( false ) {} }; -ContextInfo::ContextInfo() : - mnElement( XML_TOKEN_INVALID ), - mbTrimSpaces( false ) -{ -} - // ============================================================================ ContextHandler2Helper::ContextHandler2Helper( bool bEnableTrimSpace ) : @@ -65,7 +58,7 @@ ContextHandler2Helper::ContextHandler2Helper( bool bEnableTrimSpace ) : mnRootStackSize( 0 ), mbEnableTrimSpace( bEnableTrimSpace ) { - pushContextInfo( XML_ROOT_CONTEXT ); + pushElementInfo( XML_ROOT_CONTEXT ); } ContextHandler2Helper::ContextHandler2Helper( const ContextHandler2Helper& rParent ) : @@ -84,7 +77,7 @@ sal_Int32 ContextHandler2Helper::getCurrentElement() const return mxContextStack->empty() ? XML_ROOT_CONTEXT : mxContextStack->back().mnElement; } -sal_Int32 ContextHandler2Helper::getPreviousElement( sal_Int32 nCountBack ) const +sal_Int32 ContextHandler2Helper::getParentElement( sal_Int32 nCountBack ) const { if( (nCountBack < 0) || (mxContextStack->size() < static_cast< size_t >( nCountBack )) ) return XML_TOKEN_INVALID; @@ -97,38 +90,39 @@ bool ContextHandler2Helper::isRootElement() const return mxContextStack->size() == mnRootStackSize + 1; } -Reference< XFastContextHandler > ContextHandler2Helper::implCreateChildContext( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) +Reference< XFastContextHandler > ContextHandler2Helper::implCreateChildContext( + sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) { - appendCollectedChars(); + // #i76091# process collected characters (calls onCharacters() if needed) + processCollectedChars(); ContextHandlerRef xContext = onCreateContext( nElement, AttributeList( rxAttribs ) ); return Reference< XFastContextHandler >( xContext.get() ); } -void ContextHandler2Helper::implStartCurrentContext( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) +void ContextHandler2Helper::implStartElement( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) { AttributeList aAttribs( rxAttribs ); - pushContextInfo( nElement ).mbTrimSpaces = aAttribs.getToken( NMSP_XML | XML_space, XML_TOKEN_INVALID ) != XML_preserve; + pushElementInfo( nElement ).mbTrimSpaces = aAttribs.getToken( NMSP_XML | XML_space, XML_TOKEN_INVALID ) != XML_preserve; onStartElement( aAttribs ); } void ContextHandler2Helper::implCharacters( const OUString& rChars ) { - // #i76091# collect characters until context ends + // #i76091# collect characters until new element starts or this element ends if( !mxContextStack->empty() ) - mxContextStack->back().maCurrChars.append( rChars ); + mxContextStack->back().maChars.append( rChars ); } -void ContextHandler2Helper::implEndCurrentContext( sal_Int32 nElement ) +void ContextHandler2Helper::implEndElement( sal_Int32 nElement ) { (void)nElement; // prevent "unused parameter" warning in product build - OSL_ENSURE( getCurrentElement() == nElement, "ContextHandler2Helper::implEndCurrentContext - context stack broken" ); + OSL_ENSURE( getCurrentElement() == nElement, "ContextHandler2Helper::implEndElement - context stack broken" ); if( !mxContextStack->empty() ) { - // #i76091# process collected characters - appendCollectedChars(); - // finalize the current context and pop context info from stack - onEndElement( mxContextStack->back().maFinalChars.makeStringAndClear() ); - popContextInfo(); + // #i76091# process collected characters (calls onCharacters() if needed) + processCollectedChars(); + onEndElement(); + popElementInfo(); } } @@ -139,7 +133,7 @@ ContextHandlerRef ContextHandler2Helper::implCreateRecordContext( sal_Int32 nRec void ContextHandler2Helper::implStartRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) { - pushContextInfo( nRecId ); + pushElementInfo( nRecId ); onStartRecord( rStrm ); } @@ -149,42 +143,44 @@ void ContextHandler2Helper::implEndRecord( sal_Int32 nRecId ) OSL_ENSURE( getCurrentElement() == nRecId, "ContextHandler2Helper::implEndRecord - context stack broken" ); if( !mxContextStack->empty() ) { - // finalize the current context and pop context info from stack onEndRecord(); - popContextInfo(); + popElementInfo(); } } -ContextInfo& ContextHandler2Helper::pushContextInfo( sal_Int32 nElement ) +ElementInfo& ContextHandler2Helper::pushElementInfo( sal_Int32 nElement ) { mxContextStack->resize( mxContextStack->size() + 1 ); - ContextInfo& rInfo = mxContextStack->back(); + ElementInfo& rInfo = mxContextStack->back(); rInfo.mnElement = nElement; return rInfo; } -void ContextHandler2Helper::popContextInfo() +void ContextHandler2Helper::popElementInfo() { - OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::popContextInfo - context stack broken" ); + OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::popElementInfo - context stack broken" ); if( !mxContextStack->empty() ) mxContextStack->pop_back(); } -void ContextHandler2Helper::appendCollectedChars() +void ContextHandler2Helper::processCollectedChars() { - OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::appendCollectedChars - no context info" ); - ContextInfo& rInfo = mxContextStack->back(); - if( rInfo.maCurrChars.getLength() > 0 ) + OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::processCollectedChars - no context info" ); + ElementInfo& rInfo = mxContextStack->back(); + if( rInfo.maChars.getLength() > 0 ) { - OUString aChars = rInfo.maCurrChars.makeStringAndClear(); - rInfo.maFinalChars.append( (mbEnableTrimSpace && rInfo.mbTrimSpaces) ? aChars.trim() : aChars ); + OUString aChars = rInfo.maChars.makeStringAndClear(); + if( mbEnableTrimSpace && rInfo.mbTrimSpaces ) + aChars = aChars.trim(); + if( aChars.getLength() > 0 ) + onCharacters( aChars ); } } // ============================================================================ ContextHandler2::ContextHandler2( ContextHandler2Helper& rParent ) : - ContextHandler( rParent.queryContextHandler() ), + ContextHandler( dynamic_cast< ContextHandler& >( rParent ) ), ContextHandler2Helper( rParent ) { } @@ -193,11 +189,6 @@ ContextHandler2::~ContextHandler2() { } -ContextHandler& ContextHandler2::queryContextHandler() -{ - return *this; -} - // com.sun.star.xml.sax.XFastContextHandler interface ------------------------- Reference< XFastContextHandler > SAL_CALL ContextHandler2::createFastChildContext( @@ -209,7 +200,7 @@ Reference< XFastContextHandler > SAL_CALL ContextHandler2::createFastChildContex void SAL_CALL ContextHandler2::startFastElement( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) throw( SAXException, RuntimeException ) { - implStartCurrentContext( nElement, rxAttribs ); + implStartElement( nElement, rxAttribs ); } void SAL_CALL ContextHandler2::characters( const OUString& rChars ) throw( SAXException, RuntimeException ) @@ -219,7 +210,7 @@ void SAL_CALL ContextHandler2::characters( const OUString& rChars ) throw( SAXEx void SAL_CALL ContextHandler2::endFastElement( sal_Int32 nElement ) throw( SAXException, RuntimeException ) { - implEndCurrentContext( nElement ); + implEndElement( nElement ); } // oox.core.RecordContext interface ------------------------------------------- @@ -250,7 +241,11 @@ void ContextHandler2::onStartElement( const AttributeList& ) { } -void ContextHandler2::onEndElement( const OUString& ) +void ContextHandler2::onCharacters( const OUString& ) +{ +} + +void ContextHandler2::onEndElement() { } @@ -271,4 +266,3 @@ void ContextHandler2::onEndRecord() } // namespace core } // namespace oox - diff --git a/oox/source/core/facreg.cxx b/oox/source/core/facreg.cxx index de6212984093..6d62f0ec34a8 100644 --- a/oox/source/core/facreg.cxx +++ b/oox/source/core/facreg.cxx @@ -37,8 +37,8 @@ #include #include -using namespace rtl; -using namespace com::sun::star; +using ::rtl::OUString; +using namespace ::com::sun::star; #define SERVICE( className ) \ extern OUString SAL_CALL className##_getImplementationName() throw(); \ diff --git a/oox/source/core/fasttokenhandler.cxx b/oox/source/core/fasttokenhandler.cxx index c662828bc583..547570e29439 100644 --- a/oox/source/core/fasttokenhandler.cxx +++ b/oox/source/core/fasttokenhandler.cxx @@ -26,20 +26,23 @@ ************************************************************************/ #include "oox/core/fasttokenhandler.hxx" + #include #include "oox/token/tokenmap.hxx" -using ::rtl::OUString; -using ::osl::Mutex; -using ::osl::MutexGuard; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::RuntimeException; - namespace oox { namespace core { // ============================================================================ +using namespace ::com::sun::star::uno; + +using ::osl::Mutex; +using ::osl::MutexGuard; +using ::rtl::OUString; + +// ============================================================================ + namespace { Mutex& lclGetTokenMutex() @@ -89,4 +92,3 @@ sal_Int32 FastTokenHandler::getTokenFromUTF8( const Sequence< sal_Int8 >& rIdent } // namespace core } // namespace oox - diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx old mode 100644 new mode 100755 index fb9e43c732de..8caca4e6295a --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -26,49 +26,42 @@ ************************************************************************/ #include "oox/core/filterbase.hxx" + #include #include #include #include +#include +#include #include #include #include -#include -#include -#include "tokens.hxx" #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/binaryoutputstream.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/modelobjecthelper.hxx" #include "oox/ole/oleobjecthelper.hxx" +#include "oox/ole/vbaproject.hxx" +#include "tokens.hxx" + +namespace oox { +namespace core { + +// ============================================================================ + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::graphic; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::task; +using namespace ::com::sun::star::uno; -using ::rtl::OUString; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; -using ::com::sun::star::lang::IllegalArgumentException; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::lang::XComponent; -using ::com::sun::star::beans::PropertyValue; -using ::com::sun::star::frame::XFrame; -using ::com::sun::star::frame::XModel; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::io::XOutputStream; -using ::com::sun::star::io::XStream; -using ::com::sun::star::task::XStatusIndicator; -using ::com::sun::star::task::XInteractionHandler; -using ::com::sun::star::graphic::XGraphic; using ::comphelper::MediaDescriptor; using ::comphelper::SequenceAsHashMap; using ::oox::ole::OleObjectHelper; - -namespace oox { -namespace core { +using ::oox::ole::VbaProject; +using ::rtl::OUString; // ============================================================================ @@ -133,6 +126,7 @@ struct FilterBaseImpl typedef ::boost::shared_ptr< GraphicHelper > GraphicHelperRef; typedef ::boost::shared_ptr< ModelObjectHelper > ModelObjHelperRef; typedef ::boost::shared_ptr< OleObjectHelper > OleObjHelperRef; + typedef ::boost::shared_ptr< VbaProject > VbaProjectRef; FilterDirection meDirection; SequenceAsHashMap maArguments; @@ -143,6 +137,7 @@ struct FilterBaseImpl GraphicHelperRef mxGraphicHelper; /// Graphic and graphic object handling. ModelObjHelperRef mxModelObjHelper; /// Tables to create new named drawing objects. OleObjHelperRef mxOleObjHelper; /// OLE object handling. + VbaProjectRef mxVbaProject; /// VBA project manager. Reference< XMultiServiceFactory > mxGlobalFactory; Reference< XModel > mxModel; @@ -392,6 +387,13 @@ OleObjectHelper& FilterBase::getOleObjectHelper() const return *mxImpl->mxOleObjHelper; } +VbaProject& FilterBase::getVbaProject() const +{ + if( !mxImpl->mxVbaProject ) + mxImpl->mxVbaProject.reset( implCreateVbaProject() ); + return *mxImpl->mxVbaProject; +} + OUString FilterBase::requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier ) const { ::std::vector< OUString > aDefaultPasswords; @@ -563,4 +565,3 @@ GraphicHelper* FilterBase::implCreateGraphicHelper() const } // namespace core } // namespace oox - diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx index 00244c224778..8c3e64f99174 100644 --- a/oox/source/core/filterdetect.cxx +++ b/oox/source/core/filterdetect.cxx @@ -26,50 +26,38 @@ ************************************************************************/ #include "oox/core/filterdetect.hxx" + #include #include -#include -#include #include #include +#include +#include +#include "oox/core/fasttokenhandler.hxx" +#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/binaryoutputstream.hxx" #include "oox/helper/zipstorage.hxx" -#include "oox/core/fasttokenhandler.hxx" -#include "oox/core/namespaces.hxx" #include "oox/ole/olestorage.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; -using ::com::sun::star::uno::XInterface; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::beans::NamedValue; -using ::com::sun::star::beans::PropertyValue; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::io::XOutputStream; -using ::com::sun::star::io::XStream; -using ::com::sun::star::xml::sax::InputSource; -using ::com::sun::star::xml::sax::SAXException; -using ::com::sun::star::xml::sax::XFastAttributeList; -using ::com::sun::star::xml::sax::XFastContextHandler; -using ::com::sun::star::xml::sax::XFastParser; -using ::com::sun::star::xml::sax::XLocator; -using ::comphelper::MediaDescriptor; -using ::comphelper::SequenceAsHashMap; - namespace oox { namespace core { // ============================================================================ +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +using ::comphelper::MediaDescriptor; +using ::comphelper::SequenceAsHashMap; +using ::rtl::OUString; + +// ============================================================================ + FilterDetectDocHandler::FilterDetectDocHandler( OUString& rFilterName ) : mrFilterName( rFilterName ) { @@ -654,4 +642,3 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq } // namespace core } // namespace oox - diff --git a/oox/source/core/fragmenthandler.cxx b/oox/source/core/fragmenthandler.cxx index 66c7bf5e136b..a1c42e56c155 100644 --- a/oox/source/core/fragmenthandler.cxx +++ b/oox/source/core/fragmenthandler.cxx @@ -26,22 +26,22 @@ ************************************************************************/ #include "oox/core/fragmenthandler.hxx" -#include "oox/core/xmlfilterbase.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::xml::sax::SAXException; -using ::com::sun::star::xml::sax::XFastAttributeList; -using ::com::sun::star::xml::sax::XFastContextHandler; -using ::com::sun::star::xml::sax::XLocator; +#include "oox/core/xmlfilterbase.hxx" namespace oox { namespace core { // ============================================================================ +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +using ::rtl::OUString; + +// ============================================================================ + FragmentBaseData::FragmentBaseData( XmlFilterBase& rFilter, const OUString& rFragmentPath, RelationsRef xRelations ) : mrFilter( rFilter ), maFragmentPath( rFragmentPath ), @@ -139,4 +139,3 @@ const RecordInfo* FragmentHandler::getRecordInfos() const } // namespace core } // namespace oox - diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx index 531f43d76d28..e01d2af65113 100644 --- a/oox/source/core/fragmenthandler2.cxx +++ b/oox/source/core/fragmenthandler2.cxx @@ -27,18 +27,18 @@ #include "oox/core/fragmenthandler2.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::xml::sax::SAXException; -using ::com::sun::star::xml::sax::XFastAttributeList; -using ::com::sun::star::xml::sax::XFastContextHandler; - namespace oox { namespace core { // ============================================================================ +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +using ::rtl::OUString; + +// ============================================================================ + FragmentHandler2::FragmentHandler2( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEnableTrimSpace ) : FragmentHandler( rFilter, rFragmentPath ), ContextHandler2Helper( bEnableTrimSpace ) @@ -49,11 +49,6 @@ FragmentHandler2::~FragmentHandler2() { } -ContextHandler& FragmentHandler2::queryContextHandler() -{ - return *this; -} - // com.sun.star.xml.sax.XFastDocumentHandler interface -------------------- void SAL_CALL FragmentHandler2::startDocument() throw( SAXException, RuntimeException ) @@ -77,7 +72,7 @@ Reference< XFastContextHandler > SAL_CALL FragmentHandler2::createFastChildConte void SAL_CALL FragmentHandler2::startFastElement( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) throw( SAXException, RuntimeException ) { - implStartCurrentContext( nElement, rxAttribs ); + implStartElement( nElement, rxAttribs ); } void SAL_CALL FragmentHandler2::characters( const OUString& rChars ) throw( SAXException, RuntimeException ) @@ -87,7 +82,7 @@ void SAL_CALL FragmentHandler2::characters( const OUString& rChars ) throw( SAXE void SAL_CALL FragmentHandler2::endFastElement( sal_Int32 nElement ) throw( SAXException, RuntimeException ) { - implEndCurrentContext( nElement ); + implEndElement( nElement ); } // oox.core.ContextHandler interface ------------------------------------------ @@ -118,7 +113,11 @@ void FragmentHandler2::onStartElement( const AttributeList& ) { } -void FragmentHandler2::onEndElement( const OUString& ) +void FragmentHandler2::onCharacters( const OUString& ) +{ +} + +void FragmentHandler2::onEndElement() { } @@ -149,4 +148,3 @@ void FragmentHandler2::finalizeImport() } // namespace core } // namespace oox - diff --git a/oox/source/core/recordparser.cxx b/oox/source/core/recordparser.cxx index 8f0de9c2894a..1fea7c85a88b 100644 --- a/oox/source/core/recordparser.cxx +++ b/oox/source/core/recordparser.cxx @@ -26,27 +26,28 @@ ************************************************************************/ #include "oox/core/recordparser.hxx" + #include #include #include #include -#include "oox/helper/recordinputstream.hxx" #include "oox/core/fragmenthandler.hxx" - -using ::rtl::OUString; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::lang::DisposedException; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::io::IOException; -using ::com::sun::star::xml::sax::SAXException; -using ::com::sun::star::xml::sax::XLocator; +#include "oox/helper/recordinputstream.hxx" namespace oox { namespace core { // ============================================================================ +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +using ::rtl::OUString; + +// ============================================================================ + namespace prv { class Locator : public ::cppu::WeakImplHelper1< XLocator > @@ -348,4 +349,3 @@ const RecordInfo* RecordParser::getEndRecordInfo( sal_Int32 nRecId ) const } // namespace core } // namespace oox - diff --git a/oox/source/core/relations.cxx b/oox/source/core/relations.cxx index c8d17cce3b9b..db3420906f30 100644 --- a/oox/source/core/relations.cxx +++ b/oox/source/core/relations.cxx @@ -26,17 +26,20 @@ ************************************************************************/ #include "oox/core/relations.hxx" + #include #include "oox/helper/helper.hxx" -using ::rtl::OUString; -using ::rtl::OUStringBuffer; - namespace oox { namespace core { // ============================================================================ +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +// ============================================================================ + namespace { OUString lclRemoveFileName( const OUString& rPath ) @@ -143,4 +146,3 @@ OUString Relations::getFragmentPathFromFirstType( const OUString& rType ) const } // namespace core } // namespace oox - diff --git a/oox/source/core/relationshandler.cxx b/oox/source/core/relationshandler.cxx index e0d7acda81e0..5ff41b6613f7 100644 --- a/oox/source/core/relationshandler.cxx +++ b/oox/source/core/relationshandler.cxx @@ -26,18 +26,22 @@ ************************************************************************/ #include "oox/core/relationshandler.hxx" + #include -#include "tokens.hxx" -#include "oox/helper/attributelist.hxx" #include "oox/core/namespaces.hxx" +#include "oox/helper/attributelist.hxx" +#include "tokens.hxx" + +namespace oox { +namespace core { + +// ============================================================================ -using ::rtl::OUString; -using ::rtl::OUStringBuffer; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; -namespace oox { -namespace core { +using ::rtl::OUString; +using ::rtl::OUStringBuffer; // ============================================================================ @@ -106,4 +110,3 @@ Reference< XFastContextHandler > RelationsFragment::createFastChildContext( } // namespace core } // namespace oox - diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 87faadd7a9ce..058efa2e2a7d 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -28,9 +28,6 @@ #include "oox/core/xmlfilterbase.hxx" #include - -#include -#include #include #include #include @@ -38,50 +35,41 @@ #include #include #include -#include "properties.hxx" -#include "tokens.hxx" -#include "oox/helper/containerhelper.hxx" -#include "oox/helper/propertyset.hxx" -#include "oox/helper/zipstorage.hxx" +#include +#include #include "oox/core/fasttokenhandler.hxx" #include "oox/core/filterdetect.hxx" #include "oox/core/fragmenthandler.hxx" #include "oox/core/namespaces.hxx" #include "oox/core/recordparser.hxx" #include "oox/core/relationshandler.hxx" +#include "oox/helper/containerhelper.hxx" +#include "oox/helper/propertyset.hxx" +#include "oox/helper/zipstorage.hxx" +#include "properties.hxx" +#include "tokens.hxx" +namespace oox { +namespace core { + +// ============================================================================ + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::document; +using namespace ::com::sun::star::embed; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::util; +using namespace ::com::sun::star::xml::sax; + +using ::comphelper::MediaDescriptor; using ::rtl::OStringBuffer; using ::rtl::OUString; using ::rtl::OUStringBuffer; -using ::com::sun::star::beans::StringPair; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; -using ::com::sun::star::lang::Locale; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::embed::XRelationshipAccess; -using ::com::sun::star::embed::XStorage; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::io::XOutputStream; -using ::com::sun::star::io::XStream; -using ::com::sun::star::container::XNameContainer; -using ::com::sun::star::xml::sax::XFastParser; -using ::com::sun::star::xml::sax::XFastTokenHandler; -using ::com::sun::star::xml::sax::XFastDocumentHandler; -using ::com::sun::star::xml::sax::InputSource; -using ::com::sun::star::xml::sax::SAXException; -using ::com::sun::star::document::XDocumentProperties; -using ::com::sun::star::util::DateTime; -using ::comphelper::MediaDescriptor; -using ::sax_fastparser::FastSerializerHelper; using ::sax_fastparser::FSHelperPtr; - -namespace oox { -namespace core { +using ::sax_fastparser::FastSerializerHelper; // ============================================================================ @@ -536,4 +524,3 @@ StorageRef XmlFilterBase::implCreateStorage( const Reference< XStream >& rxOutSt } // namespace core } // namespace oox - diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx index dce6535c2f49..5342f3535e51 100644 --- a/oox/source/drawingml/chart/chartdrawingfragment.cxx +++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx @@ -177,7 +177,7 @@ ContextHandlerRef ChartDrawingFragment::onCreateContext( sal_Int32 nElement, con case CDR_TOKEN( graphicFrame ): if( !mbOleSupport ) return 0; - mxShape.reset( new Shape( "com.sun.star.drawing.OLE2Shape" ) ); + mxShape.reset( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ); return new GraphicalObjectFrameContext( *this, ShapePtr(), mxShape, true ); case CDR_TOKEN( grpSp ): mxShape.reset( new Shape( "com.sun.star.drawing.GroupShape" ) ); @@ -206,26 +206,24 @@ ContextHandlerRef ChartDrawingFragment::onCreateContext( sal_Int32 nElement, con return 0; } -void ChartDrawingFragment::onEndElement( const OUString& rChars ) +void ChartDrawingFragment::onCharacters( const OUString& rChars ) { - switch( getCurrentElement() ) - { - case CDR_TOKEN( x ): - case CDR_TOKEN( y ): - if( mxAnchor.get() ) mxAnchor->setPos( getCurrentElement(), getPreviousElement(), rChars ); - break; + if( isCurrentElement( CDR_TOKEN( x ), CDR_TOKEN( y ) ) && mxAnchor.get() ) + mxAnchor->setPos( getCurrentElement(), getParentElement(), rChars ); +} - case CDR_TOKEN( absSizeAnchor ): - case CDR_TOKEN( relSizeAnchor ): - if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() ) - { - Rectangle aLoc = mxAnchor->calcEmuLocation( maEmuChartRect ); - if( (aLoc.X >= 0) && (aLoc.Y >= 0) && (aLoc.Width >= 0) && (aLoc.Height >= 0) ) - mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, &aLoc ); - } - mxShape.reset(); - mxAnchor.reset(); - break; +void ChartDrawingFragment::onEndElement() +{ + if( isCurrentElement( CDR_TOKEN( absSizeAnchor ), CDR_TOKEN( relSizeAnchor ) ) ) + { + if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() ) + { + Rectangle aLoc = mxAnchor->calcEmuLocation( maEmuChartRect ); + if( (aLoc.X >= 0) && (aLoc.Y >= 0) && (aLoc.Width >= 0) && (aLoc.Height >= 0) ) + mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, &aLoc ); + } + mxShape.reset(); + mxAnchor.reset(); } } diff --git a/oox/source/drawingml/chart/datasourcecontext.cxx b/oox/source/drawingml/chart/datasourcecontext.cxx index 6fd12c415a50..a044dd67018d 100644 --- a/oox/source/drawingml/chart/datasourcecontext.cxx +++ b/oox/source/drawingml/chart/datasourcecontext.cxx @@ -90,7 +90,7 @@ ContextHandlerRef DoubleSequenceContext::onCreateContext( sal_Int32 nElement, co return 0; } -void DoubleSequenceContext::onEndElement( const OUString& rChars ) +void DoubleSequenceContext::onCharacters( const OUString& rChars ) { switch( getCurrentElement() ) { @@ -163,7 +163,7 @@ ContextHandlerRef StringSequenceContext::onCreateContext( sal_Int32 nElement, co return 0; } -void StringSequenceContext::onEndElement( const OUString& rChars ) +void StringSequenceContext::onCharacters( const OUString& rChars ) { switch( getCurrentElement() ) { @@ -231,4 +231,3 @@ ContextHandlerRef DataSourceContext::onCreateContext( sal_Int32 nElement, const } // namespace chart } // namespace drawingml } // namespace oox - diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx index 5412c97f0c91..014ca51e869d 100644 --- a/oox/source/drawingml/chart/seriescontext.cxx +++ b/oox/source/drawingml/chart/seriescontext.cxx @@ -48,8 +48,8 @@ using ::rtl::OUString; namespace { -ContextHandlerRef lclDataLabelSharedCreateContext( - ContextHandler2& rContext, sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel ) +ContextHandlerRef lclDataLabelSharedCreateContext( ContextHandler2& rContext, + sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel ) { if( rContext.isRootElement() ) switch( nElement ) { @@ -82,7 +82,7 @@ ContextHandlerRef lclDataLabelSharedCreateContext( orModel.mobShowVal = rAttribs.getBool( XML_val ); return 0; case C_TOKEN( separator ): - // collect separator text in onEndElement() + // collect separator text in onCharacters() return &rContext; case C_TOKEN( spPr ): return new ShapePropertiesContext( rContext, orModel.mxShapeProp.create() ); @@ -92,14 +92,10 @@ ContextHandlerRef lclDataLabelSharedCreateContext( return 0; } -void lclDataLabelSharedEndElement( ContextHandler2& rContext, const OUString& rChars, DataLabelModelBase& orModel ) +void lclDataLabelSharedCharacters( ContextHandler2& rContext, const OUString& rChars, DataLabelModelBase& orModel ) { - switch( rContext.getCurrentElement() ) - { - case C_TOKEN( separator ): - orModel.moaSeparator = rChars; - break; - } + if( rContext.isCurrentElement( C_TOKEN( separator ) ) ) + orModel.moaSeparator = rChars; } } // namespace @@ -130,9 +126,9 @@ ContextHandlerRef DataLabelContext::onCreateContext( sal_Int32 nElement, const A return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel ); } -void DataLabelContext::onEndElement( const OUString& rChars ) +void DataLabelContext::onCharacters( const OUString& rChars ) { - lclDataLabelSharedEndElement( *this, rChars, mrModel ); + lclDataLabelSharedCharacters( *this, rChars, mrModel ); } // ============================================================================ @@ -162,9 +158,9 @@ ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel ); } -void DataLabelsContext::onEndElement( const OUString& rChars ) +void DataLabelsContext::onCharacters( const OUString& rChars ) { - lclDataLabelSharedEndElement( *this, rChars, mrModel ); + lclDataLabelSharedCharacters( *this, rChars, mrModel ); } // ============================================================================ @@ -308,7 +304,7 @@ ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const A mrModel.mfIntercept = rAttribs.getDouble( XML_val, 0.0 ); return 0; case C_TOKEN( name ): - return this; // collect name in onEndElement() + return this; // collect name in onCharacters() case C_TOKEN( order ): mrModel.mnOrder = rAttribs.getInteger( XML_val, 2 ); return 0; @@ -326,14 +322,10 @@ ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const A return 0; } -void TrendlineContext::onEndElement( const ::rtl::OUString& rChars ) +void TrendlineContext::onCharacters( const OUString& rChars ) { - switch( getCurrentElement() ) - { - case C_TOKEN( name ): - mrModel.maName = rChars; - break; - } + if( isCurrentElement( C_TOKEN( name ) ) ) + mrModel.maName = rChars; } // ============================================================================ diff --git a/oox/source/drawingml/chart/titlecontext.cxx b/oox/source/drawingml/chart/titlecontext.cxx index 3954a9d5b08b..cc2b7ace0e72 100644 --- a/oox/source/drawingml/chart/titlecontext.cxx +++ b/oox/source/drawingml/chart/titlecontext.cxx @@ -55,34 +55,28 @@ TextContext::~TextContext() ContextHandlerRef TextContext::onCreateContext( sal_Int32 nElement, const AttributeList& ) { - switch( getCurrentElement() ) + // this context handler is used for and embedded elements + if( isCurrentElement( C_TOKEN( tx ) ) ) switch( nElement ) { - case C_TOKEN( tx ): - switch( nElement ) - { - case C_TOKEN( rich ): - return new TextBodyContext( *this, mrModel.mxTextBody.create() ); - case C_TOKEN( strRef ): - OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" ); - return new StringSequenceContext( *this, mrModel.mxDataSeq.create() ); - case C_TOKEN( v ): - OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" ); - return this; // collect value in onEndElement() - } - break; + case C_TOKEN( rich ): + return new TextBodyContext( *this, mrModel.mxTextBody.create() ); + + case C_TOKEN( strRef ): + OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" ); + return new StringSequenceContext( *this, mrModel.mxDataSeq.create() ); + + case C_TOKEN( v ): + OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" ); + return this; // collect value in onCharacters() } - return false; + return 0; } -void TextContext::onEndElement( const OUString& rChars ) +void TextContext::onCharacters( const OUString& rChars ) { - switch( getCurrentElement() ) - { - case C_TOKEN( v ): - // store as single string sequence element - mrModel.mxDataSeq.create().maData[ 0 ] <<= rChars; - break; - } + // store as single string sequence element + if( isCurrentElement( C_TOKEN( v ) ) ) + mrModel.mxDataSeq.create().maData[ 0 ] <<= rChars; } // ============================================================================ @@ -98,25 +92,25 @@ TitleContext::~TitleContext() ContextHandlerRef TitleContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { - switch( getCurrentElement() ) + // this context handler is used for only + switch( nElement ) { - case C_TOKEN( title ): - switch( nElement ) - { - case C_TOKEN( layout ): - return new LayoutContext( *this, mrModel.mxLayout.create() ); - case C_TOKEN( overlay ): - // default is 'false', not 'true' as specified - mrModel.mbOverlay = rAttribs.getBool( XML_val, false ); - return 0; - case C_TOKEN( spPr ): - return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); - case C_TOKEN( tx ): - return new TextContext( *this, mrModel.mxText.create() ); - case C_TOKEN( txPr ): - return new TextBodyContext( *this, mrModel.mxTextProp.create() ); - } - break; + case C_TOKEN( layout ): + return new LayoutContext( *this, mrModel.mxLayout.create() ); + + case C_TOKEN( overlay ): + // default is 'false', not 'true' as specified + mrModel.mbOverlay = rAttribs.getBool( XML_val, false ); + return 0; + + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); + + case C_TOKEN( tx ): + return new TextContext( *this, mrModel.mxText.create() ); + + case C_TOKEN( txPr ): + return new TextBodyContext( *this, mrModel.mxTextProp.create() ); } return 0; } @@ -134,26 +128,26 @@ LegendContext::~LegendContext() ContextHandlerRef LegendContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { - switch( getCurrentElement() ) + // this context handler is used for only + switch( nElement ) { - case C_TOKEN( legend ): - switch( nElement ) - { - case C_TOKEN( layout ): - return new LayoutContext( *this, mrModel.mxLayout.create() ); - case C_TOKEN( legendPos ): - mrModel.mnPosition = rAttribs.getToken( XML_val, XML_r ); - return 0; - case C_TOKEN( overlay ): - // default is 'false', not 'true' as specified - mrModel.mbOverlay = rAttribs.getBool( XML_val, false ); - return 0; - case C_TOKEN( spPr ): - return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); - case C_TOKEN( txPr ): - return new TextBodyContext( *this, mrModel.mxTextProp.create() ); - } - break; + case C_TOKEN( layout ): + return new LayoutContext( *this, mrModel.mxLayout.create() ); + + case C_TOKEN( legendPos ): + mrModel.mnPosition = rAttribs.getToken( XML_val, XML_r ); + return 0; + + case C_TOKEN( overlay ): + // default is 'false', not 'true' as specified + mrModel.mbOverlay = rAttribs.getBool( XML_val, false ); + return 0; + + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); + + case C_TOKEN( txPr ): + return new TextBodyContext( *this, mrModel.mxTextProp.create() ); } return 0; } diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx index 48461bb2858e..0df33903ffbb 100644 --- a/oox/source/drawingml/graphicshapecontext.cxx +++ b/oox/source/drawingml/graphicshapecontext.cxx @@ -27,7 +27,6 @@ #include "oox/drawingml/graphicshapecontext.hxx" #include -#include #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/customshapeproperties.hxx" @@ -41,12 +40,8 @@ #include "oox/vml/vmldrawing.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" -#include "oox/ole/oleobjecthelper.hxx" #include "oox/drawingml/fillproperties.hxx" #include "oox/drawingml/transform2dcontext.hxx" -#include "oox/drawingml/chart/chartconverter.hxx" -#include "oox/drawingml/chart/chartspacefragment.hxx" -#include "oox/drawingml/chart/chartspacemodel.hxx" #include "properties.hxx" #include "tokens.hxx" @@ -58,7 +53,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::xml::sax; using namespace ::oox::core; -using ::oox::vml::OleObjectInfo; namespace oox { namespace drawingml { @@ -157,65 +151,19 @@ Reference< XFastContextHandler > GraphicalObjectFrameContext::createFastChildCon // ============================================================================ -class CreateOleObjectCallback : public CreateShapeCallback -{ -public: - explicit CreateOleObjectCallback( XmlFilterBase& rFilter, const ::boost::shared_ptr< OleObjectInfo >& rxOleObjectInfo ); - virtual OUString onCreateXShape( const OUString& rServiceName, const awt::Rectangle& rShapeRect ); - -private: - ::boost::shared_ptr< OleObjectInfo > mxOleObjectInfo; -}; - -// ---------------------------------------------------------------------------- - -CreateOleObjectCallback::CreateOleObjectCallback( XmlFilterBase& rFilter, const ::boost::shared_ptr< OleObjectInfo >& rxOleObjectInfo ) : - CreateShapeCallback( rFilter ), - mxOleObjectInfo( rxOleObjectInfo ) -{ -} - -OUString CreateOleObjectCallback::onCreateXShape( const OUString&, const awt::Rectangle& rShapeRect ) -{ - awt::Size aOleSize( rShapeRect.Width, rShapeRect.Height ); - bool bSuccess = mrFilter.getOleObjectHelper().importOleObject( maShapeProps, *mxOleObjectInfo, aOleSize ); - OUString aServiceName = bSuccess ? CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" ) : CREATE_OUSTRING( "com.sun.star.drawing.GraphicObjectShape" ); - - // get the path to the representation graphic - OUString aGraphicPath; - if( mxOleObjectInfo->maShapeId.getLength() > 0 ) - if( ::oox::vml::Drawing* pVmlDrawing = mrFilter.getVmlDrawing() ) - if( const ::oox::vml::ShapeBase* pVmlShape = pVmlDrawing->getShapes().getShapeById( mxOleObjectInfo->maShapeId, true ) ) - aGraphicPath = pVmlShape->getGraphicPath(); - - // import and store the graphic - if( aGraphicPath.getLength() > 0 ) - { - Reference< graphic::XGraphic > xGraphic = mrFilter.getGraphicHelper().importEmbeddedGraphic( aGraphicPath ); - if( xGraphic.is() ) - maShapeProps[ PROP_Graphic ] <<= xGraphic; - } - - return aServiceName; -} - -// ============================================================================ - OleObjectGraphicDataContext::OleObjectGraphicDataContext( ContextHandler& rParent, ShapePtr xShape ) : ShapeContext( rParent, ShapePtr(), xShape ), - mxOleObjectInfo( new OleObjectInfo( true ) ) + mrOleObjectInfo( xShape->setOleObjectType() ) { - CreateShapeCallbackRef xCallback( new CreateOleObjectCallback( getFilter(), mxOleObjectInfo ) ); - xShape->setCreateShapeCallback( xCallback ); } OleObjectGraphicDataContext::~OleObjectGraphicDataContext() { /* Register the OLE shape at the VML drawing, this prevents that the related VML shape converts the OLE object by itself. */ - if( mxOleObjectInfo->maShapeId.getLength() > 0 ) + if( mrOleObjectInfo.maShapeId.getLength() > 0 ) if( ::oox::vml::Drawing* pVmlDrawing = getFilter().getVmlDrawing() ) - pVmlDrawing->registerOleObject( *mxOleObjectInfo ); + pVmlDrawing->registerOleObject( mrOleObjectInfo ); } Reference< XFastContextHandler > OleObjectGraphicDataContext::createFastChildContext( sal_Int32 nElement, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) @@ -227,37 +175,37 @@ Reference< XFastContextHandler > OleObjectGraphicDataContext::createFastChildCon { case PPT_TOKEN( oleObj ): { - mxOleObjectInfo->maShapeId = aAttribs.getXString( XML_spid, OUString() ); + mrOleObjectInfo.maShapeId = aAttribs.getXString( XML_spid, OUString() ); const Relation* pRelation = getRelations().getRelationFromRelId( aAttribs.getString( R_TOKEN( id ), OUString() ) ); OSL_ENSURE( pRelation, "OleObjectGraphicDataContext::createFastChildContext - missing relation for OLE object" ); if( pRelation ) { - mxOleObjectInfo->mbLinked = pRelation->mbExternal; + mrOleObjectInfo.mbLinked = pRelation->mbExternal; if( pRelation->mbExternal ) { - mxOleObjectInfo->maTargetLink = getFilter().getAbsoluteUrl( pRelation->maTarget ); + mrOleObjectInfo.maTargetLink = getFilter().getAbsoluteUrl( pRelation->maTarget ); } else { OUString aFragmentPath = getFragmentPathFromRelation( *pRelation ); if( aFragmentPath.getLength() > 0 ) - getFilter().importBinaryData( mxOleObjectInfo->maEmbeddedData, aFragmentPath ); + getFilter().importBinaryData( mrOleObjectInfo.maEmbeddedData, aFragmentPath ); } } - mxOleObjectInfo->maName = aAttribs.getXString( XML_name, OUString() ); - mxOleObjectInfo->maProgId = aAttribs.getXString( XML_progId, OUString() ); - mxOleObjectInfo->mbShowAsIcon = aAttribs.getBool( XML_showAsIcon, false ); + mrOleObjectInfo.maName = aAttribs.getXString( XML_name, OUString() ); + mrOleObjectInfo.maProgId = aAttribs.getXString( XML_progId, OUString() ); + mrOleObjectInfo.mbShowAsIcon = aAttribs.getBool( XML_showAsIcon, false ); xRet.set( this ); } break; case PPT_TOKEN( embed ): - OSL_ENSURE( !mxOleObjectInfo->mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" ); + OSL_ENSURE( !mrOleObjectInfo.mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" ); break; case PPT_TOKEN( link ): - OSL_ENSURE( mxOleObjectInfo->mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" ); - mxOleObjectInfo->mbAutoUpdate = aAttribs.getBool( XML_updateAutomatic, false ); + OSL_ENSURE( mrOleObjectInfo.mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" ); + mrOleObjectInfo.mbAutoUpdate = aAttribs.getBool( XML_updateAutomatic, false ); break; } return xRet; @@ -268,8 +216,7 @@ Reference< XFastContextHandler > OleObjectGraphicDataContext::createFastChildCon DiagramGraphicDataContext::DiagramGraphicDataContext( ContextHandler& rParent, ShapePtr pShapePtr ) : ShapeContext( rParent, ShapePtr(), pShapePtr ) { - pShapePtr->setServiceName( "com.sun.star.drawing.GroupShape" ); - pShapePtr->setSubType( 0 ); + pShapePtr->setDiagramType(); } DiagramGraphicDataContext::~DiagramGraphicDataContext() @@ -349,62 +296,10 @@ Reference< XFastContextHandler > DiagramGraphicDataContext::createFastChildConte // ============================================================================ -class CreateChartCallback : public CreateShapeCallback -{ -public: - explicit CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEmbedShapes ); - virtual void onXShapeCreated( const Reference< drawing::XShape >& rxShape, const Reference< drawing::XShapes >& rxShapes ) const; - -private: - OUString maFragmentPath; - bool mbEmbedShapes; -}; - -// ---------------------------------------------------------------------------- - -CreateChartCallback::CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEmbedShapes ) : - CreateShapeCallback( rFilter ), - maFragmentPath( rFragmentPath ), - mbEmbedShapes( bEmbedShapes ) -{ -} - -void CreateChartCallback::onXShapeCreated( const Reference< drawing::XShape >& rxShape, const Reference< drawing::XShapes >& rxShapes ) const -{ - OSL_ENSURE( maFragmentPath.getLength() > 0, "CreateChartCallback::onXShapeCreated - missing chart fragment" ); - if( maFragmentPath.getLength() > 0 ) try - { - // set the chart2 OLE class ID at the OLE shape - PropertySet aShapeProp( rxShape ); - aShapeProp.setProperty( PROP_CLSID, CREATE_OUSTRING( "12dcae26-281f-416f-a234-c3086127382e" ) ); - - // get the XModel interface of the embedded object from the OLE shape - Reference< frame::XModel > xDocModel; - aShapeProp.getProperty( xDocModel, PROP_Model ); - Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW ); - - // load the chart data from the XML fragment - chart::ChartSpaceModel aModel; - mrFilter.importFragment( new chart::ChartSpaceFragment( mrFilter, maFragmentPath, aModel ) ); - - // convert imported chart model to chart document - Reference< drawing::XShapes > xExternalPage; - if( !mbEmbedShapes ) - xExternalPage = rxShapes; - mrFilter.getChartConverter().convertFromModel( mrFilter, aModel, xChartDoc, xExternalPage, rxShape->getPosition(), rxShape->getSize() ); - } - catch( Exception& ) - { - } -} - -// ============================================================================ - ChartGraphicDataContext::ChartGraphicDataContext( ContextHandler& rParent, const ShapePtr& rxShape, bool bEmbedShapes ) : ShapeContext( rParent, ShapePtr(), rxShape ), - mbEmbedShapes( bEmbedShapes ) + mrChartShapeInfo( rxShape->setChartType( bEmbedShapes ) ) { - rxShape->setServiceName( "com.sun.star.drawing.OLE2Shape" ); } Reference< XFastContextHandler > ChartGraphicDataContext::createFastChildContext( ::sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) @@ -413,9 +308,7 @@ Reference< XFastContextHandler > ChartGraphicDataContext::createFastChildContext if( nElement == C_TOKEN( chart ) ) { AttributeList aAttribs( rxAttribs ); - OUString aFragmentPath = getFragmentPathFromRelId( aAttribs.getString( R_TOKEN( id ), OUString() ) ); - CreateShapeCallbackRef xCallback( new CreateChartCallback( getFilter(), aFragmentPath, mbEmbedShapes ) ); - mpShapePtr->setCreateShapeCallback( xCallback ); + mrChartShapeInfo.maFragmentPath = getFragmentPathFromRelId( aAttribs.getString( R_TOKEN( id ), OUString() ) ); } return 0; } diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index f0ae2ec2a7a3..d3a6afb0d4ad 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -32,8 +32,15 @@ #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/textbody.hxx" #include "oox/drawingml/table/tableproperties.hxx" +#include "oox/drawingml/chart/chartconverter.hxx" +#include "oox/drawingml/chart/chartspacefragment.hxx" +#include "oox/drawingml/chart/chartspacemodel.hxx" +#include "oox/vml/vmldrawing.hxx" +#include "oox/vml/vmlshape.hxx" +#include "oox/vml/vmlshapecontainer.hxx" #include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" +#include "oox/helper/graphichelper.hxx" #include "oox/helper/propertyset.hxx" #include "properties.hxx" #include "tokens.hxx" @@ -45,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -64,26 +72,6 @@ namespace oox { namespace drawingml { // ============================================================================ -CreateShapeCallback::CreateShapeCallback( XmlFilterBase& rFilter ) : - mrFilter( rFilter ) -{ -} - -CreateShapeCallback::~CreateShapeCallback() -{ -} - -OUString CreateShapeCallback::onCreateXShape( const OUString& rServiceName, const Rectangle& ) -{ - return rServiceName; -} - -void CreateShapeCallback::onXShapeCreated( const Reference< XShape >&, const Reference< XShapes >& ) const -{ -} - -// ============================================================================ - Shape::Shape( const sal_Char* pServiceName ) : mpLinePropertiesPtr( new LineProperties ) , mpFillPropertiesPtr( new FillProperties ) @@ -92,6 +80,7 @@ Shape::Shape( const sal_Char* pServiceName ) , mpMasterTextListStyle( new TextListStyle ) , mnSubType( 0 ) , mnSubTypeIndex( -1 ) +, meFrameType( FRAMETYPE_GENERIC ) , mnRotation( 0 ) , mbFlipH( false ) , mbFlipV( false ) @@ -101,6 +90,7 @@ Shape::Shape( const sal_Char* pServiceName ) msServiceName = OUString::createFromAscii( pServiceName ); setDefaults(); } + Shape::~Shape() { } @@ -123,6 +113,39 @@ void Shape::setDefaults() maShapeProperties[ PROP_CharHeight ] <<= static_cast< float >( 18.0 ); } +::oox::vml::OleObjectInfo& Shape::setOleObjectType() +{ + OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setOleObjectType - multiple frame types" ); + meFrameType = FRAMETYPE_OLEOBJECT; + mxOleObjectInfo.reset( new ::oox::vml::OleObjectInfo( true ) ); + return *mxOleObjectInfo; +} + +ChartShapeInfo& Shape::setChartType( bool bEmbedShapes ) +{ + OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setChartType - multiple frame types" ); + meFrameType = FRAMETYPE_CHART; + msServiceName = CREATE_OUSTRING( "com.sun.star.drawing.OLE2Object" ); + mxChartShapeInfo.reset( new ChartShapeInfo( bEmbedShapes ) ); + return *mxChartShapeInfo; +} + +void Shape::setDiagramType() +{ + OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setDiagramType - multiple frame types" ); + meFrameType = FRAMETYPE_DIAGRAM; + msServiceName = CREATE_OUSTRING( "com.sun.star.drawing.GroupShape" ); + mnSubType = 0; +} + +void Shape::setTableType() +{ + OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setTableType - multiple frame types" ); + meFrameType = FRAMETYPE_TABLE; + msServiceName = CREATE_OUSTRING( "com.sun.star.drawing.TableShape" ); + mnSubType = 0; +} + void Shape::setServiceName( const sal_Char* pServiceName ) { if ( pServiceName ) @@ -137,7 +160,7 @@ const ShapeStyleRef* Shape::getShapeStyleRef( sal_Int32 nRefType ) const } void Shape::addShape( - const ::oox::core::XmlFilterBase& rFilterBase, + ::oox::core::XmlFilterBase& rFilterBase, const Theme* pTheme, const Reference< XShapes >& rxShapes, const awt::Rectangle* pShapeRect, @@ -189,7 +212,7 @@ void Shape::applyShapeReference( const Shape& rReferencedShape ) // for group shapes, the following method is also adding each child void Shape::addChildren( - const ::oox::core::XmlFilterBase& rFilterBase, + XmlFilterBase& rFilterBase, Shape& rMaster, const Theme* pTheme, const Reference< XShapes >& rxShapes, @@ -247,7 +270,7 @@ void Shape::addChildren( } Reference< XShape > Shape::createAndInsert( - const ::oox::core::XmlFilterBase& rFilterBase, + ::oox::core::XmlFilterBase& rFilterBase, const rtl::OUString& rServiceName, const Theme* pTheme, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, @@ -256,11 +279,10 @@ Reference< XShape > Shape::createAndInsert( { awt::Size aSize( pShapeRect ? awt::Size( pShapeRect->Width, pShapeRect->Height ) : maSize ); awt::Point aPosition( pShapeRect ? awt::Point( pShapeRect->X, pShapeRect->Y ) : maPosition ); + awt::Rectangle aShapeRectHmm( aPosition.X / 360, aPosition.Y / 360, aSize.Width / 360, aSize.Height / 360 ); - OUString aServiceName = rServiceName; - if( mxCreateCallback.get() ) - aServiceName = mxCreateCallback->onCreateXShape( aServiceName, awt::Rectangle( aPosition.X / 360, aPosition.Y / 360, aSize.Width / 360, aSize.Height / 360 ) ); - sal_Bool bIsCustomShape = aServiceName == OUString::createFromAscii( "com.sun.star.drawing.CustomShape" ); + OUString aServiceName = finalizeServiceName( rFilterBase, rServiceName, aShapeRectHmm ); + sal_Bool bIsCustomShape = aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.CustomShape" ) ); basegfx::B2DHomMatrix aTransformation; if( aSize.Width != 1 || aSize.Height != 1) @@ -432,13 +454,6 @@ Reference< XShape > Shape::createAndInsert( PropertyMap aShapeProperties; PropertyMap::const_iterator aShapePropIter; - if( mxCreateCallback.get() ) - { - for ( aShapePropIter = mxCreateCallback->getShapeProperties().begin(); - aShapePropIter != mxCreateCallback->getShapeProperties().end(); aShapePropIter++ ) - aShapeProperties[ (*aShapePropIter).first ] = (*aShapePropIter).second; - } - // add properties from textbody to shape properties if( mpTextBody.get() ) { @@ -502,9 +517,8 @@ Reference< XShape > Shape::createAndInsert( xLockable->removeActionLock(); } - // use a callback for further processing on the XShape (e.g. charts) - if( mxShape.is() && mxCreateCallback.get() ) - mxCreateCallback->onXShapeCreated( mxShape, rxShapes ); + if( mxShape.is() ) + finalizeXShape( rFilterBase, rxShapes ); return mxShape; } @@ -537,5 +551,77 @@ void Shape::setMasterTextListStyle( const TextListStylePtr& pMasterTextListStyle mpMasterTextListStyle = pMasterTextListStyle; } +OUString Shape::finalizeServiceName( XmlFilterBase& rFilter, const OUString& rServiceName, const Rectangle& rShapeRect ) +{ + OUString aServiceName = rServiceName; + switch( meFrameType ) + { + case FRAMETYPE_OLEOBJECT: + { + Size aOleSize( rShapeRect.Width, rShapeRect.Height ); + if( rFilter.getOleObjectHelper().importOleObject( maShapeProperties, *mxOleObjectInfo, aOleSize ) ) + aServiceName = CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" ); + + // get the path to the representation graphic + OUString aGraphicPath; + if( mxOleObjectInfo->maShapeId.getLength() > 0 ) + if( ::oox::vml::Drawing* pVmlDrawing = rFilter.getVmlDrawing() ) + if( const ::oox::vml::ShapeBase* pVmlShape = pVmlDrawing->getShapes().getShapeById( mxOleObjectInfo->maShapeId, true ) ) + aGraphicPath = pVmlShape->getGraphicPath(); + + // import and store the graphic + if( aGraphicPath.getLength() > 0 ) + { + Reference< graphic::XGraphic > xGraphic = rFilter.getGraphicHelper().importEmbeddedGraphic( aGraphicPath ); + if( xGraphic.is() ) + maShapeProperties[ PROP_Graphic ] <<= xGraphic; + } + } + break; + + default:; + } + return aServiceName; +} + +void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >& rxShapes ) +{ + switch( meFrameType ) + { + case FRAMETYPE_CHART: + { + OSL_ENSURE( mxChartShapeInfo->maFragmentPath.getLength() > 0, "Shape::finalizeXShape - missing chart fragment" ); + if( mxShape.is() && (mxChartShapeInfo->maFragmentPath.getLength() > 0) ) try + { + // set the chart2 OLE class ID at the OLE shape + PropertySet aShapeProp( mxShape ); + aShapeProp.setProperty( PROP_CLSID, CREATE_OUSTRING( "12dcae26-281f-416f-a234-c3086127382e" ) ); + + // get the XModel interface of the embedded object from the OLE shape + Reference< frame::XModel > xDocModel; + aShapeProp.getProperty( xDocModel, PROP_Model ); + Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW ); + + // load the chart data from the XML fragment + chart::ChartSpaceModel aModel; + rFilter.importFragment( new chart::ChartSpaceFragment( rFilter, mxChartShapeInfo->maFragmentPath, aModel ) ); + + // convert imported chart model to chart document + Reference< drawing::XShapes > xExternalPage; + if( !mxChartShapeInfo->mbEmbedShapes ) + xExternalPage = rxShapes; + rFilter.getChartConverter().convertFromModel( rFilter, aModel, xChartDoc, xExternalPage, mxShape->getPosition(), mxShape->getSize() ); + } + catch( Exception& ) + { + } + } + break; + + default:; + } +} + +// ============================================================================ } } diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx index e1bd51f852ad..2c8e0808d8af 100644 --- a/oox/source/drawingml/shapegroupcontext.cxx +++ b/oox/source/drawingml/shapegroupcontext.cxx @@ -108,7 +108,7 @@ Reference< XFastContextHandler > ShapeGroupContext::createFastChildContext( sal_ xRet.set( new GraphicShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ) ) ); break; case XML_graphicFrame: // CT_GraphicalObjectFrame - xRet.set( new GraphicalObjectFrameContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.OLE2Shape" ) ), true ) ); + xRet.set( new GraphicalObjectFrameContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ), true ) ); break; } if( !xRet.is() ) diff --git a/oox/source/drawingml/table/tablecontext.cxx b/oox/source/drawingml/table/tablecontext.cxx index b194fdc9ee26..ef5d87e3081b 100644 --- a/oox/source/drawingml/table/tablecontext.cxx +++ b/oox/source/drawingml/table/tablecontext.cxx @@ -44,8 +44,7 @@ TableContext::TableContext( ContextHandler& rParent, ShapePtr pShapePtr ) : ShapeContext( rParent, ShapePtr(), pShapePtr ) , mrTableProperties( *pShapePtr->getTableProperties().get() ) { - pShapePtr->setServiceName( "com.sun.star.drawing.TableShape" ); - pShapePtr->setSubType( 0 ); + pShapePtr->setTableType(); } TableContext::~TableContext() diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx index 1f365a1fdacd..ae10c290b425 100644 --- a/oox/source/helper/attributelist.cxx +++ b/oox/source/helper/attributelist.cxx @@ -29,6 +29,7 @@ #include #include +#include "oox/token/tokenmap.hxx" namespace oox { @@ -77,6 +78,11 @@ sal_Unicode lclGetXChar( const sal_Unicode*& rpcStr, const sal_Unicode* pcEnd ) // ---------------------------------------------------------------------------- +sal_Int32 AttributeConversion::decodeToken( const OUString& rValue ) +{ + return StaticTokenMap::get().getTokenFromUnicode( rValue ); +} + OUString AttributeConversion::decodeXString( const OUString& rValue ) { // string shorter than one encoded character - no need to decode diff --git a/oox/source/ole/axbinaryreader.cxx b/oox/source/ole/axbinaryreader.cxx index 68a18932bf42..0c4743be9e31 100755 --- a/oox/source/ole/axbinaryreader.cxx +++ b/oox/source/ole/axbinaryreader.cxx @@ -93,7 +93,8 @@ AxFontData::AxFontData() : mnFontEffects( 0 ), mnFontHeight( 160 ), mnFontCharSet( WINDOWS_CHARSET_DEFAULT ), - mnHorAlign( AX_FONTDATA_LEFT ) + mnHorAlign( AX_FONTDATA_LEFT ), + mbDblUnderline( false ) { } @@ -121,6 +122,7 @@ bool AxFontData::importBinaryModel( BinaryInputStream& rInStrm ) aReader.skipIntProperty< sal_uInt8 >(); // font pitch/family aReader.readIntProperty< sal_uInt8 >( mnHorAlign ); aReader.skipIntProperty< sal_uInt16 >(); // font weight + mbDblUnderline = false; return aReader.finalizeImport(); } @@ -135,6 +137,7 @@ bool AxFontData::importStdFont( BinaryInputStream& rInStrm ) setFlag( mnFontEffects, AX_FONTDATA_ITALIC, getFlag( aFontInfo.mnFlags, OLE_STDFONT_ITALIC ) ); setFlag( mnFontEffects, AX_FONTDATA_UNDERLINE, getFlag( aFontInfo.mnFlags, OLE_STDFONT_UNDERLINE ) ); setFlag( mnFontEffects, AX_FONTDATA_STRIKEOUT, getFlag( aFontInfo.mnFlags,OLE_STDFONT_STRIKE ) ); + mbDblUnderline = false; // StdFont stores font height in 1/10,000 of points setHeightPoints( getLimitedValue< sal_Int16, sal_Int32 >( aFontInfo.mnHeight / 10000, 0, SAL_MAX_INT16 ) ); mnFontCharSet = aFontInfo.mnCharSet; @@ -147,7 +150,7 @@ bool AxFontData::importStdFont( BinaryInputStream& rInStrm ) bool AxFontData::importGuidAndFont( BinaryInputStream& rInStrm ) { OUString aGuid = OleHelper::importGuid( rInStrm ); - if( aGuid.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "{AFC20920-DA4E-11CE-B943-00AA006887B4}" ) ) ) + if( aGuid.equalsAscii( AX_GUID_CFONT ) ) return importBinaryModel( rInStrm ); if( aGuid.equalsAscii( OLE_GUID_STDFONT ) ) return importStdFont( rInStrm ); diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index 73da2edea7d1..a0d3d7340f57 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -76,6 +76,7 @@ using namespace ::com::sun::star::form::binding; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::sheet; +using namespace ::com::sun::star::style; using namespace ::com::sun::star::table; using namespace ::com::sun::star::uno; @@ -108,28 +109,6 @@ const sal_uInt32 COMCTL_ID_PROGRESSBAR_60 = 0x97AB8A01; // ---------------------------------------------------------------------------- -const sal_uInt32 AX_FLAGS_ENABLED = 0x00000002; -const sal_uInt32 AX_FLAGS_LOCKED = 0x00000004; -const sal_uInt32 AX_FLAGS_OPAQUE = 0x00000008; -const sal_uInt32 AX_FLAGS_COLUMNHEADS = 0x00000400; -const sal_uInt32 AX_FLAGS_ENTIREROWS = 0x00000800; -const sal_uInt32 AX_FLAGS_EXISTINGENTRIES = 0x00001000; -const sal_uInt32 AX_FLAGS_CAPTIONLEFT = 0x00002000; -const sal_uInt32 AX_FLAGS_EDITABLE = 0x00004000; -const sal_uInt32 AX_FLAGS_IMEMODE_MASK = 0x00078000; -const sal_uInt32 AX_FLAGS_DRAGENABLED = 0x00080000; -const sal_uInt32 AX_FLAGS_ENTERASNEWLINE = 0x00100000; -const sal_uInt32 AX_FLAGS_KEEPSELECTION = 0x00200000; -const sal_uInt32 AX_FLAGS_TABASCHARACTER = 0x00400000; -const sal_uInt32 AX_FLAGS_WORDWRAP = 0x00800000; -const sal_uInt32 AX_FLAGS_BORDERSSUPPRESSED = 0x02000000; -const sal_uInt32 AX_FLAGS_SELECTLINE = 0x04000000; -const sal_uInt32 AX_FLAGS_SINGLECHARSELECT = 0x08000000; -const sal_uInt32 AX_FLAGS_AUTOSIZE = 0x10000000; -const sal_uInt32 AX_FLAGS_HIDESELECTION = 0x20000000; -const sal_uInt32 AX_FLAGS_MAXLENAUTOTAB = 0x40000000; -const sal_uInt32 AX_FLAGS_MULTILINE = 0x80000000; - const sal_uInt32 AX_CMDBUTTON_DEFFLAGS = 0x0000001B; const sal_uInt32 AX_LABEL_DEFFLAGS = 0x0080001B; const sal_uInt32 AX_IMAGE_DEFFLAGS = 0x0000001B; @@ -164,30 +143,10 @@ const sal_uInt32 AX_PICPOS_BELOWRIGHT = AX_PICPOS_IMPL( TOPRIGHT, BOTTO const sal_uInt32 AX_PICPOS_CENTER = AX_PICPOS_IMPL( CENTER, CENTER ); #undef AX_PICPOS_IMPL -const sal_Int32 AX_DISPLAYSTYLE_TEXT = 1; -const sal_Int32 AX_DISPLAYSTYLE_LISTBOX = 2; -const sal_Int32 AX_DISPLAYSTYLE_COMBOBOX = 3; -const sal_Int32 AX_DISPLAYSTYLE_CHECKBOX = 4; -const sal_Int32 AX_DISPLAYSTYLE_OPTBUTTON = 5; -const sal_Int32 AX_DISPLAYSTYLE_TOGGLE = 6; -const sal_Int32 AX_DISPLAYSTYLE_DROPDOWN = 7; - -const sal_Int32 AX_SELCTION_SINGLE = 0; -const sal_Int32 AX_SELCTION_MULTI = 1; -const sal_Int32 AX_SELCTION_EXTENDED = 2; - -const sal_Int32 AX_SCROLLBAR_NONE = 0x00; -const sal_Int32 AX_SCROLLBAR_HORIZONTAL = 0x01; -const sal_Int32 AX_SCROLLBAR_VERTICAL = 0x02; - const sal_Int32 AX_MATCHENTRY_FIRSTLETTER = 0; const sal_Int32 AX_MATCHENTRY_COMPLETE = 1; const sal_Int32 AX_MATCHENTRY_NONE = 2; -const sal_Int32 AX_SHOWDROPBUTTON_NEVER = 0; -const sal_Int32 AX_SHOWDROPBUTTON_FOCUS = 1; -const sal_Int32 AX_SHOWDROPBUTTON_ALWAYS = 2; - const sal_Int32 AX_ORIENTATION_AUTO = -1; const sal_Int32 AX_ORIENTATION_VERTICAL = 0; const sal_Int32 AX_ORIENTATION_HORIZONTAL = 1; @@ -333,11 +292,22 @@ void ControlConverter::convertPicture( PropertyMap& rPropMap, const StreamDataSe void ControlConverter::convertOrientation( PropertyMap& rPropMap, bool bHorizontal ) const { - namespace AwtScrollBarOrient = ::com::sun::star::awt::ScrollBarOrientation; - sal_Int32 nScrollOrient = bHorizontal ? AwtScrollBarOrient::HORIZONTAL : AwtScrollBarOrient::VERTICAL; + sal_Int32 nScrollOrient = bHorizontal ? ScrollBarOrientation::HORIZONTAL : ScrollBarOrientation::VERTICAL; rPropMap.setProperty( PROP_Orientation, nScrollOrient ); } +void ControlConverter::convertVerticalAlign( PropertyMap& rPropMap, sal_Int32 nVerticalAlign ) const +{ + VerticalAlignment eAlign = VerticalAlignment_TOP; + switch( nVerticalAlign ) + { + case XML_Top: eAlign = VerticalAlignment_TOP; break; + case XML_Center: eAlign = VerticalAlignment_MIDDLE; break; + case XML_Bottom: eAlign = VerticalAlignment_BOTTOM; break; + } + rPropMap.setProperty( PROP_VerticalAlign, eAlign ); +} + void ControlConverter::convertScrollBar( PropertyMap& rPropMap, sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nPosition, sal_Int32 nSmallChange, sal_Int32 nLargeChange, bool bAwtModel ) const @@ -451,8 +421,7 @@ void ControlConverter::convertAxBorder( PropertyMap& rPropMap, void ControlConverter::convertAxVisualEffect( PropertyMap& rPropMap, sal_Int32 nSpecialEffect ) const { - namespace AwtVisualEffect = ::com::sun::star::awt::VisualEffect; - sal_Int16 nVisualEffect = (nSpecialEffect == AX_SPECIALEFFECT_FLAT) ? AwtVisualEffect::FLAT : AwtVisualEffect::LOOK3D; + sal_Int16 nVisualEffect = (nSpecialEffect == AX_SPECIALEFFECT_FLAT) ? VisualEffect::FLAT : VisualEffect::LOOK3D; rPropMap.setProperty( PROP_VisualEffect, nVisualEffect ); } @@ -462,23 +431,22 @@ void ControlConverter::convertAxPicture( PropertyMap& rPropMap, const StreamData convertPicture( rPropMap, rPicData ); // picture position - namespace AwtImagePos = ::com::sun::star::awt::ImagePosition; - sal_Int16 nImagePos = AwtImagePos::LeftCenter; + sal_Int16 nImagePos = ImagePosition::LeftCenter; switch( nPicPos ) { - case AX_PICPOS_LEFTTOP: nImagePos = AwtImagePos::LeftTop; break; - case AX_PICPOS_LEFTCENTER: nImagePos = AwtImagePos::LeftCenter; break; - case AX_PICPOS_LEFTBOTTOM: nImagePos = AwtImagePos::LeftBottom; break; - case AX_PICPOS_RIGHTTOP: nImagePos = AwtImagePos::RightTop; break; - case AX_PICPOS_RIGHTCENTER: nImagePos = AwtImagePos::RightCenter; break; - case AX_PICPOS_RIGHTBOTTOM: nImagePos = AwtImagePos::RightBottom; break; - case AX_PICPOS_ABOVELEFT: nImagePos = AwtImagePos::AboveLeft; break; - case AX_PICPOS_ABOVECENTER: nImagePos = AwtImagePos::AboveCenter; break; - case AX_PICPOS_ABOVERIGHT: nImagePos = AwtImagePos::AboveRight; break; - case AX_PICPOS_BELOWLEFT: nImagePos = AwtImagePos::BelowLeft; break; - case AX_PICPOS_BELOWCENTER: nImagePos = AwtImagePos::BelowCenter; break; - case AX_PICPOS_BELOWRIGHT: nImagePos = AwtImagePos::BelowRight; break; - case AX_PICPOS_CENTER: nImagePos = AwtImagePos::Centered; break; + case AX_PICPOS_LEFTTOP: nImagePos = ImagePosition::LeftTop; break; + case AX_PICPOS_LEFTCENTER: nImagePos = ImagePosition::LeftCenter; break; + case AX_PICPOS_LEFTBOTTOM: nImagePos = ImagePosition::LeftBottom; break; + case AX_PICPOS_RIGHTTOP: nImagePos = ImagePosition::RightTop; break; + case AX_PICPOS_RIGHTCENTER: nImagePos = ImagePosition::RightCenter; break; + case AX_PICPOS_RIGHTBOTTOM: nImagePos = ImagePosition::RightBottom; break; + case AX_PICPOS_ABOVELEFT: nImagePos = ImagePosition::AboveLeft; break; + case AX_PICPOS_ABOVECENTER: nImagePos = ImagePosition::AboveCenter; break; + case AX_PICPOS_ABOVERIGHT: nImagePos = ImagePosition::AboveRight; break; + case AX_PICPOS_BELOWLEFT: nImagePos = ImagePosition::BelowLeft; break; + case AX_PICPOS_BELOWCENTER: nImagePos = ImagePosition::BelowCenter; break; + case AX_PICPOS_BELOWRIGHT: nImagePos = ImagePosition::BelowRight; break; + case AX_PICPOS_CENTER: nImagePos = ImagePosition::Centered; break; default: OSL_ENSURE( false, "ControlConverter::convertAxPicture - unknown picture position" ); } rPropMap.setProperty( PROP_ImagePosition, nImagePos ); @@ -491,13 +459,12 @@ void ControlConverter::convertAxPicture( PropertyMap& rPropMap, const StreamData convertPicture( rPropMap, rPicData ); // picture scale mode - namespace AwtScaleMode = ::com::sun::star::awt::ImageScaleMode; - sal_Int16 nScaleMode = AwtScaleMode::None; + sal_Int16 nScaleMode = ImageScaleMode::None; switch( nPicSizeMode ) { - case AX_PICSIZE_CLIP: nScaleMode = AwtScaleMode::None; break; - case AX_PICSIZE_STRETCH: nScaleMode = AwtScaleMode::Anisotropic; break; - case AX_PICSIZE_ZOOM: nScaleMode = AwtScaleMode::Isotropic; break; + case AX_PICSIZE_CLIP: nScaleMode = ImageScaleMode::None; break; + case AX_PICSIZE_STRETCH: nScaleMode = ImageScaleMode::Anisotropic; break; + case AX_PICSIZE_ZOOM: nScaleMode = ImageScaleMode::Isotropic; break; default: OSL_ENSURE( false, "ControlConverter::convertAxPicture - unknown picture size mode" ); } rPropMap.setProperty( PROP_ScaleMode, nScaleMode ); @@ -565,6 +532,7 @@ OUString ControlModelBase::getServiceName() const case API_CONTROL_CHECKBOX: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlCheckBoxModel" ); case API_CONTROL_RADIOBUTTON: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlRadioButtonModel" ); case API_CONTROL_EDIT: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlEditModel" ); + case API_CONTROL_NUMERIC: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlNumericFieldModel" ); case API_CONTROL_LISTBOX: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlListBoxModel" ); case API_CONTROL_COMBOBOX: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlComboBoxModel" ); case API_CONTROL_SPINBUTTON: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlSpinButtonModel" ); @@ -582,6 +550,7 @@ OUString ControlModelBase::getServiceName() const case API_CONTROL_CHECKBOX: return CREATE_OUSTRING( "com.sun.star.form.component.CheckBox" ); case API_CONTROL_RADIOBUTTON: return CREATE_OUSTRING( "com.sun.star.form.component.RadioButton" ); case API_CONTROL_EDIT: return CREATE_OUSTRING( "com.sun.star.form.component.TextField" ); + case API_CONTROL_NUMERIC: return CREATE_OUSTRING( "com.sun.star.form.component.NumericField" ); case API_CONTROL_LISTBOX: return CREATE_OUSTRING( "com.sun.star.form.component.ListBox" ); case API_CONTROL_COMBOBOX: return CREATE_OUSTRING( "com.sun.star.form.component.ComboBox" ); case API_CONTROL_SPINBUTTON: return CREATE_OUSTRING( "com.sun.star.form.component.SpinButton" ); @@ -662,8 +631,8 @@ sal_uInt32 ComCtlModelBase::getDataPartId() const { switch( mnVersion ) { - case 5: return mnDataPartId5; - case 6: return mnDataPartId6; + case COMCTL_VERSION_50: return mnDataPartId5; + case COMCTL_VERSION_60: return mnDataPartId6; } OSL_ENSURE( false, "ComCtlObjectBase::getDataPartId - unxpected version" ); return SAL_MAX_UINT32; @@ -784,7 +753,7 @@ void ComCtlProgressBarModel::convertProperties( PropertyMap& rPropMap, const Con void ComCtlProgressBarModel::importControlData( BinaryInputStream& rInStrm ) { rInStrm >> mfMin >> mfMax; - if( mnVersion == 6 ) + if( mnVersion == COMCTL_VERSION_60 ) rInStrm >> mnVertical >> mnSmooth; } @@ -840,17 +809,15 @@ bool AxFontDataModel::importBinaryModel( BinaryInputStream& rInStrm ) void AxFontDataModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const { - namespace cssa = ::com::sun::star::awt; - // font name if( maFontData.maFontName.getLength() > 0 ) rPropMap.setProperty( PROP_FontName, maFontData.maFontName ); // font effects - rPropMap.setProperty( PROP_FontWeight, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_BOLD, cssa::FontWeight::BOLD, cssa::FontWeight::NORMAL ) ); - rPropMap.setProperty( PROP_FontSlant, getFlagValue< sal_Int16 >( maFontData.mnFontEffects, AX_FONTDATA_ITALIC, cssa::FontSlant_ITALIC, cssa::FontSlant_NONE ) ); - rPropMap.setProperty( PROP_FontUnderline, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_UNDERLINE, cssa::FontUnderline::SINGLE, cssa::FontUnderline::NONE ) ); - rPropMap.setProperty( PROP_FontStrikeout, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_STRIKEOUT, cssa::FontStrikeout::SINGLE, cssa::FontStrikeout::NONE ) ); + rPropMap.setProperty( PROP_FontWeight, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_BOLD, FontWeight::BOLD, FontWeight::NORMAL ) ); + rPropMap.setProperty( PROP_FontSlant, getFlagValue< sal_Int16 >( maFontData.mnFontEffects, AX_FONTDATA_ITALIC, FontSlant_ITALIC, FontSlant_NONE ) ); + rPropMap.setProperty( PROP_FontUnderline, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_UNDERLINE, maFontData.mbDblUnderline ? FontUnderline::DOUBLE : FontUnderline::SINGLE, FontUnderline::NONE ) ); + rPropMap.setProperty( PROP_FontStrikeout, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_STRIKEOUT, FontStrikeout::SINGLE, FontStrikeout::NONE ) ); rPropMap.setProperty( PROP_FontHeight, maFontData.getHeightPoints() ); // font character set @@ -863,12 +830,12 @@ void AxFontDataModel::convertProperties( PropertyMap& rPropMap, const ControlCon // text alignment if( mbSupportsAlign ) { - sal_Int32 nAlign = cssa::TextAlign::LEFT; + sal_Int32 nAlign = TextAlign::LEFT; switch( maFontData.mnHorAlign ) { - case AX_FONTDATA_LEFT: nAlign = cssa::TextAlign::LEFT; break; - case AX_FONTDATA_RIGHT: nAlign = cssa::TextAlign::RIGHT; break; - case AX_FONTDATA_CENTER: nAlign = cssa::TextAlign::CENTER; break; + case AX_FONTDATA_LEFT: nAlign = TextAlign::LEFT; break; + case AX_FONTDATA_RIGHT: nAlign = TextAlign::RIGHT; break; + case AX_FONTDATA_CENTER: nAlign = TextAlign::CENTER; break; default: OSL_ENSURE( false, "AxFontDataModel::convertProperties - unknown text alignment" ); } // form controls expect short value @@ -886,6 +853,7 @@ AxCommandButtonModel::AxCommandButtonModel() : mnBackColor( AX_SYSCOLOR_BUTTONFACE ), mnFlags( AX_CMDBUTTON_DEFFLAGS ), mnPicturePos( AX_PICPOS_ABOVECENTER ), + mnVerticalAlign( XML_Center ), mbFocusOnClick( true ) { } @@ -941,8 +909,8 @@ void AxCommandButtonModel::convertProperties( PropertyMap& rPropMap, const Contr rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) ); rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) ); rPropMap.setProperty( PROP_FocusOnClick, mbFocusOnClick ); - rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_MIDDLE ); rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor ); + rConv.convertVerticalAlign( rPropMap, mnVerticalAlign ); rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_NOTSUPPORTED ); rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos ); AxFontDataModel::convertProperties( rPropMap, rConv ); @@ -956,7 +924,8 @@ AxLabelModel::AxLabelModel() : mnFlags( AX_LABEL_DEFFLAGS ), mnBorderColor( AX_SYSCOLOR_WINDOWFRAME ), mnBorderStyle( AX_BORDERSTYLE_NONE ), - mnSpecialEffect( AX_SPECIALEFFECT_FLAT ) + mnSpecialEffect( AX_SPECIALEFFECT_FLAT ), + mnVerticalAlign( XML_Top ) { } @@ -1004,8 +973,8 @@ void AxLabelModel::convertProperties( PropertyMap& rPropMap, const ControlConver rPropMap.setProperty( PROP_Label, maCaption ); rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) ); rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) ); - rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_TOP ); rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor ); + rConv.convertVerticalAlign( rPropMap, mnVerticalAlign ); rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_VOID ); rConv.convertAxBorder( rPropMap, mnBorderColor, mnBorderStyle, mnSpecialEffect ); AxFontDataModel::convertProperties( rPropMap, rConv ); @@ -1102,7 +1071,8 @@ AxMorphDataModelBase::AxMorphDataModelBase() : mnShowDropButton( AX_SHOWDROPBUTTON_NEVER ), mnMaxLength( 0 ), mnPasswordChar( 0 ), - mnListRows( 8 ) + mnListRows( 8 ), + mnVerticalAlign( XML_Center ) { } @@ -1191,6 +1161,7 @@ void AxMorphDataModelBase::convertProperties( PropertyMap& rPropMap, const Contr AxToggleButtonModel::AxToggleButtonModel() { + mnDisplayStyle = AX_DISPLAYSTYLE_TOGGLE; } ApiControlType AxToggleButtonModel::getControlType() const @@ -1203,8 +1174,8 @@ void AxToggleButtonModel::convertProperties( PropertyMap& rPropMap, const Contro { rPropMap.setProperty( PROP_Label, maCaption ); rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) ); - rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_MIDDLE ); rPropMap.setProperty( PROP_Toggle, true ); + rConv.convertVerticalAlign( rPropMap, mnVerticalAlign ); rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_NOTSUPPORTED ); rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos ); rConv.convertAxState( rPropMap, maValue, mnMultiSelect, API_DEFAULTSTATE_BOOLEAN, mbAwtModel ); @@ -1215,6 +1186,7 @@ void AxToggleButtonModel::convertProperties( PropertyMap& rPropMap, const Contro AxCheckBoxModel::AxCheckBoxModel() { + mnDisplayStyle = AX_DISPLAYSTYLE_CHECKBOX; } ApiControlType AxCheckBoxModel::getControlType() const @@ -1227,7 +1199,7 @@ void AxCheckBoxModel::convertProperties( PropertyMap& rPropMap, const ControlCon { rPropMap.setProperty( PROP_Label, maCaption ); rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) ); - rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_MIDDLE ); + rConv.convertVerticalAlign( rPropMap, mnVerticalAlign ); rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_VOID ); rConv.convertAxVisualEffect( rPropMap, mnSpecialEffect ); rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos ); @@ -1239,6 +1211,7 @@ void AxCheckBoxModel::convertProperties( PropertyMap& rPropMap, const ControlCon AxOptionButtonModel::AxOptionButtonModel() { + mnDisplayStyle = AX_DISPLAYSTYLE_OPTBUTTON; } ApiControlType AxOptionButtonModel::getControlType() const @@ -1251,7 +1224,7 @@ void AxOptionButtonModel::convertProperties( PropertyMap& rPropMap, const Contro { rPropMap.setProperty( PROP_Label, maCaption ); rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) ); - rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_MIDDLE ); + rConv.convertVerticalAlign( rPropMap, mnVerticalAlign ); rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_VOID ); rConv.convertAxVisualEffect( rPropMap, mnSpecialEffect ); rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos ); @@ -1263,6 +1236,7 @@ void AxOptionButtonModel::convertProperties( PropertyMap& rPropMap, const Contro AxTextBoxModel::AxTextBoxModel() { + mnDisplayStyle = AX_DISPLAYSTYLE_TEXT; } ApiControlType AxTextBoxModel::getControlType() const @@ -1288,8 +1262,34 @@ void AxTextBoxModel::convertProperties( PropertyMap& rPropMap, const ControlConv // ============================================================================ +AxNumericFieldModel::AxNumericFieldModel() +{ + mnDisplayStyle = AX_DISPLAYSTYLE_TEXT; +} + +ApiControlType AxNumericFieldModel::getControlType() const +{ + OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_TEXT, "AxNumericFieldModel::getControlType - invalid control type" ); + return API_CONTROL_NUMERIC; +} + +void AxNumericFieldModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_HideInactiveSelection, getFlag( mnFlags, AX_FLAGS_HIDESELECTION ) ); + // TODO: OUString::toDouble() does not handle local decimal separator + rPropMap.setProperty( mbAwtModel ? PROP_Value : PROP_DefaultValue, maValue.toDouble() ); + rPropMap.setProperty( PROP_Spin, getFlag( mnScrollBars, AX_SCROLLBAR_VERTICAL ) ); + rPropMap.setProperty( PROP_Repeat, true ); + rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_VOID ); + rConv.convertAxBorder( rPropMap, mnBorderColor, mnBorderStyle, mnSpecialEffect ); + AxMorphDataModelBase::convertProperties( rPropMap, rConv ); +} + +// ============================================================================ + AxListBoxModel::AxListBoxModel() { + mnDisplayStyle = AX_DISPLAYSTYLE_LISTBOX; } ApiControlType AxListBoxModel::getControlType() const @@ -1312,6 +1312,7 @@ void AxListBoxModel::convertProperties( PropertyMap& rPropMap, const ControlConv AxComboBoxModel::AxComboBoxModel() { + mnDisplayStyle = AX_DISPLAYSTYLE_COMBOBOX; } ApiControlType AxComboBoxModel::getControlType() const @@ -1500,7 +1501,7 @@ void AxScrollBarModel::convertProperties( PropertyMap& rPropMap, const ControlCo // ============================================================================ AxTabStripModel::AxTabStripModel() : - AxFontDataModel( false ), // no support for Align property + AxFontDataModel( false ), // no support for alignment properties mnBackColor( AX_SYSCOLOR_BUTTONFACE ), mnTextColor( AX_SYSCOLOR_BUTTONTEXT ), mnFlags( AX_TABSTRIP_DEFFLAGS ), @@ -1562,7 +1563,7 @@ OUString AxTabStripModel::getCaption( sal_Int32 nIndex ) const // ============================================================================ AxContainerModelBase::AxContainerModelBase( bool bFontSupport ) : - AxFontDataModel( false ), // no support for Align property + AxFontDataModel( false ), // no support for alignment properties maLogicalSize( AX_CONTAINER_DEFWIDTH, AX_CONTAINER_DEFHEIGHT ), maScrollPos( 0, 0 ), mnBackColor( AX_SYSCOLOR_BUTTONFACE ), @@ -1755,43 +1756,26 @@ EmbeddedControl::~EmbeddedControl() { } -ControlModelRef EmbeddedControl::createModel( const OUString& rClassId ) +ControlModelBase* EmbeddedControl::createModelFromGuid( const OUString& rClassId ) { OUString aClassId = rClassId.toAsciiUpperCase(); - if( aClassId.equalsAscii( AX_GUID_COMMANDBUTTON ) ) - mxModel.reset( new AxCommandButtonModel ); - else if( aClassId.equalsAscii( AX_GUID_LABEL ) ) - mxModel.reset( new AxLabelModel ); - else if( aClassId.equalsAscii( AX_GUID_IMAGE ) ) - mxModel.reset( new AxImageModel ); - else if( aClassId.equalsAscii( AX_GUID_TOGGLEBUTTON ) ) - mxModel.reset( new AxToggleButtonModel ); - else if( aClassId.equalsAscii( AX_GUID_CHECKBOX ) ) - mxModel.reset( new AxCheckBoxModel ); - else if( aClassId.equalsAscii( AX_GUID_OPTIONBUTTON ) ) - mxModel.reset( new AxOptionButtonModel ); - else if( aClassId.equalsAscii( AX_GUID_TEXTBOX ) ) - mxModel.reset( new AxTextBoxModel ); - else if( aClassId.equalsAscii( AX_GUID_LISTBOX ) ) - mxModel.reset( new AxListBoxModel ); - else if( aClassId.equalsAscii( AX_GUID_COMBOBOX ) ) - mxModel.reset( new AxComboBoxModel ); - else if( aClassId.equalsAscii( AX_GUID_SPINBUTTON ) ) - mxModel.reset( new AxSpinButtonModel ); - else if( aClassId.equalsAscii( AX_GUID_SCROLLBAR ) ) - mxModel.reset( new AxScrollBarModel ); - else if( aClassId.equalsAscii( AX_GUID_FRAME ) ) - mxModel.reset( new AxFrameModel ); - else if( aClassId.equalsAscii( COMCTL_GUID_SCROLLBAR_60 ) ) - mxModel.reset( new ComCtlScrollBarModel( 6 ) ); - else - mxModel.reset(); - // embedded controls are form component instances - if( mxModel.get() ) - mxModel->setFormComponentMode(); + if( aClassId.equalsAscii( AX_GUID_COMMANDBUTTON ) ) return &createModel< AxCommandButtonModel >(); + if( aClassId.equalsAscii( AX_GUID_LABEL ) ) return &createModel< AxLabelModel >(); + if( aClassId.equalsAscii( AX_GUID_IMAGE ) ) return &createModel< AxImageModel >(); + if( aClassId.equalsAscii( AX_GUID_TOGGLEBUTTON ) ) return &createModel< AxToggleButtonModel >(); + if( aClassId.equalsAscii( AX_GUID_CHECKBOX ) ) return &createModel< AxCheckBoxModel >(); + if( aClassId.equalsAscii( AX_GUID_OPTIONBUTTON ) ) return &createModel< AxOptionButtonModel >(); + if( aClassId.equalsAscii( AX_GUID_TEXTBOX ) ) return &createModel< AxTextBoxModel >(); + if( aClassId.equalsAscii( AX_GUID_LISTBOX ) ) return &createModel< AxListBoxModel >(); + if( aClassId.equalsAscii( AX_GUID_COMBOBOX ) ) return &createModel< AxComboBoxModel >(); + if( aClassId.equalsAscii( AX_GUID_SPINBUTTON ) ) return &createModel< AxSpinButtonModel >(); + if( aClassId.equalsAscii( AX_GUID_SCROLLBAR ) ) return &createModel< AxScrollBarModel >(); + if( aClassId.equalsAscii( AX_GUID_FRAME ) ) return &createModel< AxFrameModel >(); + if( aClassId.equalsAscii( COMCTL_GUID_SCROLLBAR_60 ) ) return &createModel< ComCtlScrollBarModel >( COMCTL_VERSION_60 ); - return mxModel; + mxModel.reset(); + return 0; } OUString EmbeddedControl::getServiceName() const @@ -1817,14 +1801,14 @@ bool EmbeddedControl::convertProperties( const Reference< XControlModel >& rxCtr EmbeddedForm::EmbeddedForm( const Reference< XModel >& rxDocModel, const Reference< XDrawPage >& rxDrawPage, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) : - ControlConverter( rxDocModel, rGraphicHelper, bDefaultColorBgr ), + maControlConv( rxDocModel, rGraphicHelper, bDefaultColorBgr ), mxModelFactory( rxDocModel, UNO_QUERY ), mxFormsSupp( rxDrawPage, UNO_QUERY ) { OSL_ENSURE( mxModelFactory.is(), "EmbeddedForm::EmbeddedForm - missing service factory" ); } -Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl& rControl ) +Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl& rControl, sal_Int32& rnCtrlIndex ) { if( mxModelFactory.is() && rControl.hasModel() ) try { @@ -1834,12 +1818,12 @@ Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl Reference< XControlModel > xCtrlModel( xFormComp, UNO_QUERY_THROW ); // insert the control into the form - Reference< XIndexContainer > xFormIC( createForm(), UNO_SET_THROW ); - sal_Int32 nNewIndex = xFormIC->getCount(); - xFormIC->insertByIndex( nNewIndex, Any( xFormComp ) ); + Reference< XIndexContainer > xFormIC( createXForm(), UNO_SET_THROW ); + rnCtrlIndex = xFormIC->getCount(); + xFormIC->insertByIndex( rnCtrlIndex, Any( xFormComp ) ); // convert the control properties - if( rControl.convertProperties( xCtrlModel, *this ) ) + if( rControl.convertProperties( xCtrlModel, maControlConv ) ) return xCtrlModel; } catch( Exception& ) @@ -1848,7 +1832,7 @@ Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl return Reference< XControlModel >(); } -Reference< XIndexContainer > EmbeddedForm::createForm() +Reference< XIndexContainer > EmbeddedForm::createXForm() { if( mxFormsSupp.is() ) { diff --git a/oox/source/ole/axcontrolfragment.cxx b/oox/source/ole/axcontrolfragment.cxx index ecd782da2cb0..b57807a41df6 100644 --- a/oox/source/ole/axcontrolfragment.cxx +++ b/oox/source/ole/axcontrolfragment.cxx @@ -105,7 +105,7 @@ ContextHandlerRef AxControlFragment::onCreateContext( sal_Int32 nElement, const switch( rAttribs.getToken( AX_TOKEN( persistence ), XML_TOKEN_INVALID ) ) { case XML_persistPropertyBag: - if( ControlModelBase* pModel = mrControl.createModel( aClassId ).get() ) + if( ControlModelBase* pModel = mrControl.createModelFromGuid( aClassId ) ) return new AxControlPropertyContext( *this, *pModel ); break; @@ -121,7 +121,7 @@ ContextHandlerRef AxControlFragment::onCreateContext( sal_Int32 nElement, const OUString aStrmClassId = OleHelper::importGuid( aInStrm ); OSL_ENSURE( aClassId.equalsIgnoreAsciiCase( aStrmClassId ), "AxControlFragment::importBinaryControl - form control class ID mismatch" ); - if( ControlModelBase* pModel = mrControl.createModel( aStrmClassId ).get() ) + if( ControlModelBase* pModel = mrControl.createModelFromGuid( aStrmClassId ) ) pModel->importBinaryModel( aInStrm ); } } @@ -139,7 +139,7 @@ ContextHandlerRef AxControlFragment::onCreateContext( sal_Int32 nElement, const OleStorage aStorage( getFilter().getGlobalFactory(), xStrgStrm, false ); BinaryXInputStream aInStrm( aStorage.openInputStream( CREATE_OUSTRING( "f" ) ), true ); if( !aInStrm.isEof() ) - if( AxContainerModelBase* pModel = dynamic_cast< AxContainerModelBase* >( mrControl.createModel( aClassId ).get() ) ) + if( AxContainerModelBase* pModel = dynamic_cast< AxContainerModelBase* >( mrControl.createModelFromGuid( aClassId ) ) ) pModel->importBinaryModel( aInStrm ); } } diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx index 0a0796e15a7e..8952350c8589 100644 --- a/oox/source/ole/olehelper.cxx +++ b/oox/source/ole/olehelper.cxx @@ -51,10 +51,16 @@ const sal_uInt32 OLE_PALETTECOLOR_MASK = 0x0000FFFF; const sal_uInt32 OLE_BGRCOLOR_MASK = 0x00FFFFFF; const sal_uInt32 OLE_SYSTEMCOLOR_MASK = 0x0000FFFF; +/** Swaps the red and blue component of the passed color. */ +inline sal_uInt32 lclSwapRedBlue( sal_uInt32 nColor ) +{ + return static_cast< sal_uInt32 >( (nColor & 0xFF00FF00) | ((nColor & 0x0000FF) << 16) | ((nColor & 0xFF0000) >> 16) ); +} + /** Returns the UNO RGB color from the passed encoded OLE BGR color. */ inline sal_Int32 lclDecodeBgrColor( sal_uInt32 nOleColor ) { - return static_cast< sal_Int32 >( ((nOleColor & 0x0000FF) << 16) | (nOleColor & 0x00FF00) | ((nOleColor & 0xFF0000) >> 16) ); + return static_cast< sal_Int32 >( lclSwapRedBlue( nOleColor ) & 0xFFFFFF ); } // ---------------------------------------------------------------------------- @@ -161,6 +167,11 @@ StdFontInfo::StdFontInfo( const ::rtl::OUString& rName, sal_uInt32 nHeight, return API_RGB_BLACK; } +/*static*/ sal_uInt32 OleHelper::encodeOleColor( sal_Int32 nRgbColor ) +{ + return OLE_COLORTYPE_BGR | lclSwapRedBlue( static_cast< sal_uInt32 >( nRgbColor & 0xFFFFFF ) ); +} + /*static*/ OUString OleHelper::importGuid( BinaryInputStream& rInStrm ) { OUStringBuffer aBuffer; diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index fbc5306763a6..39306040fd66 100755 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -31,10 +31,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -63,6 +65,7 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::io; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::script; +using namespace ::com::sun::star::script::vba; using namespace ::com::sun::star::uno; using ::comphelper::ConfigurationHelper; @@ -127,12 +130,35 @@ bool VbaFilterConfig::isExportVba() const // ============================================================================ +VbaMacroAttacherBase::VbaMacroAttacherBase( const OUString& rMacroName ) : + maMacroName( rMacroName ) +{ + OSL_ENSURE( maMacroName.getLength() > 0, "VbaMacroAttacherBase::VbaMacroAttacherBase - empty macro name" ); +} + +VbaMacroAttacherBase::~VbaMacroAttacherBase() +{ +} + +void VbaMacroAttacherBase::resolveAndAttachMacro( const Reference< XVBAMacroResolver >& rxResolver ) +{ + try + { + attachMacro( rxResolver->resolveVBAMacroToScriptURL( maMacroName ) ); + } + catch( Exception& ) + { + } +} + +// ============================================================================ + VbaProject::VbaProject( const Reference< XMultiServiceFactory >& rxGlobalFactory, const Reference< XModel >& rxDocModel, const OUString& rConfigCompName ) : VbaFilterConfig( rxGlobalFactory, rConfigCompName ), mxGlobalFactory( rxGlobalFactory ), mxDocModel( rxDocModel ), - maLibName( CREATE_OUSTRING( "Standard" ) ) + maPrjName( CREATE_OUSTRING( "Standard" ) ) { OSL_ENSURE( mxDocModel.is(), "VbaProject::VbaProject - missing document model" ); mxBasicLib = openLibrary( PROP_BasicLibraries, false ); @@ -156,6 +182,12 @@ void VbaProject::importVbaProject( StorageBase& rVbaPrjStrg, const GraphicHelper } } +void VbaProject::registerMacroAttacher( const VbaMacroAttacherRef& rxAttacher ) +{ + OSL_ENSURE( rxAttacher.get(), "VbaProject::registerMacroAttacher - unexpected empty reference" ); + maMacroAttachers.push_back( rxAttacher ); +} + bool VbaProject::hasModules() const { return mxBasicLib.is() && mxBasicLib->hasElements(); @@ -200,7 +232,7 @@ bool VbaProject::attachMacroToEvent( const Reference< XEventsSupplier >& rxEvent // check that the specified macro exists in the module VbaHelper::hasMacro( mxBasicLib, rModuleName, rMacroName ) && // attach the macro to the events supplier - VbaHelper::attachMacroToEvent( rxEventsSupp, rEventName, maLibName, rModuleName, rMacroName ); + VbaHelper::attachMacroToEvent( rxEventsSupp, rEventName, CREATE_OUSTRING( "Standard" ) /*maPrjName*/, rModuleName, rMacroName ); } bool VbaProject::attachMacroToDocumentEvent( const OUString& rEventName, @@ -227,7 +259,7 @@ bool VbaProject::attachMacroToEvent( const Reference< XEventsSupplier >& rxEvent // insert the new macro into the code module and attach it to the event return VbaHelper::insertMacro( mxBasicLib, rModuleName, aProxyName, rProxyArgs, rProxyType, aProxyCode ) && - VbaHelper::attachMacroToEvent( rxEventsSupp, rEventName, maLibName, rModuleName, aProxyName ); + VbaHelper::attachMacroToEvent( rxEventsSupp, rEventName, CREATE_OUSTRING( "Standard" ) /*maPrjName*/, rModuleName, aProxyName ); } return false; } @@ -248,7 +280,11 @@ void VbaProject::addDummyModule( const OUString& rName, sal_Int32 nType ) maDummyModules[ rName ] = nType; } -void VbaProject::prepareModuleImport() +void VbaProject::prepareImport() +{ +} + +void VbaProject::finalizeImport() { } @@ -267,9 +303,9 @@ Reference< XNameContainer > VbaProject::openLibrary( sal_Int32 nPropId, bool bCr try { Reference< XLibraryContainer > xLibContainer( getLibraryContainer( nPropId ), UNO_SET_THROW ); - if( bCreateMissing && !xLibContainer->hasByName( maLibName ) ) - xLibContainer->createLibrary( maLibName ); - xLibrary.set( xLibContainer->getByName( maLibName ), UNO_QUERY_THROW ); + if( bCreateMissing && !xLibContainer->hasByName( CREATE_OUSTRING( "Standard" ) /*maPrjName*/ ) ) + xLibContainer->createLibrary( CREATE_OUSTRING( "Standard" ) /*maPrjName*/ ); + xLibrary.set( xLibContainer->getByName( CREATE_OUSTRING( "Standard" ) /*maPrjName*/ ), UNO_QUERY_THROW ); } catch( Exception& ) { @@ -311,7 +347,7 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap return; // virtual call, derived classes may do some preparations - prepareModuleImport(); + prepareImport(); // read all records of the directory rtl_TextEncoding eTextEnc = RTL_TEXTENCODING_MS_1252; @@ -341,6 +377,14 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap eTextEnc = eNewTextEnc; } break; + case VBA_ID_PROJECTNAME: + { + OUString aPrjName = aRecStrm.readCharArrayUC( nRecSize, eTextEnc ); + OSL_ENSURE( aPrjName.getLength() > 0, "VbaProject::importVba - invalid project name" ); + if( aPrjName.getLength() > 0 ) + maPrjName = aPrjName; + } + break; case VBA_ID_PROJECTMODULES: OOX_ENSURE_RECORDSIZE( nRecSize == 2 ); OSL_ENSURE( aModules.empty(), "VbaProject::importVba - unexpected PROJECTMODULES record" ); @@ -438,10 +482,10 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap } /* Now it is time to load the source code. All modules will be inserted - into the Basic library of the document specified by the 'maLibName' + into the Basic library of the document specified by the 'maPrjName' member. Do not create the Basic library, if there are no modules specified. */ - if( !aModules.empty() && !aDummyModules.empty() ) try + if( !aModules.empty() || !aDummyModules.empty() ) try { // get the basic library Reference< XNameContainer > xBasicLib( createBasicLibrary(), UNO_SET_THROW ); @@ -516,6 +560,27 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap } } } + + // attach macros to registered objects + attachMacros(); + // virtual call, derived classes may do some more processing + finalizeImport(); +} + +void VbaProject::attachMacros() +{ + if( !maMacroAttachers.empty() ) try + { + Sequence< Any > aArgs( 2 ); + aArgs[ 0 ] <<= mxDocModel; + aArgs[ 1 ] <<= maPrjName; + Reference< XVBAMacroResolver > xResolver( mxGlobalFactory->createInstanceWithArguments( + CREATE_OUSTRING( "com.sun.star.script.vba.VBAMacroResolver" ), aArgs ), UNO_QUERY_THROW ); + maMacroAttachers.forEachMem( &VbaMacroAttacherBase::resolveAndAttachMacro, ::boost::cref( xResolver ) ); + } + catch( Exception& ) + { + } } void VbaProject::copyStorage( StorageBase& rVbaPrjStrg ) diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index d60629b4481b..b3cd99ad6166 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -30,6 +30,7 @@ #include "oox/dump/pptxdumper.hxx" #include "oox/drawingml/table/tablestylelistfragmenthandler.hxx" #include "oox/helper/graphichelper.hxx" +#include "oox/ole/vbaproject.hxx" using ::rtl::OUString; using namespace ::com::sun::star; @@ -180,6 +181,11 @@ GraphicHelper* PowerPointImport::implCreateGraphicHelper() const return new PptGraphicHelper( *this ); } +::oox::ole::VbaProject* PowerPointImport::implCreateVbaProject() const +{ + return new ::oox::ole::VbaProject( getGlobalFactory(), getModel(), CREATE_OUSTRING( "Impress" ) ); +} + OUString PowerPointImport::implGetImplementationName() const { return PowerPointImport_getImplementationName(); diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index bfe3ead6ca04..60144bbbe79d 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -64,7 +64,7 @@ PPTShape::~PPTShape() } void PPTShape::addShape( - const oox::core::XmlFilterBase& rFilterBase, + oox::core::XmlFilterBase& rFilterBase, const SlidePersist& rSlidePersist, const oox::drawingml::Theme* pTheme, const Reference< XShapes >& rxShapes, diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index ce99ffc49f19..f4dee1216937 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -129,7 +129,7 @@ sal_Int16 SlidePersist::getLayoutFromValueToken() return nLayout; } -void SlidePersist::createXShapes( const XmlFilterBase& rFilterBase ) +void SlidePersist::createXShapes( XmlFilterBase& rFilterBase ) { applyTextStyles( rFilterBase ); diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index e253d43e56e7..9313184d6865 100644 --- a/oox/source/shape/ShapeContextHandler.cxx +++ b/oox/source/shape/ShapeContextHandler.cxx @@ -68,7 +68,7 @@ ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element ) switch (Element & 0xffff) { case XML_graphic: - mpShape.reset(new Shape("com.sun.star.drawing.OLE2Shape" )); + mpShape.reset(new Shape("com.sun.star.drawing.GraphicObjectShape" )); mxGraphicShapeContext.set (new GraphicalObjectFrameContext(*rFragmentHandler, pMasterShape, mpShape, true)); break; diff --git a/oox/source/shape/ShapeFilterBase.cxx b/oox/source/shape/ShapeFilterBase.cxx index 7ed001ffc96c..c0a4857479a7 100644 --- a/oox/source/shape/ShapeFilterBase.cxx +++ b/oox/source/shape/ShapeFilterBase.cxx @@ -27,6 +27,7 @@ #include "ShapeFilterBase.hxx" #include "oox/drawingml/chart/chartconverter.hxx" +#include "oox/ole/vbaproject.hxx" namespace oox { namespace shape { @@ -65,6 +66,11 @@ const ::oox::drawingml::table::TableStyleListPtr ShapeFilterBase::getTableStyles return *mxChartConv; } +::oox::ole::VbaProject* ShapeFilterBase::implCreateVbaProject() const +{ + return new ::oox::ole::VbaProject( getGlobalFactory(), getModel(), CREATE_OUSTRING( "Writer" ) ); +} + ::rtl::OUString ShapeFilterBase::implGetImplementationName() const { return ::rtl::OUString(); diff --git a/oox/source/shape/ShapeFilterBase.hxx b/oox/source/shape/ShapeFilterBase.hxx index 09cbc75e01aa..748b92389b0c 100644 --- a/oox/source/shape/ShapeFilterBase.hxx +++ b/oox/source/shape/ShapeFilterBase.hxx @@ -60,12 +60,13 @@ public: virtual ::oox::drawingml::chart::ChartConverter& getChartConverter(); - virtual rtl::OUString implGetImplementationName() const; - virtual bool importDocument() { return true; } virtual bool exportDocument() { return true; } private: + virtual ::oox::ole::VbaProject* implCreateVbaProject() const; + virtual rtl::OUString implGetImplementationName() const; + ::boost::shared_ptr< ::oox::drawingml::chart::ChartConverter > mxChartConv; }; diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index 243351cff050..8d02aa6e5256 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -9,6 +9,7 @@ AdjustLuminance AdjustmentValues Align AnchorPosition +ApplyFormDesignMode ArrangeOrder Aspect AttachedAxisIndex @@ -110,6 +111,7 @@ DefaultScrollValue DefaultSpinValue DefaultState DefaultText +DefaultValue DiagonalBLTR DiagonalTLBR DialogLibraries @@ -387,6 +389,7 @@ SortInfo Sound SoundOn Speed +Spin SpinIncrement SpinValue SpinValueMax @@ -445,6 +448,7 @@ UseRings UseSelectedPage VScroll Validation +Value VaryColorsByPoint VertJustify VerticalAlign diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt index b05a21152722..13c1a10ff9b4 100644 --- a/oox/source/token/tokens.txt +++ b/oox/source/token/tokens.txt @@ -63,6 +63,7 @@ BookSection BookTitle BorderColor BorderStyle +Bottom BroadcastTitle Broadcaster Button @@ -72,6 +73,7 @@ Cancel Caption Case CaseNumber +Center ChapterNumber Characters CharactersWithSpaces @@ -82,6 +84,8 @@ ClientData ColHidden Colored Column +Combo +ComboEdit Comments Company Compiler @@ -116,6 +120,7 @@ Director Disabled Dismiss DisplayStyle +Distributed Distributor DocSecurity DocumentFromInternetSite @@ -134,6 +139,7 @@ Editor ElectronicSource Embed EnhancedMetaFile +Extend Extension External False @@ -190,11 +196,13 @@ Issue JournalArticle JournalName JustLastX +Justify LCID LCT Label LargeChange Last +Left LineA Lines Link @@ -239,6 +247,7 @@ MouseIcon MousePointer MoveWithCells Movie +Multi MultiLine MultiSel MultiSelect @@ -315,6 +324,7 @@ Relationships RelationshipsGroupReference Report Reporter +Right RootElement Row RowHidden @@ -340,6 +350,8 @@ ShortTitle ShowDropButtonWhen ShowImportExportValidationErrors SignatureTime +Simple +Single Size SizeMode SizeWithCells @@ -367,6 +379,7 @@ Theater ThesisType Title TitlesOfParts +Top TotalTime Translator True @@ -2087,6 +2100,7 @@ fNode fPr fPrintsWithSheet fPublished +face facet fact factor @@ -2249,6 +2263,7 @@ followColorScheme followSib followedHyperlink font +font4 fontAlgn fontColor fontId diff --git a/oox/source/vml/makefile.mk b/oox/source/vml/makefile.mk index 2b47a1c930db..094d37cd8c1c 100644 --- a/oox/source/vml/makefile.mk +++ b/oox/source/vml/makefile.mk @@ -41,13 +41,15 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- SLOFILES = \ - $(SLO)$/vmldrawing.obj \ - $(SLO)$/vmldrawingfragment.obj \ - $(SLO)$/vmlformatting.obj \ - $(SLO)$/vmlinputstream.obj \ - $(SLO)$/vmlshape.obj \ - $(SLO)$/vmlshapecontainer.obj \ - $(SLO)$/vmlshapecontext.obj + $(SLO)$/vmldrawing.obj \ + $(SLO)$/vmldrawingfragment.obj \ + $(SLO)$/vmlformatting.obj \ + $(SLO)$/vmlinputstream.obj \ + $(SLO)$/vmlshape.obj \ + $(SLO)$/vmlshapecontainer.obj \ + $(SLO)$/vmlshapecontext.obj \ + $(SLO)$/vmltextbox.obj \ + $(SLO)$/vmltextboxcontext.obj # --- Targets ------------------------------------------------------- diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index 56afb8cf76e9..065558d68c9f 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -27,12 +27,15 @@ #include "oox/vml/vmldrawing.hxx" +#include +#include #include -#include "tokens.hxx" +#include #include "oox/core/xmlfilterbase.hxx" #include "oox/ole/axcontrol.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" +#include "tokens.hxx" namespace oox { namespace vml { @@ -41,6 +44,7 @@ namespace vml { using namespace ::com::sun::star::awt; using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; using ::oox::core::XmlFilterBase; @@ -57,6 +61,13 @@ OUString lclGetShapeId( sal_Int32 nShapeId ) return CREATE_OUSTRING( "\0s" ) + OUString::valueOf( nShapeId ); } +/** Returns the numeric VML shape identifier from its textual representation. */ +sal_Int32 lclGetShapeId( const OUString& rShapeId ) +{ + // identifier consists of a literal NUL character, a lowercase 's', and the id + return ((rShapeId.getLength() >= 3) && (rShapeId[ 0 ] == '\0') && (rShapeId[ 1 ] == 's')) ? rShapeId.copy( 2 ).toInt32() : -1; +} + } // namespace // ============================================================================ @@ -106,6 +117,18 @@ Drawing::~Drawing() return *mxCtrlForm; } +void Drawing::registerBlockId( sal_Int32 nBlockId ) +{ + OSL_ENSURE( nBlockId > 0, "Drawing::registerBlockId - invalid block index" ); + if( nBlockId > 0 ) + { + // lower_bound() returns iterator pointing to element equal to nBlockId, if existing + BlockIdVector::iterator aIt = ::std::lower_bound( maBlockIds.begin(), maBlockIds.end(), nBlockId ); + if( (aIt == maBlockIds.end()) || (nBlockId != *aIt) ) + maBlockIds.insert( aIt, nBlockId ); + } +} + void Drawing::registerOleObject( const OleObjectInfo& rOleObject ) { OSL_ENSURE( rOleObject.maShapeId.getLength() > 0, "Drawing::registerOleObject - missing OLE object shape id" ); @@ -132,6 +155,47 @@ void Drawing::convertAndInsert() const mxShapes->convertAndInsert( xShapes ); } +sal_Int32 Drawing::getLocalShapeIndex( const OUString& rShapeId ) const +{ + sal_Int32 nShapeId = lclGetShapeId( rShapeId ); + if( nShapeId <= 0 ) return -1; + + /* Shapes in a drawing are counted per registered shape identifier blocks + as stored in the o:idmap element. The contents of this element have + been stored in our member maBlockIds. Each block represents 1024 shape + identifiers, starting with identifier 1 for the block #0. This means, + block #0 represents the identifiers 1-1024, block #1 represents the + identifiers 1025-2048, and so on. The local shape index has to be + calculated according to all blocks registered for this drawing. + + Example: + Registered for this drawing are blocks #1 and #3 (shape identifiers + 1025-2048 and 3073-4096). + Shape identifier 1025 -> local shape index 1. + Shape identifier 1026 -> local shape index 2. + ... + Shape identifier 2048 -> local shape index 1024. + Shape identifier 3073 -> local shape index 1025. + ... + Shape identifier 4096 -> local shape index 2048. + */ + + // get block id from shape id and find its index in the list of used blocks + sal_Int32 nBlockId = (nShapeId - 1) / 1024; + BlockIdVector::iterator aIt = ::std::lower_bound( maBlockIds.begin(), maBlockIds.end(), nBlockId ); + sal_Int32 nIndex = static_cast< sal_Int32 >( aIt - maBlockIds.begin() ); + + // block id not found in set -> register it now (value of nIndex remains valid) + if( (aIt == maBlockIds.end()) || (*aIt != nBlockId) ) + maBlockIds.insert( aIt, nBlockId ); + + // get one-based offset of shape id in its block + sal_Int32 nBlockOffset = (nShapeId - 1) % 1024 + 1; + + // calculate the local shape index + return 1024 * nIndex + nBlockOffset; +} + const OleObjectInfo* Drawing::getOleObjectInfo( const OUString& rShapeId ) const { return ContainerHelper::getMapElement( maOleObjects, rShapeId ); @@ -142,21 +206,72 @@ const ControlInfo* Drawing::getControlInfo( const OUString& rShapeId ) const return ContainerHelper::getMapElement( maControls, rShapeId ); } +Reference< XShape > Drawing::createAndInsertXShape( const OUString& rService, + const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const +{ + OSL_ENSURE( rService.getLength() > 0, "Drawing::createAndInsertXShape - missing UNO shape service name" ); + OSL_ENSURE( rxShapes.is(), "Drawing::createAndInsertXShape - missing XShapes container" ); + Reference< XShape > xShape; + if( (rService.getLength() > 0) && rxShapes.is() ) try + { + Reference< XMultiServiceFactory > xFactory( mrFilter.getModelFactory(), UNO_SET_THROW ); + xShape.set( xFactory->createInstance( rService ), UNO_QUERY_THROW ); + // insert shape into passed shape collection (maybe drawpage or group shape) + rxShapes->add( xShape ); + xShape->setPosition( Point( rShapeRect.X, rShapeRect.Y ) ); + xShape->setSize( Size( rShapeRect.Width, rShapeRect.Height ) ); + } + catch( Exception& ) + { + } + OSL_ENSURE( xShape.is(), "Drawing::createAndInsertXShape - cannot instanciate shape object" ); + return xShape; +} + +Reference< XShape > Drawing::createAndInsertXControlShape( const ::oox::ole::EmbeddedControl& rControl, + const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect, sal_Int32& rnCtrlIndex ) const +{ + Reference< XShape > xShape; + try + { + // create control model and insert it into the form of the draw page + Reference< XControlModel > xCtrlModel( getControlForm().convertAndInsert( rControl, rnCtrlIndex ), UNO_SET_THROW ); + + // create the control shape + xShape = createAndInsertXShape( CREATE_OUSTRING( "com.sun.star.drawing.ControlShape" ), rxShapes, rShapeRect ); + + // set the control model at the shape + Reference< XControlShape >( xShape, UNO_QUERY_THROW )->setControl( xCtrlModel ); + } + catch( Exception& ) + { + } + return xShape; +} + bool Drawing::isShapeSupported( const ShapeBase& /*rShape*/ ) const { return true; } -bool Drawing::convertShapeClientAnchor( Rectangle& /*orShapeRect*/, const OUString& /*rShapeAnchor*/ ) const +OUString Drawing::getShapeBaseName( const ShapeBase& /*rShape*/ ) const +{ + return OUString(); +} + +bool Drawing::convertClientAnchor( Rectangle& /*orShapeRect*/, const OUString& /*rShapeAnchor*/ ) const { return false; } -void Drawing::convertControlClientData( const Reference< XControlModel >& /*rxCtrlModel*/, const ShapeClientData& /*rClientData*/ ) const +Reference< XShape > Drawing::createAndInsertClientXShape( const ShapeBase& /*rShape*/, + const Reference< XShapes >& /*rxShapes*/, const Rectangle& /*rShapeRect*/ ) const { + return Reference< XShape >(); } -void Drawing::notifyShapeInserted( const Reference< XShape >& /*rxShape*/, const Rectangle& /*rShapeRect*/ ) +void Drawing::notifyXShapeInserted( const Reference< XShape >& /*rxShape*/, + const Rectangle& /*rShapeRect*/, const ShapeBase& /*rShape*/, bool /*bGroupChild*/ ) { } diff --git a/oox/source/vml/vmldrawingfragment.cxx b/oox/source/vml/vmldrawingfragment.cxx index 60ed554c2cb6..aaa4532e5328 100644 --- a/oox/source/vml/vmldrawingfragment.cxx +++ b/oox/source/vml/vmldrawingfragment.cxx @@ -47,7 +47,7 @@ using ::rtl::OUString; // ============================================================================ DrawingFragment::DrawingFragment( XmlFilterBase& rFilter, const OUString& rFragmentPath, Drawing& rDrawing ) : - FragmentHandler2( rFilter, rFragmentPath ), + FragmentHandler2( rFilter, rFragmentPath, false ), // do not trim whitespace, has been preprocessed by the input stream mrDrawing( rDrawing ) { } @@ -65,7 +65,7 @@ ContextHandlerRef DrawingFragment::onCreateContext( sal_Int32 nElement, const At // DOCX filter handles plain shape elements with this fragment handler case VMLDRAWING_WORD: if( isRootElement() ) - return ShapeContextBase::createShapeContext( *this, nElement, rAttribs, mrDrawing.getShapes() ); + return ShapeContextBase::createShapeContext( *this, mrDrawing.getShapes(), nElement, rAttribs ); break; // XLSX and PPTX filters load the entire VML fragment @@ -77,7 +77,7 @@ ContextHandlerRef DrawingFragment::onCreateContext( sal_Int32 nElement, const At if( nElement == XML_xml ) return this; break; case XML_xml: - return ShapeContextBase::createShapeContext( *this, nElement, rAttribs, mrDrawing.getShapes() ); + return ShapeContextBase::createShapeContext( *this, mrDrawing.getShapes(), nElement, rAttribs ); } break; } diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index e82f78cf7210..9aa91597dcc9 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -28,14 +28,14 @@ #include "oox/vml/vmlformatting.hxx" #include -#include "tokens.hxx" #include "oox/drawingml/color.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/fillproperties.hxx" #include "oox/drawingml/lineproperties.hxx" +#include "oox/helper/attributelist.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/token/tokenmap.hxx" +#include "tokens.hxx" namespace oox { namespace vml { @@ -85,8 +85,9 @@ bool lclExtractDouble( double& orfValue, sal_Int32& ornEndPos, const OUString& r /*static*/ bool ConversionHelper::decodeBool( const OUString& rValue ) { + sal_Int32 nToken = AttributeConversion::decodeToken( rValue ); // anything else than 't' or 'true' is considered to be false, as specified - return ((rValue.getLength() == 1) && (rValue[ 0 ] == 't')) || (rValue == CREATE_OUSTRING( "true" )); + return (nToken == XML_t) || (nToken == XML_true); } /*static*/ double ConversionHelper::decodePercent( const OUString& rValue, double fDefValue ) @@ -175,58 +176,35 @@ bool lclExtractDouble( double& orfValue, sal_Int32& ornEndPos, const OUString& r return (decodeMeasureToEmu( rGraphicHelper, rValue, nRefValue, bPixelX, bDefaultAsPixel ) + 180) / 360; } -// ============================================================================ - -namespace { - -/** Converts a VML color attribute to a DrawingML color. - - @param orDmlColor (out-parameter) The destination DrawingML color. - - @param roVmlColor The VML string representation of the color. If existing, - this can be a 6-digit hexadecimal RGB value with leading '#' character, - a predefined color name (e.g. 'black', 'red', etc.), the index into an - application defined color palette in brackets with leading color name - (e.g. 'red [9]' or 'windowColor [64]'), or a color modifier used in - one-color gradients (e.g. 'fill darken(128)' or 'fill lighten(0)'. - - @param roVmlOpacity The opacity of the color. If existing, this should be - a floating-point value in the range [0.0;1.0]. - - @param nDefaultRgb Deafult RGB color used if the parameter roVmlColor is - empty. - - @param nPrimaryRgb If set to something else than API_RGB_TRANSPARENT, - specifies the color to be used to resolve the color modifiers used in - one-color gradients. - */ -void lclGetColor( Color& orDmlColor, const GraphicHelper& rGraphicHelper, +/*static*/ Color ConversionHelper::decodeColor( const GraphicHelper& rGraphicHelper, const OptValue< OUString >& roVmlColor, const OptValue< double >& roVmlOpacity, - sal_Int32 nDefaultRgb, sal_Int32 nPrimaryRgb = API_RGB_TRANSPARENT ) + sal_Int32 nDefaultRgb, sal_Int32 nPrimaryRgb ) { + Color aDmlColor; + // convert opacity const sal_Int32 DML_FULL_OPAQUE = ::oox::drawingml::MAX_PERCENT; double fOpacity = roVmlOpacity.get( 1.0 ); sal_Int32 nOpacity = getLimitedValue< sal_Int32, double >( fOpacity * DML_FULL_OPAQUE, 0, DML_FULL_OPAQUE ); if( nOpacity < DML_FULL_OPAQUE ) - orDmlColor.addTransformation( XML_alpha, nOpacity ); + aDmlColor.addTransformation( XML_alpha, nOpacity ); // color attribute not present - set passed default color if( !roVmlColor.has() ) { - orDmlColor.setSrgbClr( nDefaultRgb ); - return; + aDmlColor.setSrgbClr( nDefaultRgb ); + return aDmlColor; } // separate leading color name or RGB value from following palette index OUString aColorName, aColorIndex; - ConversionHelper::separatePair( aColorName, aColorIndex, roVmlColor.get(), ' ' ); + separatePair( aColorName, aColorIndex, roVmlColor.get(), ' ' ); // RGB colors in the format '#RRGGBB' if( (aColorName.getLength() == 7) && (aColorName[ 0 ] == '#') ) { - orDmlColor.setSrgbClr( aColorName.copy( 1 ).toInt32( 16 ) ); - return; + aDmlColor.setSrgbClr( aColorName.copy( 1 ).toInt32( 16 ) ); + return aDmlColor; } // RGB colors in the format '#RGB' @@ -235,27 +213,27 @@ void lclGetColor( Color& orDmlColor, const GraphicHelper& rGraphicHelper, sal_Int32 nR = aColorName.copy( 1, 1 ).toInt32( 16 ) * 0x11; sal_Int32 nG = aColorName.copy( 2, 1 ).toInt32( 16 ) * 0x11; sal_Int32 nB = aColorName.copy( 3, 1 ).toInt32( 16 ) * 0x11; - orDmlColor.setSrgbClr( (nR << 16) | (nG << 8) | nB ); - return; + aDmlColor.setSrgbClr( (nR << 16) | (nG << 8) | nB ); + return aDmlColor; } /* Predefined color names or system color names (resolve to RGB to detect valid color name). */ - sal_Int32 nColorToken = StaticTokenMap::get().getTokenFromUnicode( aColorName ); + sal_Int32 nColorToken = AttributeConversion::decodeToken( aColorName ); sal_Int32 nRgbValue = Color::getVmlPresetColor( nColorToken, API_RGB_TRANSPARENT ); if( nRgbValue == API_RGB_TRANSPARENT ) nRgbValue = rGraphicHelper.getSystemColor( nColorToken, API_RGB_TRANSPARENT ); if( nRgbValue != API_RGB_TRANSPARENT ) { - orDmlColor.setSrgbClr( nRgbValue ); - return; + aDmlColor.setSrgbClr( nRgbValue ); + return aDmlColor; } // try palette colors enclosed in brackets if( (aColorIndex.getLength() >= 3) && (aColorIndex[ 0 ] == '[') && (aColorIndex[ aColorIndex.getLength() - 1 ] == ']') ) { - orDmlColor.setPaletteClr( aColorIndex.copy( 1, aColorIndex.getLength() - 2 ).toInt32() ); - return; + aDmlColor.setPaletteClr( aColorIndex.copy( 1, aColorIndex.getLength() - 2 ).toInt32() ); + return aDmlColor; } // try fill gradient modificator 'fill ()' @@ -266,7 +244,7 @@ void lclGetColor( Color& orDmlColor, const GraphicHelper& rGraphicHelper, if( (2 <= nOpenParen) && (nOpenParen + 1 < nCloseParen) && (nCloseParen + 1 == aColorIndex.getLength()) ) { sal_Int32 nModToken = XML_TOKEN_INVALID; - switch( StaticTokenMap::get().getTokenFromUnicode( aColorIndex.copy( 0, nOpenParen ) ) ) + switch( AttributeConversion::decodeToken( aColorIndex.copy( 0, nOpenParen ) ) ) { case XML_darken: nModToken = XML_shade; case XML_lighten: nModToken = XML_tint; @@ -277,18 +255,23 @@ void lclGetColor( Color& orDmlColor, const GraphicHelper& rGraphicHelper, /* Simulate this modifier color by a color with related transformation. The modifier amount has to be converted from the range [0;255] to percentage [0;100000] used by DrawingML. */ - orDmlColor.setSrgbClr( nPrimaryRgb ); - orDmlColor.addTransformation( nModToken, static_cast< sal_Int32 >( nValue * ::oox::drawingml::MAX_PERCENT / 255 ) ); - return; + aDmlColor.setSrgbClr( nPrimaryRgb ); + aDmlColor.addTransformation( nModToken, static_cast< sal_Int32 >( nValue * ::oox::drawingml::MAX_PERCENT / 255 ) ); + return aDmlColor; } } } - OSL_ENSURE( false, OStringBuffer( "lclGetColor - invalid VML color name '" ). + OSL_ENSURE( false, OStringBuffer( "ConversionHelper::decodeColor - invalid VML color name '" ). append( OUStringToOString( roVmlColor.get(), RTL_TEXTENCODING_ASCII_US ) ).append( '\'' ).getStr() ); - orDmlColor.setSrgbClr( nDefaultRgb ); + aDmlColor.setSrgbClr( nDefaultRgb ); + return aDmlColor; } +// ============================================================================ + +namespace { + sal_Int32 lclGetEmu( const GraphicHelper& rGraphicHelper, const OptValue< OUString >& roValue, sal_Int32 nDefValue ) { return roValue.has() ? ConversionHelper::decodeMeasureToEmu( rGraphicHelper, roValue.get(), 0, false, false ) : nDefValue; @@ -299,7 +282,7 @@ void lclGetDmlLineDash( OptValue< sal_Int32 >& oroPresetDash, LineProperties::Da if( roDashStyle.has() ) { const OUString& rDashStyle = roDashStyle.get(); - switch( StaticTokenMap::get().getTokenFromUnicode( rDashStyle ) ) + switch( AttributeConversion::decodeToken( rDashStyle ) ) { case XML_solid: oroPresetDash = XML_solid; return; case XML_shortdot: oroPresetDash = XML_sysDot; return; @@ -445,7 +428,7 @@ void StrokeModel::pushToPropMap( PropertyMap& rPropMap, aLineProps.maLineFill.moFillType = XML_solidFill; lclConvertArrow( aLineProps.maStartArrow, maStartArrow ); lclConvertArrow( aLineProps.maEndArrow, maEndArrow ); - lclGetColor( aLineProps.maLineFill.maFillColor, rGraphicHelper, moColor, moOpacity, API_RGB_BLACK ); + aLineProps.maLineFill.maFillColor = ConversionHelper::decodeColor( rGraphicHelper, moColor, moOpacity, API_RGB_BLACK ); aLineProps.moLineWidth = lclGetEmu( rGraphicHelper, moWeight, 1 ); lclGetDmlLineDash( aLineProps.moPresetDash, aLineProps.maCustomDash, moDashStyle ); aLineProps.moLineCompound = lclGetDmlLineCompound( moLineStyle ); @@ -498,9 +481,8 @@ void FillModel::pushToPropMap( PropertyMap& rPropMap, double fFocus = moFocus.get( 0.0 ); // prepare colors - Color aColor1, aColor2; - lclGetColor( aColor1, rGraphicHelper, moColor, moOpacity, API_RGB_WHITE ); - lclGetColor( aColor2, rGraphicHelper, moColor2, moOpacity2, API_RGB_WHITE, aColor1.getColor( rGraphicHelper ) ); + Color aColor1 = ConversionHelper::decodeColor( rGraphicHelper, moColor, moOpacity, API_RGB_WHITE ); + Color aColor2 = ConversionHelper::decodeColor( rGraphicHelper, moColor2, moOpacity2, API_RGB_WHITE, aColor1.getColor( rGraphicHelper ) ); // type XML_gradient is linear or axial gradient if( nFillType == XML_gradient ) @@ -588,7 +570,7 @@ void FillModel::pushToPropMap( PropertyMap& rPropMap, { aFillProps.moFillType = XML_solidFill; // fill color (default is white) - lclGetColor( aFillProps.maFillColor, rGraphicHelper, moColor, moOpacity, API_RGB_WHITE ); + aFillProps.maFillColor = ConversionHelper::decodeColor( rGraphicHelper, moColor, moOpacity, API_RGB_WHITE ); } } } diff --git a/oox/source/vml/vmlinputstream.cxx b/oox/source/vml/vmlinputstream.cxx index 27776c66ca0b..fb2443aba4c4 100644 --- a/oox/source/vml/vmlinputstream.cxx +++ b/oox/source/vml/vmlinputstream.cxx @@ -151,6 +151,48 @@ void lclProcessAttribs( OStringBuffer& rBuffer, const sal_Char* pcBeg, const sal lclAppendToBuffer( rBuffer, pcBeg, pcEnd ); } +void lclProcessContents( OStringBuffer& rBuffer, const sal_Char* pcBeg, const sal_Char* pcEnd ) +{ + /* MSO has a very weird way to store and handle whitespaces. The stream + may contain lots of spaces, tabs, and newlines which have to be handled + as single space character. This will be done in this function. + + If the element text contains a literal line break, it will be stored as +
tag (without matching closing
element). + + A single space character following another character is stored + literally and must not be stipped away here. Example: The element + abc + contains the three letters a, b, and c, followed by a space character. + + Consecutive space characters, or a leading single space character, are + stored in a element. If there are N space characters (N > 1), + then the element contains exactly (N-1) NBSP characters + (non-breaking space), followed by a regular space character. Example: + The element + \xA0\xA0\xA0 + represents 4 consecutive space characters. Has to be handled by the + implementation. + + A single space character for its own is stored in an empty element. + Example: The element + + represents a single space character. Has to be handled by the + implementation. + */ + + // skip leading whitespace + const sal_Char* pcContentsBeg = lclFindNonWhiteSpace( pcBeg, pcEnd ); + while( pcContentsBeg < pcEnd ) + { + const sal_Char* pcWhitespaceBeg = lclFindWhiteSpace( pcContentsBeg + 1, pcEnd ); + lclAppendToBuffer( rBuffer, pcContentsBeg, pcWhitespaceBeg ); + if( pcWhitespaceBeg < pcEnd ) + rBuffer.append( ' ' ); + pcContentsBeg = lclFindNonWhiteSpace( pcWhitespaceBeg, pcEnd ); + } +} + } // namespace // ============================================================================ @@ -179,8 +221,9 @@ StreamDataContainer::StreamDataContainer( const Reference< XInputStream >& rxInS { // look for the next opening angle bracket const sal_Char* pcOpen = lclFindCharacter( pcCurr, pcEnd, '<' ); + // copy all characters from current position to opening bracket - lclAppendToBuffer( aBuffer, pcCurr, pcOpen ); + lclProcessContents( aBuffer, pcCurr, pcOpen ); // nothing to do if no opening bracket has been found if( pcOpen < pcEnd ) @@ -217,10 +260,10 @@ StreamDataContainer::StreamDataContainer( const Reference< XInputStream >& rxInS // do nothing } - // replace '
' elements with '
' elements + // replace '
' element with newline else if( (nElementLen >= 4) && (pcOpen[ 1 ] == 'b') && (pcOpen[ 2 ] == 'r') && (lclFindNonWhiteSpace( pcOpen + 3, pcClose ) == pcClose) ) { - aBuffer.append( RTL_CONSTASCII_STRINGPARAM( "
" ) ); + aBuffer.append( '\n' ); } // check start elements and empty elements for repeated attributes diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 290e624698f4..5603d1b541b1 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -27,16 +27,14 @@ #include "oox/vml/vmlshape.hxx" -#include #include #include #include -#include #include #include #include #include -#include "properties.hxx" +#include #include "oox/core/xmlfilterbase.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" @@ -46,6 +44,8 @@ #include "oox/ole/oleobjecthelper.hxx" #include "oox/vml/vmldrawing.hxx" #include "oox/vml/vmlshapecontainer.hxx" +#include "oox/vml/vmltextbox.hxx" +#include "properties.hxx" namespace oox { namespace vml { @@ -55,16 +55,21 @@ namespace vml { using namespace ::com::sun::star::awt; using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::graphic; -using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; using ::oox::core::XmlFilterBase; using ::rtl::OUString; +using ::rtl::OUStringBuffer; // ============================================================================ namespace { +const sal_Int32 VML_SHAPETYPE_PICTUREFRAME = 75; +const sal_Int32 VML_SHAPETYPE_HOSTCONTROL = 201; + +// ---------------------------------------------------------------------------- + Point lclGetAbsPoint( const Point& rRelPoint, const Rectangle& rShapeRect, const Rectangle& rCoordSys ) { double fWidthRatio = static_cast< double >( rShapeRect.Width ) / rCoordSys.Width; @@ -87,55 +92,6 @@ Rectangle lclGetAbsRect( const Rectangle& rRelRect, const Rectangle& rShapeRect, return aAbsRect; } -Reference< XShape > lclCreateXShape( const XmlFilterBase& rFilter, const OUString& rService ) -{ - OSL_ENSURE( rService.getLength() > 0, "lclCreateXShape - missing UNO shape service name" ); - Reference< XShape > xShape; - try - { - Reference< XMultiServiceFactory > xFactory( rFilter.getModelFactory(), UNO_SET_THROW ); - xShape.set( xFactory->createInstance( rService ), UNO_QUERY_THROW ); - } - catch( Exception& ) - { - } - OSL_ENSURE( xShape.is(), "lclCreateXShape - cannot instanciate shape object" ); - return xShape; -} - -void lclInsertXShape( const Reference< XShapes >& rxShapes, const Reference< XShape >& rxShape ) -{ - OSL_ENSURE( rxShapes.is(), "lclInsertXShape - missing XShapes container" ); - OSL_ENSURE( rxShape.is(), "lclInsertXShape - missing XShape" ); - if( rxShapes.is() && rxShape.is() ) try - { - // insert shape into passed shape collection (maybe drawpage or group shape) - rxShapes->add( rxShape ); - } - catch( Exception& ) - { - } -} - -void lclSetXShapeRect( const Reference< XShape >& rxShape, const Rectangle& rShapeRect ) -{ - OSL_ENSURE( rxShape.is(), "lclSetXShapeRect - missing XShape" ); - if( rxShape.is() ) - { - rxShape->setPosition( Point( rShapeRect.X, rShapeRect.Y ) ); - rxShape->setSize( Size( rShapeRect.Width, rShapeRect.Height ) ); - } -} - -Reference< XShape > lclCreateAndInsertXShape( const XmlFilterBase& rFilter, - const Reference< XShapes >& rxShapes, const OUString& rService, const Rectangle& rShapeRect ) -{ - Reference< XShape > xShape = lclCreateXShape( rFilter, rService ); - lclInsertXShape( rxShapes, xShape ); - lclSetXShapeRect( xShape, rShapeRect ); - return xShape; -} - } // namespace // ============================================================================ @@ -168,6 +124,11 @@ ShapeType::~ShapeType() { } +sal_Int32 ShapeType::getShapeType() const +{ + return maTypeModel.moShapeType.get( 0 ); +} + OUString ShapeType::getGraphicPath() const { return maTypeModel.moGraphicPath.get( OUString() ); @@ -208,12 +169,30 @@ Rectangle ShapeType::getRelRectangle() const // ============================================================================ -ShapeClientData::ShapeClientData() : +ClientData::ClientData() : mnObjType( XML_TOKEN_INVALID ), + mnTextHAlign( XML_Left ), + mnTextVAlign( XML_Top ), mnCol( -1 ), mnRow( -1 ), + mnChecked( VML_CLIENTDATA_UNCHECKED ), + mnDropStyle( XML_Combo ), + mnDropLines( 1 ), + mnVal( 0 ), + mnMin( 0 ), + mnMax( 0 ), + mnInc( 0 ), + mnPage( 0 ), + mnSelType( XML_Single ), + mnVTEdit( VML_CLIENTDATA_TEXT ), mbPrintObject( true ), - mbVisible( false ) + mbVisible( false ), + mbDde( false ), + mbNo3D( false ), + mbNo3D2( false ), + mbMultiLine( false ), + mbVScroll( false ), + mbSecretEdit( false ) { } @@ -223,9 +202,19 @@ ShapeModel::ShapeModel() { } -ShapeClientData& ShapeModel::createClientData() +ShapeModel::~ShapeModel() +{ +} + +TextBox& ShapeModel::createTextBox() +{ + mxTextBox.reset( new TextBox ); + return *mxTextBox; +} + +ClientData& ShapeModel::createClientData() { - mxClientData.reset( new ShapeClientData ); + mxClientData.reset( new ClientData ); return *mxClientData; } @@ -244,6 +233,22 @@ void ShapeBase::finalizeFragmentImport() maTypeModel.assignUsed( pShapeType->getTypeModel() ); } +OUString ShapeBase::getShapeName() const +{ + if( maTypeModel.maShapeName.getLength() > 0 ) + return maTypeModel.maShapeName; + + OUString aBaseName = mrDrawing.getShapeBaseName( *this ); + if( aBaseName.getLength() > 0 ) + { + sal_Int32 nShapeIdx = mrDrawing.getLocalShapeIndex( getShapeId() ); + if( nShapeIdx > 0 ) + return OUStringBuffer( aBaseName ).append( sal_Unicode( ' ' ) ).append( nShapeIdx ).makeStringAndClear(); + } + + return OUString(); +} + const ShapeType* ShapeBase::getChildTypeById( const OUString& ) const { return 0; @@ -262,15 +267,23 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS /* Calculate shape rectangle. Applications may do something special according to some imported shape client data (e.g. Excel cell anchor). */ Rectangle aShapeRect = calcShapeRectangle( pParentAnchor ); + // convert the shape, if the calculated rectangle is not empty if( ((aShapeRect.Width > 0) || (aShapeRect.Height > 0)) && rxShapes.is() ) { xShape = implConvertAndInsert( rxShapes, aShapeRect ); - /* Notify the drawing that a new shape has been inserted (but not - for children of group shapes). For convenience, pass the - rectangle that contains position and size of the shape. */ - if( !pParentAnchor && xShape.is() ) - mrDrawing.notifyShapeInserted( xShape, aShapeRect ); + if( xShape.is() ) + { + // set shape name (imported or generated) + PropertySet aShapeProp( xShape ); + aShapeProp.setProperty( PROP_Name, getShapeName() ); + + /* Notify the drawing that a new shape has been inserted. For + convenience, pass the rectangle that contains position and + size of the shape. */ + bool bGroupChild = pParentAnchor != 0; + mrDrawing.notifyXShapeInserted( xShape, aShapeRect, *this, bGroupChild ); + } } } return xShape; @@ -283,10 +296,12 @@ void ShapeBase::convertFormatting( const Reference< XShape >& rxShape, const Sha /* Calculate shape rectangle. Applications may do something special according to some imported shape client data (e.g. Excel cell anchor). */ Rectangle aShapeRect = calcShapeRectangle( pParentAnchor ); + // convert the shape, if the calculated rectangle is not empty if( (aShapeRect.Width > 0) || (aShapeRect.Height > 0) ) { - lclSetXShapeRect( rxShape, aShapeRect ); + rxShape->setPosition( Point( aShapeRect.X, aShapeRect.Y ) ); + rxShape->setSize( Size( aShapeRect.Width, aShapeRect.Height ) ); convertShapeProperties( rxShape ); } } @@ -299,7 +314,8 @@ Rectangle ShapeBase::calcShapeRectangle( const ShapeParentAnchor* pParentAnchor /* Calculate shape rectangle. Applications may do something special according to some imported shape client data (e.g. Excel cell anchor). */ Rectangle aShapeRect; - if( !maShapeModel.mxClientData.get() || !mrDrawing.convertShapeClientAnchor( aShapeRect, maShapeModel.mxClientData->maAnchor ) ) + const ClientData* pClientData = getClientData(); + if( !pClientData || !mrDrawing.convertClientAnchor( aShapeRect, pClientData->maAnchor ) ) aShapeRect = getRectangle( pParentAnchor ); return aShapeRect; } @@ -327,7 +343,7 @@ SimpleShape::SimpleShape( Drawing& rDrawing, const OUString& rService ) : Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const { - Reference< XShape > xShape = lclCreateAndInsertXShape( mrDrawing.getFilter(), rxShapes, maService, rShapeRect ); + Reference< XShape > xShape = mrDrawing.createAndInsertXShape( maService, rxShapes, rShapeRect ); convertShapeProperties( xShape ); return xShape; } @@ -386,7 +402,7 @@ Reference< XShape > CustomShape::implConvertAndInsert( const Reference< XShapes { // create the custom shape geometry Reference< XEnhancedCustomShapeDefaulter > xDefaulter( xShape, UNO_QUERY_THROW ); - xDefaulter->createCustomShapeDefaults( OUString::valueOf( maTypeModel.moShapeType.get( 0 ) ) ); + xDefaulter->createCustomShapeDefaults( OUString::valueOf( getShapeType() ) ); // convert common properties convertShapeProperties( xShape ); } @@ -406,11 +422,14 @@ ComplexShape::ComplexShape( Drawing& rDrawing ) : Reference< XShape > ComplexShape::implConvertAndInsert( const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const { XmlFilterBase& rFilter = mrDrawing.getFilter(); + sal_Int32 nShapeType = getShapeType(); OUString aGraphicPath = getGraphicPath(); // try to find registered OLE object info if( const OleObjectInfo* pOleObjectInfo = mrDrawing.getOleObjectInfo( maTypeModel.maShapeId ) ) { + OSL_ENSURE( nShapeType == VML_SHAPETYPE_PICTUREFRAME, "ComplexShape::implConvertAndInsert - unexpected shape type" ); + // if OLE object is embedded into a DrawingML shape (PPTX), do not create it here if( pOleObjectInfo->mbDmlShape ) return Reference< XShape >(); @@ -419,7 +438,7 @@ Reference< XShape > ComplexShape::implConvertAndInsert( const Reference< XShapes Size aOleSize( rShapeRect.Width, rShapeRect.Height ); if( rFilter.getOleObjectHelper().importOleObject( aOleProps, *pOleObjectInfo, aOleSize ) ) { - Reference< XShape > xShape = lclCreateAndInsertXShape( rFilter, rxShapes, CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" ), rShapeRect ); + Reference< XShape > xShape = mrDrawing.createAndInsertXShape( CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" ), rxShapes, rShapeRect ); if( xShape.is() ) { // set the replacement graphic @@ -440,36 +459,40 @@ Reference< XShape > ComplexShape::implConvertAndInsert( const Reference< XShapes // try to find registered form control info const ControlInfo* pControlInfo = mrDrawing.getControlInfo( maTypeModel.maShapeId ); - if( pControlInfo && (pControlInfo->maFragmentPath.getLength() > 0) && (maTypeModel.maName.getLength() > 0) ) + if( pControlInfo && (pControlInfo->maFragmentPath.getLength() > 0) ) { - OSL_ENSURE( maTypeModel.maName == pControlInfo->maName, "ComplexShape::implConvertAndInsert - control name mismatch" ); - ::oox::ole::EmbeddedControl aControl( maTypeModel.maName ); - // load the control properties from fragment - if( rFilter.importFragment( new ::oox::ole::AxControlFragment( rFilter, pControlInfo->maFragmentPath, aControl ) ) ) try - { - // create control model and insert it into the form of the draw page - Reference< XControlModel > xCtrlModel( mrDrawing.getControlForm().convertAndInsert( aControl ), UNO_SET_THROW ); - if( maShapeModel.mxClientData.get() ) - mrDrawing.convertControlClientData( xCtrlModel, *maShapeModel.mxClientData ); - - // create the control shape, set control model at the shape - Reference< XShape > xShape = lclCreateAndInsertXShape( - rFilter, rxShapes, CREATE_OUSTRING( "com.sun.star.drawing.ControlShape" ), rShapeRect ); - Reference< XControlShape > xCtrlShape( xShape, UNO_QUERY ); // do not throw, but always return the shape - if( xCtrlShape.is() ) - xCtrlShape->setControl( xCtrlModel ); - return xShape; - } - catch( Exception& ) + OSL_ENSURE( nShapeType == VML_SHAPETYPE_HOSTCONTROL, "ComplexShape::implConvertAndInsert - unexpected shape type" ); + OUString aShapeName = getShapeName(); + if( aShapeName.getLength() > 0 ) { + OSL_ENSURE( aShapeName == pControlInfo->maName, "ComplexShape::implConvertAndInsert - control name mismatch" ); + // load the control properties from fragment + ::oox::ole::EmbeddedControl aControl( aShapeName ); + if( rFilter.importFragment( new ::oox::ole::AxControlFragment( rFilter, pControlInfo->maFragmentPath, aControl ) ) ) + { + // create and return the control shape (including control model) + sal_Int32 nCtrlIndex = -1; + Reference< XShape > xShape = mrDrawing.createAndInsertXControlShape( aControl, rxShapes, rShapeRect, nCtrlIndex ); + // on error, proceed and try to create picture from replacement image + if( xShape.is() ) + return xShape; + } } - // on error, proceed and try to create picture from replacement image + } + + // host application wants to create the shape (do not try failed OLE controls again) + if( (nShapeType == VML_SHAPETYPE_HOSTCONTROL) && !pControlInfo ) + { + OSL_ENSURE( getClientData(), "ComplexShape::implConvertAndInsert - missing client data" ); + Reference< XShape > xShape = mrDrawing.createAndInsertClientXShape( *this, rxShapes, rShapeRect ); + if( xShape.is() ) + return xShape; } // try to create a picture object if( aGraphicPath.getLength() > 0 ) { - Reference< XShape > xShape = lclCreateAndInsertXShape( rFilter, rxShapes, CREATE_OUSTRING( "com.sun.star.drawing.GraphicObjectShape" ), rShapeRect ); + Reference< XShape > xShape = mrDrawing.createAndInsertXShape( CREATE_OUSTRING( "com.sun.star.drawing.GraphicObjectShape" ), rxShapes, rShapeRect ); if( xShape.is() ) { OUString aGraphicUrl = rFilter.getGraphicHelper().importEmbeddedGraphicObject( aGraphicPath ); @@ -525,7 +548,7 @@ Reference< XShape > GroupShape::implConvertAndInsert( const Reference< XShapes > aParentAnchor.maCoordSys = getCoordSystem(); if( !mxChildren->empty() && (aParentAnchor.maCoordSys.Width > 0) && (aParentAnchor.maCoordSys.Height > 0) ) try { - xGroupShape = lclCreateAndInsertXShape( mrDrawing.getFilter(), rxShapes, CREATE_OUSTRING( "com.sun.star.drawing.GroupShape" ), rShapeRect ); + xGroupShape = mrDrawing.createAndInsertXShape( CREATE_OUSTRING( "com.sun.star.drawing.GroupShape" ), rxShapes, rShapeRect ); Reference< XShapes > xChildShapes( xGroupShape, UNO_QUERY_THROW ); mxChildren->convertAndInsert( xChildShapes, &aParentAnchor ); // no child shape has been created - delete the group shape diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index ac08c1836c2d..d16644a7908a 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -27,8 +27,10 @@ #include "oox/vml/vmlshapecontext.hxx" +#include "oox/vml/vmldrawing.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" +#include "oox/vml/vmltextboxcontext.hxx" namespace oox { namespace vml { @@ -104,39 +106,101 @@ OptValue< DoublePair > lclDecodePercentPair( const AttributeList& rAttribs, sal_ bool lclDecodeVmlxBool( const OUString& rValue, bool bDefaultForEmpty ) { if( rValue.getLength() == 0 ) return bDefaultForEmpty; + sal_Int32 nToken = AttributeConversion::decodeToken( rValue ); // anything else than 't' or 'True' is considered to be false, as specified - return ((rValue.getLength() == 1) && (rValue[ 0 ] == 't')) || (rValue == CREATE_OUSTRING( "True" )); + return (nToken == XML_t) || (nToken == XML_True); } } // namespace // ============================================================================ -ShapeClientDataContext::ShapeClientDataContext( ContextHandler2Helper& rParent, - const AttributeList& rAttribs, ShapeClientData& rClientData ) : +ShapeLayoutContext::ShapeLayoutContext( ContextHandler2Helper& rParent, Drawing& rDrawing ) : + ContextHandler2( rParent ), + mrDrawing( rDrawing ) +{ +} + + +ContextHandlerRef ShapeLayoutContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( nElement ) + { + case O_TOKEN( idmap ): + { + OUString aBlockIds = rAttribs.getString( XML_data, OUString() ); + sal_Int32 nIndex = 0; + while( nIndex >= 0 ) + { + OUString aToken = aBlockIds.getToken( 0, ' ', nIndex ).trim(); + if( aToken.getLength() > 0 ) + mrDrawing.registerBlockId( aToken.toInt32() ); + } + } + break; + } + return 0; +} + +// ============================================================================ + +ClientDataContext::ClientDataContext( ContextHandler2Helper& rParent, + ClientData& rClientData, const AttributeList& rAttribs ) : ContextHandler2( rParent ), mrClientData( rClientData ) { mrClientData.mnObjType = rAttribs.getToken( XML_ObjectType, XML_TOKEN_INVALID ); } -ContextHandlerRef ShapeClientDataContext::onCreateContext( sal_Int32 /*nElement*/, const AttributeList& /*rAttribs*/ ) +ContextHandlerRef ClientDataContext::onCreateContext( sal_Int32 /*nElement*/, const AttributeList& /*rAttribs*/ ) { - return isRootElement() ? this : 0; + if( isRootElement() ) + { + maElementText = OUString(); + return this; + } + return 0; } -void ShapeClientDataContext::onEndElement( const OUString& rChars ) +void ClientDataContext::onCharacters( const OUString& rChars ) +{ + /* Empty but existing elements have special meaning, e.g. 'true'. Collect + existing text and convert it in onEndElement(). */ + maElementText = rChars; +} + +void ClientDataContext::onEndElement() { switch( getCurrentElement() ) { - case VMLX_TOKEN( Anchor ): mrClientData.maAnchor = rChars; break; - case VMLX_TOKEN( FmlaPict ): mrClientData.maPictureLink = rChars; break; - case VMLX_TOKEN( FmlaLink ): mrClientData.maLinkedCell = rChars; break; - case VMLX_TOKEN( FmlaRange ): mrClientData.maSourceRange = rChars; break; - case VMLX_TOKEN( Column ): mrClientData.mnCol = rChars.toInt32(); break; - case VMLX_TOKEN( Row ): mrClientData.mnRow = rChars.toInt32(); break; - case VMLX_TOKEN( PrintObject ): mrClientData.mbPrintObject = lclDecodeVmlxBool( rChars, true ); break; - case VMLX_TOKEN( Visible ): mrClientData.mbVisible = true; break; + case VMLX_TOKEN( Anchor ): mrClientData.maAnchor = maElementText; break; + case VMLX_TOKEN( FmlaMacro ): mrClientData.maFmlaMacro = maElementText; break; + case VMLX_TOKEN( FmlaPict ): mrClientData.maFmlaPict = maElementText; break; + case VMLX_TOKEN( FmlaLink ): mrClientData.maFmlaLink = maElementText; break; + case VMLX_TOKEN( FmlaRange ): mrClientData.maFmlaRange = maElementText; break; + case VMLX_TOKEN( FmlaGroup ): mrClientData.maFmlaGroup = maElementText; break; + case VMLX_TOKEN( TextHAlign ): mrClientData.mnTextHAlign = AttributeConversion::decodeToken( maElementText ); break; + case VMLX_TOKEN( TextVAlign ): mrClientData.mnTextVAlign = AttributeConversion::decodeToken( maElementText ); break; + case VMLX_TOKEN( Column ): mrClientData.mnCol = maElementText.toInt32(); break; + case VMLX_TOKEN( Row ): mrClientData.mnRow = maElementText.toInt32(); break; + case VMLX_TOKEN( Checked ): mrClientData.mnChecked = maElementText.toInt32(); break; + case VMLX_TOKEN( DropStyle ): mrClientData.mnDropStyle = AttributeConversion::decodeToken( maElementText ); break; + case VMLX_TOKEN( DropLines ): mrClientData.mnDropLines = maElementText.toInt32(); break; + case VMLX_TOKEN( Val ): mrClientData.mnVal = maElementText.toInt32(); break; + case VMLX_TOKEN( Min ): mrClientData.mnMin = maElementText.toInt32(); break; + case VMLX_TOKEN( Max ): mrClientData.mnMax = maElementText.toInt32(); break; + case VMLX_TOKEN( Inc ): mrClientData.mnInc = maElementText.toInt32(); break; + case VMLX_TOKEN( Page ): mrClientData.mnPage = maElementText.toInt32(); break; + case VMLX_TOKEN( SelType ): mrClientData.mnSelType = AttributeConversion::decodeToken( maElementText ); break; + case VMLX_TOKEN( VTEdit ): mrClientData.mnVTEdit = maElementText.toInt32(); break; + case VMLX_TOKEN( PrintObject ): mrClientData.mbPrintObject = lclDecodeVmlxBool( maElementText, true ); break; + case VMLX_TOKEN( Visible ): mrClientData.mbVisible = lclDecodeVmlxBool( maElementText, true ); break; + case VMLX_TOKEN( DDE ): mrClientData.mbDde = lclDecodeVmlxBool( maElementText, true ); break; + case VMLX_TOKEN( NoThreeD ): mrClientData.mbNo3D = lclDecodeVmlxBool( maElementText, true ); break; + case VMLX_TOKEN( NoThreeD2 ): mrClientData.mbNo3D2 = lclDecodeVmlxBool( maElementText, true ); break; + case VMLX_TOKEN( MultiLine ): mrClientData.mbMultiLine = lclDecodeVmlxBool( maElementText, true ); break; + case VMLX_TOKEN( VScroll ): mrClientData.mbVScroll = lclDecodeVmlxBool( maElementText, true ); break; + case VMLX_TOKEN( SecretEdit ): mrClientData.mbSecretEdit = lclDecodeVmlxBool( maElementText, true ); break; } } @@ -148,23 +212,26 @@ ShapeContextBase::ShapeContextBase( ContextHandler2Helper& rParent ) : } /*static*/ ContextHandlerRef ShapeContextBase::createShapeContext( ContextHandler2Helper& rParent, - sal_Int32 nElement, const AttributeList& rAttribs, ShapeContainer& rShapes ) + ShapeContainer& rShapes, sal_Int32 nElement, const AttributeList& rAttribs ) { switch( nElement ) { + case O_TOKEN( shapelayout ): + return new ShapeLayoutContext( rParent, rShapes.getDrawing() ); + case VML_TOKEN( shapetype ): - return new ShapeTypeContext( rParent, rAttribs, rShapes.createShapeType() ); + return new ShapeTypeContext( rParent, rShapes.createShapeType(), rAttribs ); case VML_TOKEN( group ): - return new GroupShapeContext( rParent, rAttribs, rShapes.createShape< GroupShape >() ); + return new GroupShapeContext( rParent, rShapes.createShape< GroupShape >(), rAttribs ); case VML_TOKEN( shape ): - return new ShapeContext( rParent, rAttribs, rShapes.createShape< ComplexShape >() ); + return new ShapeContext( rParent, rShapes.createShape< ComplexShape >(), rAttribs ); case VML_TOKEN( rect ): case VML_TOKEN( roundrect ): - return new ShapeContext( rParent, rAttribs, rShapes.createShape< RectangleShape >() ); + return new ShapeContext( rParent, rShapes.createShape< RectangleShape >(), rAttribs ); case VML_TOKEN( oval ): - return new ShapeContext( rParent, rAttribs, rShapes.createShape< EllipseShape >() ); + return new ShapeContext( rParent, rShapes.createShape< EllipseShape >(), rAttribs ); case VML_TOKEN( polyline ): - return new ShapeContext( rParent, rAttribs, rShapes.createShape< PolyLineShape >() ); + return new ShapeContext( rParent, rShapes.createShape< PolyLineShape >(), rAttribs ); // TODO: case VML_TOKEN( arc ): @@ -172,14 +239,14 @@ ShapeContextBase::ShapeContextBase( ContextHandler2Helper& rParent ) : case VML_TOKEN( line ): case VML_TOKEN( diagram ): case VML_TOKEN( image ): - return new ShapeContext( rParent, rAttribs, rShapes.createShape< ComplexShape >() ); + return new ShapeContext( rParent, rShapes.createShape< ComplexShape >(), rAttribs ); } return false; } // ============================================================================ -ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, const AttributeList& rAttribs, ShapeType& rShapeType ) : +ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, ShapeType& rShapeType, const AttributeList& rAttribs ) : ShapeContextBase( rParent ), mrTypeModel( rShapeType.getTypeModel() ) { @@ -189,7 +256,7 @@ ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, const Attrib OSL_ENSURE( mrTypeModel.maShapeId.getLength() > 0, "ShapeTypeContext::ShapeTypeContext - missing shape identifier" ); // if the o:spid attribute exists, the id attribute contains the user-defined shape name if( bHasOspid ) - mrTypeModel.maName = rAttribs.getXString( XML_id, OUString() ); + mrTypeModel.maShapeName = rAttribs.getXString( XML_id, OUString() ); // builtin shape type identifier mrTypeModel.moShapeType = rAttribs.getInteger( O_TOKEN( spt ) ); @@ -280,8 +347,8 @@ void ShapeTypeContext::setStyle( const OUString& rStyle ) // ============================================================================ -ShapeContext::ShapeContext( ContextHandler2Helper& rParent, const AttributeList& rAttribs, ShapeBase& rShape ) : - ShapeTypeContext( rParent, rAttribs, rShape ), +ShapeContext::ShapeContext( ContextHandler2Helper& rParent, ShapeBase& rShape, const AttributeList& rAttribs ) : + ShapeTypeContext( rParent, rShape, rAttribs ), mrShapeModel( rShape.getShapeModel() ) { // collect shape specific attributes @@ -293,8 +360,13 @@ ShapeContext::ShapeContext( ContextHandler2Helper& rParent, const AttributeList& ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { // Excel specific shape client data - if( isRootElement() && (nElement == VMLX_TOKEN( ClientData )) ) - return new ShapeClientDataContext( *this, rAttribs, mrShapeModel.createClientData() ); + if( isRootElement() ) switch( nElement ) + { + case VML_TOKEN( textbox ): + return new TextBoxContext( *this, mrShapeModel.createTextBox(), rAttribs ); + case VMLX_TOKEN( ClientData ): + return new ClientDataContext( *this, mrShapeModel.createClientData(), rAttribs ); + } // handle remaining stuff in base class return ShapeTypeContext::onCreateContext( nElement, rAttribs ); } @@ -313,8 +385,8 @@ void ShapeContext::setPoints( const OUString& rPoints ) // ============================================================================ -GroupShapeContext::GroupShapeContext( ContextHandler2Helper& rParent, const AttributeList& rAttribs, GroupShape& rShape ) : - ShapeContext( rParent, rAttribs, rShape ), +GroupShapeContext::GroupShapeContext( ContextHandler2Helper& rParent, GroupShape& rShape, const AttributeList& rAttribs ) : + ShapeContext( rParent, rShape, rAttribs ), mrShapes( rShape.getChildren() ) { } @@ -322,7 +394,7 @@ GroupShapeContext::GroupShapeContext( ContextHandler2Helper& rParent, const Attr ContextHandlerRef GroupShapeContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { // try to create a context of an embedded shape - ContextHandlerRef xContext = createShapeContext( *this, nElement, rAttribs, mrShapes ); + ContextHandlerRef xContext = createShapeContext( *this, mrShapes, nElement, rAttribs ); // handle remaining stuff of this shape in base class return xContext.get() ? xContext : ShapeContext::onCreateContext( nElement, rAttribs ); } diff --git a/oox/source/vml/vmltextbox.cxx b/oox/source/vml/vmltextbox.cxx new file mode 100755 index 000000000000..e684490f39af --- /dev/null +++ b/oox/source/vml/vmltextbox.cxx @@ -0,0 +1,82 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "oox/vml/vmltextbox.hxx" + +#include +#include "tokens.hxx" + +namespace oox { +namespace vml { + +// ============================================================================ + +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +// ============================================================================ + +TextFontModel::TextFontModel() +{ +} + +// ============================================================================ + +TextPortionModel::TextPortionModel( const TextFontModel& rFont, const OUString& rText ) : + maFont( rFont ), + maText( rText ) +{ +} + +// ============================================================================ + +TextBox::TextBox() +{ +} + +void TextBox::appendPortion( const TextFontModel& rFont, const OUString& rText ) +{ + maPortions.push_back( TextPortionModel( rFont, rText ) ); +} + +const TextFontModel* TextBox::getFirstFont() const +{ + return maPortions.empty() ? 0 : &maPortions.front().maFont; +} + +OUString TextBox::getText() const +{ + OUStringBuffer aBuffer; + for( PortionVector::const_iterator aIt = maPortions.begin(), aEnd = maPortions.end(); aIt != aEnd; ++aIt ) + aBuffer.append( aIt->maText ); + return aBuffer.makeStringAndClear(); +} + +// ============================================================================ + +} // namespace vml +} // namespace oox diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx new file mode 100755 index 000000000000..4b57656b4f78 --- /dev/null +++ b/oox/source/vml/vmltextboxcontext.cxx @@ -0,0 +1,146 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "oox/vml/vmltextboxcontext.hxx" + +namespace oox { +namespace vml { + +// ============================================================================ + +using ::oox::core::ContextHandler2; +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; +using ::rtl::OUString; + +// ============================================================================ + +TextPortionContext::TextPortionContext( ContextHandler2Helper& rParent, + TextBox& rTextBox, const TextFontModel& rParentFont, + sal_Int32 nElement, const AttributeList& rAttribs ) : + ContextHandler2( rParent ), + mrTextBox( rTextBox ), + maFont( rParentFont ), + mnInitialPortions( rTextBox.getPortionCount() ) +{ + switch( nElement ) + { + case XML_font: + maFont.moName = rAttribs.getXString( XML_face ); + maFont.moColor = rAttribs.getXString( XML_color ); + maFont.monSize = rAttribs.getInteger( XML_size ); + break; + case XML_u: + OSL_ENSURE( !maFont.monUnderline, "TextPortionContext::TextPortionContext - nested elements" ); + maFont.monUnderline = (rAttribs.getToken( XML_class, XML_TOKEN_INVALID ) == XML_font4) ? XML_double : XML_single; + break; + case XML_sub: + case XML_sup: + OSL_ENSURE( !maFont.monEscapement, "TextPortionContext::TextPortionContext - nested or elements" ); + maFont.monEscapement = nElement; + break; + case XML_b: + OSL_ENSURE( !maFont.mobBold, "TextPortionContext::TextPortionContext - nested elements" ); + maFont.mobBold = true; + break; + case XML_i: + OSL_ENSURE( !maFont.mobItalic, "TextPortionContext::TextPortionContext - nested elements" ); + maFont.mobItalic = true; + break; + case XML_s: + OSL_ENSURE( !maFont.mobStrikeout, "TextPortionContext::TextPortionContext - nested elements" ); + maFont.mobStrikeout = true; + break; + default: + OSL_ENSURE( false, "TextPortionContext::TextPortionContext - unknown element" ); + } +} + +ContextHandlerRef TextPortionContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + OSL_ENSURE( nElement != XML_font, "TextPortionContext::onCreateContext - nested elements" ); + return new TextPortionContext( *this, mrTextBox, maFont, nElement, rAttribs ); +} + +void TextPortionContext::onCharacters( const OUString& rChars ) +{ + switch( getCurrentElement() ) + { + case XML_span: + // replace all NBSP characters with SP + mrTextBox.appendPortion( maFont, rChars.replace( 160, ' ' ) ); + break; + default: + mrTextBox.appendPortion( maFont, rChars ); + } +} + +void TextPortionContext::onEndElement() +{ + /* An empty child element without own child elements represents a single + space character, for example: + + + abc + + def + + + represents the italic text 'abc', an unformatted space character, and + the bold text 'def'. + */ + if( (mnInitialPortions > 0) && (mrTextBox.getPortionCount() == mnInitialPortions) ) + mrTextBox.appendPortion( maFont, OUString( sal_Unicode( ' ' ) ) ); +} + +// ============================================================================ + +TextBoxContext::TextBoxContext( ContextHandler2Helper& rParent, TextBox& rTextBox, const AttributeList& /*rAttribs*/ ) : + ContextHandler2( rParent ), + mrTextBox( rTextBox ) +{ +} + +ContextHandlerRef TextBoxContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( getCurrentElement() ) + { + case VML_TOKEN( textbox ): + if( nElement == XML_div ) return this; + break; + case XML_div: + if( nElement == XML_font ) return new TextPortionContext( *this, mrTextBox, TextFontModel(), nElement, rAttribs ); + break; + } + return 0; +} + +// ============================================================================ + +} // namespace vml +} // namespace oox + diff --git a/oox/source/xls/autofiltercontext.cxx b/oox/source/xls/autofiltercontext.cxx index 4ae31fc94c56..279b62de2ccf 100644 --- a/oox/source/xls/autofiltercontext.cxx +++ b/oox/source/xls/autofiltercontext.cxx @@ -204,7 +204,7 @@ void OoxAutoFilterContext::onStartElement( const AttributeList& rAttribs ) } } -void OoxAutoFilterContext::onEndElement( const OUString& /*rChars*/ ) +void OoxAutoFilterContext::onEndElement() { switch( getCurrentElement() ) { diff --git a/oox/source/xls/chartsheetfragment.cxx b/oox/source/xls/chartsheetfragment.cxx index fe1cdfa179bb..432b50b075f2 100644 --- a/oox/source/xls/chartsheetfragment.cxx +++ b/oox/source/xls/chartsheetfragment.cxx @@ -86,14 +86,14 @@ ContextHandlerRef OoxChartsheetFragment::onCreateContext( sal_Int32 nElement, co case XLS_TOKEN( oddHeader ): case XLS_TOKEN( oddFooter ): case XLS_TOKEN( evenHeader ): - case XLS_TOKEN( evenFooter ): return this; // collect contents in onEndElement() + case XLS_TOKEN( evenFooter ): return this; // collect contents in onCharacters() } break; } return 0; } -void OoxChartsheetFragment::onEndElement( const OUString& rChars ) +void OoxChartsheetFragment::onCharacters( const OUString& rChars ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/commentsbuffer.cxx b/oox/source/xls/commentsbuffer.cxx index 190309649789..ecc5d4dff390 100644 --- a/oox/source/xls/commentsbuffer.cxx +++ b/oox/source/xls/commentsbuffer.cxx @@ -115,9 +115,8 @@ void Comment::finalizeImport() // position and formatting pNoteShape->convertFormatting( xAnnoShape ); // visibility - const ::oox::vml::ShapeModel::ShapeClientDataPtr& rxClientData = pNoteShape->getShapeModel().mxClientData; - bool bVisible = rxClientData.get() && rxClientData->mbVisible; - xAnno->setIsVisible( bVisible ); + const ::oox::vml::ClientData* pClientData = pNoteShape->getClientData(); + xAnno->setIsVisible( pClientData && pClientData->mbVisible ); } } } diff --git a/oox/source/xls/commentsfragment.cxx b/oox/source/xls/commentsfragment.cxx index c87d3028b7cb..44ae98ca7b43 100644 --- a/oox/source/xls/commentsfragment.cxx +++ b/oox/source/xls/commentsfragment.cxx @@ -56,7 +56,7 @@ ContextHandlerRef OoxCommentsFragment::onCreateContext( sal_Int32 nElement, cons if( nElement == XLS_TOKEN( commentList ) ) return this; break; case XLS_TOKEN( authors ): - if( nElement == XLS_TOKEN( author ) ) return this; // collect author in onEndElement() + if( nElement == XLS_TOKEN( author ) ) return this; // collect author in onCharacters() break; case XLS_TOKEN( commentList ): if( nElement == XLS_TOKEN( comment ) ) { importComment( rAttribs ); return this; } @@ -69,17 +69,16 @@ ContextHandlerRef OoxCommentsFragment::onCreateContext( sal_Int32 nElement, cons return 0; } -void OoxCommentsFragment::onEndElement( const OUString& rChars ) +void OoxCommentsFragment::onCharacters( const OUString& rChars ) { - switch( getCurrentElement() ) - { - case XLS_TOKEN( author ): - getComments().appendAuthor( rChars ); - break; - case XLS_TOKEN( comment ): - mxComment.reset(); - break; - } + if( isCurrentElement( XLS_TOKEN( author ) ) ) + getComments().appendAuthor( rChars ); +} + +void OoxCommentsFragment::onEndElement() +{ + if( isCurrentElement( XLS_TOKEN( comment ) ) ) + mxComment.reset(); } ContextHandlerRef OoxCommentsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) @@ -109,12 +108,8 @@ ContextHandlerRef OoxCommentsFragment::onCreateRecordContext( sal_Int32 nRecId, void OoxCommentsFragment::onEndRecord() { - switch( getCurrentElement() ) - { - case OOBIN_ID_COMMENT: - mxComment.reset(); - break; - } + if( isCurrentElement( OOBIN_ID_COMMENT ) ) + mxComment.reset(); } // oox.core.FragmentHandler2 interface ---------------------------------------- diff --git a/oox/source/xls/condformatcontext.cxx b/oox/source/xls/condformatcontext.cxx index 8cd3a33615fc..a879dcb2e86d 100644 --- a/oox/source/xls/condformatcontext.cxx +++ b/oox/source/xls/condformatcontext.cxx @@ -67,14 +67,10 @@ void OoxCondFormatContext::onStartElement( const AttributeList& rAttribs ) } } -void OoxCondFormatContext::onEndElement( const OUString& rChars ) +void OoxCondFormatContext::onCharacters( const OUString& rChars ) { - switch( getCurrentElement() ) - { - case XLS_TOKEN( formula ): - if( mxCondFmt.get() && mxRule.get() ) mxRule->appendFormula( rChars ); - break; - } + if( isCurrentElement( XLS_TOKEN( formula ) ) && mxCondFmt.get() && mxRule.get() ) + mxRule->appendFormula( rChars ); } ContextHandlerRef OoxCondFormatContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& ) diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx index 7b52b986750a..9f565868a77a 100644 --- a/oox/source/xls/drawingfragment.cxx +++ b/oox/source/xls/drawingfragment.cxx @@ -27,11 +27,15 @@ #include "oox/xls/drawingfragment.hxx" -#include +#include +#include +#include +#include +#include +#include +#include #include "oox/drawingml/connectorshapecontext.hxx" #include "oox/drawingml/graphicshapecontext.hxx" -#include "oox/drawingml/shapecontext.hxx" -#include "oox/drawingml/shapegroupcontext.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/propertyset.hxx" #include "oox/vml/vmlshape.hxx" @@ -48,21 +52,25 @@ namespace xls { // ============================================================================ using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::document; using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::script; using namespace ::com::sun::star::table; using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; +using namespace ::oox::core; +using namespace ::oox::drawingml; +using namespace ::oox::ole; -using ::oox::core::ContextHandlerRef; -using ::oox::drawingml::ConnectorShapeContext; -using ::oox::drawingml::GraphicalObjectFrameContext; -using ::oox::drawingml::GraphicShapeContext; -using ::oox::drawingml::Shape; -using ::oox::drawingml::ShapePtr; -using ::oox::drawingml::ShapeContext; -using ::oox::drawingml::ShapeGroupContext; +using ::rtl::OStringBuffer; using ::rtl::OUString; +using ::rtl::OUStringToOString; // no using's for ::oox::vml, that may clash with ::oox::drawingml types +// ============================================================================ +// DrawingML // ============================================================================ namespace { @@ -403,6 +411,108 @@ Rectangle ShapeAnchor::calcEmuLocation( const AnchorSizeModel& rEmuSheetSize ) c // ============================================================================ +ShapeMacroAttacher::ShapeMacroAttacher( const OUString& rMacroName, const Reference< XShape >& rxShape ) : + VbaMacroAttacherBase( rMacroName ), + mxShape( rxShape ) +{ +} + +void ShapeMacroAttacher::attachMacro( const OUString& rMacroUrl ) +{ + try + { + Reference< XEventsSupplier > xSupplier( mxShape, UNO_QUERY_THROW ); + Reference< XNameReplace > xEvents( xSupplier->getEvents(), UNO_SET_THROW ); + Sequence< PropertyValue > aEventProps( 2 ); + aEventProps[ 0 ].Name = CREATE_OUSTRING( "EventType" ); + aEventProps[ 0 ].Value <<= CREATE_OUSTRING( "Script" ); + aEventProps[ 1 ].Name = CREATE_OUSTRING( "Script" ); + aEventProps[ 1 ].Value <<= rMacroUrl; + xEvents->replaceByName( CREATE_OUSTRING( "OnClick" ), Any( aEventProps ) ); + } + catch( Exception& ) + { + } +} + +// ============================================================================ + +Shape::Shape( const WorksheetHelper& rHelper, const AttributeList& rAttribs, const sal_Char* pcServiceName ) : + ::oox::drawingml::Shape( pcServiceName ), + WorksheetHelper( rHelper ) +{ + OUString aMacro = rAttribs.getXString( XML_macro, OUString() ); + if( aMacro.getLength() > 0 ) + maMacroName = getFormulaParser().importMacroName( aMacro ); +} + +void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >& rxShapes ) +{ + if( (maMacroName.getLength() > 0) && mxShape.is() ) + { + VbaMacroAttacherRef xAttacher( new ShapeMacroAttacher( maMacroName, mxShape ) ); + getBaseFilter().getVbaProject().registerMacroAttacher( xAttacher ); + } + ::oox::drawingml::Shape::finalizeXShape( rFilter, rxShapes ); +} + +// ============================================================================ + +OoxGroupShapeContext::OoxGroupShapeContext( ContextHandler& rParent, + const WorksheetHelper& rHelper, const ShapePtr& rxShape ) : + ShapeGroupContext( rParent, ShapePtr(), rxShape ), + WorksheetHelper( rHelper ) +{ +} + +/*static*/ ContextHandlerRef OoxGroupShapeContext::createShapeContext( ContextHandler& rParent, + const WorksheetHelper& rHelper, sal_Int32 nElement, const AttributeList& rAttribs, ShapePtr* pxShape ) +{ + switch( nElement ) + { + case XDR_TOKEN( sp ): + { + ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.CustomShape" ) ); + if( pxShape ) *pxShape = xShape; + return new ShapeContext( rParent, ShapePtr(), xShape ); + } + case XDR_TOKEN( cxnSp ): + { + ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.ConnectorShape" ) ); + if( pxShape ) *pxShape = xShape; + return new ConnectorShapeContext( rParent, ShapePtr(), xShape ); + } + case XDR_TOKEN( pic ): + { + ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" ) ); + if( pxShape ) *pxShape = xShape; + return new GraphicShapeContext( rParent, ShapePtr(), xShape ); + } + case XDR_TOKEN( graphicFrame ): + { + ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" ) ); + if( pxShape ) *pxShape = xShape; + return new GraphicalObjectFrameContext( rParent, ShapePtr(), xShape, rHelper.getSheetType() != SHEETTYPE_CHARTSHEET ); + } + case XDR_TOKEN( grpSp ): + { + ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GroupShape" ) ); + if( pxShape ) *pxShape = xShape; + return new OoxGroupShapeContext( rParent, rHelper, xShape ); + } + } + return 0; +} + +Reference< XFastContextHandler > SAL_CALL OoxGroupShapeContext::createFastChildContext( + sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) throw (SAXException, RuntimeException) +{ + ContextHandlerRef xContext = createShapeContext( *this, *this, nElement, AttributeList( rxAttribs ) ); + return xContext.get() ? xContext.get() : ShapeGroupContext::createFastChildContext( nElement, rxAttribs ); +} + +// ============================================================================ + OoxDrawingFragment::OoxDrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) : OoxWorksheetFragmentBase( rHelper, rFragmentPath ), mxDrawPage( rHelper.getDrawPage(), UNO_QUERY ) @@ -438,31 +548,19 @@ ContextHandlerRef OoxDrawingFragment::onCreateContext( sal_Int32 nElement, const case XDR_TOKEN( absoluteAnchor ): case XDR_TOKEN( oneCellAnchor ): case XDR_TOKEN( twoCellAnchor ): + { switch( nElement ) { - case XDR_TOKEN( sp ): - mxShape.reset( new Shape( "com.sun.star.drawing.CustomShape" ) ); - return new ShapeContext( *this, ShapePtr(), mxShape ); - case XDR_TOKEN( cxnSp ): - mxShape.reset( new Shape( "com.sun.star.drawing.ConnectorShape" ) ); - return new ConnectorShapeContext( *this, ShapePtr(), mxShape ); - case XDR_TOKEN( pic ): - mxShape.reset( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ); - return new GraphicShapeContext( *this, ShapePtr(), mxShape ); - case XDR_TOKEN( graphicFrame ): - mxShape.reset( new Shape( "com.sun.star.drawing.OLE2Shape" ) ); - return new GraphicalObjectFrameContext( *this, ShapePtr(), mxShape, getSheetType() != SHEETTYPE_CHARTSHEET ); - case XDR_TOKEN( grpSp ): - mxShape.reset( new Shape( "com.sun.star.drawing.GroupShape" ) ); - return new ShapeGroupContext( *this, ShapePtr(), mxShape ); - case XDR_TOKEN( from ): case XDR_TOKEN( to ): return this; case XDR_TOKEN( pos ): if( mxAnchor.get() ) mxAnchor->importPos( rAttribs ); break; case XDR_TOKEN( ext ): if( mxAnchor.get() ) mxAnchor->importExt( rAttribs ); break; case XDR_TOKEN( clientData ): if( mxAnchor.get() ) mxAnchor->importClientData( rAttribs ); break; + + default: return OoxGroupShapeContext::createShapeContext( *this, *this, nElement, rAttribs, &mxShape ); } + } break; case XDR_TOKEN( from ): @@ -472,14 +570,14 @@ ContextHandlerRef OoxDrawingFragment::onCreateContext( sal_Int32 nElement, const case XDR_TOKEN( col ): case XDR_TOKEN( row ): case XDR_TOKEN( colOff ): - case XDR_TOKEN( rowOff ): return this; // collect index in onEndElement() + case XDR_TOKEN( rowOff ): return this; // collect index in onCharacters() } break; } return 0; } -void OoxDrawingFragment::onEndElement( const OUString& rChars ) +void OoxDrawingFragment::onCharacters( const OUString& rChars ) { switch( getCurrentElement() ) { @@ -487,8 +585,15 @@ void OoxDrawingFragment::onEndElement( const OUString& rChars ) case XDR_TOKEN( row ): case XDR_TOKEN( colOff ): case XDR_TOKEN( rowOff ): - if( mxAnchor.get() ) mxAnchor->setCellPos( getCurrentElement(), getPreviousElement(), rChars ); + if( mxAnchor.get() ) mxAnchor->setCellPos( getCurrentElement(), getParentElement(), rChars ); break; + } +} + +void OoxDrawingFragment::onEndElement() +{ + switch( getCurrentElement() ) + { case XDR_TOKEN( absoluteAnchor ): case XDR_TOKEN( oneCellAnchor ): case XDR_TOKEN( twoCellAnchor ): @@ -508,6 +613,8 @@ void OoxDrawingFragment::onEndElement( const OUString& rChars ) } } +// ============================================================================ +// VML // ============================================================================ namespace { @@ -523,6 +630,8 @@ private: sal_Int32 mnRow; }; +// ---------------------------------------------------------------------------- + VmlFindNoteFunc::VmlFindNoteFunc( const CellAddress& rPos ) : mnCol( rPos.Column ), mnRow( rPos.Row ) @@ -531,19 +640,88 @@ VmlFindNoteFunc::VmlFindNoteFunc( const CellAddress& rPos ) : bool VmlFindNoteFunc::operator()( const ::oox::vml::ShapeBase& rShape ) const { - const ::oox::vml::ShapeModel::ShapeClientDataPtr& rxClientData = rShape.getShapeModel().mxClientData; - return rxClientData.get() && (rxClientData->mnCol == mnCol) && (rxClientData->mnRow == mnRow); + const ::oox::vml::ClientData* pClientData = rShape.getClientData(); + return pClientData && (pClientData->mnCol == mnCol) && (pClientData->mnRow == mnRow); } } // namespace -// ---------------------------------------------------------------------------- +// ============================================================================ + +VmlControlMacroAttacher::VmlControlMacroAttacher( const OUString& rMacroName, + const Reference< XIndexContainer >& rxCtrlFormIC, sal_Int32 nCtrlIndex, sal_Int32 nCtrlType, sal_Int32 nDropStyle ) : + VbaMacroAttacherBase( rMacroName ), + mxCtrlFormIC( rxCtrlFormIC ), + mnCtrlIndex( nCtrlIndex ), + mnCtrlType( nCtrlType ), + mnDropStyle( nDropStyle ) +{ +} + +void VmlControlMacroAttacher::attachMacro( const OUString& rMacroUrl ) +{ + ScriptEventDescriptor aEventDesc; + aEventDesc.ScriptType = CREATE_OUSTRING( "Script" ); + aEventDesc.ScriptCode = rMacroUrl; + + // editable drop downs are treated like edit boxes + bool bEditDropDown = (mnCtrlType == XML_Drop) && (mnDropStyle == XML_ComboEdit); + sal_Int32 nCtrlType = bEditDropDown ? XML_Edit : mnCtrlType; + + switch( nCtrlType ) + { + case XML_Button: + case XML_Checkbox: + case XML_Radio: + aEventDesc.ListenerType = CREATE_OUSTRING( "XActionListener" ); + aEventDesc.EventMethod = CREATE_OUSTRING( "actionPerformed" ); + break; + case XML_Label: + case XML_GBox: + case XML_Dialog: + aEventDesc.ListenerType = CREATE_OUSTRING( "XMouseListener" ); + aEventDesc.EventMethod = CREATE_OUSTRING( "mouseReleased" ); + break; + case XML_Edit: + aEventDesc.ListenerType = CREATE_OUSTRING( "XTextListener" ); + aEventDesc.EventMethod = CREATE_OUSTRING( "textChanged" ); + break; + case XML_Spin: + case XML_Scroll: + aEventDesc.ListenerType = CREATE_OUSTRING( "XAdjustmentListener" ); + aEventDesc.EventMethod = CREATE_OUSTRING( "adjustmentValueChanged" ); + break; + case XML_List: + case XML_Drop: + aEventDesc.ListenerType = CREATE_OUSTRING( "XChangeListener" ); + aEventDesc.EventMethod = CREATE_OUSTRING( "changed" ); + break; + default: + OSL_ENSURE( false, "VmlControlMacroAttacher::attachMacro - unexpected object type" ); + return; + } + + try + { + Reference< XEventAttacherManager > xEventMgr( mxCtrlFormIC, UNO_QUERY_THROW ); + xEventMgr->registerScriptEvent( mnCtrlIndex, aEventDesc ); + } + catch( Exception& ) + { + } +} + +// ============================================================================ VmlDrawing::VmlDrawing( const WorksheetHelper& rHelper ) : ::oox::vml::Drawing( rHelper.getOoxFilter(), rHelper.getDrawPage(), ::oox::vml::VMLDRAWING_EXCEL ), WorksheetHelper( rHelper ), maControlConv( rHelper.getBaseFilter().getModel(), rHelper.getBaseFilter().getGraphicHelper() ) { + // default font for legacy listboxes and dropdowns: Tahoma, 8pt + maListBoxFont.moName = CREATE_OUSTRING( "Tahoma" ); + maListBoxFont.moColor = CREATE_OUSTRING( "auto" ); + maListBoxFont.monSize = 160; } const ::oox::vml::ShapeBase* VmlDrawing::getNoteShape( const CellAddress& rPos ) const @@ -553,11 +731,35 @@ const ::oox::vml::ShapeBase* VmlDrawing::getNoteShape( const CellAddress& rPos ) bool VmlDrawing::isShapeSupported( const ::oox::vml::ShapeBase& rShape ) const { - const ::oox::vml::ShapeModel::ShapeClientDataPtr& rxClientData = rShape.getShapeModel().mxClientData; - return !rxClientData.get() || (rxClientData->mnObjType != XML_Note); + const ::oox::vml::ClientData* pClientData = rShape.getClientData(); + return !pClientData || (pClientData->mnObjType != XML_Note); } -bool VmlDrawing::convertShapeClientAnchor( Rectangle& orShapeRect, const OUString& rShapeAnchor ) const +OUString VmlDrawing::getShapeBaseName( const ::oox::vml::ShapeBase& rShape ) const +{ + if( const ::oox::vml::ClientData* pClientData = rShape.getClientData() ) + { + switch( pClientData->mnObjType ) + { + case XML_Button: return CREATE_OUSTRING( "Button" ); + case XML_Checkbox: return CREATE_OUSTRING( "Check Box" ); + case XML_Dialog: return CREATE_OUSTRING( "Dialog Frame" ); + case XML_Drop: return CREATE_OUSTRING( "Drop Down" ); + case XML_Edit: return CREATE_OUSTRING( "Edit Box" ); + case XML_GBox: return CREATE_OUSTRING( "Group Box" ); + case XML_Label: return CREATE_OUSTRING( "Label" ); + case XML_List: return CREATE_OUSTRING( "List Box" ); + case XML_Note: return CREATE_OUSTRING( "Comment" ); + case XML_Pict: return (pClientData->mbDde || getOleObjectInfo( rShape.getShapeId() )) ? CREATE_OUSTRING( "Object" ) : CREATE_OUSTRING( "Picture" ); + case XML_Radio: return CREATE_OUSTRING( "Option Button" ); + case XML_Scroll: return CREATE_OUSTRING( "Scroll Bar" ); + case XML_Spin: return CREATE_OUSTRING( "Spinner" ); + } + } + return ::oox::vml::Drawing::getShapeBaseName( rShape ); +} + +bool VmlDrawing::convertClientAnchor( Rectangle& orShapeRect, const OUString& rShapeAnchor ) const { if( rShapeAnchor.getLength() == 0 ) return false; @@ -567,26 +769,310 @@ bool VmlDrawing::convertShapeClientAnchor( Rectangle& orShapeRect, const OUStrin return (orShapeRect.Width >= 0) && (orShapeRect.Height >= 0); } -void VmlDrawing::convertControlClientData( const Reference< XControlModel >& rxCtrlModel, - const ::oox::vml::ShapeClientData& rClientData ) const +Reference< XShape > VmlDrawing::createAndInsertClientXShape( const ::oox::vml::ShapeBase& rShape, + const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const { - if( rxCtrlModel.is() ) + // simulate the legacy drawing controls with OLE form controls + OUString aShapeName = rShape.getShapeName(); + const ::oox::vml::ClientData* pClientData = rShape.getClientData(); + if( (aShapeName.getLength() > 0) && pClientData ) { - PropertySet aPropSet( rxCtrlModel ); + Rectangle aShapeRect = rShapeRect; + const GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper(); + const ::oox::vml::TextBox* pTextBox = rShape.getTextBox(); + EmbeddedControl aControl( aShapeName ); + switch( pClientData->mnObjType ) + { + case XML_Button: + { + AxCommandButtonModel& rAxModel = aControl.createModel< AxCommandButtonModel >(); + convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign ); + rAxModel.mnFlags = AX_FLAGS_ENABLED | AX_FLAGS_OPAQUE | AX_FLAGS_WORDWRAP; + rAxModel.mnVerticalAlign = pClientData->mnTextVAlign; + } + break; + + case XML_Label: + { + AxLabelModel& rAxModel = aControl.createModel< AxLabelModel >(); + convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign ); + rAxModel.mnFlags = AX_FLAGS_ENABLED | AX_FLAGS_WORDWRAP; + rAxModel.mnBorderStyle = AX_BORDERSTYLE_NONE; + rAxModel.mnSpecialEffect = AX_SPECIALEFFECT_FLAT; + rAxModel.mnVerticalAlign = pClientData->mnTextVAlign; + } + break; + + case XML_Edit: + { + bool bNumeric = (pClientData->mnVTEdit == ::oox::vml::VML_CLIENTDATA_INTEGER) || (pClientData->mnVTEdit == ::oox::vml::VML_CLIENTDATA_NUMBER); + AxMorphDataModelBase& rAxModel = bNumeric ? + static_cast< AxMorphDataModelBase& >( aControl.createModel< AxNumericFieldModel >() ) : + static_cast< AxMorphDataModelBase& >( aControl.createModel< AxTextBoxModel >() ); + convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maValue, pTextBox, pClientData->mnTextHAlign ); + setFlag( rAxModel.mnFlags, AX_FLAGS_MULTILINE, pClientData->mbMultiLine ); + setFlag( rAxModel.mnScrollBars, AX_SCROLLBAR_VERTICAL, pClientData->mbVScroll ); + if( pClientData->mbSecretEdit ) + rAxModel.mnPasswordChar = '*'; + } + break; + + case XML_GBox: + { + AxFrameModel& rAxModel = aControl.createModel< AxFrameModel >(); + convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign ); + rAxModel.mnBorderStyle = pClientData->mbNo3D ? AX_BORDERSTYLE_SINGLE : AX_BORDERSTYLE_NONE; + rAxModel.mnSpecialEffect = pClientData->mbNo3D ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_BUMPED; + + /* Move top border of groupbox up by half font height, because + Excel specifies Y position of the groupbox border line + instead the top border of the caption text. */ + if( const ::oox::vml::TextFontModel* pFontModel = pTextBox ? pTextBox->getFirstFont() : 0 ) + { + sal_Int32 nFontHeightHmm = getUnitConverter().scaleToMm100( pFontModel->monSize.get( 160 ), UNIT_TWIP ); + sal_Int32 nYDiff = ::std::min< sal_Int32 >( nFontHeightHmm / 2, aShapeRect.Y ); + aShapeRect.Y -= nYDiff; + aShapeRect.Height += nYDiff; + } + } + break; + + case XML_Checkbox: + { + AxCheckBoxModel& rAxModel = aControl.createModel< AxCheckBoxModel >(); + convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign ); + convertControlBackground( rAxModel, rShape ); + rAxModel.maValue = OUString::valueOf( pClientData->mnChecked ); + rAxModel.mnSpecialEffect = pClientData->mbNo3D ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN; + rAxModel.mnVerticalAlign = pClientData->mnTextVAlign; + bool bTriState = (pClientData->mnChecked != ::oox::vml::VML_CLIENTDATA_UNCHECKED) && (pClientData->mnChecked != ::oox::vml::VML_CLIENTDATA_CHECKED); + rAxModel.mnMultiSelect = bTriState ? AX_SELCTION_MULTI : AX_SELCTION_SINGLE; + } + break; + + case XML_Radio: + { + AxOptionButtonModel& rAxModel = aControl.createModel< AxOptionButtonModel >(); + convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign ); + convertControlBackground( rAxModel, rShape ); + rAxModel.maValue = OUString::valueOf( pClientData->mnChecked ); + rAxModel.mnSpecialEffect = pClientData->mbNo3D ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN; + rAxModel.mnVerticalAlign = pClientData->mnTextVAlign; + } + break; - // printable - aPropSet.setProperty( PROP_Printable, rClientData.mbPrintObject ); + case XML_List: + { + AxListBoxModel& rAxModel = aControl.createModel< AxListBoxModel >(); + convertControlFontData( rAxModel.maFontData, rAxModel.mnTextColor, maListBoxFont ); + rAxModel.mnBorderStyle = pClientData->mbNo3D2 ? AX_BORDERSTYLE_SINGLE : AX_BORDERSTYLE_NONE; + rAxModel.mnSpecialEffect = pClientData->mbNo3D2 ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN; + switch( pClientData->mnSelType ) + { + case XML_Single: rAxModel.mnMultiSelect = AX_SELCTION_SINGLE; break; + case XML_Multi: rAxModel.mnMultiSelect = AX_SELCTION_MULTI; break; + case XML_Extend: rAxModel.mnMultiSelect = AX_SELCTION_EXTENDED; break; + } + } + break; - // control sources - if( (rClientData.maLinkedCell.getLength() > 0) || (rClientData.maSourceRange.getLength() > 0) ) - maControlConv.bindToSources( rxCtrlModel, rClientData.maLinkedCell, rClientData.maSourceRange, getSheetIndex() ); + case XML_Drop: + { + AxComboBoxModel& rAxModel = aControl.createModel< AxComboBoxModel >(); + convertControlFontData( rAxModel.maFontData, rAxModel.mnTextColor, maListBoxFont ); + rAxModel.mnDisplayStyle = AX_DISPLAYSTYLE_DROPDOWN; + rAxModel.mnShowDropButton = AX_SHOWDROPBUTTON_ALWAYS; + rAxModel.mnBorderStyle = pClientData->mbNo3D2 ? AX_BORDERSTYLE_SINGLE : AX_BORDERSTYLE_NONE; + rAxModel.mnSpecialEffect = pClientData->mbNo3D2 ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN; + rAxModel.mnListRows = pClientData->mnDropLines; + } + break; + + case XML_Spin: + { + AxSpinButtonModel& rAxModel = aControl.createModel< AxSpinButtonModel >(); + rAxModel.mnMin = pClientData->mnMin; + rAxModel.mnMax = pClientData->mnMax; + rAxModel.mnPosition = pClientData->mnVal; + rAxModel.mnSmallChange = pClientData->mnInc; + } + break; + + case XML_Scroll: + { + AxScrollBarModel& rAxModel = aControl.createModel< AxScrollBarModel >(); + rAxModel.mnMin = pClientData->mnMin; + rAxModel.mnMax = pClientData->mnMax; + rAxModel.mnPosition = pClientData->mnVal; + rAxModel.mnSmallChange = pClientData->mnInc; + rAxModel.mnLargeChange = pClientData->mnPage; + } + break; + + case XML_Dialog: + { + // fake with a group box + AxFrameModel& rAxModel = aControl.createModel< AxFrameModel >(); + convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, XML_Left ); + rAxModel.mnBorderStyle = AX_BORDERSTYLE_SINGLE; + rAxModel.mnSpecialEffect = AX_SPECIALEFFECT_FLAT; + } + break; + } + + if( ControlModelBase* pAxModel = aControl.getModel() ) + { + // create the control shape + pAxModel->maSize.first = aShapeRect.Width; + pAxModel->maSize.second = aShapeRect.Height; + sal_Int32 nCtrlIndex = -1; + Reference< XShape > xShape = createAndInsertXControlShape( aControl, rxShapes, aShapeRect, nCtrlIndex ); + + // control shape macro + if( xShape.is() && (nCtrlIndex >= 0) && (pClientData->maFmlaMacro.getLength() > 0) ) + { + OUString aMacroName = getFormulaParser().importMacroName( pClientData->maFmlaMacro ); + if( aMacroName.getLength() > 0 ) + { + Reference< XIndexContainer > xFormIC = getControlForm().getXForm(); + VbaMacroAttacherRef xAttacher( new VmlControlMacroAttacher( aMacroName, xFormIC, nCtrlIndex, pClientData->mnObjType, pClientData->mnDropStyle ) ); + getBaseFilter().getVbaProject().registerMacroAttacher( xAttacher ); + } + } + + return xShape; + } } + + return Reference< XShape >(); } -void VmlDrawing::notifyShapeInserted( const Reference< XShape >& /*rxShape*/, const Rectangle& rShapeRect ) +void VmlDrawing::notifyXShapeInserted( const Reference< XShape >& rxShape, + const Rectangle& rShapeRect, const ::oox::vml::ShapeBase& rShape, bool bGroupChild ) { - // collect all shape positions in the WorksheetHelper base class - extendShapeBoundingBox( rShapeRect ); + // collect all shape positions in the WorksheetHelper base class (but not children of group shapes) + if( !bGroupChild ) + extendShapeBoundingBox( rShapeRect ); + + // convert settings from VML client data + if( const ::oox::vml::ClientData* pClientData = rShape.getClientData() ) + { + // specific settings for embedded form controls + try + { + Reference< XControlShape > xCtrlShape( rxShape, UNO_QUERY_THROW ); + Reference< XControlModel > xCtrlModel( xCtrlShape->getControl(), UNO_SET_THROW ); + PropertySet aPropSet( xCtrlModel ); + + // printable + aPropSet.setProperty( PROP_Printable, pClientData->mbPrintObject ); + + // control source links + if( (pClientData->maFmlaLink.getLength() > 0) || (pClientData->maFmlaRange.getLength() > 0) ) + maControlConv.bindToSources( xCtrlModel, pClientData->maFmlaLink, pClientData->maFmlaRange, getSheetIndex() ); + } + catch( Exception& ) + { + } + } +} + +// private -------------------------------------------------------------------- + +sal_uInt32 VmlDrawing::convertControlTextColor( const OUString& rTextColor ) const +{ + // color attribute not present or 'auto' - use passed default color + if( (rTextColor.getLength() == 0) || rTextColor.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "auto" ) ) ) + return AX_SYSCOLOR_WINDOWTEXT; + + if( rTextColor[ 0 ] == '#' ) + { + // RGB colors in the format '#RRGGBB' + if( rTextColor.getLength() == 7 ) + return OleHelper::encodeOleColor( rTextColor.copy( 1 ).toInt32( 16 ) ); + + // RGB colors in the format '#RGB' + if( rTextColor.getLength() == 4 ) + { + sal_Int32 nR = rTextColor.copy( 1, 1 ).toInt32( 16 ) * 0x11; + sal_Int32 nG = rTextColor.copy( 2, 1 ).toInt32( 16 ) * 0x11; + sal_Int32 nB = rTextColor.copy( 3, 1 ).toInt32( 16 ) * 0x11; + return OleHelper::encodeOleColor( (nR << 16) | (nG << 8) | nB ); + } + + OSL_ENSURE( false, OStringBuffer( "VmlDrawing::convertControlTextColor - invalid color name '" ). + append( OUStringToOString( rTextColor, RTL_TEXTENCODING_ASCII_US ) ).append( '\'' ).getStr() ); + return AX_SYSCOLOR_WINDOWTEXT; + } + + const GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper(); + + /* Predefined color names or system color names (resolve to RGB to detect + valid color name). */ + sal_Int32 nColorToken = AttributeConversion::decodeToken( rTextColor ); + sal_Int32 nRgbValue = Color::getVmlPresetColor( nColorToken, API_RGB_TRANSPARENT ); + if( nRgbValue == API_RGB_TRANSPARENT ) + nRgbValue = rGraphicHelper.getSystemColor( nColorToken, API_RGB_TRANSPARENT ); + if( nRgbValue != API_RGB_TRANSPARENT ) + return OleHelper::encodeOleColor( nRgbValue ); + + // try palette color + return OleHelper::encodeOleColor( rGraphicHelper.getPaletteColor( rTextColor.toInt32() ) ); +} + +void VmlDrawing::convertControlFontData( AxFontData& rAxFontData, sal_uInt32& rnOleTextColor, const ::oox::vml::TextFontModel& rFontModel ) const +{ + if( rFontModel.moName.has() ) + rAxFontData.maFontName = rFontModel.moName.get(); + + // font height: convert from twips to points, then to internal representation of AX controls + rAxFontData.setHeightPoints( static_cast< sal_Int16 >( (rFontModel.monSize.get( 200 ) + 10) / 20 ) ); + + // font effects + rAxFontData.mnFontEffects = 0; + setFlag( rAxFontData.mnFontEffects, AX_FONTDATA_BOLD, rFontModel.mobBold.get( false ) ); + setFlag( rAxFontData.mnFontEffects, AX_FONTDATA_ITALIC, rFontModel.mobItalic.get( false ) ); + setFlag( rAxFontData.mnFontEffects, AX_FONTDATA_STRIKEOUT, rFontModel.mobStrikeout.get( false ) ); + sal_Int32 nUnderline = rFontModel.monUnderline.get( XML_none ); + setFlag( rAxFontData.mnFontEffects, AX_FONTDATA_UNDERLINE, nUnderline != XML_none ); + rAxFontData.mbDblUnderline = nUnderline == XML_double; + + // font color + rnOleTextColor = convertControlTextColor( rFontModel.moColor.get( OUString() ) ); +} + +void VmlDrawing::convertControlText( AxFontData& rAxFontData, sal_uInt32& rnOleTextColor, + OUString& rCaption, const ::oox::vml::TextBox* pTextBox, sal_Int32 nTextHAlign ) const +{ + if( pTextBox ) + { + rCaption = pTextBox->getText(); + if( const ::oox::vml::TextFontModel* pFontModel = pTextBox->getFirstFont() ) + convertControlFontData( rAxFontData, rnOleTextColor, *pFontModel ); + } + + switch( nTextHAlign ) + { + case XML_Left: rAxFontData.mnHorAlign = AX_FONTDATA_LEFT; break; + case XML_Center: rAxFontData.mnHorAlign = AX_FONTDATA_CENTER; break; + case XML_Right: rAxFontData.mnHorAlign = AX_FONTDATA_RIGHT; break; + default: rAxFontData.mnHorAlign = AX_FONTDATA_LEFT; + } +} + +void VmlDrawing::convertControlBackground( AxMorphDataModelBase& rAxModel, const ::oox::vml::ShapeBase& rShape ) const +{ + const ::oox::vml::FillModel& rFillModel = rShape.getTypeModel().maFillModel; + bool bHasFill = rFillModel.moFilled.get( true ); + setFlag( rAxModel.mnFlags, AX_FLAGS_OPAQUE, bHasFill ); + if( bHasFill ) + { + const GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper(); + sal_Int32 nSysWindowColor = rGraphicHelper.getSystemColor( XML_window, API_RGB_WHITE ); + ::oox::drawingml::Color aColor = ::oox::vml::ConversionHelper::decodeColor( rGraphicHelper, rFillModel.moColor, rFillModel.moOpacity, nSysWindowColor ); + sal_Int32 nRgbValue = aColor.getColor( rGraphicHelper ); + rAxModel.mnBackColor = OleHelper::encodeOleColor( nRgbValue ); + } } // ============================================================================ @@ -607,4 +1093,3 @@ void OoxVmlDrawingFragment::finalizeImport() } // namespace xls } // namespace oox - diff --git a/oox/source/xls/excelfilter.cxx b/oox/source/xls/excelfilter.cxx index 71475790851f..f07bfd48495f 100644 --- a/oox/source/xls/excelfilter.cxx +++ b/oox/source/xls/excelfilter.cxx @@ -26,36 +26,35 @@ ************************************************************************/ #include "oox/xls/excelfilter.hxx" + +#include +#include "oox/dump/biffdumper.hxx" +#include "oox/dump/xlsbdumper.hxx" #include "oox/helper/binaryinputstream.hxx" #include "oox/xls/biffdetector.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/excelchartconverter.hxx" +#include "oox/xls/excelvbaproject.hxx" #include "oox/xls/stylesbuffer.hxx" #include "oox/xls/themebuffer.hxx" #include "oox/xls/workbookfragment.hxx" -#include "oox/dump/biffdumper.hxx" -#include "oox/dump/xlsbdumper.hxx" - -using ::rtl::OUString; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::XInterface; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::xml::sax::XFastDocumentHandler; -using ::oox::core::BinaryFilterBase; -using ::oox::core::FragmentHandlerRef; -using ::oox::core::Relation; -using ::oox::core::Relations; -using ::oox::core::XmlFilterBase; -using ::oox::drawingml::table::TableStyleListPtr; namespace oox { namespace xls { // ============================================================================ +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::sheet; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; +using namespace ::oox::core; + +using ::rtl::OUString; +using ::oox::drawingml::table::TableStyleListPtr; + +// ============================================================================ + ExcelFilterBase::ExcelFilterBase() : mpData( 0 ) { @@ -160,6 +159,11 @@ GraphicHelper* ExcelFilter::implCreateGraphicHelper() const return new ExcelGraphicHelper( getWorkbookData() ); } +::oox::ole::VbaProject* ExcelFilter::implCreateVbaProject() const +{ + return new ExcelVbaProject( getGlobalFactory(), Reference< XSpreadsheetDocument >( getModel(), UNO_QUERY ) ); +} + OUString ExcelFilter::implGetImplementationName() const { return ExcelFilter_getImplementationName(); @@ -235,6 +239,11 @@ GraphicHelper* ExcelBiffFilter::implCreateGraphicHelper() const return new ExcelGraphicHelper( getWorkbookData() ); } +::oox::ole::VbaProject* ExcelBiffFilter::implCreateVbaProject() const +{ + return new ExcelVbaProject( getGlobalFactory(), Reference< XSpreadsheetDocument >( getModel(), UNO_QUERY ) ); +} + OUString ExcelBiffFilter::implGetImplementationName() const { return ExcelBiffFilter_getImplementationName(); @@ -244,4 +253,3 @@ OUString ExcelBiffFilter::implGetImplementationName() const } // namespace xls } // namespace oox - diff --git a/oox/source/xls/excelvbaproject.cxx b/oox/source/xls/excelvbaproject.cxx index 859dd8c733ba..3d7d34b87823 100755 --- a/oox/source/xls/excelvbaproject.cxx +++ b/oox/source/xls/excelvbaproject.cxx @@ -56,13 +56,13 @@ using ::rtl::OUStringBuffer; // ============================================================================ -VbaProject::VbaProject( const Reference< XMultiServiceFactory >& rxGlobalFactory, const Reference< XSpreadsheetDocument >& rxDocument ) : +ExcelVbaProject::ExcelVbaProject( const Reference< XMultiServiceFactory >& rxGlobalFactory, const Reference< XSpreadsheetDocument >& rxDocument ) : ::oox::ole::VbaProject( rxGlobalFactory, Reference< XModel >( rxDocument, UNO_QUERY ), CREATE_OUSTRING( "Calc" ) ), mxDocument( rxDocument ) { } -void VbaProject::attachToEvents() +void ExcelVbaProject::attachToEvents() { // do nothing is code is not executable if( !isImportVbaExecutable() ) @@ -125,7 +125,7 @@ void lclGenerateMissingCodeNames( CodeNameSet& rUsedCodeNames, SheetPropertySetL } // namespace -void VbaProject::prepareModuleImport() +void ExcelVbaProject::prepareImport() { /* Check if the sheets have imported codenames. Generate new unused codenames if not. */ @@ -169,9 +169,14 @@ void VbaProject::prepareModuleImport() } } +void ExcelVbaProject::finalizeImport() +{ + attachToEvents(); +} + // private -------------------------------------------------------------------- -void VbaProject::attachToDocumentEvents( const OUString& rCodeName ) +void ExcelVbaProject::attachToDocumentEvents( const OUString& rCodeName ) { if( (rCodeName.getLength() == 0) || !hasModule( rCodeName ) ) return; @@ -189,7 +194,7 @@ void VbaProject::attachToDocumentEvents( const OUString& rCodeName ) attachMacroToDocumentEvent( CREATE_OUSTRING( "OnPrepareUnload" ), rCodeName, CREATE_OUSTRING( "Workbook_BeforeClose" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO False" ) ); } -void VbaProject::attachToSheetEvents( const Reference< XEventsSupplier >& rxEventsSupp, const OUString& rCodeName ) +void ExcelVbaProject::attachToSheetEvents( const Reference< XEventsSupplier >& rxEventsSupp, const OUString& rCodeName ) { if( !rxEventsSupp.is() || (rCodeName.getLength() == 0) || !hasModule( rCodeName ) ) return; diff --git a/oox/source/xls/externallinkbuffer.cxx b/oox/source/xls/externallinkbuffer.cxx index 04fcd2f84648..648555474218 100644 --- a/oox/source/xls/externallinkbuffer.cxx +++ b/oox/source/xls/externallinkbuffer.cxx @@ -26,7 +26,7 @@ ************************************************************************/ #include "oox/xls/externallinkbuffer.hxx" -#include + #include #include #include @@ -38,6 +38,7 @@ #include #include #include +#include #include "oox/helper/attributelist.hxx" #include "oox/core/filterbase.hxx" #include "oox/xls/addressconverter.hxx" @@ -46,31 +47,21 @@ #include "oox/xls/formulaparser.hxx" #include "oox/xls/worksheetbuffer.hxx" +namespace oox { +namespace xls { + +// ============================================================================ + +using namespace ::com::sun::star::sheet; +using namespace ::com::sun::star::table; +using namespace ::com::sun::star::uno; + +using ::oox::core::Relation; +using ::oox::core::Relations; using ::rtl::OString; using ::rtl::OStringBuffer; using ::rtl::OStringToOUString; using ::rtl::OUString; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::table::CellAddress; -using ::com::sun::star::sheet::ComplexReference; -using ::com::sun::star::sheet::DDEItemInfo; -using ::com::sun::star::sheet::DDELinkInfo; -using ::com::sun::star::sheet::ExternalLinkInfo; -using ::com::sun::star::sheet::ExternalReference; -using ::com::sun::star::sheet::SingleReference; -using ::com::sun::star::sheet::XDDELinks; -using ::com::sun::star::sheet::XDDELinkResults; -using ::com::sun::star::sheet::XExternalDocLinks; -using ::com::sun::star::sheet::XExternalSheetCache; -using ::oox::core::Relation; -using ::oox::core::Relations; - -namespace oox { -namespace xls { // ============================================================================ @@ -947,8 +938,10 @@ void RefSheetsModel::readBiff8Data( BiffInputStream& rStrm ) ExternalLinkBuffer::ExternalLinkBuffer( const WorkbookHelper& rHelper ) : WorkbookHelper( rHelper ), + mxSelfRef( new ExternalLink( rHelper ) ), mbUseRefSheets( false ) { + mxSelfRef->setSelfLinkType(); } ExternalLinkRef ExternalLinkBuffer::importExternalReference( const AttributeList& rAttribs ) @@ -1046,22 +1039,24 @@ void ExternalLinkBuffer::importExternSheet8( BiffInputStream& rStrm ) Sequence< ExternalLinkInfo > ExternalLinkBuffer::getLinkInfos() const { ::std::vector< ExternalLinkInfo > aLinkInfos; - // dummy entry for index 0 - aLinkInfos.push_back( ExternalLinkInfo( ::com::sun::star::sheet::ExternalLinkType::UNKNOWN, Any() ) ); + // should not be used for OOBIN documents + OSL_ENSURE( (getFilterType() == FILTER_OOX) && !mbUseRefSheets, "ExternalLinkBuffer::getLinkInfos - unexpected file format" ); + // add entry for implicit index 0 (self reference to this document) + aLinkInfos.push_back( mxSelfRef->getLinkInfo() ); for( ExternalLinkVec::const_iterator aIt = maExtLinks.begin(), aEnd = maExtLinks.end(); aIt != aEnd; ++aIt ) aLinkInfos.push_back( (*aIt)->getLinkInfo() ); return ContainerHelper::vectorToSequence( aLinkInfos ); } -ExternalLinkRef ExternalLinkBuffer::getExternalLink( sal_Int32 nRefId ) const +ExternalLinkRef ExternalLinkBuffer::getExternalLink( sal_Int32 nRefId, bool bUseRefSheets ) const { ExternalLinkRef xExtLink; switch( getFilterType() ) { case FILTER_OOX: - // OOXML: one-based index - if( !mbUseRefSheets ) - xExtLink = maLinks.get( nRefId - 1 ); + // OOXML: 0 = this document, otherwise one-based index into link list + if( !bUseRefSheets || !mbUseRefSheets ) + xExtLink = (nRefId == 0) ? mxSelfRef : maLinks.get( nRefId - 1 ); // OOBIN: zero-based index into ref-sheets list else if( const RefSheetsModel* pRefSheets = getRefSheets( nRefId ) ) xExtLink = maLinks.get( pRefSheets->mnExtRefId ); @@ -1140,4 +1135,3 @@ const RefSheetsModel* ExternalLinkBuffer::getRefSheets( sal_Int32 nRefId ) const } // namespace xls } // namespace oox - diff --git a/oox/source/xls/externallinkfragment.cxx b/oox/source/xls/externallinkfragment.cxx index 15aaf8bc5412..16bd11bc5144 100644 --- a/oox/source/xls/externallinkfragment.cxx +++ b/oox/source/xls/externallinkfragment.cxx @@ -69,32 +69,30 @@ ContextHandlerRef OoxExternalSheetDataContext::onCreateContext( sal_Int32 nEleme if( nElement == XLS_TOKEN( cell ) ) { importCell( rAttribs ); return this; } break; case XLS_TOKEN( cell ): - if( nElement == XLS_TOKEN( v ) ) return this; // collect characters in onEndElement() + if( nElement == XLS_TOKEN( v ) ) return this; // collect characters in onCharacters() break; } return 0; } -void OoxExternalSheetDataContext::onEndElement( const OUString& rChars ) +void OoxExternalSheetDataContext::onCharacters( const OUString& rChars ) { - switch( getCurrentElement() ) + if( isCurrentElement( XLS_TOKEN( v ) ) ) { - case XLS_TOKEN( v ): - switch( mnCurrType ) - { - case XML_b: - case XML_n: - setCellValue( Any( rChars.toDouble() ) ); - break; - case XML_e: - setCellValue( Any( BiffHelper::calcDoubleFromError( getUnitConverter().calcBiffErrorCode( rChars ) ) ) ); - break; - case XML_str: - setCellValue( Any( rChars ) ); - break; - } - mnCurrType = XML_TOKEN_INVALID; - break; + switch( mnCurrType ) + { + case XML_b: + case XML_n: + setCellValue( Any( rChars.toDouble() ) ); + break; + case XML_e: + setCellValue( Any( BiffHelper::calcDoubleFromError( getUnitConverter().calcBiffErrorCode( rChars ) ) ) ); + break; + case XML_str: + setCellValue( Any( rChars ) ); + break; + } + mnCurrType = XML_TOKEN_INVALID; } } @@ -245,7 +243,7 @@ ContextHandlerRef OoxExternalLinkFragment::onCreateContext( sal_Int32 nElement, } break; case XLS_TOKEN( value ): - if( nElement == XLS_TOKEN( val ) ) return this; // collect value in onEndElement() + if( nElement == XLS_TOKEN( val ) ) return this; // collect value in onCharacters() break; case XLS_TOKEN( oleLink ): @@ -258,32 +256,30 @@ ContextHandlerRef OoxExternalLinkFragment::onCreateContext( sal_Int32 nElement, return false; } -void OoxExternalLinkFragment::onEndElement( const OUString& rChars ) +void OoxExternalLinkFragment::onCharacters( const OUString& rChars ) { - switch( getCurrentElement() ) + if( isCurrentElement( XLS_TOKEN( val ) ) ) + maResultValue = rChars; +} + +void OoxExternalLinkFragment::onEndElement() +{ + if( isCurrentElement( XLS_TOKEN( value ) ) && mxExtName.get() ) switch( mnResultType ) { - case XLS_TOKEN( val ): - maResultValue = rChars; + case XML_b: + mxExtName->appendResultValue( maResultValue.toDouble() ); break; - case XLS_TOKEN( value ): - if( mxExtName.get() ) switch( mnResultType ) - { - case XML_b: - mxExtName->appendResultValue( maResultValue.toDouble() ); - break; - case XML_e: - mxExtName->appendResultValue( BiffHelper::calcDoubleFromError( getUnitConverter().calcBiffErrorCode( maResultValue ) ) ); - break; - case XML_n: - mxExtName->appendResultValue( maResultValue.toDouble() ); - break; - case XML_str: - mxExtName->appendResultValue( maResultValue ); - break; - default: - mxExtName->appendResultValue( BiffHelper::calcDoubleFromError( BIFF_ERR_NA ) ); - } + case XML_e: + mxExtName->appendResultValue( BiffHelper::calcDoubleFromError( getUnitConverter().calcBiffErrorCode( maResultValue ) ) ); + break; + case XML_n: + mxExtName->appendResultValue( maResultValue.toDouble() ); + break; + case XML_str: + mxExtName->appendResultValue( maResultValue ); break; + default: + mxExtName->appendResultValue( BiffHelper::calcDoubleFromError( BIFF_ERR_NA ) ); } } diff --git a/oox/source/xls/formulaparser.cxx b/oox/source/xls/formulaparser.cxx index 12deadecd695..e3a8282e1a15 100644 --- a/oox/source/xls/formulaparser.cxx +++ b/oox/source/xls/formulaparser.cxx @@ -439,7 +439,7 @@ public: const ApiTokenSequence& rTokens ); /** Tries to resolve the passed ref-id to an OLE target URL. */ - OUString resolveOleTarget( sal_Int32 nRefId ) const; + OUString resolveOleTarget( sal_Int32 nRefId, bool bUseRefSheets ) const; protected: typedef ::std::pair< sal_Int32, bool > WhiteSpace; @@ -605,9 +605,9 @@ void FormulaParserImpl::setFormula( FormulaContext& rContext, const ApiTokenSequ finalizeImport( rTokens ); } -OUString FormulaParserImpl::resolveOleTarget( sal_Int32 nRefId ) const +OUString FormulaParserImpl::resolveOleTarget( sal_Int32 nRefId, bool bUseRefSheets ) const { - const ExternalLink* pExtLink = getExternalLinks().getExternalLink( nRefId ).get(); + const ExternalLink* pExtLink = getExternalLinks().getExternalLink( nRefId, bUseRefSheets ).get(); OSL_ENSURE( pExtLink && (pExtLink->getLinkType() == LINKTYPE_OLE), "FormulaParserImpl::resolveOleTarget - missing or wrong link" ); if( pExtLink && (pExtLink->getLinkType() == LINKTYPE_OLE) ) return getBaseFilter().getAbsoluteUrl( pExtLink->getTargetUrl() ); @@ -2734,6 +2734,29 @@ bool BiffFormulaParserImpl::pushBiffFunction( sal_uInt16 nFuncId, sal_uInt8 nPar // ============================================================================ +namespace { + +/** Extracts the reference identifier and the remaining data from a formula in + the format '[RefID]Remaining'. */ +bool lclExtractRefId( sal_Int32& rnRefId, OUString& rRemainder, const OUString& rFormulaString ) +{ + if( (rFormulaString.getLength() >= 4) && (rFormulaString[ 0 ] == '[') ) + { + sal_Int32 nBracketClose = rFormulaString.indexOf( ']', 1 ); + if( nBracketClose >= 2 ) + { + rnRefId = rFormulaString.copy( 1, nBracketClose - 1 ).toInt32(); + rRemainder = rFormulaString.copy( nBracketClose + 1 ); + return rRemainder.getLength() > 0; + } + } + return false; +} + +} + +// ---------------------------------------------------------------------------- + FormulaParser::FormulaParser( const WorkbookHelper& rHelper ) : FormulaProcessorBase( rHelper ) { @@ -2808,24 +2831,12 @@ void FormulaParser::convertNumberToHyperlink( FormulaContext& rContext, const OU OUString FormulaParser::importOleTargetLink( const OUString& rFormulaString ) { - // obviously, this would overburden our formula parser, so we parse it manually - OUString aTargetLink; - sal_Int32 nFmlaLen = rFormulaString.getLength(); - if( (nFmlaLen >= 8) && (rFormulaString[ 0 ] == '[') ) - { - // passed string is trimmed already - sal_Int32 nBracketClose = rFormulaString.indexOf( ']' ); - sal_Int32 nExclamation = rFormulaString.indexOf( '!' ); - if( (nBracketClose >= 2) && - (nBracketClose + 1 == nExclamation) && - (rFormulaString[ nExclamation + 1 ] == '\'') && - (rFormulaString[ nFmlaLen - 1 ] == '\'') ) - { - sal_Int32 nRefId = rFormulaString.copy( 1, nBracketClose - 1 ).toInt32(); - aTargetLink = mxImpl->resolveOleTarget( nRefId ); - } - } - return aTargetLink; + sal_Int32 nRefId = -1; + OUString aRemainder; + if( lclExtractRefId( nRefId, aRemainder, rFormulaString ) && (aRemainder.getLength() >= 3) && + (aRemainder[ 0 ] == '!') && (aRemainder[ 1 ] == '\'') && (aRemainder[ aRemainder.getLength() - 1 ] == '\'') ) + return mxImpl->resolveOleTarget( nRefId, false ); + return OUString(); } OUString FormulaParser::importOleTargetLink( RecordInputStream& rStrm ) @@ -2840,7 +2851,7 @@ OUString FormulaParser::importOleTargetLink( RecordInputStream& rStrm ) sal_Int32 nNameId; rStrm >> nToken >> nRefId >> nNameId; if( nToken == (BIFF_TOKCLASS_VAL|BIFF_TOKID_NAMEX) ) - aTargetLink = mxImpl->resolveOleTarget( nRefId ); + aTargetLink = mxImpl->resolveOleTarget( nRefId, true ); } rStrm.seek( nFmlaEndPos ); return aTargetLink; @@ -2854,8 +2865,60 @@ OUString FormulaParser::importOleTargetLink( BiffInputStream& rStrm, const sal_u return aTargetLink; } +OUString FormulaParser::importMacroName( const OUString& rFormulaString ) +{ + /* Valid macros are either sheet macros or VBA macros. OOXML and all BIFF + documents store defined names for sheet macros, but OOXML documents do + not store any defined name for VBA macros (while BIFF documents do). + Sheet macros may be defined locally to a sheet, or globally to the + document. As a result, all of the following macro specifiers are valid: + + 1) Macros located in the own document: + [0]!MySheetMacro (global sheet macro 'MySheetMacro') + Macro1!MyMacro (sheet-local sheet macro 'MyMacro') + [0]!MyVBAProc (VBA macro 'MyVBAProc') + [0]!Mod1.MyVBAProc (VBA macro 'MyVBAProc' from code module 'Mod1') + + 2) Macros from an external document: + [2]!MySheetMacro (global external sheet macro 'MySheetMacro') + [2]Macro1!MyMacro (sheet-local external sheet macro 'MyMacro') + [2]!MyVBAProc (external VBA macro 'MyVBAProc') + [2]!Mod1.MyVBAProc (external VBA macro from code module 'Mod1') + + This implementation is only interested in VBA macros from the own + document, ignoring the valid syntax 'Macro1!MyMacro' for sheet-local + sheet macros. + */ + sal_Int32 nRefId = -1; + OUString aRemainder; + if( lclExtractRefId( nRefId, aRemainder, rFormulaString ) && (aRemainder.getLength() > 1) && (aRemainder[ 0 ] == '!') ) + { + /* In BIFF12 documents, the reference identifier is always the + one-based index of the external link as it is in OOXML documents + (it is not an index into the list of reference sheets as used in + cell formulas). Index 0 is an implicit placeholder for the own + document. In BIFF12 documents, the reference to the own document is + stored explicitly, mostly at the top of the list, so index 1 may + resolve to the own document too. + Passing 'false' to getExternalLink() specifies to ignore the + reference sheets list (if existing) and to access the list of + external links directly. */ + const ExternalLink* pExtLink = getExternalLinks().getExternalLink( nRefId, false ).get(); + OSL_ENSURE( pExtLink, "FormulaParser::importMacroName - missing link" ); + // do not accept macros in external documents (not supported) + if( pExtLink && (pExtLink->getLinkType() == LINKTYPE_SELF) ) + { + // ignore sheet macros (defined name for VBA macros may not exist, see above) + OUString aMacroName = aRemainder.copy( 1 ); + const DefinedName* pDefName = getDefinedNames().getByModelName( aMacroName ).get(); + if( !pDefName || pDefName->isVBName() ) + return aMacroName; + } + } + return OUString(); +} + // ============================================================================ } // namespace xls } // namespace oox - diff --git a/oox/source/xls/richstringcontext.cxx b/oox/source/xls/richstringcontext.cxx index 4eb3f5e91a4f..ba022041f651 100644 --- a/oox/source/xls/richstringcontext.cxx +++ b/oox/source/xls/richstringcontext.cxx @@ -44,10 +44,18 @@ ContextHandlerRef OoxRichStringContext::onCreateContext( sal_Int32 nElement, con { switch( nElement ) { - case XLS_TOKEN( t ): mxPortion = mxString->importText( rAttribs ); return this; // collect text in onEndElement() - case XLS_TOKEN( r ): mxPortion = mxString->importRun( rAttribs ); return this; - case XLS_TOKEN( rPh ): mxPhonetic = mxString->importPhoneticRun( rAttribs ); return this; - case XLS_TOKEN( phoneticPr ): mxString->importPhoneticPr( rAttribs ); break; + case XLS_TOKEN( t ): + mxPortion = mxString->importText( rAttribs ); + return this; // collect text in onCharacters() + case XLS_TOKEN( r ): + mxPortion = mxString->importRun( rAttribs ); + return this; + case XLS_TOKEN( rPh ): + mxPhonetic = mxString->importPhoneticRun( rAttribs ); + return this; + case XLS_TOKEN( phoneticPr ): + mxString->importPhoneticPr( rAttribs ); + break; } } else switch( getCurrentElement() ) @@ -61,7 +69,7 @@ ContextHandlerRef OoxRichStringContext::onCreateContext( sal_Int32 nElement, con break; case XLS_TOKEN( t ): - return this; // collect portion text in onEndElement() + return this; // collect portion text in onCharacters() } break; @@ -69,22 +77,24 @@ ContextHandlerRef OoxRichStringContext::onCreateContext( sal_Int32 nElement, con switch( nElement ) { case XLS_TOKEN( t ): - return this; // collect phonetic text in onEndElement() + return this; // collect phonetic text in onCharacters() } break; } return 0; } -void OoxRichStringContext::onEndElement( const OUString& rChars ) +void OoxRichStringContext::onCharacters( const OUString& rChars ) { - if( getCurrentElement() == XLS_TOKEN( t ) ) + if( isCurrentElement( XLS_TOKEN( t ) ) ) switch( getParentElement() ) { - switch( getPreviousElement() ) - { - case XLS_TOKEN( rPh ): if( mxPhonetic.get() ) mxPhonetic->setText( rChars ); break; - default: if( mxPortion.get() ) mxPortion->setText( rChars ); break; - } + case XLS_TOKEN( rPh ): + if( mxPhonetic.get() ) + mxPhonetic->setText( rChars ); + break; + default: + if( mxPortion.get() ) + mxPortion->setText( rChars ); } } diff --git a/oox/source/xls/sheetdatacontext.cxx b/oox/source/xls/sheetdatacontext.cxx index 05e4c5bfe767..667d093d2cb6 100644 --- a/oox/source/xls/sheetdatacontext.cxx +++ b/oox/source/xls/sheetdatacontext.cxx @@ -198,7 +198,7 @@ ContextHandlerRef OoxSheetDataContext::onCreateContext( sal_Int32 nElement, cons return 0; } -void OoxSheetDataContext::onEndElement( const OUString& rChars ) +void OoxSheetDataContext::onCharacters( const OUString& rChars ) { switch( getCurrentElement() ) { @@ -252,44 +252,45 @@ void OoxSheetDataContext::onEndElement( const OUString& rChars ) break; default: - OSL_ENSURE( false, "OoxSheetDataContext::onEndElement - unknown formula type" ); + OSL_ENSURE( false, "OoxSheetDataContext::onCharacters - unknown formula type" ); } } catch( Exception& ) { } break; + } +} - case XLS_TOKEN( c ): - if( maCurrCell.mxCell.is() ) +void OoxSheetDataContext::onEndElement() +{ + if( isCurrentElement( XLS_TOKEN( c ) ) && maCurrCell.mxCell.is() ) + { + if( maCurrCell.mxCell->getType() == CellContentType_EMPTY ) + { + if( maCurrCell.mbHasValueStr ) { - if( maCurrCell.mxCell->getType() == CellContentType_EMPTY ) - { - if( maCurrCell.mbHasValueStr ) - { - // implemented in WorksheetHelper class - setCell( maCurrCell ); - } - else if( (maCurrCell.mnCellType == XML_inlineStr) && mxInlineStr.get() ) - { - // convert font settings - mxInlineStr->finalizeImport(); - // write string to cell - Reference< XText > xText( maCurrCell.mxCell, UNO_QUERY ); - if( xText.is() ) - mxInlineStr->convert( xText, maCurrCell.mnXfId ); - } - else - { - // empty cell, update cell type - maCurrCell.mnCellType = XML_TOKEN_INVALID; - } - } - - // store the cell formatting data - setCellFormat( maCurrCell ); + // implemented in WorksheetHelper class + setCell( maCurrCell ); } - break; + else if( (maCurrCell.mnCellType == XML_inlineStr) && mxInlineStr.get() ) + { + // convert font settings + mxInlineStr->finalizeImport(); + // write string to cell + Reference< XText > xText( maCurrCell.mxCell, UNO_QUERY ); + if( xText.is() ) + mxInlineStr->convert( xText, maCurrCell.mnXfId ); + } + else + { + // empty cell, update cell type + maCurrCell.mnCellType = XML_TOKEN_INVALID; + } + } + + // store the cell formatting data + setCellFormat( maCurrCell ); } } diff --git a/oox/source/xls/workbookfragment.cxx b/oox/source/xls/workbookfragment.cxx index 6e43a32495be..6322bd94c480 100644 --- a/oox/source/xls/workbookfragment.cxx +++ b/oox/source/xls/workbookfragment.cxx @@ -128,14 +128,10 @@ ContextHandlerRef OoxWorkbookFragment::onCreateContext( sal_Int32 nElement, cons return 0; } -void OoxWorkbookFragment::onEndElement( const OUString& rChars ) +void OoxWorkbookFragment::onCharacters( const OUString& rChars ) { - switch( getCurrentElement() ) - { - case XLS_TOKEN( definedName ): - if( mxCurrName.get() ) mxCurrName->setFormula( rChars ); - break; - } + if( isCurrentElement( XLS_TOKEN( definedName ) ) && mxCurrName.get() ) + mxCurrName->setFormula( rChars ); } ContextHandlerRef OoxWorkbookFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx index afeed95accca..5b7e9699d76b 100644 --- a/oox/source/xls/workbookhelper.cxx +++ b/oox/source/xls/workbookhelper.cxx @@ -26,31 +26,31 @@ ************************************************************************/ #include "oox/xls/workbookhelper.hxx" -#include + +#include #include #include -#include #include -#include -#include -#include -#include -#include #include #include +#include +#include +#include +#include #include #include -#include "properties.hxx" +#include +#include +#include "oox/drawingml/theme.hxx" #include "oox/helper/progressbar.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/drawingml/theme.hxx" +#include "oox/ole/vbaproject.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/biffcodec.hxx" #include "oox/xls/defnamesbuffer.hxx" #include "oox/xls/excelchartconverter.hxx" #include "oox/xls/excelfilter.hxx" -#include "oox/xls/excelvbaproject.hxx" #include "oox/xls/externallinkbuffer.hxx" #include "oox/xls/formulaparser.hxx" #include "oox/xls/pagesettings.hxx" @@ -66,40 +66,28 @@ #include "oox/xls/webquerybuffer.hxx" #include "oox/xls/workbooksettings.hxx" #include "oox/xls/worksheetbuffer.hxx" +#include "properties.hxx" + +namespace oox { +namespace xls { + +// ============================================================================ + +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::document; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::sheet; +using namespace ::com::sun::star::style; +using namespace ::com::sun::star::table; +using namespace ::com::sun::star::uno; -using ::rtl::OUString; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; -using ::com::sun::star::container::XIndexAccess; -using ::com::sun::star::container::XNameAccess; -using ::com::sun::star::container::XNameContainer; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::awt::XDevice; -using ::com::sun::star::document::XActionLockable; -using ::com::sun::star::table::CellAddress; -using ::com::sun::star::table::CellRangeAddress; -using ::com::sun::star::table::XCell; -using ::com::sun::star::table::XCellRange; -using ::com::sun::star::sheet::XSpreadsheetDocument; -using ::com::sun::star::sheet::XSpreadsheet; -using ::com::sun::star::sheet::XNamedRange; -using ::com::sun::star::sheet::XNamedRanges; -using ::com::sun::star::sheet::XDatabaseRanges; -using ::com::sun::star::sheet::XExternalDocLinks; -using ::com::sun::star::style::XStyle; -using ::com::sun::star::style::XStyleFamiliesSupplier; using ::oox::core::BinaryFilterBase; using ::oox::core::FilterBase; using ::oox::core::FragmentHandler; using ::oox::core::XmlFilterBase; using ::oox::drawingml::Theme; - -namespace oox { -namespace xls { +using ::rtl::OUString; // ============================================================================ @@ -613,6 +601,8 @@ void WorkbookData::finalize() aPropSet.setProperty( PROP_IsUndoEnabled, true ); // disable editing read-only documents (e.g. from read-only files) aPropSet.setProperty( PROP_IsChangeReadOnlyEnabled, false ); + // #111099# open forms in alive mode (has no effect, if no controls in document) + aPropSet.setProperty( PROP_ApplyFormDesignMode, false ); } } @@ -691,11 +681,7 @@ void WorkbookHelper::finalizeWorkbookImport() sheet events. */ StorageRef xVbaPrjStrg = mrBookData.getVbaProjectStorage(); if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() ) - { - VbaProject aVbaProject( getGlobalFactory(), getDocument() ); - aVbaProject.importVbaProject( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() ); - aVbaProject.attachToEvents(); - } + getBaseFilter().getVbaProject().importVbaProject( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() ); } // document model ------------------------------------------------------------- @@ -1004,4 +990,3 @@ bool WorkbookHelperRoot::isValid() const } // namespace xls } // namespace oox - diff --git a/oox/source/xls/worksheetfragment.cxx b/oox/source/xls/worksheetfragment.cxx index d75c92832994..7b397792d117 100644 --- a/oox/source/xls/worksheetfragment.cxx +++ b/oox/source/xls/worksheetfragment.cxx @@ -119,7 +119,7 @@ ContextHandlerRef OoxDataValidationsContext::onCreateContext( sal_Int32 nElement { case XLS_TOKEN( formula1 ): case XLS_TOKEN( formula2 ): - return this; // collect formulas in onEndElement() + return this; // collect formulas in onCharacters() } break; } @@ -138,7 +138,7 @@ ApiTokenSequence lclImportDataValFormula( FormulaParser& rParser, const OUString } // namespace -void OoxDataValidationsContext::onEndElement( const OUString& rChars ) +void OoxDataValidationsContext::onCharacters( const OUString& rChars ) { if( mxValModel.get() ) switch( getCurrentElement() ) { @@ -153,10 +153,15 @@ void OoxDataValidationsContext::onEndElement( const OUString& rChars ) mxValModel->maTokens2 = lclImportDataValFormula( getFormulaParser(), rChars, mxValModel->maRanges.getBaseAddress() ); break; - case XLS_TOKEN( dataValidation ): - setValidation( *mxValModel ); - mxValModel.reset(); - break; + } +} + +void OoxDataValidationsContext::onEndElement() +{ + if( isCurrentElement( XLS_TOKEN( dataValidation ) ) && mxValModel.get() ) + { + setValidation( *mxValModel ); + mxValModel.reset(); } } @@ -252,7 +257,7 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con case SHEETTYPE_WORKSHEET: return (nElement == XLS_TOKEN( worksheet )) ? this : 0; case SHEETTYPE_CHARTSHEET: return 0; case SHEETTYPE_MACROSHEET: return (nElement == XM_TOKEN( macrosheet )) ? this : 0; - case SHEETTYPE_DIALOGSHEET: return (nElement == XM_TOKEN( dialogsheet )) ? this : 0; + case SHEETTYPE_DIALOGSHEET: return (nElement == XLS_TOKEN( dialogsheet )) ? this : 0; case SHEETTYPE_MODULESHEET: return 0; case SHEETTYPE_EMPTYSHEET: return 0; } @@ -260,6 +265,7 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con case XLS_TOKEN( worksheet ): case XM_TOKEN( macrosheet ): + case XLS_TOKEN( dialogsheet ): switch( nElement ) { case XLS_TOKEN( sheetData ): return new OoxSheetDataContext( *this ); @@ -340,7 +346,7 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con case XLS_TOKEN( oddHeader ): case XLS_TOKEN( oddFooter ): case XLS_TOKEN( evenHeader ): - case XLS_TOKEN( evenFooter ): return this; // collect h/f contents in onEndElement() + case XLS_TOKEN( evenFooter ): return this; // collect h/f contents in onCharacters() } break; @@ -354,7 +360,7 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con return 0; } -void OoxWorksheetFragment::onEndElement( const OUString& rChars ) +void OoxWorksheetFragment::onCharacters( const OUString& rChars ) { switch( getCurrentElement() ) { -- cgit From 9840b5ce988888a7c85560e2b1e0c1b99bfa96b4 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 26 Aug 2010 18:37:44 +0200 Subject: dr77: #i114128# import legacy drawing controls --- sc/source/core/data/bcaslot.cxx | 12 +++++++++--- sc/source/filter/excel/excimp8.cxx | 2 +- sc/source/filter/excel/xltools.cxx | 6 +++--- sc/source/ui/vba/vbasheetobject.cxx | 6 +++--- 4 files changed, 16 insertions(+), 10 deletions(-) mode change 100755 => 100644 sc/source/ui/vba/vbasheetobject.cxx diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index 95482b1c624b..540fb577a79b 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -136,10 +136,16 @@ ScBroadcastAreaSlot::ScBroadcastAreaSlot( ScDocument* pDocument, ScBroadcastAreaSlot::~ScBroadcastAreaSlot() { for ( ScBroadcastAreas::iterator aIter( aBroadcastAreaTbl.begin()); - aIter != aBroadcastAreaTbl.end(); ++aIter) + aIter != aBroadcastAreaTbl.end(); /* none */) { - if (!(*aIter)->DecRef()) - delete *aIter; + // Prevent hash from accessing dangling pointer in case area is + // deleted. + ScBroadcastArea* pArea = *aIter; + // Erase all so no hash will be accessed upon destruction of the + // hash_set. + aBroadcastAreaTbl.erase( aIter++); + if (!pArea->DecRef()) + delete pArea; } } diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 9608804da9f9..a61008014ed2 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -327,7 +327,7 @@ void ImportExcel8::AttachDocumentEvents() uno::Reference< sheet::XSpreadsheetDocument > xDocument( pShell->GetModel(), uno::UNO_QUERY ); if( xGlobalFactory.is() && xDocument.is() ) { - ::oox::xls::VbaProject aVbaProject( xGlobalFactory, xDocument ); + ::oox::xls::ExcelVbaProject aVbaProject( xGlobalFactory, xDocument ); aVbaProject.attachToEvents(); } } diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index 0dd988d67586..47420ab8dcfd 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -695,9 +695,9 @@ const OUString XclTools::maSbMacroSuffix( RTL_CONSTASCII_USTRINGPARAM( "?languag OUString XclTools::GetSbMacroUrl( const String& rMacroName, SfxObjectShell* pDocShell ) { OSL_ENSURE( rMacroName.Len() > 0, "XclTools::GetSbMacroUrl - macro name is empty" ); - ::ooo::vba::VBAMacroResolvedInfo aMacroInfo = ::ooo::vba::resolveVBAMacro( pDocShell, rMacroName, false ); - if( aMacroInfo.IsResolved() ) - return ::ooo::vba::makeMacroURL( aMacroInfo.ResolvedMacro() ); + ::ooo::vba::MacroResolvedInfo aMacroInfo = ::ooo::vba::resolveVBAMacro( pDocShell, rMacroName, false ); + if( aMacroInfo.mbFound ) + return ::ooo::vba::makeMacroURL( aMacroInfo.msResolvedMacro ); return OUString(); } diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx old mode 100755 new mode 100644 index 4bd0f1d60547..f92cafa0da0d --- a/sc/source/ui/vba/vbasheetobject.cxx +++ b/sc/source/ui/vba/vbasheetobject.cxx @@ -350,14 +350,14 @@ void SAL_CALL ScVbaControlObjectBase::setOnAction( const OUString& rMacroName ) // if a macro name has been passed, try to attach it to the event if( rMacroName.getLength() > 0 ) { - VBAMacroResolvedInfo aResolvedMacro = resolveVBAMacro( getSfxObjShell( mxModel ), rMacroName ); - if( !aResolvedMacro.IsResolved() ) + MacroResolvedInfo aResolvedMacro = resolveVBAMacro( getSfxObjShell( mxModel ), rMacroName ); + if( !aResolvedMacro.mbFound ) throw uno::RuntimeException(); script::ScriptEventDescriptor aDescriptor; aDescriptor.ListenerType = maListenerType; aDescriptor.EventMethod = maEventMethod; aDescriptor.ScriptType = CREATE_OUSTRING( "Script" ); - aDescriptor.ScriptCode = makeMacroURL( aResolvedMacro.ResolvedMacro() ); + aDescriptor.ScriptCode = makeMacroURL( aResolvedMacro.msResolvedMacro ); xEventMgr->registerScriptEvent( nIndex, aDescriptor ); } } -- cgit From 0484109ea6e454ce329721e9ad97fb9c46989b2c Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 26 Aug 2010 18:37:44 +0200 Subject: dr77: #i114128# import legacy drawing controls --- .../com/sun/star/script/vba/VBAMacroResolver.idl | 49 +++++++++++ .../com/sun/star/script/vba/XVBAMacroResolver.idl | 94 ++++++++++++++++++++++ offapi/com/sun/star/script/vba/makefile.mk | 47 +++++++++++ offapi/prj/build.lst | 5 +- offapi/prj/d.lst | 2 + offapi/util/makefile.mk | 1 + offuh/prj/d.lst | 3 + 7 files changed, 199 insertions(+), 2 deletions(-) create mode 100755 offapi/com/sun/star/script/vba/VBAMacroResolver.idl create mode 100755 offapi/com/sun/star/script/vba/XVBAMacroResolver.idl create mode 100755 offapi/com/sun/star/script/vba/makefile.mk diff --git a/offapi/com/sun/star/script/vba/VBAMacroResolver.idl b/offapi/com/sun/star/script/vba/VBAMacroResolver.idl new file mode 100755 index 000000000000..62f6e8ce0c2a --- /dev/null +++ b/offapi/com/sun/star/script/vba/VBAMacroResolver.idl @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_script_vba_VBAMacroResolver_idl__ +#define __com_sun_star_script_vba_VBAMacroResolver_idl__ + +#include + +//============================================================================= + +module com { module sun { module star { module script { module vba { + +//============================================================================= + +service VBAMacroResolver : XVBAMacroResolver +{ +}; + +//============================================================================= + +}; }; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/script/vba/XVBAMacroResolver.idl b/offapi/com/sun/star/script/vba/XVBAMacroResolver.idl new file mode 100755 index 000000000000..378219268010 --- /dev/null +++ b/offapi/com/sun/star/script/vba/XVBAMacroResolver.idl @@ -0,0 +1,94 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_script_vba_XVBAMacroResolver_idl__ +#define __com_sun_star_script_vba_XVBAMacroResolver_idl__ + +#include + +//============================================================================= + +module com { module sun { module star { module script { module vba { + +//============================================================================= + +/** Converts VBA macro names to script URLs and vice versa. + */ +interface XVBAMacroResolver +{ + //------------------------------------------------------------------------- + + /** Returns the script URL representing the passed VBA macro name. + + @param aVBAMacroName + The VBA macro name to be resolved to a script URL. The macro name + may consist of up to three parts, divided by periods. The first two + parts are optional. The first part represents the VBA project name. + The second part represents the module name. The third part + represents the procedure name. Example: All the VBA macro names + "VBAProject.Module1.TestMacro", "Module1.TestMacro", + "VBAProject.TestMacro", and "TestMacro" may refer to the same VBA + procedure located in "Module" of the project "VBAProject". If the + module name is missing, then all modules are searched for a macro + with the specified name. + + @return + The script URL referring to the passed VBA macro. + + @throws IllegalArgumentException + if a macro with the passed name does not exist. + **/ + string resolveVBAMacroToScriptURL( [in] string aVBAMacroName ) + raises (::com::sun::star::lang::IllegalArgumentException); + + //------------------------------------------------------------------------- + + /** Returns the VBA macro name for a macro with the passed script URL. + + @param aScriptURL + The script URL to be resolved to a VBA macro name. Must be a + document-local script. + + @return + The VBA macro name referring to a macro with the passed script URL. + + @throws IllegalArgumentException + if a macro with the passed name does not exist. + **/ + string resolveScriptURLtoVBAMacro( [in] string aScriptURL ) + raises (::com::sun::star::lang::IllegalArgumentException); + + //------------------------------------------------------------------------- +}; + +//============================================================================= + +}; }; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/script/vba/makefile.mk b/offapi/com/sun/star/script/vba/makefile.mk new file mode 100755 index 000000000000..93356e9e8934 --- /dev/null +++ b/offapi/com/sun/star/script/vba/makefile.mk @@ -0,0 +1,47 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/..$/..$/.. + +PRJNAME=offapi + +TARGET=cssscriptvba +PACKAGE=com$/sun$/star$/script$/vba + +# --- Settings ----------------------------------------------------- +.INCLUDE : $(PRJ)$/util$/makefile.pmk + +# ------------------------------------------------------------------------ + +IDLFILES=\ + VBAMacroResolver.idl \ + XVBAMacroResolver.idl + +# ------------------------------------------------------------------ + +.INCLUDE : target.mk +.INCLUDE : $(PRJ)$/util$/target.pmk diff --git a/offapi/prj/build.lst b/offapi/prj/build.lst index a0be2398f429..bc6dda566031 100644 --- a/offapi/prj/build.lst +++ b/offapi/prj/build.lst @@ -3,6 +3,7 @@ oa offapi usr1 - all oa_mkout NULL oa offapi\com\sun\star\script nmake - all oa_script oa_embed NULL oa offapi\com\sun\star\script\browse nmake - all oa_sfbrowse NULL oa offapi\com\sun\star\script\provider nmake - all oa_sfprovider NULL +oa offapi\com\sun\star\script\vba nmake - all oa_script_vba NULL oa offapi\com\sun\star\auth nmake - all oa_auth NULL oa offapi\com\sun\star\accessibility nmake - all oa_accessibility oa_awt NULL oa offapi\com\sun\star\awt nmake - all oa_awt NULL @@ -21,10 +22,10 @@ oa offapi\com\sun\star\datatransfer\dnd nmake - all oa_datatrans_dnd oa_awt NULL oa offapi\com\sun\star\deployment nmake - all oa_deployment oa_ucb oa_xml_input NULL oa offapi\com\sun\star\deployment\test nmake - all oa_deploymenttest oa_ucb NULL oa offapi\com\sun\star\deployment\ui nmake - all oa_deployment_ui oa_awt oa_ui_dialogs NULL -oa offapi\com\sun\star\embed nmake - all oa_embed NULL oa offapi\com\sun\star\document nmake - all oa_docu oa_embed NULL oa offapi\com\sun\star\drawing nmake - all oa_draw NULL oa offapi\com\sun\star\drawing\framework nmake - all oa_draw_framework NULL +oa offapi\com\sun\star\embed nmake - all oa_embed NULL oa offapi\com\sun\star\form nmake - all oa_form oa_inspection NULL oa offapi\com\sun\star\form\component nmake - all oa_fcomp oa_form oa_form_submission NULL oa offapi\com\sun\star\form\inspection nmake - all oa_finsp oa_fcomp oa_inspection NULL @@ -105,4 +106,4 @@ oa offapi\com\sun\star\rendering nmake - all oa_rendering oa_geometry NU oa offapi\com\sun\star\rdf nmake - all oa_rdf oa_datatransfer oa_text NULL oa offapi\com\sun\star\office nmake - all oa_office oa_text NULL oa offapi\drafts\com\sun\star\form nmake - all oa_drafts_form NULL -oa offapi\util nmake - all oa_util oa_auth oa_awt oa_awttree oa_awtgrid oa_chart oa_chart2 oa_chart2_data oa_config oa_configbootstrap oa_configbackend oa_configbackend_xml oa_datatrans_clip oa_datatrans_dnd oa_datatransfer oa_docu oa_draw oa_draw_framework oa_embed oa_fcomp oa_finsp oa_fcontr oa_fieldmaster oa_form oa_xforms oa_formula oa_frame oa_i18n oa_inst oa_ldap oa_ling2 oa_logging oa_mail oa_media oa_mozilla oa_packages oa_manifest oa_zippackage oa_plug oa_pres oa_animations oa_putil oa_resrc oa_sax oa_xml_input oa_scan oa_sdb oa_sdbtools oa_sdbapp oa_sdbc oa_sdbcx oa_setup oa_sheet oa_style oa_svg oa_sync oa_sync2 oa_system oa_table oa_task oa_text oa_textfield oa_docinfo oa_ucb oa_view oa_xml oa_xml_dom oa_xml_xpath oa_xml_views oa_xml_events oa_image oa_xsd oa_inspection oa_ui oa_ui_dialogs oa_accessibility oa_form_binding oa_form_validation oa_form_submission oa_fruntime oa_geometry oa_rendering oa_sfprovider oa_sfbrowse oa_drafts_form oa_deployment oa_deploymenttest oa_deployment_ui oa_frame_status oa_gallery oa_graphic oa_security oa_crypto_sax oa_crypto oa_csax oa_wrapper oa_script oa_smarttags oa_report oa_reportins oa_reportmeta oa_rdf oa_oooimprovement oa_office oa_prestextfield oa_starme NULL +oa offapi\util nmake - all oa_util oa_auth oa_awt oa_awttree oa_awtgrid oa_chart oa_chart2 oa_chart2_data oa_config oa_configbootstrap oa_configbackend oa_configbackend_xml oa_datatrans_clip oa_datatrans_dnd oa_datatransfer oa_docu oa_draw oa_draw_framework oa_embed oa_fcomp oa_finsp oa_fcontr oa_fieldmaster oa_form oa_xforms oa_formula oa_frame oa_i18n oa_inst oa_ldap oa_ling2 oa_logging oa_mail oa_media oa_mozilla oa_packages oa_manifest oa_zippackage oa_plug oa_pres oa_animations oa_putil oa_resrc oa_sax oa_xml_input oa_scan oa_sdb oa_sdbtools oa_sdbapp oa_sdbc oa_sdbcx oa_setup oa_sheet oa_style oa_svg oa_sync oa_sync2 oa_system oa_table oa_task oa_text oa_textfield oa_docinfo oa_ucb oa_view oa_xml oa_xml_dom oa_xml_xpath oa_xml_views oa_xml_events oa_image oa_xsd oa_inspection oa_ui oa_ui_dialogs oa_accessibility oa_form_binding oa_form_validation oa_form_submission oa_fruntime oa_geometry oa_rendering oa_sfprovider oa_sfbrowse oa_drafts_form oa_deployment oa_deploymenttest oa_deployment_ui oa_frame_status oa_gallery oa_graphic oa_security oa_crypto_sax oa_crypto oa_csax oa_wrapper oa_script oa_script_vba oa_smarttags oa_report oa_reportins oa_reportmeta oa_rdf oa_oooimprovement oa_office oa_prestextfield oa_starme NULL diff --git a/offapi/prj/d.lst b/offapi/prj/d.lst index 9532cd773c6f..764521f3e944 100644 --- a/offapi/prj/d.lst +++ b/offapi/prj/d.lst @@ -69,6 +69,7 @@ mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\scanner mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\script mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\script\browse mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\script\provider +mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\script\vba mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\sdb mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\sdb\application mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\sdb\tools @@ -185,6 +186,7 @@ mkdir: %COMMON_DEST%\idl%_EXT%\drafts\com\sun\star\form ..\com\sun\star\script\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\script ..\com\sun\star\script\browse\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\script\browse ..\com\sun\star\script\provider\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\script\provider +..\com\sun\star\script\vba\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\script\vba ..\com\sun\star\sdb\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\sdb ..\com\sun\star\sdb\application\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\sdb\application ..\com\sun\star\sdb\tools\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\sdb\tools diff --git a/offapi/util/makefile.mk b/offapi/util/makefile.mk index 0ed4feba57b6..016180d7765c 100644 --- a/offapi/util/makefile.mk +++ b/offapi/util/makefile.mk @@ -95,6 +95,7 @@ UNOIDLDBFILES= \ $(UCR)$/cssdomevents.db \ $(UCR)$/cssscanner.db \ $(UCR)$/cssscript.db \ + $(UCR)$/cssscriptvba.db \ $(UCR)$/csssdb.db \ $(UCR)$/csssdbc.db \ $(UCR)$/csssdbcx.db \ diff --git a/offuh/prj/d.lst b/offuh/prj/d.lst index ba7343039eae..a88257dc695d 100644 --- a/offuh/prj/d.lst +++ b/offuh/prj/d.lst @@ -72,6 +72,7 @@ mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\sdbc mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\sdbcx mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\scanner mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\script +mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\script\vba mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\sheet mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\smarttags mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\style @@ -271,6 +272,8 @@ mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\rdf ..\%__SRC%\inc\offuh\com\sun\star\scanner\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\scanner\*.hpp ..\%__SRC%\inc\offuh\com\sun\star\script\*.hdl %_DEST%\inc%_EXT%\offuh\com\sun\star\script\*.hdl ..\%__SRC%\inc\offuh\com\sun\star\script\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\script\*.hpp +..\%__SRC%\inc\offuh\com\sun\star\script\vba\*.hdl %_DEST%\inc%_EXT%\offuh\com\sun\star\script\vba\*.hdl +..\%__SRC%\inc\offuh\com\sun\star\script\vba\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\script\vba\*.hpp ..\%__SRC%\inc\offuh\com\sun\star\sheet\*.hdl %_DEST%\inc%_EXT%\offuh\com\sun\star\sheet\*.hdl ..\%__SRC%\inc\offuh\com\sun\star\sheet\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\sheet\*.hpp ..\%__SRC%\inc\offuh\com\sun\star\smarttags\*.hdl %_DEST%\inc%_EXT%\offuh\com\sun\star\smarttags\*.hdl -- cgit From f95947fde18de02e64a4983f4decc143d7e1c96e Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 26 Aug 2010 18:37:44 +0200 Subject: dr77: #i114128# import legacy drawing controls --- vbahelper/source/vbahelper/vbaapplicationbase.cxx | 6 +++--- vbahelper/source/vbahelper/vbacommandbarcontrol.cxx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx index 6d2c51066ca2..fd31e0864695 100644 --- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx +++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx @@ -332,8 +332,8 @@ void SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, const u } - VBAMacroResolvedInfo aMacroInfo = resolveVBAMacro( getSfxObjShell( aMacroDocumentModel ), sMacro_only_Name ); - if( aMacroInfo.IsResolved() ) + MacroResolvedInfo aMacroInfo = resolveVBAMacro( getSfxObjShell( aMacroDocumentModel ), sMacro_only_Name ); + if( aMacroInfo.mbFound ) { // handle the arguments const uno::Any* aArgsPtrArray[] = { &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11, &varg12, &varg13, &varg14, &varg15, &varg16, &varg17, &varg18, &varg19, &varg20, &varg21, &varg22, &varg23, &varg24, &varg25, &varg26, &varg27, &varg28, &varg29, &varg30 }; @@ -359,7 +359,7 @@ void SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, const u uno::Any aRet; uno::Any aDummyCaller; - executeMacro( aMacroInfo.MacroDocContext(), aMacroInfo.ResolvedMacro(), aArgs, aRet, aDummyCaller ); + executeMacro( aMacroInfo.mpDocContext, aMacroInfo.msResolvedMacro, aArgs, aRet, aDummyCaller ); } else { diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx index 3f9c7ddeae89..551d18ab59b2 100644 --- a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx @@ -78,10 +78,10 @@ ScVbaCommandBarControl::setOnAction( const ::rtl::OUString& _onaction ) throw (u { // get the current model uno::Reference< frame::XModel > xModel( pCBarHelper->getModel() ); - VBAMacroResolvedInfo aResolvedMacro = ooo::vba::resolveVBAMacro( getSfxObjShell( xModel ), _onaction, true ); - if ( aResolvedMacro.IsResolved() ) + MacroResolvedInfo aResolvedMacro = ooo::vba::resolveVBAMacro( getSfxObjShell( xModel ), _onaction, true ); + if ( aResolvedMacro.mbFound ) { - rtl::OUString aCommandURL = ooo::vba::makeMacroURL( aResolvedMacro.ResolvedMacro() ); + rtl::OUString aCommandURL = ooo::vba::makeMacroURL( aResolvedMacro.msResolvedMacro ); OSL_TRACE(" ScVbaCommandBarControl::setOnAction: %s", rtl::OUStringToOString( aCommandURL, RTL_TEXTENCODING_UTF8 ).getStr() ); setPropertyValue( m_aPropertyValues, rtl::OUString::createFromAscii("CommandURL"), uno::makeAny( aCommandURL ) ); ApplyChange(); -- cgit From 9c7444d184aff4aafb20d1e0e4f734c9ed978e5b Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 26 Aug 2010 18:37:44 +0200 Subject: dr77: #i114128# import legacy drawing controls --- scp2/source/ooo/file_library_ooo.scp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp index d930b2dc9fa2..fcaf89d67cb1 100644 --- a/scp2/source/ooo/file_library_ooo.scp +++ b/scp2/source/ooo/file_library_ooo.scp @@ -1388,7 +1388,7 @@ STD_UNO_LIB_FILE( gid_File_Lib_Svx, svx) STD_UNO_LIB_FILE( gid_File_Lib_TextConversionDlgs, textconversiondlgs) STD_LIB_FILE( gid_File_Lib_Editeng, editeng) -STD_LIB_FILE( gid_File_Lib_Msfilter, msfilter) +STD_UNO_LIB_FILE( gid_File_Lib_Msfilter, msfilter) STD_UNO_LIB_FILE( gid_File_Lib_Sw , sw) STD_LIB_FILE( gid_File_Lib_Swui, swui) -- cgit From c29c922edb2ae9454e86e9f99d55ba005132194e Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Mon, 30 Aug 2010 16:10:01 +0200 Subject: dr77: change all exported services in oox module from MultiServiceFactory to ComponentContext --- .../filters/calc_MS_Excel_2007_Binary.xcu | 2 +- .../fragments/filters/calc_MS_Excel_2007_XML.xcu | 2 +- .../filters/calc_MS_Excel_2007_XML_Template.xcu | 2 +- .../filters/impress_MS_PowerPoint_2007_XML.xcu | 2 +- .../impress_MS_PowerPoint_2007_XML_Template.xcu | 2 +- .../config/fragments/types/calc_MS_Excel_40.xcu | 2 +- .../types/calc_MS_Excel_40_VorlageTemplate.xcu | 2 +- .../config/fragments/types/calc_MS_Excel_5095.xcu | 2 +- .../types/calc_MS_Excel_5095_VorlageTemplate.xcu | 2 +- .../config/fragments/types/calc_MS_Excel_95.xcu | 2 +- .../types/calc_MS_Excel_95_VorlageTemplate.xcu | 2 +- .../config/fragments/types/calc_MS_Excel_97.xcu | 2 +- .../types/calc_MS_Excel_97_VorlageTemplate.xcu | 2 +- filter/source/msfilter/msvbahelper.cxx | 4 +- filter/source/msfilter/services.cxx | 148 +++-------------- oox/inc/oox/core/binaryfilterbase.hxx | 3 +- oox/inc/oox/core/filterbase.hxx | 19 ++- oox/inc/oox/core/filterdetect.hxx | 10 +- oox/inc/oox/core/xmlfilterbase.hxx | 3 +- oox/inc/oox/helper/graphichelper.hxx | 3 +- oox/inc/oox/ole/vbacontrol.hxx | 5 +- oox/inc/oox/ole/vbaproject.hxx | 10 +- oox/inc/oox/ppt/pptimport.hxx | 3 +- oox/inc/oox/xls/biffdetector.hxx | 11 +- oox/inc/oox/xls/excelfilter.hxx | 6 +- oox/inc/oox/xls/excelvbaproject.hxx | 2 +- oox/source/core/binaryfilterbase.cxx | 8 +- oox/source/core/facreg.cxx | 182 ++++++--------------- oox/source/core/filterbase.cxx | 108 ++++++------ oox/source/core/filterdetect.cxx | 29 ++-- oox/source/core/xmlfilterbase.cxx | 13 +- oox/source/drawingml/chart/converterbase.cxx | 2 +- oox/source/dump/dumperbase.cxx | 2 +- oox/source/helper/graphichelper.cxx | 17 +- oox/source/ole/axcontrolfragment.cxx | 2 +- oox/source/ole/vbacontrol.cxx | 15 +- oox/source/ole/vbaproject.cxx | 31 ++-- oox/source/ppt/pptimport.cxx | 21 +-- oox/source/ppt/timenode.cxx | 2 +- oox/source/shape/FastTokenHandlerService.cxx | 102 ++++++------ oox/source/shape/FastTokenHandlerService.hxx | 46 +++--- oox/source/shape/ShapeContextHandler.cxx | 64 +++----- oox/source/shape/ShapeContextHandler.hxx | 22 +-- oox/source/shape/ShapeFilterBase.cxx | 10 +- oox/source/shape/ShapeFilterBase.hxx | 3 +- oox/source/token/properties.txt | 1 - oox/source/xls/biffdetector.cxx | 86 +++++----- oox/source/xls/excelfilter.cxx | 34 ++-- oox/source/xls/excelvbaproject.cxx | 4 +- oox/source/xls/stylesbuffer.cxx | 44 +++-- oox/source/xls/workbookhelper.cxx | 2 +- writerfilter/source/filter/ImportFilter.cxx | 3 +- 52 files changed, 460 insertions(+), 646 deletions(-) diff --git a/filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu b/filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu index 650c0cf980fb..2402d74084e3 100644 --- a/filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu +++ b/filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu @@ -1,7 +1,7 @@ IMPORT ALIEN 3RDPARTYFILTER PREFERRED - com.sun.star.comp.oox.ExcelFilter + com.sun.star.comp.oox.xls.ExcelFilter MS Excel 2007 Binary diff --git a/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu b/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu index 508927802621..73c9e1be54df 100644 --- a/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu +++ b/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu @@ -1,7 +1,7 @@ IMPORT ALIEN 3RDPARTYFILTER PREFERRED - com.sun.star.comp.oox.ExcelFilter + com.sun.star.comp.oox.xls.ExcelFilter MS Excel 2007 XML diff --git a/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu b/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu index 46f1eca86085..d5a14a27d0e2 100644 --- a/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu +++ b/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu @@ -1,7 +1,7 @@ IMPORT ALIEN 3RDPARTYFILTER TEMPLATE TEMPLATEPATH - com.sun.star.comp.oox.ExcelFilter + com.sun.star.comp.oox.xls.ExcelFilter MS Excel 2007 XML Template diff --git a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu index 7fdcbd702a54..254ba468b6eb 100644 --- a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu +++ b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu @@ -1,7 +1,7 @@ IMPORT ALIEN 3RDPARTYFILTER PREFERRED - com.sun.star.comp.Impress.oox.PowerPointImport + com.sun.star.comp.oox.ppt.PowerPointImport MS PowerPoint 2007 XML diff --git a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu index 4fad96fc0521..01fd72086d6b 100644 --- a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu +++ b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu @@ -1,7 +1,7 @@ IMPORT ALIEN 3RDPARTYFILTER TEMPLATE TEMPLATEPATH PREFERRED - com.sun.star.comp.Impress.oox.PowerPointImport + com.sun.star.comp.oox.ppt.PowerPointImport MS PowerPoint 2007 XML Template diff --git a/filter/source/config/fragments/types/calc_MS_Excel_40.xcu b/filter/source/config/fragments/types/calc_MS_Excel_40.xcu index b45c21fa33bd..939a0a4025ad 100644 --- a/filter/source/config/fragments/types/calc_MS_Excel_40.xcu +++ b/filter/source/config/fragments/types/calc_MS_Excel_40.xcu @@ -1,5 +1,5 @@ - com.sun.star.comp.calc.FormatDetector + com.sun.star.comp.oox.xls.BiffDetector xls xlw xlc xlm application/vnd.ms-excel diff --git a/filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu b/filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu index 42bb10ed09c8..291382df43b6 100644 --- a/filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu +++ b/filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu @@ -1,5 +1,5 @@ - com.sun.star.comp.calc.FormatDetector + com.sun.star.comp.oox.xls.BiffDetector xlt application/vnd.ms-excel diff --git a/filter/source/config/fragments/types/calc_MS_Excel_5095.xcu b/filter/source/config/fragments/types/calc_MS_Excel_5095.xcu index 3f450f0cb85f..5656b73f57dd 100644 --- a/filter/source/config/fragments/types/calc_MS_Excel_5095.xcu +++ b/filter/source/config/fragments/types/calc_MS_Excel_5095.xcu @@ -1,5 +1,5 @@ - com.sun.star.comp.calc.FormatDetector + com.sun.star.comp.oox.xls.BiffDetector xls xlc xlm xlw application/vnd.ms-excel diff --git a/filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu b/filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu index 8dbb02c0170e..9c1799dfe405 100644 --- a/filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu +++ b/filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu @@ -1,5 +1,5 @@ - com.sun.star.comp.calc.FormatDetector + com.sun.star.comp.oox.xls.BiffDetector xlt application/vnd.ms-excel diff --git a/filter/source/config/fragments/types/calc_MS_Excel_95.xcu b/filter/source/config/fragments/types/calc_MS_Excel_95.xcu index 0ea10dddc31e..8e02ea8f088d 100644 --- a/filter/source/config/fragments/types/calc_MS_Excel_95.xcu +++ b/filter/source/config/fragments/types/calc_MS_Excel_95.xcu @@ -1,5 +1,5 @@ - com.sun.star.comp.calc.FormatDetector + com.sun.star.comp.oox.xls.BiffDetector xls xlc xlm xlw application/vnd.ms-excel diff --git a/filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu b/filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu index fb3e41014f85..bc80367624f3 100644 --- a/filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu +++ b/filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu @@ -1,5 +1,5 @@ - com.sun.star.comp.calc.FormatDetector + com.sun.star.comp.oox.xls.BiffDetector xlt application/vnd.ms-excel diff --git a/filter/source/config/fragments/types/calc_MS_Excel_97.xcu b/filter/source/config/fragments/types/calc_MS_Excel_97.xcu index 9f1949d9f413..ab71bc304247 100644 --- a/filter/source/config/fragments/types/calc_MS_Excel_97.xcu +++ b/filter/source/config/fragments/types/calc_MS_Excel_97.xcu @@ -1,5 +1,5 @@ - com.sun.star.comp.calc.FormatDetector + com.sun.star.comp.oox.xls.BiffDetector xls xlc xlm xlw application/vnd.ms-excel diff --git a/filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu b/filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu index 26f4bca3a725..ff390ce3d376 100644 --- a/filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu +++ b/filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu @@ -1,5 +1,5 @@ - com.sun.star.comp.calc.FormatDetector + com.sun.star.comp.oox.xls.BiffDetector xlt application/vnd.ms-excel diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx index 11cb07618821..07170e424aba 100644 --- a/filter/source/msfilter/msvbahelper.cxx +++ b/filter/source/msfilter/msvbahelper.cxx @@ -405,10 +405,10 @@ uno::Sequence< ::rtl::OUString > VBAMacroResolver_getSupportedServiceNames() ::rtl::OUString VBAMacroResolver_getImplementationName() { - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAMacroResolver" ) ); + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.vba.VBAMacroResolver" ) ); } -uno::Reference< uno::XInterface > SAL_CALL VBAMacroResolver_createInstance( const uno::Reference< lang::XMultiServiceFactory >& ) throw (uno::Exception) +uno::Reference< uno::XInterface > SAL_CALL VBAMacroResolver_createInstance( const uno::Reference< uno::XComponentContext >& ) throw (uno::Exception) { return static_cast< ::cppu::OWeakObject* >( new VBAMacroResolver ); } diff --git a/filter/source/msfilter/services.cxx b/filter/source/msfilter/services.cxx index e34862ca0d13..cfe0bbdaaf12 100755 --- a/filter/source/msfilter/services.cxx +++ b/filter/source/msfilter/services.cxx @@ -25,152 +25,56 @@ * ************************************************************************/ -#include -#include +#include using ::rtl::OUString; -using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; -// ============================================================================ - -/* Steps to add an implementation 'MyClass' as a service: - - Step 1: Implement the static functions MyClass_getSupportedServiceNames(), - MyClass_getImplementationName(), and MyClass_createInstance() in the cxx - file of MyClass (see other examples in this module). +// Declare static functions providing service information ===================== - Step 2: Add the line 'DECL_STATIC_FUNCS_???( MyClass )' below in this file. - If the service will be instanciated without component context, use - DECL_STATIC_FUNCS_FACTORY. If the service will be instanciated with - component context, use DECL_STATIC_FUNCS_COMPCONTEXT. +#define DECLARE_FUNCTIONS( className ) \ +extern OUString SAL_CALL className##_getImplementationName() throw(); \ +extern Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \ +extern Reference< XInterface > SAL_CALL className##_createInstance( \ + const Reference< XComponentContext >& rxContext ) throw (Exception) - Step 3: Add 'WRITE_SERVICE_INFO( MyClass )' in function - component_writeInfo() below in this file. +namespace ooo { namespace vba { DECLARE_FUNCTIONS( VBAMacroResolver ); } } - Step 4: Add 'IMPLEMENT_SINGLEFACTORY( MyClass )' (instanciation without - component context) or 'IMPLEMENT_SINGLECOMPFACTORY( MyClass )' - (instanciation with component context) in function component_getFactory() - below in this file. - */ +#undef DECLARE_FUNCTIONS // ============================================================================ -// Declare static functions providing service information --------------------- +namespace { -#define DECL_STATIC_FUNCS_FACTORY( className ) \ -extern OUString SAL_CALL className##_getImplementationName() throw(); \ -extern uno::Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \ -extern uno::Reference< uno::XInterface > SAL_CALL className##_createInstance( \ - const uno::Reference< lang::XMultiServiceFactory >& rxFactory ) throw (uno::Exception) +#define IMPLEMENTATION_ENTRY( className ) \ + { &className##_createInstance, &className##_getImplementationName, &className##_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 } -#define DECL_STATIC_FUNCS_COMPCONTEXT( className ) \ -extern OUString SAL_CALL className##_getImplementationName() throw(); \ -extern uno::Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \ -extern uno::Reference< uno::XInterface > SAL_CALL className##_createInstance( \ - const uno::Reference< uno::XComponentContext >& rxContext ) throw (uno::Exception) +static ::cppu::ImplementationEntry const spServices[] = +{ + IMPLEMENTATION_ENTRY( ::ooo::vba::VBAMacroResolver ), + { 0, 0, 0, 0, 0, 0 } +}; -// step 2: add new classes in this list -namespace ooo { namespace vba { DECL_STATIC_FUNCS_FACTORY( VBAMacroResolver ); } } +#undef IMPLEMENTATION_ENTRY -#undef DECL_STATIC_FUNCS_FACTORY -#undef DECL_STATIC_FUNCS_COMPCONTEXT +} // namespace // ---------------------------------------------------------------------------- -extern "C" { - -// ---------------------------------------------------------------------------- - -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char **ppEnvironmentTypeName, uno_Environment ** /*ppEnvironment*/ ) +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( + const sal_Char** ppEnvironmentTypeName, uno_Environment** /*ppEnvironment*/ ) { *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -// Write service information to registry -------------------------------------- - -void SAL_CALL writeInfo( registry::XRegistryKey* pRegistryKey, const OUString& rImplementationName, const uno::Sequence< OUString >& rServices ) -{ - uno::Reference< registry::XRegistryKey > xNewKey( pRegistryKey->createKey( - OUString( sal_Unicode( '/' ) ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" ) ) ) ); - for( sal_Int32 i = 0; i < rServices.getLength(); ++i ) - xNewKey->createKey( rServices[i] ); -} - -#define WRITE_SERVICE_INFO( className ) \ - writeInfo( pKey, className##_getImplementationName(), className##_getSupportedServiceNames() ) - -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey ) { - if( pRegistryKey ) try - { - registry::XRegistryKey* pKey = reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ); - - // step 3: add new classes in this list - WRITE_SERVICE_INFO( ::ooo::vba::VBAMacroResolver ); - } - catch( registry::InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "so_vba - component_writeInfo - InvalidRegistryException" ); - } - return sal_True; -} - -#undef WRITE_SERVICE_INFO - -// Create a factory for the service instances --------------------------------- - -#define IMPLEMENT_SINGLEFACTORY( className ) \ -if( !bFound && className##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) ) \ -{ \ - xFactory = ::cppu::createSingleFactory( xMSF, className##_getImplementationName(), \ - className##_createInstance, className##_getSupportedServiceNames() ); \ - bFound = true; \ + return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices ); } -#define IMPLEMENT_SINGLECOMPFACTORY( className ) \ -if( !bFound && className##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) ) \ -{ \ - xCompFactory = ::cppu::createSingleComponentFactory( className##_createInstance, \ - className##_getImplementationName(), className##_getSupportedServiceNames() ); \ - bFound = true; \ -} - -SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /*pRegistryKey*/ ) +extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey ) { - void* pReturn = 0; - if( pImplName && pServiceManager ) - { - uno::Reference< lang::XMultiServiceFactory > xMSF( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ) ); - - // define variables which are used in the macros - uno::Reference< lang::XSingleServiceFactory > xFactory; - uno::Reference< lang::XSingleComponentFactory > xCompFactory; - const sal_Int32 nImplNameLen = strlen( pImplName ); - bool bFound = false; - - // Step 4: add new class in this list - IMPLEMENT_SINGLEFACTORY( ::ooo::vba::VBAMacroResolver ) - - // factory is valid -> service was found - if( xFactory.is()) - { - xFactory->acquire(); - pReturn = xFactory.get(); - } - else if( xCompFactory.is() ) - { - xCompFactory->acquire(); - pReturn = xCompFactory.get(); - } - } - return pReturn; + return ::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, spServices ); } -#undef IMPLEMENT_SINGLEFACTORY -#undef IMPLEMENT_SINGLECOMPFACTORY - -// ---------------------------------------------------------------------------- - -} // extern "C" - // ============================================================================ diff --git a/oox/inc/oox/core/binaryfilterbase.hxx b/oox/inc/oox/core/binaryfilterbase.hxx index f1cc7b399bce..4cd9cd1db62f 100644 --- a/oox/inc/oox/core/binaryfilterbase.hxx +++ b/oox/inc/oox/core/binaryfilterbase.hxx @@ -40,7 +40,8 @@ class BinaryFilterBase : public FilterBase { public: explicit BinaryFilterBase( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory ); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); virtual ~BinaryFilterBase(); diff --git a/oox/inc/oox/core/filterbase.hxx b/oox/inc/oox/core/filterbase.hxx index 0371768d02a7..c3b82af62f5d 100644 --- a/oox/inc/oox/core/filterbase.hxx +++ b/oox/inc/oox/core/filterbase.hxx @@ -51,9 +51,11 @@ namespace com { namespace sun { namespace star { namespace io { class XInputStream; } namespace io { class XOutputStream; } namespace io { class XStream; } + namespace lang { class XMultiComponentFactory; } namespace lang { class XMultiServiceFactory; } namespace task { class XInteractionHandler; } namespace task { class XStatusIndicator; } + namespace uno { class XComponentContext; } } } } namespace comphelper { @@ -90,7 +92,8 @@ class OOX_DLLPUBLIC FilterBase : public FilterBaseBase, public ::cppu::BaseMutex { public: explicit FilterBase( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory ); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); virtual ~FilterBase(); @@ -110,9 +113,17 @@ public: /** Returns the specified argument passed through the XInitialization interface. */ ::com::sun::star::uno::Any getArgument( const ::rtl::OUString& rArgName ) const; - /** Returns the global service factory passed in the filter constructor (always existing). */ + /** Returns the component context passed in the filter constructor (always existing). */ + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& + getComponentContext() const; + + /** Returns the component service factory (always existing). */ + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory >& + getComponentFactory() const; + + /** Returns the multi service factory of the component (always existing). */ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& - getGlobalFactory() const; + getServiceFactory() const; /** Returns the document model (always existing). */ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& @@ -122,7 +133,7 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& getModelFactory() const; - /** Returns the frame that will contain the document model. */ + /** Returns the frame that will contain the document model (may be null). */ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& getTargetFrame() const; diff --git a/oox/inc/oox/core/filterdetect.hxx b/oox/inc/oox/core/filterdetect.hxx index 70c35ff26076..7eb283f5056b 100644 --- a/oox/inc/oox/core/filterdetect.hxx +++ b/oox/inc/oox/core/filterdetect.hxx @@ -38,6 +38,7 @@ namespace com { namespace sun { namespace star { namespace io { class XInputStream; } + namespace uno { class XComponentContext; } } } } namespace comphelper { class MediaDescriptor; } @@ -96,7 +97,8 @@ private: class OOX_DLLPUBLIC FilterDetect : public ::cppu::WeakImplHelper2< ::com::sun::star::document::XExtendedFilterDetection, ::com::sun::star::lang::XServiceInfo > { public: - explicit FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory ); + explicit FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); virtual ~FilterDetect(); /** Tries to extract an unencrypted ZIP package from the passed media @@ -149,12 +151,12 @@ public: interface of the temporary file will be stored in the 'ComponentData' property of the passed media descriptor. */ - virtual ::rtl::OUString SAL_CALL detect( - ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rMediaDescSeq ) + virtual ::rtl::OUString SAL_CALL + detect( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rMediaDescSeq ) throw( ::com::sun::star::uno::RuntimeException ); private: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxFactory; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext; }; // ============================================================================ diff --git a/oox/inc/oox/core/xmlfilterbase.hxx b/oox/inc/oox/core/xmlfilterbase.hxx index 796cd82781c0..11d2d488c8b6 100644 --- a/oox/inc/oox/core/xmlfilterbase.hxx +++ b/oox/inc/oox/core/xmlfilterbase.hxx @@ -80,7 +80,8 @@ class OOX_DLLPUBLIC XmlFilterBase : public FilterBase { public: explicit XmlFilterBase( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory ); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); virtual ~XmlFilterBase(); diff --git a/oox/inc/oox/helper/graphichelper.hxx b/oox/inc/oox/helper/graphichelper.hxx index 5b9c5d945678..bfe19b5472ae 100644 --- a/oox/inc/oox/helper/graphichelper.hxx +++ b/oox/inc/oox/helper/graphichelper.hxx @@ -45,7 +45,6 @@ namespace com { namespace sun { namespace star { namespace graphic { class XGraphic; } namespace graphic { class XGraphicObject; } namespace graphic { class XGraphicProvider; } - namespace lang { class XMultiServiceFactory; } namespace uno { class XComponentContext; } } } } @@ -68,7 +67,7 @@ class GraphicHelper { public: explicit GraphicHelper( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxTargetFrame, const StorageRef& rxStorage ); virtual ~GraphicHelper(); diff --git a/oox/inc/oox/ole/vbacontrol.hxx b/oox/inc/oox/ole/vbacontrol.hxx index 8d0b5e825eb9..8c4274ffda7e 100755 --- a/oox/inc/oox/ole/vbacontrol.hxx +++ b/oox/inc/oox/ole/vbacontrol.hxx @@ -32,6 +32,7 @@ namespace com { namespace sun { namespace star { namespace container { class XNameContainer; } + namespace uno { class XComponentContext; } } } } namespace oox { class StorageBase; } @@ -191,7 +192,7 @@ class VbaUserForm : public VbaFormControl { public: explicit VbaUserForm( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr = true ); @@ -205,7 +206,7 @@ public: rtl_TextEncoding eTextEnc ); private: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxGlobalFactory; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxCompContext; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxDocModel; ControlConverter maConverter; }; diff --git a/oox/inc/oox/ole/vbaproject.hxx b/oox/inc/oox/ole/vbaproject.hxx index 6834fa08f252..13891ddd5a24 100755 --- a/oox/inc/oox/ole/vbaproject.hxx +++ b/oox/inc/oox/ole/vbaproject.hxx @@ -37,9 +37,9 @@ namespace com { namespace sun { namespace star { namespace container { class XNameContainer; } namespace document { class XEventsSupplier; } namespace frame { class XModel; } - namespace lang { class XMultiServiceFactory; } namespace script { class XLibraryContainer; } namespace script { namespace vba { class XVBAMacroResolver; } } + namespace uno { class XComponentContext; } } } } namespace oox { class GraphicHelper; } @@ -53,7 +53,7 @@ class OOX_DLLPUBLIC VbaFilterConfig { public: explicit VbaFilterConfig( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::rtl::OUString& rConfigCompName ); ~VbaFilterConfig(); @@ -116,7 +116,7 @@ class OOX_DLLPUBLIC VbaProject : public VbaFilterConfig { public: explicit VbaProject( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel, const ::rtl::OUString& rConfigCompName ); virtual ~VbaProject(); @@ -338,8 +338,8 @@ private: typedef RefVector< VbaMacroAttacherBase > MacroAttacherVector; typedef ::std::map< ::rtl::OUString, sal_Int32 > DummyModuleMap; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > - mxGlobalFactory; /// Global service factory. + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + mxCompContext; /// Component context with service manager. ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxDocModel; /// Document model used to import/export the VBA project. ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > diff --git a/oox/inc/oox/ppt/pptimport.hxx b/oox/inc/oox/ppt/pptimport.hxx index cb87d07329e3..d3a4b1bbd7b3 100644 --- a/oox/inc/oox/ppt/pptimport.hxx +++ b/oox/inc/oox/ppt/pptimport.hxx @@ -46,7 +46,8 @@ class PowerPointImport : public oox::core::XmlFilterBase { public: - PowerPointImport( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr ); + PowerPointImport( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); virtual ~PowerPointImport(); // from FilterBase diff --git a/oox/inc/oox/xls/biffdetector.hxx b/oox/inc/oox/xls/biffdetector.hxx index 9ce5d19af3fe..e50b68e0d938 100644 --- a/oox/inc/oox/xls/biffdetector.hxx +++ b/oox/inc/oox/xls/biffdetector.hxx @@ -35,8 +35,8 @@ #include "oox/xls/biffhelper.hxx" namespace com { namespace sun { namespace star { - namespace lang { class XMultiServiceFactory; } namespace beans { struct PropertyValue; } + namespace uno { class XComponentContext; } } } } namespace oox { class BinaryInputStream; } @@ -53,7 +53,8 @@ class BiffDetector : public ::cppu::WeakImplHelper2< { public: explicit BiffDetector( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory ); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); virtual ~BiffDetector(); @@ -63,7 +64,7 @@ public: /** Detects the BIFF version and workbook stream name of the passed storage. */ static BiffType detectStorageBiffVersion( ::rtl::OUString& orWorkbookStreamName, - StorageRef xStorage ); + const StorageRef& rxStorage ); // com.sun.star.lang.XServiceInfo interface ------------------------------- @@ -84,8 +85,8 @@ public: throw( ::com::sun::star::uno::RuntimeException ); private: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > - mxFactory; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + mxContext; }; // ============================================================================ diff --git a/oox/inc/oox/xls/excelfilter.hxx b/oox/inc/oox/xls/excelfilter.hxx index 0b293cf57193..82550ccd34f0 100644 --- a/oox/inc/oox/xls/excelfilter.hxx +++ b/oox/inc/oox/xls/excelfilter.hxx @@ -59,7 +59,8 @@ class ExcelFilter : public ::oox::core::XmlFilterBase, public ExcelFilterBase { public: explicit ExcelFilter( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory ); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); virtual ~ExcelFilter(); virtual bool importDocument() throw(); @@ -82,7 +83,8 @@ class ExcelBiffFilter : public ::oox::core::BinaryFilterBase, public ExcelFilter { public: explicit ExcelBiffFilter( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory ); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); virtual ~ExcelBiffFilter(); virtual bool importDocument() throw(); diff --git a/oox/inc/oox/xls/excelvbaproject.hxx b/oox/inc/oox/xls/excelvbaproject.hxx index f2a9aebd988a..490c1d6ad3a1 100755 --- a/oox/inc/oox/xls/excelvbaproject.hxx +++ b/oox/inc/oox/xls/excelvbaproject.hxx @@ -45,7 +45,7 @@ class OOX_DLLPUBLIC ExcelVbaProject : public ::oox::ole::VbaProject { public: explicit ExcelVbaProject( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument >& rxDocument ); /** Attaches all document and sheet events to existing VBA macros. */ diff --git a/oox/source/core/binaryfilterbase.cxx b/oox/source/core/binaryfilterbase.cxx index 9eb476920a4b..9bebedb9c96b 100644 --- a/oox/source/core/binaryfilterbase.cxx +++ b/oox/source/core/binaryfilterbase.cxx @@ -42,8 +42,8 @@ using ::rtl::OUString; // ============================================================================ -BinaryFilterBase::BinaryFilterBase( const Reference< XMultiServiceFactory >& rxGlobalFactory ) : - FilterBase( rxGlobalFactory ) +BinaryFilterBase::BinaryFilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + FilterBase( rxContext ) { } @@ -55,12 +55,12 @@ BinaryFilterBase::~BinaryFilterBase() StorageRef BinaryFilterBase::implCreateStorage( const Reference< XInputStream >& rxInStream ) const { - return StorageRef( new ::oox::ole::OleStorage( getGlobalFactory(), rxInStream, true ) ); + return StorageRef( new ::oox::ole::OleStorage( getServiceFactory(), rxInStream, true ) ); } StorageRef BinaryFilterBase::implCreateStorage( const Reference< XStream >& rxOutStream ) const { - return StorageRef( new ::oox::ole::OleStorage( getGlobalFactory(), rxOutStream, true ) ); + return StorageRef( new ::oox::ole::OleStorage( getServiceFactory(), rxOutStream, true ) ); } // ============================================================================ diff --git a/oox/source/core/facreg.cxx b/oox/source/core/facreg.cxx index 6d62f0ec34a8..99bdffa856f2 100644 --- a/oox/source/core/facreg.cxx +++ b/oox/source/core/facreg.cxx @@ -25,152 +25,74 @@ * ************************************************************************/ -#include "oox/dllapi.h" +#include -#include - -#include - -#include -#include +using ::rtl::OUString; +using namespace ::com::sun::star::uno; -#include -#include +// Declare static functions providing service information ===================== -using ::rtl::OUString; -using namespace ::com::sun::star; - -#define SERVICE( className ) \ -extern OUString SAL_CALL className##_getImplementationName() throw(); \ -extern uno::Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw();\ -extern uno::Reference< uno::XInterface > SAL_CALL className##_createInstance( \ - const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) \ - throw( uno::Exception ) - -#define SERVICE2( className ) \ -extern OUString SAL_CALL className##_getImplementationName() throw(); \ -extern uno::Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw();\ -extern uno::Reference< uno::XInterface > SAL_CALL className##_createInstance( \ - const uno::Reference< uno::XComponentContext > & xContext ) \ - throw( uno::Exception ) +#define DECLARE_FUNCTIONS( className ) \ +extern OUString SAL_CALL className##_getImplementationName() throw(); \ +extern Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \ +extern Reference< XInterface > SAL_CALL className##_createInstance( \ + const Reference< XComponentContext >& rxContext ) throw (Exception) namespace oox { - namespace core { SERVICE( FilterDetect ); } - namespace ppt { SERVICE( PowerPointImport ); } - namespace xls { SERVICE( BiffDetector ); } - namespace xls { SERVICE( ExcelFilter ); } - namespace xls { SERVICE( ExcelBiffFilter ); } - namespace shape { SERVICE( ShapeContextHandler ); } - namespace shape { SERVICE( FastTokenHandlerService ); } - namespace docprop { SERVICE2( OOXMLDocPropImportImpl ); } - namespace xls { SERVICE2( OOXMLFormulaParser ); } + namespace core { DECLARE_FUNCTIONS( FilterDetect ); } + namespace docprop { DECLARE_FUNCTIONS( OOXMLDocPropImportImpl ); } + namespace ppt { DECLARE_FUNCTIONS( PowerPointImport ); } + namespace shape { DECLARE_FUNCTIONS( FastTokenHandlerService ); } + namespace shape { DECLARE_FUNCTIONS( ShapeContextHandler ); } + namespace xls { DECLARE_FUNCTIONS( BiffDetector ); } + namespace xls { DECLARE_FUNCTIONS( ExcelFilter ); } + namespace xls { DECLARE_FUNCTIONS( ExcelBiffFilter ); } + namespace xls { DECLARE_FUNCTIONS( OOXMLFormulaParser ); } } -// -#ifdef __cplusplus -extern "C" -{ -#endif - -OOX_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} +#undef DECLARE_FUNCTIONS -void SAL_CALL writeInfo( registry::XRegistryKey * pRegistryKey, const OUString& rImplementationName, const uno::Sequence< OUString >& rServices ) -{ - uno::Reference< registry::XRegistryKey > xNewKey( - pRegistryKey->createKey( - OUString( sal_Unicode( '/' ) ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ) ); +// ============================================================================ - for( sal_Int32 i = 0; i < rServices.getLength(); i++ ) - xNewKey->createKey( rServices.getConstArray()[i]); -} +namespace { -#define WRITEINFO(className)\ - writeInfo( pKey, className##_getImplementationName(), className##_getSupportedServiceNames() ) +#define IMPLEMENTATION_ENTRY( className ) \ + { &className##_createInstance, &className##_getImplementationName, &className##_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 } -OOX_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void * , void * pRegistryKey ) +static ::cppu::ImplementationEntry const spServices[] = +{ + IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ), + IMPLEMENTATION_ENTRY( ::oox::docprop::OOXMLDocPropImportImpl ), + IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ), + IMPLEMENTATION_ENTRY( ::oox::shape::FastTokenHandlerService ), + IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ), + IMPLEMENTATION_ENTRY( ::oox::xls::BiffDetector ), + IMPLEMENTATION_ENTRY( ::oox::xls::ExcelFilter ), + IMPLEMENTATION_ENTRY( ::oox::xls::ExcelBiffFilter ), + IMPLEMENTATION_ENTRY( ::oox::xls::OOXMLFormulaParser ), + { 0, 0, 0, 0, 0, 0 } +}; + +#undef IMPLEMENTATION_ENTRY + +} // namespace + +// ---------------------------------------------------------------------------- + +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( + const sal_Char** ppEnvironmentTypeName, uno_Environment** /*ppEnvironment*/ ) { - if( pRegistryKey ) - { - try - { - registry::XRegistryKey *pKey = reinterpret_cast< registry::XRegistryKey * >( pRegistryKey ); - - WRITEINFO( ::oox::core::FilterDetect ); - WRITEINFO( ::oox::ppt::PowerPointImport ); - WRITEINFO( ::oox::xls::BiffDetector ); - WRITEINFO( ::oox::xls::ExcelFilter ); - WRITEINFO( ::oox::xls::ExcelBiffFilter ); - WRITEINFO( ::oox::shape::ShapeContextHandler ); - WRITEINFO( ::oox::shape::FastTokenHandlerService ); - WRITEINFO( ::oox::docprop::OOXMLDocPropImportImpl ); - WRITEINFO( ::oox::xls::OOXMLFormulaParser ); - } - catch (registry::InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_True; + *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -#define SINGLEFACTORY(classname)\ - if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\ - {\ - xFactory = ::cppu::createSingleFactory( xMSF,\ - classname##_getImplementationName(),\ - classname##_createInstance,\ - classname##_getSupportedServiceNames() );\ - } - -#define SINGLEFACTORY2(classname)\ - if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\ - {\ - xCompFactory = ::cppu::createSingleComponentFactory(\ - classname##_createInstance,\ - classname##_getImplementationName(),\ - classname##_getSupportedServiceNames() );\ - } - -OOX_DLLPUBLIC void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * ) +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey ) { - void * pRet = 0; - if( pServiceManager ) - { - uno::Reference< lang::XMultiServiceFactory > xMSF( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) ); - - uno::Reference< lang::XSingleServiceFactory > xFactory; - uno::Reference< lang::XSingleComponentFactory > xCompFactory; - - const sal_Int32 nImplNameLen = strlen( pImplName ); - - SINGLEFACTORY( ::oox::core::FilterDetect ) - else SINGLEFACTORY( oox::ppt::PowerPointImport ) - else SINGLEFACTORY( ::oox::xls::BiffDetector ) - else SINGLEFACTORY( ::oox::xls::ExcelFilter ) - else SINGLEFACTORY( ::oox::xls::ExcelBiffFilter ) - else SINGLEFACTORY( ::oox::shape::ShapeContextHandler) - else SINGLEFACTORY( ::oox::shape::FastTokenHandlerService) - else SINGLEFACTORY2( ::oox::docprop::OOXMLDocPropImportImpl ) - else SINGLEFACTORY2( ::oox::xls::OOXMLFormulaParser ) - - if( xFactory.is()) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - else if ( xCompFactory.is() ) - { - xCompFactory->acquire(); - pRet = xCompFactory.get(); - } - } - return pRet; + return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices ); } -#ifdef __cplusplus +extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey ) +{ + return ::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, spServices ); } -#endif +// ============================================================================ diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index 8caca4e6295a..e7d4c5499118 100755 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -139,7 +139,9 @@ struct FilterBaseImpl OleObjHelperRef mxOleObjHelper; /// OLE object handling. VbaProjectRef mxVbaProject; /// VBA project manager. - Reference< XMultiServiceFactory > mxGlobalFactory; + Reference< XComponentContext > mxComponentContext; + Reference< XMultiComponentFactory > mxComponentFactory; + Reference< XMultiServiceFactory > mxServiceFactory; Reference< XModel > mxModel; Reference< XMultiServiceFactory > mxModelFactory; Reference< XFrame > mxTargetFrame; @@ -148,10 +150,9 @@ struct FilterBaseImpl Reference< XStatusIndicator > mxStatusIndicator; Reference< XInteractionHandler > mxInteractionHandler; - explicit FilterBaseImpl( const Reference< XMultiServiceFactory >& rxGlobalFactory ); + explicit FilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ); - void setDocumentModel( const Reference< XComponent >& rxComponent ); - bool hasDocumentModel() const; + void setDocumentModel( const Reference< XComponent >& rxComponent ) throw( IllegalArgumentException ); void initializeFilter(); void finalizeFilter(); @@ -159,22 +160,25 @@ struct FilterBaseImpl // ---------------------------------------------------------------------------- -FilterBaseImpl::FilterBaseImpl( const Reference< XMultiServiceFactory >& rxGlobalFactory ) : +FilterBaseImpl::FilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : meDirection( FILTERDIRECTION_UNKNOWN ), - mxGlobalFactory( rxGlobalFactory ) + mxComponentContext( rxContext, UNO_SET_THROW ), + mxComponentFactory( rxContext->getServiceManager(), UNO_SET_THROW ), + mxServiceFactory( rxContext->getServiceManager(), UNO_QUERY_THROW ) { - OSL_ENSURE( mxGlobalFactory.is(), "FilterBaseImpl::FilterBaseImpl - missing service factory" ); } -void FilterBaseImpl::setDocumentModel( const Reference< XComponent >& rxComponent ) +void FilterBaseImpl::setDocumentModel( const Reference< XComponent >& rxComponent ) throw( IllegalArgumentException ) { - mxModel.set( rxComponent, UNO_QUERY ); - mxModelFactory.set( rxComponent, UNO_QUERY ); -} - -bool FilterBaseImpl::hasDocumentModel() const -{ - return mxGlobalFactory.is() && mxModel.is() && mxModelFactory.is(); + try + { + mxModel.set( rxComponent, UNO_QUERY_THROW ); + mxModelFactory.set( rxComponent, UNO_QUERY_THROW ); + } + catch( Exception& ) + { + throw IllegalArgumentException(); + } } void FilterBaseImpl::initializeFilter() @@ -205,8 +209,8 @@ void FilterBaseImpl::finalizeFilter() // ============================================================================ -FilterBase::FilterBase( const Reference< XMultiServiceFactory >& rxGlobalFactory ) : - mxImpl( new FilterBaseImpl( rxGlobalFactory ) ) +FilterBase::FilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + mxImpl( new FilterBaseImpl( rxContext ) ) { } @@ -232,9 +236,19 @@ Any FilterBase::getArgument( const OUString& rArgName ) const return (aIt == mxImpl->maArguments.end()) ? Any() : aIt->second; } -const Reference< XMultiServiceFactory >& FilterBase::getGlobalFactory() const +const Reference< XComponentContext >& FilterBase::getComponentContext() const { - return mxImpl->mxGlobalFactory; + return mxImpl->mxComponentContext; +} + +const Reference< XMultiComponentFactory >& FilterBase::getComponentFactory() const +{ + return mxImpl->mxComponentFactory; +} + +const Reference< XMultiServiceFactory >& FilterBase::getServiceFactory() const +{ + return mxImpl->mxServiceFactory; } const Reference< XModel >& FilterBase::getModel() const @@ -459,8 +473,6 @@ void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs ) throw( Exce void SAL_CALL FilterBase::setTargetDocument( const Reference< XComponent >& rxDocument ) throw( IllegalArgumentException, RuntimeException ) { mxImpl->setDocumentModel( rxDocument ); - if( !mxImpl->hasDocumentModel() ) - throw IllegalArgumentException(); mxImpl->meDirection = FILTERDIRECTION_IMPORT; } @@ -469,8 +481,6 @@ void SAL_CALL FilterBase::setTargetDocument( const Reference< XComponent >& rxDo void SAL_CALL FilterBase::setSourceDocument( const Reference< XComponent >& rxDocument ) throw( IllegalArgumentException, RuntimeException ) { mxImpl->setDocumentModel( rxDocument ); - if( !mxImpl->hasDocumentModel() ) - throw IllegalArgumentException(); mxImpl->meDirection = FILTERDIRECTION_EXPORT; } @@ -478,35 +488,35 @@ void SAL_CALL FilterBase::setSourceDocument( const Reference< XComponent >& rxDo sal_Bool SAL_CALL FilterBase::filter( const Sequence< PropertyValue >& rMediaDescSeq ) throw( RuntimeException ) { + if( !mxImpl->mxModel.is() || !mxImpl->mxModelFactory.is() || (mxImpl->meDirection == FILTERDIRECTION_UNKNOWN) ) + throw RuntimeException(); + sal_Bool bRet = sal_False; - if( mxImpl->hasDocumentModel() && (mxImpl->meDirection != FILTERDIRECTION_UNKNOWN) ) + setMediaDescriptor( rMediaDescSeq ); + DocumentOpenedGuard aOpenedGuard( mxImpl->maFileUrl ); + if( aOpenedGuard.isValid() || !mxImpl->maFileUrl.getLength() ) { - setMediaDescriptor( rMediaDescSeq ); - DocumentOpenedGuard aOpenedGuard( mxImpl->maFileUrl ); - if( aOpenedGuard.isValid() || !mxImpl->maFileUrl.getLength() ) + mxImpl->initializeFilter(); + switch( mxImpl->meDirection ) { - mxImpl->initializeFilter(); - switch( mxImpl->meDirection ) - { - case FILTERDIRECTION_UNKNOWN: - break; - case FILTERDIRECTION_IMPORT: - if( mxImpl->mxInStream.is() ) - { - mxImpl->mxStorage = implCreateStorage( mxImpl->mxInStream ); - bRet = mxImpl->mxStorage.get() && importDocument(); - } - break; - case FILTERDIRECTION_EXPORT: - if( mxImpl->mxOutStream.is() ) - { - mxImpl->mxStorage = implCreateStorage( mxImpl->mxOutStream ); - bRet = mxImpl->mxStorage.get() && exportDocument(); - } - break; - } - mxImpl->finalizeFilter(); + case FILTERDIRECTION_UNKNOWN: + break; + case FILTERDIRECTION_IMPORT: + if( mxImpl->mxInStream.is() ) + { + mxImpl->mxStorage = implCreateStorage( mxImpl->mxInStream ); + bRet = mxImpl->mxStorage.get() && importDocument(); + } + break; + case FILTERDIRECTION_EXPORT: + if( mxImpl->mxOutStream.is() ) + { + mxImpl->mxStorage = implCreateStorage( mxImpl->mxOutStream ); + bRet = mxImpl->mxStorage.get() && exportDocument(); + } + break; } + mxImpl->finalizeFilter(); } return bRet; } @@ -558,7 +568,7 @@ void FilterBase::setMediaDescriptor( const Sequence< PropertyValue >& rMediaDesc GraphicHelper* FilterBase::implCreateGraphicHelper() const { // default: return base implementation without any special behaviour - return new GraphicHelper( mxImpl->mxGlobalFactory, mxImpl->mxTargetFrame, mxImpl->mxStorage ); + return new GraphicHelper( mxImpl->mxComponentContext, mxImpl->mxTargetFrame, mxImpl->mxStorage ); } // ============================================================================ diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx index 8c3e64f99174..fb17c69155ef 100644 --- a/oox/source/core/filterdetect.cxx +++ b/oox/source/core/filterdetect.cxx @@ -235,17 +235,16 @@ OUString FilterDetect_getImplementationName() } /* Helper for registry */ -Reference< XInterface > SAL_CALL FilterDetect_createInstance( const Reference< XMultiServiceFactory >& xServiceManager ) throw( Exception ) +Reference< XInterface > SAL_CALL FilterDetect_createInstance( const Reference< XComponentContext >& rxContext ) throw( Exception ) { - return Reference< XInterface >( *new FilterDetect( xServiceManager ) ); + return static_cast< ::cppu::OWeakObject* >( new FilterDetect( rxContext ) ); } // ---------------------------------------------------------------------------- -FilterDetect::FilterDetect( const Reference< XMultiServiceFactory >& rxFactory ) : - mxFactory( rxFactory ) +FilterDetect::FilterDetect( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + mxContext( rxContext, UNO_SET_THROW ) { - OSL_ENSURE( mxFactory.is(), "FilterDetect::FilterDetect - no service factory" ); } FilterDetect::~FilterDetect() @@ -455,11 +454,12 @@ PasswordVerifier::PasswordVerifier( const PackageEncryptionInfo& rEncryptInfo ) Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescriptor& rMediaDesc ) const { - if( mxFactory.is() ) + Reference< XMultiServiceFactory > xFactory( mxContext->getServiceManager(), UNO_QUERY ); + if( xFactory.is() ) { // try the plain input stream Reference< XInputStream > xInStrm( rMediaDesc[ MediaDescriptor::PROP_INPUTSTREAM() ], UNO_QUERY ); - if( !xInStrm.is() || lclIsZipPackage( mxFactory, xInStrm ) ) + if( !xInStrm.is() || lclIsZipPackage( xFactory, xInStrm ) ) return xInStrm; // check if a temporary file is passed in the 'ComponentData' property @@ -467,12 +467,12 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript if( xDecrypted.is() ) { Reference< XInputStream > xDecrInStrm = xDecrypted->getInputStream(); - if( lclIsZipPackage( mxFactory, xDecrInStrm ) ) + if( lclIsZipPackage( xFactory, xDecrInStrm ) ) return xDecrInStrm; } // try to decrypt an encrypted OLE package - ::oox::ole::OleStorage aOleStorage( mxFactory, xInStrm, false ); + ::oox::ole::OleStorage aOleStorage( xFactory, xInStrm, false ); if( aOleStorage.isStorage() ) try { // open the required input streams in the encrypted package @@ -518,7 +518,7 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript else { // create temporary file for unencrypted package - Reference< XStream > xTempFile( mxFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TempFile" ) ), UNO_QUERY_THROW ); + Reference< XStream > xTempFile( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TempFile" ) ), UNO_QUERY_THROW ); Reference< XOutputStream > xDecryptedPackage( xTempFile->getOutputStream(), UNO_SET_THROW ); BinaryXOutputStream aDecryptedPackage( xDecryptedPackage, true ); BinaryXInputStream aEncryptedPackage( xEncryptedPackage, true ); @@ -549,7 +549,7 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript rMediaDesc.setComponentDataEntry( CREATE_OUSTRING( "DecryptedPackage" ), Any( xTempFile ) ); Reference< XInputStream > xDecrInStrm = xTempFile->getInputStream(); - if( lclIsZipPackage( mxFactory, xDecrInStrm ) ) + if( lclIsZipPackage( xFactory, xDecrInStrm ) ) return xDecrInStrm; } } @@ -588,12 +588,13 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq { OUString aFilterName; MediaDescriptor aMediaDesc( rMediaDescSeq ); + Reference< XMultiServiceFactory > xFactory( mxContext->getServiceManager(), UNO_QUERY_THROW ); /* Check that the user has not choosen to abort detection, e.g. by hitting 'Cancel' in the password input dialog. This may happen because this filter detection is used by different filters. */ bool bAborted = aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_ABORTED(), false ); - if( !bAborted && mxFactory.is() ) try + if( !bAborted ) try { aMediaDesc.addInputStream(); @@ -604,10 +605,10 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq Reference< XInputStream > xInStrm( extractUnencryptedPackage( aMediaDesc ), UNO_SET_THROW ); // try to detect the file type, must be a ZIP package - ZipStorage aZipStorage( mxFactory, xInStrm ); + ZipStorage aZipStorage( xFactory, xInStrm ); if( aZipStorage.isStorage() ) { - Reference< XFastParser > xParser( mxFactory->createInstance( + Reference< XFastParser > xParser( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW ); xParser->setFastDocumentHandler( new FilterDetectDocHandler( aFilterName ) ); diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 058efa2e2a7d..8cb35e6d090f 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -107,8 +107,8 @@ XmlFilterBaseImpl::XmlFilterBaseImpl() : // ============================================================================ -XmlFilterBase::XmlFilterBase( const Reference< XMultiServiceFactory >& rxGlobalFactory ) : - FilterBase( rxGlobalFactory ), +XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + FilterBase( rxContext ), mxImpl( new XmlFilterBaseImpl ), mnRelId( 1 ), mnMaxDocId( 0 ) @@ -116,7 +116,7 @@ XmlFilterBase::XmlFilterBase( const Reference< XMultiServiceFactory >& rxGlobalF try { // create the fast parser - mxImpl->mxFastParser.set( rxGlobalFactory->createInstance( CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW ); + mxImpl->mxFastParser.set( getServiceFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW ); mxImpl->mxFastParser->setTokenHandler( new FastTokenHandler ); // register XML namespaces @@ -144,6 +144,7 @@ XmlFilterBase::XmlFilterBase( const Reference< XMultiServiceFactory >& rxGlobalF } catch( Exception& ) { + throw RuntimeException(); } } @@ -504,7 +505,7 @@ Reference< XInputStream > XmlFilterBase::implGetInputStream( MediaDescriptor& rM /* Get the input stream directly from the media descriptor, or decrypt the package again. The latter is needed e.g. when the document is reloaded. All this is implemented in the detector service. */ - FilterDetect aDetector( getGlobalFactory() ); + FilterDetect aDetector( getComponentContext() ); return aDetector.extractUnencryptedPackage( rMediaDesc ); } @@ -512,12 +513,12 @@ Reference< XInputStream > XmlFilterBase::implGetInputStream( MediaDescriptor& rM StorageRef XmlFilterBase::implCreateStorage( const Reference< XInputStream >& rxInStream ) const { - return StorageRef( new ZipStorage( getGlobalFactory(), rxInStream ) ); + return StorageRef( new ZipStorage( getServiceFactory(), rxInStream ) ); } StorageRef XmlFilterBase::implCreateStorage( const Reference< XStream >& rxOutStream ) const { - return StorageRef( new ZipStorage( getGlobalFactory(), rxOutStream ) ); + return StorageRef( new ZipStorage( getServiceFactory(), rxOutStream ) ); } // ============================================================================ diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx index 136025fa862e..f2949c99a2ab 100644 --- a/oox/source/drawingml/chart/converterbase.cxx +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -241,7 +241,7 @@ Reference< XInterface > ConverterRoot::createInstance( const OUString& rServiceN Reference< XInterface > xInt; try { - xInt = mxData->mrFilter.getGlobalFactory()->createInstance( rServiceName ); + xInt = mxData->mrFilter.getServiceFactory()->createInstance( rServiceName ); } catch( Exception& ) { diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index 2a6cf61542f9..5c1cf3398fc9 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -1714,7 +1714,7 @@ void Config::construct( const Config& rParent ) void Config::construct( const sal_Char* pcEnvVar, const FilterBase& rFilter ) { if( rFilter.getFileUrl().getLength() > 0 ) - construct( pcEnvVar, rFilter.getGlobalFactory(), rFilter.getStorage(), rFilter.getFileUrl(), rFilter.getMediaDescriptor() ); + construct( pcEnvVar, rFilter.getServiceFactory(), rFilter.getStorage(), rFilter.getFileUrl(), rFilter.getMediaDescriptor() ); } void Config::construct( const sal_Char* pcEnvVar, const Reference< XMultiServiceFactory >& rxFactory, const StorageRef& rxRootStrg, const OUString& rSysFileName, MediaDescriptor& rMediaDesc ) diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx index a33f91359f2b..dc95cf71ee35 100644 --- a/oox/source/helper/graphichelper.cxx +++ b/oox/source/helper/graphichelper.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include #include "tokens.hxx" #include "oox/helper/containerhelper.hxx" @@ -67,13 +66,17 @@ inline sal_Int32 lclConvertScreenPixelToHmm( double fPixel, double fPixelPerHmm // ============================================================================ -GraphicHelper::GraphicHelper( const Reference< XMultiServiceFactory >& rxGlobalFactory, const Reference< XFrame >& rxTargetFrame, const StorageRef& rxStorage ) : - mxGraphicProvider( rxGlobalFactory->createInstance( CREATE_OUSTRING( "com.sun.star.graphic.GraphicProvider" ) ), UNO_QUERY ), +GraphicHelper::GraphicHelper( const Reference< XComponentContext >& rxContext, const Reference< XFrame >& rxTargetFrame, const StorageRef& rxStorage ) : + mxCompContext( rxContext ), mxStorage( rxStorage ), maGraphicObjScheme( CREATE_OUSTRING( "vnd.sun.star.GraphicObject:" ) ) { - ::comphelper::ComponentContext aContext( rxGlobalFactory ); - mxCompContext = aContext.getUNOContext(); + OSL_ENSURE( mxCompContext.is(), "GraphicHelper::GraphicHelper - missing component context" ); + Reference< XMultiServiceFactory > xFactory( mxCompContext->getServiceManager(), UNO_QUERY_THROW ); + OSL_ENSURE( xFactory.is(), "GraphicHelper::GraphicHelper - missing service factory" ); + + if( xFactory.is() ) + mxGraphicProvider.set( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.graphic.GraphicProvider" ) ), UNO_QUERY ); //! TODO: get colors from system maSystemPalette[ XML_3dDkShadow ] = 0x716F64; @@ -110,9 +113,9 @@ GraphicHelper::GraphicHelper( const Reference< XMultiServiceFactory >& rxGlobalF // if no target frame has been passed (e.g. OLE objects), try to fallback to the active frame // TODO: we need some mechanism to keep and pass the parent frame Reference< XFrame > xFrame = rxTargetFrame; - if( !xFrame.is() && rxGlobalFactory.is() ) try + if( !xFrame.is() && xFactory.is() ) try { - Reference< XFramesSupplier > xFramesSupp( rxGlobalFactory->createInstance( CREATE_OUSTRING( "com.sun.star.frame.Desktop" ) ), UNO_QUERY_THROW ); + Reference< XFramesSupplier > xFramesSupp( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.frame.Desktop" ) ), UNO_QUERY_THROW ); xFrame = xFramesSupp->getActiveFrame(); } catch( Exception& ) diff --git a/oox/source/ole/axcontrolfragment.cxx b/oox/source/ole/axcontrolfragment.cxx index b57807a41df6..8eed69b125bb 100644 --- a/oox/source/ole/axcontrolfragment.cxx +++ b/oox/source/ole/axcontrolfragment.cxx @@ -136,7 +136,7 @@ ContextHandlerRef AxControlFragment::onCreateContext( sal_Int32 nElement, const Reference< XInputStream > xStrgStrm = getFilter().openInputStream( aFragmentPath ); if( xStrgStrm.is() ) { - OleStorage aStorage( getFilter().getGlobalFactory(), xStrgStrm, false ); + OleStorage aStorage( getFilter().getServiceFactory(), xStrgStrm, false ); BinaryXInputStream aInStrm( aStorage.openInputStream( CREATE_OUSTRING( "f" ) ), true ); if( !aInStrm.isEof() ) if( AxContainerModelBase* pModel = dynamic_cast< AxContainerModelBase* >( mrControl.createModelFromGuid( aClassId ) ) ) diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx index 206bff087e00..9532cbcd8678 100755 --- a/oox/source/ole/vbacontrol.cxx +++ b/oox/source/ole/vbacontrol.cxx @@ -731,13 +731,13 @@ OUString lclGetQuotedString( const OUString& rCodeLine ) // ---------------------------------------------------------------------------- -VbaUserForm::VbaUserForm( const Reference< XMultiServiceFactory >& rxGlobalFactory, +VbaUserForm::VbaUserForm( const Reference< XComponentContext >& rxContext, const Reference< XModel >& rxDocModel, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) : - mxGlobalFactory( rxGlobalFactory ), + mxCompContext( rxContext ), mxDocModel( rxDocModel ), maConverter( rxDocModel, rGraphicHelper, bDefaultColorBgr ) { - OSL_ENSURE( mxGlobalFactory.is(), "VbaUserForm::VbaUserForm - missing service factory" ); + OSL_ENSURE( mxCompContext.is(), "VbaUserForm::VbaUserForm - missing component context" ); OSL_ENSURE( mxDocModel.is(), "VbaUserForm::VbaUserForm - missing document model" ); } @@ -745,7 +745,7 @@ void VbaUserForm::importForm( const Reference< XNameContainer >& rxDialogLib, StorageBase& rVbaFormStrg, const OUString& rModuleName, rtl_TextEncoding eTextEnc ) { OSL_ENSURE( rxDialogLib.is(), "VbaUserForm::importForm - missing dialog library" ); - if( !mxGlobalFactory.is() || !mxDocModel.is() || !rxDialogLib.is() ) + if( !mxCompContext.is() || !mxDocModel.is() || !rxDialogLib.is() ) return; // check that the '03VBFrame' stream exists, this is required for forms @@ -803,16 +803,15 @@ void VbaUserForm::importForm( const Reference< XNameContainer >& rxDialogLib, { // create the dialog model OUString aServiceName = mxCtrlModel->getServiceName(); - Reference< XControlModel > xDialogModel( mxGlobalFactory->createInstance( aServiceName ), UNO_QUERY_THROW ); + Reference< XMultiServiceFactory > xFactory( mxCompContext->getServiceManager(), UNO_QUERY_THROW ); + Reference< XControlModel > xDialogModel( xFactory->createInstance( aServiceName ), UNO_QUERY_THROW ); Reference< XNameContainer > xDialogNC( xDialogModel, UNO_QUERY_THROW ); // convert properties and embedded controls if( convertProperties( xDialogModel, maConverter, 0 ) ) { // export the dialog to XML and insert it into the dialog library - PropertySet aFactoryProps( mxGlobalFactory ); - Reference< XComponentContext > xCompContext( aFactoryProps.getAnyProperty( PROP_DefaultContext ), UNO_QUERY_THROW ); - Reference< XInputStreamProvider > xDialogSource( ::xmlscript::exportDialogModel( xDialogNC, xCompContext ), UNO_SET_THROW ); + Reference< XInputStreamProvider > xDialogSource( ::xmlscript::exportDialogModel( xDialogNC, mxCompContext ), UNO_SET_THROW ); OSL_ENSURE( !rxDialogLib->hasByName( aFormName ), "VbaUserForm::importForm - multiple dialogs with equal name" ); ContainerHelper::insertByName( rxDialogLib, aFormName, Any( xDialogSource ) ); } diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index 39306040fd66..220ca536d5c1 100755 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -94,14 +95,15 @@ bool lclReadConfigItem( const Reference< XInterface >& rxConfigAccess, const OUS // ---------------------------------------------------------------------------- -VbaFilterConfig::VbaFilterConfig( const Reference< XMultiServiceFactory >& rxGlobalFactory, const OUString& rConfigCompName ) +VbaFilterConfig::VbaFilterConfig( const Reference< XComponentContext >& rxContext, const OUString& rConfigCompName ) { - OSL_ENSURE( rxGlobalFactory.is(), "VbaFilterConfig::VbaFilterConfig - missing service factory" ); - try + OSL_ENSURE( rxContext.is(), "VbaFilterConfig::VbaFilterConfig - missing component context" ); + if( rxContext.is() ) try { OSL_ENSURE( rConfigCompName.getLength() > 0, "VbaFilterConfig::VbaFilterConfig - invalid configuration component name" ); OUString aConfigPackage = CREATE_OUSTRING( "org.openoffice.Office." ) + rConfigCompName; - mxConfigAccess = ConfigurationHelper::openConfig( rxGlobalFactory, aConfigPackage, ConfigurationHelper::E_READONLY ); + Reference< XMultiServiceFactory > xFactory( rxContext->getServiceManager(), UNO_QUERY_THROW ); + mxConfigAccess = ConfigurationHelper::openConfig( xFactory, aConfigPackage, ConfigurationHelper::E_READONLY ); } catch( Exception& ) { @@ -153,13 +155,14 @@ void VbaMacroAttacherBase::resolveAndAttachMacro( const Reference< XVBAMacroReso // ============================================================================ -VbaProject::VbaProject( const Reference< XMultiServiceFactory >& rxGlobalFactory, +VbaProject::VbaProject( const Reference< XComponentContext >& rxContext, const Reference< XModel >& rxDocModel, const OUString& rConfigCompName ) : - VbaFilterConfig( rxGlobalFactory, rConfigCompName ), - mxGlobalFactory( rxGlobalFactory ), + VbaFilterConfig( rxContext, rConfigCompName ), + mxCompContext( rxContext ), mxDocModel( rxDocModel ), maPrjName( CREATE_OUSTRING( "Standard" ) ) { + OSL_ENSURE( mxCompContext.is(), "VbaProject::VbaProject - missing component context" ); OSL_ENSURE( mxDocModel.is(), "VbaProject::VbaProject - missing document model" ); mxBasicLib = openLibrary( PROP_BasicLibraries, false ); mxDialogLib = openLibrary( PROP_DialogLibraries, false ); @@ -552,7 +555,7 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap // create and import the form Reference< XNameContainer > xDialogLib( createDialogLibrary(), UNO_SET_THROW ); - VbaUserForm aForm( mxGlobalFactory, mxDocModel, rGraphicHelper, bDefaultColorBgr ); + VbaUserForm aForm( mxCompContext, mxDocModel, rGraphicHelper, bDefaultColorBgr ); aForm.importForm( xDialogLib, *xSubStrg, aModuleName, eTextEnc ); } catch( Exception& ) @@ -569,13 +572,14 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap void VbaProject::attachMacros() { - if( !maMacroAttachers.empty() ) try + if( !maMacroAttachers.empty() && mxCompContext.is() ) try { + Reference< XMultiComponentFactory > xFactory( mxCompContext->getServiceManager(), UNO_SET_THROW ); Sequence< Any > aArgs( 2 ); aArgs[ 0 ] <<= mxDocModel; aArgs[ 1 ] <<= maPrjName; - Reference< XVBAMacroResolver > xResolver( mxGlobalFactory->createInstanceWithArguments( - CREATE_OUSTRING( "com.sun.star.script.vba.VBAMacroResolver" ), aArgs ), UNO_QUERY_THROW ); + Reference< XVBAMacroResolver > xResolver( xFactory->createInstanceWithArgumentsAndContext( + CREATE_OUSTRING( "com.sun.star.script.vba.VBAMacroResolver" ), aArgs, mxCompContext ), UNO_QUERY_THROW ); maMacroAttachers.forEachMem( &VbaMacroAttacherBase::resolveAndAttachMacro, ::boost::cref( xResolver ) ); } catch( Exception& ) @@ -585,14 +589,15 @@ void VbaProject::attachMacros() void VbaProject::copyStorage( StorageBase& rVbaPrjStrg ) { - try + if( mxCompContext.is() ) try { + Reference< XMultiServiceFactory > xFactory( mxCompContext->getServiceManager(), UNO_QUERY_THROW ); Reference< XStorageBasedDocument > xStorageBasedDoc( mxDocModel, UNO_QUERY_THROW ); Reference< XStorage > xDocStorage( xStorageBasedDoc->getDocumentStorage(), UNO_QUERY_THROW ); { using namespace ::com::sun::star::embed::ElementModes; Reference< XStream > xDocStream( xDocStorage->openStreamElement( CREATE_OUSTRING( "_MS_VBA_Macros" ), SEEKABLE | WRITE | TRUNCATE ), UNO_SET_THROW ); - OleStorage aDestStorage( mxGlobalFactory, xDocStream, false ); + OleStorage aDestStorage( xFactory, xDocStream, false ); rVbaPrjStrg.copyStorageToStorage( aDestStorage ); aDestStorage.commit(); } diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index b3cd99ad6166..249db6c09426 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -42,24 +42,25 @@ namespace oox { namespace ppt { OUString SAL_CALL PowerPointImport_getImplementationName() throw() { - return CREATE_OUSTRING( "com.sun.star.comp.Impress.oox.PowerPointImport" ); + return CREATE_OUSTRING( "com.sun.star.comp.oox.ppt.PowerPointImport" ); } uno::Sequence< OUString > SAL_CALL PowerPointImport_getSupportedServiceNames() throw() { - const OUString aServiceName = CREATE_OUSTRING( "com.sun.star.comp.ooxpptx" ); - const Sequence< OUString > aSeq( &aServiceName, 1 ); + Sequence< OUString > aSeq( 2 ); + aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" ); + aSeq[ 1 ] = CREATE_OUSTRING( "com.sun.star.document.ExportFilter" ); return aSeq; } -uno::Reference< uno::XInterface > SAL_CALL PowerPointImport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception ) +uno::Reference< uno::XInterface > SAL_CALL PowerPointImport_createInstance( const Reference< XComponentContext >& rxContext ) throw( Exception ) { - return (cppu::OWeakObject*)new PowerPointImport( rSMgr ); + return static_cast< ::cppu::OWeakObject* >( new PowerPointImport( rxContext ) ); } -PowerPointImport::PowerPointImport( const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) - : XmlFilterBase( rSMgr ) - , mxChartConv( new ::oox::drawingml::chart::ChartConverter ) +PowerPointImport::PowerPointImport( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + XmlFilterBase( rxContext ), + mxChartConv( new ::oox::drawingml::chart::ChartConverter ) { } @@ -164,7 +165,7 @@ private: }; PptGraphicHelper::PptGraphicHelper( const PowerPointImport& rFilter ) : - GraphicHelper( rFilter.getGlobalFactory(), rFilter.getTargetFrame(), rFilter.getStorage() ), + GraphicHelper( rFilter.getComponentContext(), rFilter.getTargetFrame(), rFilter.getStorage() ), mrFilter( rFilter ) { } @@ -183,7 +184,7 @@ GraphicHelper* PowerPointImport::implCreateGraphicHelper() const ::oox::ole::VbaProject* PowerPointImport::implCreateVbaProject() const { - return new ::oox::ole::VbaProject( getGlobalFactory(), getModel(), CREATE_OUSTRING( "Impress" ) ); + return new ::oox::ole::VbaProject( getComponentContext(), getModel(), CREATE_OUSTRING( "Impress" ) ); } OUString PowerPointImport::implGetImplementationName() const diff --git a/oox/source/ppt/timenode.cxx b/oox/source/ppt/timenode.cxx index 51a53d9631a2..6887bcfdf3a3 100644 --- a/oox/source/ppt/timenode.cxx +++ b/oox/source/ppt/timenode.cxx @@ -588,7 +588,7 @@ namespace oox { namespace ppt { const Reference< XAnimationNode >& rxNode ) { try { - Reference< XAnimationNode > xNode ( rFilter.getGlobalFactory()->createInstance(rServiceName ), UNO_QUERY_THROW ); + Reference< XAnimationNode > xNode ( rFilter.getServiceFactory()->createInstance( rServiceName ), UNO_QUERY_THROW ); Reference< XTimeContainer > xParentContainer( rxNode, UNO_QUERY_THROW ); xParentContainer->appendChild( xNode ); diff --git a/oox/source/shape/FastTokenHandlerService.cxx b/oox/source/shape/FastTokenHandlerService.cxx index 6c6fcfa53d6e..292f64548363 100644 --- a/oox/source/shape/FastTokenHandlerService.cxx +++ b/oox/source/shape/FastTokenHandlerService.cxx @@ -24,93 +24,95 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include + #include "FastTokenHandlerService.hxx" +#include +#include "oox/helper/helper.hxx" + namespace oox { namespace shape { -using namespace ::com::sun::star; +// ============================================================================ -FastTokenHandlerService::FastTokenHandlerService(uno::Reference< uno::XComponentContext > const & context) : - m_xContext(context) -{} +using namespace ::com::sun::star::uno; -// com.sun.star.uno.XServiceInfo: -::rtl::OUString SAL_CALL FastTokenHandlerService::getImplementationName() throw (uno::RuntimeException) +using ::rtl::OUString; + +// ============================================================================ + +OUString SAL_CALL FastTokenHandlerService_getImplementationName() { - return FastTokenHandlerService_getImplementationName(); + return CREATE_OUSTRING( "com.sun.star.comp.oox.FastTokenHandlerService" ); } -::sal_Bool SAL_CALL FastTokenHandlerService::supportsService(::rtl::OUString const & serviceName) throw (uno::RuntimeException) +Sequence< OUString > SAL_CALL FastTokenHandlerService_getSupportedServiceNames() { - uno::Sequence< ::rtl::OUString > serviceNames = FastTokenHandlerService_getSupportedServiceNames(); - for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) { - if (serviceNames[i] == serviceName) - return sal_True; - } - return sal_False; + Sequence< OUString > s( 1 ); + s[ 0 ] = CREATE_OUSTRING( "com.sun.star.xml.sax.FastTokenHandler" ); + return s; } -uno::Sequence< ::rtl::OUString > SAL_CALL FastTokenHandlerService::getSupportedServiceNames() throw (uno::RuntimeException) +Reference< XInterface > SAL_CALL FastTokenHandlerService_createInstance( const Reference< XComponentContext >& rxContext ) throw (Exception) { - return FastTokenHandlerService_getSupportedServiceNames(); + return static_cast< ::cppu::OWeakObject* >( new FastTokenHandlerService( rxContext ) ); } -::sal_Int32 SAL_CALL FastTokenHandlerService::getToken(const ::rtl::OUString & Identifier) throw (::com::sun::star::uno::RuntimeException) +// ============================================================================ + +FastTokenHandlerService::FastTokenHandlerService( const Reference< XComponentContext >& rxContext ) : + m_xContext( rxContext ) { - return mFastTokenHandler.getToken(Identifier); } -::rtl::OUString SAL_CALL FastTokenHandlerService::getIdentifier(::sal_Int32 Token) throw (::com::sun::star::uno::RuntimeException) +FastTokenHandlerService::~FastTokenHandlerService() { - return mFastTokenHandler.getIdentifier(Token); } -::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL FastTokenHandlerService::getUTF8Identifier( ::sal_Int32 Token ) throw (::com::sun::star::uno::RuntimeException) +// com.sun.star.uno.XServiceInfo: +OUString SAL_CALL FastTokenHandlerService::getImplementationName() throw (RuntimeException) { - return mFastTokenHandler.getUTF8Identifier(Token); + return FastTokenHandlerService_getImplementationName(); } -::sal_Int32 SAL_CALL FastTokenHandlerService::getTokenFromUTF8(const ::com::sun::star::uno::Sequence< ::sal_Int8 > & Identifier) throw (::com::sun::star::uno::RuntimeException) +sal_Bool SAL_CALL FastTokenHandlerService::supportsService( const OUString& serviceName ) throw (RuntimeException) { - return mFastTokenHandler.getTokenFromUTF8(Identifier); + Sequence< OUString > serviceNames = FastTokenHandlerService_getSupportedServiceNames(); + for( sal_Int32 i = 0; i < serviceNames.getLength(); ++i ) + { + if( serviceNames[ i ] == serviceName ) + return sal_True; + } + return sal_False; } -::rtl::OUString SAL_CALL FastTokenHandlerService_getImplementationName() { - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.oox.FastTokenHandlerService")); +Sequence< OUString > SAL_CALL FastTokenHandlerService::getSupportedServiceNames() throw (RuntimeException) +{ + return FastTokenHandlerService_getSupportedServiceNames(); } -uno::Sequence< ::rtl::OUString > SAL_CALL FastTokenHandlerService_getSupportedServiceNames() +// ::com::sun::star::xml::sax::XFastTokenHandler: +sal_Int32 SAL_CALL FastTokenHandlerService::getToken( const OUString& Identifier ) throw (RuntimeException) { - uno::Sequence< ::rtl::OUString > s(1); - s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.xml.sax.FastTokenHandler")); - return s; + return mFastTokenHandler.getToken(Identifier); } -uno::Reference< uno::XInterface > SAL_CALL FastTokenHandlerService_create( - const uno::Reference< uno::XComponentContext > & context) - SAL_THROW((uno::Exception)) +OUString SAL_CALL FastTokenHandlerService::getIdentifier( sal_Int32 Token ) throw (RuntimeException) { - return static_cast< ::cppu::OWeakObject * >(new FastTokenHandlerService(context)); + return mFastTokenHandler.getIdentifier(Token); } -uno::Reference< uno::XInterface > SAL_CALL -FastTokenHandlerService_createInstance -( const uno::Reference< lang::XMultiServiceFactory > & rSMgr) -throw( uno::Exception ) +Sequence< sal_Int8 > SAL_CALL FastTokenHandlerService::getUTF8Identifier( sal_Int32 Token ) throw (RuntimeException) { - uno::Reference - xPropertySet(rSMgr, uno::UNO_QUERY_THROW); - uno::Any aDefaultContext = xPropertySet->getPropertyValue - (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext"))); - - uno::Reference xContext; - aDefaultContext >>= xContext; + return mFastTokenHandler.getUTF8Identifier(Token); +} - return FastTokenHandlerService_create(xContext); +sal_Int32 SAL_CALL FastTokenHandlerService::getTokenFromUTF8( const Sequence< sal_Int8 >& Identifier ) throw (RuntimeException) +{ + return mFastTokenHandler.getTokenFromUTF8(Identifier); } -}} +// ============================================================================ + +} // namspace shape +} // namspace oox diff --git a/oox/source/shape/FastTokenHandlerService.hxx b/oox/source/shape/FastTokenHandlerService.hxx index b822654fdcfb..09c7c2044922 100644 --- a/oox/source/shape/FastTokenHandlerService.hxx +++ b/oox/source/shape/FastTokenHandlerService.hxx @@ -28,54 +28,46 @@ #ifndef OOX_SHAPE_FASTTOKENHANDLERSERVICE_HXX #define OOX_SHAPE_FASTTOKENHANDLERSERVICE_HXX -#include +#include #include -#include #include -#include #include "oox/core/fasttokenhandler.hxx" -namespace css = ::com::sun::star; - namespace oox { namespace shape { -class FastTokenHandlerService: - public ::cppu::WeakImplHelper2< - css::lang::XServiceInfo, - css::xml::sax::XFastTokenHandler> +// ============================================================================ + +typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::xml::sax::XFastTokenHandler > FastTokenHandlerServiceBase; + +class FastTokenHandlerService : public FastTokenHandlerServiceBase { public: - explicit FastTokenHandlerService(css::uno::Reference< css::uno::XComponentContext > const & context); + explicit FastTokenHandlerService( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxCcontext ); + virtual ~FastTokenHandlerService(); // ::com::sun::star::lang::XServiceInfo: - virtual ::rtl::OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString & ServiceName) throw (css::uno::RuntimeException); - virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString & ServiceName) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); // ::com::sun::star::xml::sax::XFastTokenHandler: - virtual ::sal_Int32 SAL_CALL getToken(const ::rtl::OUString & Identifier) throw (css::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getIdentifier(::sal_Int32 Token) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getToken(const ::rtl::OUString & Identifier) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getIdentifier(::sal_Int32 Token) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getUTF8Identifier( ::sal_Int32 Token ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getTokenFromUTF8(const css::uno::Sequence< ::sal_Int8 > & Identifier) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getTokenFromUTF8(const ::com::sun::star::uno::Sequence< ::sal_Int8 > & Identifier) throw (::com::sun::star::uno::RuntimeException); private: FastTokenHandlerService(FastTokenHandlerService &); // not defined void operator =(FastTokenHandlerService &); // not defined - virtual ~FastTokenHandlerService() {} - - css::uno::Reference< css::uno::XComponentContext > m_xContext; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::oox::core::FastTokenHandler mFastTokenHandler; }; -::rtl::OUString SAL_CALL FastTokenHandlerService_getImplementationName(); - -css::uno::Sequence< ::rtl::OUString > SAL_CALL FastTokenHandlerService_getSupportedServiceNames(); +// ============================================================================ -css::uno::Reference< css::uno::XInterface > SAL_CALL _FastTokenHandlerService_create( - const css::uno::Reference< css::uno::XComponentContext > & context) - SAL_THROW((css::uno::Exception)); +} // namspace shape +} // namspace oox -}} -#endif // OOX_SHAPE_FAST_TOKEN_HANDLER_SERVICE_HXX +#endif diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index 9313184d6865..86d36268b1d8 100644 --- a/oox/source/shape/ShapeContextHandler.cxx +++ b/oox/source/shape/ShapeContextHandler.cxx @@ -37,15 +37,34 @@ using namespace ::com::sun::star; using namespace core; using namespace drawingml; +::rtl::OUString SAL_CALL ShapeContextHandler_getImplementationName() +{ + return CREATE_OUSTRING( "com.sun.star.comp.oox.ShapeContextHandler" ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL +ShapeContextHandler_getSupportedServiceNames() +{ + uno::Sequence< ::rtl::OUString > s(1); + s[0] = CREATE_OUSTRING( "com.sun.star.xml.sax.FastShapeContextHandler" ); + return s; +} + +uno::Reference< uno::XInterface > SAL_CALL +ShapeContextHandler_createInstance( const uno::Reference< uno::XComponentContext > & context) + SAL_THROW((uno::Exception)) +{ + return static_cast< ::cppu::OWeakObject* >( new ShapeContextHandler(context) ); +} + + ShapeContextHandler::ShapeContextHandler (uno::Reference< uno::XComponentContext > const & context) : mnStartToken(0), m_xContext(context) { try { - uno::Reference - xFactory(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW); - mxFilterBase.set( new ShapeFilterBase(xFactory) ); + mxFilterBase.set( new ShapeFilterBase(context) ); } catch( uno::Exception& ) { @@ -320,11 +339,6 @@ uno::Sequence< ::rtl::OUString > ShapeContextHandler::getSupportedServiceNames() return ShapeContextHandler_getSupportedServiceNames(); } -::rtl::OUString SAL_CALL ShapeContextHandler_getImplementationName() { - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.oox.ShapeContextHandler")); -} - ::sal_Bool SAL_CALL ShapeContextHandler::supportsService (const ::rtl::OUString & ServiceName) throw (css::uno::RuntimeException) { @@ -336,38 +350,4 @@ uno::Sequence< ::rtl::OUString > ShapeContextHandler::getSupportedServiceNames() return sal_False; } -uno::Sequence< ::rtl::OUString > SAL_CALL -ShapeContextHandler_getSupportedServiceNames() -{ - uno::Sequence< ::rtl::OUString > s(1); - s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.xml.sax.FastShapeContextHandler")); - return s; -} - -uno::Reference< uno::XInterface > SAL_CALL -ShapeContextHandler_create( - const uno::Reference< uno::XComponentContext > & context) - SAL_THROW((uno::Exception)) -{ - return static_cast< ::cppu::OWeakObject * > - (new ShapeContextHandler(context)); -} - -uno::Reference< uno::XInterface > SAL_CALL -ShapeContextHandler_createInstance -( const uno::Reference< lang::XMultiServiceFactory > & rSMgr) -throw( uno::Exception ) -{ - uno::Reference - xPropertySet(rSMgr, uno::UNO_QUERY_THROW); - uno::Any aDefaultContext = xPropertySet->getPropertyValue - (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext"))); - - uno::Reference xContext; - aDefaultContext >>= xContext; - - return ShapeContextHandler_create(xContext); -} - }} diff --git a/oox/source/shape/ShapeContextHandler.hxx b/oox/source/shape/ShapeContextHandler.hxx index c9cf67283c37..b794c2f879c1 100644 --- a/oox/source/shape/ShapeContextHandler.hxx +++ b/oox/source/shape/ShapeContextHandler.hxx @@ -28,10 +28,9 @@ #define OOX_SHAPE_SHAPE_CONTEXT_HANDLER_HXX #include -#include "sal/config.h" -#include "com/sun/star/uno/XComponentContext.hpp" -#include "cppuhelper/implbase1.hxx" -#include "com/sun/star/xml/sax/XFastShapeContextHandler.hpp" +#include +#include +#include #include "oox/drawingml/graphicshapecontext.hxx" #include "oox/drawingml/shape.hxx" #include "oox/drawingml/theme.hxx" @@ -43,21 +42,6 @@ namespace css = ::com::sun::star; namespace oox { namespace shape { -// component and service helper functions: -::rtl::OUString SAL_CALL ShapeContextHandler_getImplementationName(); - -css::uno::Sequence< ::rtl::OUString > SAL_CALL -ShapeContextHandler_getSupportedServiceNames(); - -css::uno::Reference< css::uno::XInterface > SAL_CALL -ShapeContextHandler_create -( css::uno::Reference< css::uno::XComponentContext > const & context ); - -css::uno::Reference< css::uno::XInterface > SAL_CALL -ShapeContextHandler_createInstance -( const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr) -throw( css::uno::Exception ); - class ShapeFragmentHandler : public core::FragmentHandler { public: diff --git a/oox/source/shape/ShapeFilterBase.cxx b/oox/source/shape/ShapeFilterBase.cxx index c0a4857479a7..68e0d0002392 100644 --- a/oox/source/shape/ShapeFilterBase.cxx +++ b/oox/source/shape/ShapeFilterBase.cxx @@ -34,11 +34,9 @@ namespace shape { using namespace ::com::sun::star; -ShapeFilterBase::ShapeFilterBase -(const uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& - rxFactory) -: XmlFilterBase(rxFactory) -, mxChartConv( new ::oox::drawingml::chart::ChartConverter ) +ShapeFilterBase::ShapeFilterBase( const uno::Reference< uno::XComponentContext >& rxContext ) throw( uno::RuntimeException ) : + XmlFilterBase( rxContext ), + mxChartConv( new ::oox::drawingml::chart::ChartConverter ) { } @@ -68,7 +66,7 @@ const ::oox::drawingml::table::TableStyleListPtr ShapeFilterBase::getTableStyles ::oox::ole::VbaProject* ShapeFilterBase::implCreateVbaProject() const { - return new ::oox::ole::VbaProject( getGlobalFactory(), getModel(), CREATE_OUSTRING( "Writer" ) ); + return new ::oox::ole::VbaProject( getComponentContext(), getModel(), CREATE_OUSTRING( "Writer" ) ); } ::rtl::OUString ShapeFilterBase::implGetImplementationName() const diff --git a/oox/source/shape/ShapeFilterBase.hxx b/oox/source/shape/ShapeFilterBase.hxx index 748b92389b0c..a21357c16079 100644 --- a/oox/source/shape/ShapeFilterBase.hxx +++ b/oox/source/shape/ShapeFilterBase.hxx @@ -45,7 +45,8 @@ public: typedef boost::shared_ptr Pointer_t; explicit ShapeFilterBase( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory ); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); virtual ~ShapeFilterBase(); diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index 8d02aa6e5256..72453ed512e5 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -106,7 +106,6 @@ D3DSceneShadeMode DDELinks DatabaseRanges Decoration -DefaultContext DefaultScrollValue DefaultSpinValue DefaultState diff --git a/oox/source/xls/biffdetector.cxx b/oox/source/xls/biffdetector.cxx index fc3e1e710bcb..e5ef5416c9b3 100644 --- a/oox/source/xls/biffdetector.cxx +++ b/oox/source/xls/biffdetector.cxx @@ -27,30 +27,29 @@ #include "oox/xls/biffdetector.hxx" #include -#include #include +#include #include +#include #include "oox/helper/binaryinputstream.hxx" #include "oox/ole/olestorage.hxx" -using ::rtl::OUString; -using ::rtl::OStringBuffer; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::uno::XInterface; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::beans::PropertyValue; -using ::com::sun::star::io::XInputStream; -using ::comphelper::MediaDescriptor; - namespace oox { namespace xls { // ============================================================================ +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::comphelper::MediaDescriptor; +using ::rtl::OStringBuffer; +using ::rtl::OUString; + +// ============================================================================ + Sequence< OUString > BiffDetector_getSupportedServiceNames() { Sequence< OUString > aServiceNames( 1 ); @@ -60,18 +59,18 @@ Sequence< OUString > BiffDetector_getSupportedServiceNames() OUString BiffDetector_getImplementationName() { - return CREATE_OUSTRING( "com.sun.star.comp.oox.BiffDetector" ); + return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.BiffDetector" ); } -Reference< XInterface > SAL_CALL BiffDetector_createInstance( const Reference< XMultiServiceFactory >& rxFactory ) throw( Exception ) +Reference< XInterface > SAL_CALL BiffDetector_createInstance( const Reference< XComponentContext >& rxContext ) throw( Exception ) { - return static_cast< ::cppu::OWeakObject* >( new BiffDetector( rxFactory ) ); + return static_cast< ::cppu::OWeakObject* >( new BiffDetector( rxContext ) ); } // ============================================================================ -BiffDetector::BiffDetector( const Reference< XMultiServiceFactory >& rxFactory ) : - mxFactory( rxFactory ) +BiffDetector::BiffDetector( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + mxContext( rxContext, UNO_SET_THROW ) { } @@ -79,7 +78,7 @@ BiffDetector::~BiffDetector() { } -BiffType BiffDetector::detectStreamBiffVersion( BinaryInputStream& rInStream ) +/*static*/ BiffType BiffDetector::detectStreamBiffVersion( BinaryInputStream& rInStream ) { BiffType eBiff = BIFF_UNKNOWN; if( !rInStream.isEof() && rInStream.isSeekable() && (rInStream.getLength() > 4) ) @@ -132,36 +131,36 @@ BiffType BiffDetector::detectStreamBiffVersion( BinaryInputStream& rInStream ) return eBiff; } -BiffType BiffDetector::detectStorageBiffVersion( OUString& orWorkbookStreamName, StorageRef xStorage ) +/*static*/ BiffType BiffDetector::detectStorageBiffVersion( OUString& orWorkbookStreamName, const StorageRef& rxStorage ) { static const OUString saBookName = CREATE_OUSTRING( "Book" ); static const OUString saWorkbookName = CREATE_OUSTRING( "Workbook" ); BiffType eBiff = BIFF_UNKNOWN; - if( xStorage.get() ) + if( rxStorage.get() ) { - if( xStorage->isStorage() ) + if( rxStorage->isStorage() ) { // try to open the "Book" stream - BinaryXInputStream aBookStrm5( xStorage->openInputStream( saBookName ), true ); + BinaryXInputStream aBookStrm5( rxStorage->openInputStream( saBookName ), true ); BiffType eBookStrm5Biff = detectStreamBiffVersion( aBookStrm5 ); // try to open the "Workbook" stream - BinaryXInputStream aBookStrm8( xStorage->openInputStream( saWorkbookName ), true ); + BinaryXInputStream aBookStrm8( rxStorage->openInputStream( saWorkbookName ), true ); BiffType eBookStrm8Biff = detectStreamBiffVersion( aBookStrm8 ); // decide which stream to use if( (eBookStrm8Biff != BIFF_UNKNOWN) && ((eBookStrm5Biff == BIFF_UNKNOWN) || (eBookStrm8Biff > eBookStrm5Biff)) ) { - /* Only "Workbook" stream exists; or both streams exist, - and "Workbook" has higher BIFF version than "Book" stream. */ + /* Only "Workbook" stream exists; or both streams exist, and + "Workbook" has higher BIFF version than "Book" stream. */ eBiff = eBookStrm8Biff; orWorkbookStreamName = saWorkbookName; } else if( eBookStrm5Biff != BIFF_UNKNOWN ) { - /* Only "Book" stream exists; or both streams exist, - and "Book" has higher BIFF version than "Workbook" stream. */ + /* Only "Book" stream exists; or both streams exist, and + "Book" has higher BIFF version than "Workbook" stream. */ eBiff = eBookStrm5Biff; orWorkbookStreamName = saBookName; } @@ -169,7 +168,7 @@ BiffType BiffDetector::detectStorageBiffVersion( OUString& orWorkbookStreamName, else { // no storage, try plain input stream from medium (even for BIFF5+) - BinaryXInputStream aStrm( xStorage->openInputStream( OUString() ), false ); + BinaryXInputStream aStrm( rxStorage->openInputStream( OUString() ), false ); eBiff = detectStreamBiffVersion( aStrm ); orWorkbookStreamName = OUString(); } @@ -187,7 +186,7 @@ OUString SAL_CALL BiffDetector::getImplementationName() throw( RuntimeException sal_Bool SAL_CALL BiffDetector::supportsService( const OUString& rService ) throw( RuntimeException ) { - const Sequence< OUString > aServices( BiffDetector_getSupportedServiceNames() ); + const Sequence< OUString > aServices = BiffDetector_getSupportedServiceNames(); const OUString* pArray = aServices.getConstArray(); const OUString* pArrayEnd = pArray + aServices.getLength(); return ::std::find( pArray, pArrayEnd, rService ) != pArrayEnd; @@ -207,20 +206,19 @@ OUString SAL_CALL BiffDetector::detect( Sequence< PropertyValue >& rDescriptor ) MediaDescriptor aDescriptor( rDescriptor ); aDescriptor.addInputStream(); - Reference< XInputStream > xInStrm( aDescriptor[ MediaDescriptor::PROP_INPUTSTREAM() ], UNO_QUERY ); - if( xInStrm.is() ) + Reference< XMultiServiceFactory > xFactory( mxContext->getServiceManager(), UNO_QUERY_THROW ); + Reference< XInputStream > xInStrm( aDescriptor[ MediaDescriptor::PROP_INPUTSTREAM() ], UNO_QUERY_THROW ); + StorageRef xStorage( new ::oox::ole::OleStorage( xFactory, xInStrm, true ) ); + + OUString aWorkbookName; + switch( detectStorageBiffVersion( aWorkbookName, xStorage ) ) { - OUString aWorkbookName; - StorageRef xStorage( new ::oox::ole::OleStorage( mxFactory, xInStrm, true ) ); - switch( detectStorageBiffVersion( aWorkbookName, xStorage ) ) - { - case BIFF2: - case BIFF3: - case BIFF4: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_40" ); break; - case BIFF5: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_95" ); break; - case BIFF8: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_97" ); break; - default:; - } + case BIFF2: + case BIFF3: + case BIFF4: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_40" ); break; + case BIFF5: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_95" ); break; + case BIFF8: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_97" ); break; + default:; } return aTypeName; diff --git a/oox/source/xls/excelfilter.cxx b/oox/source/xls/excelfilter.cxx index f07bfd48495f..451a96bdb4df 100644 --- a/oox/source/xls/excelfilter.cxx +++ b/oox/source/xls/excelfilter.cxx @@ -85,26 +85,27 @@ void ExcelFilterBase::unregisterWorkbookData() OUString SAL_CALL ExcelFilter_getImplementationName() throw() { - return CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelFilter" ); + return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelFilter" ); } Sequence< OUString > SAL_CALL ExcelFilter_getSupportedServiceNames() throw() { - OUString aServiceName = CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelFilter" ); - Sequence< OUString > aSeq( &aServiceName, 1 ); + Sequence< OUString > aSeq( 2 ); + aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" ); + aSeq[ 1 ] = CREATE_OUSTRING( "com.sun.star.document.ExportFilter" ); return aSeq; } Reference< XInterface > SAL_CALL ExcelFilter_createInstance( - const Reference< XMultiServiceFactory >& rxGlobalFactory ) throw( Exception ) + const Reference< XComponentContext >& rxContext ) throw( Exception ) { - return static_cast< ::cppu::OWeakObject* >( new ExcelFilter( rxGlobalFactory ) ); + return static_cast< ::cppu::OWeakObject* >( new ExcelFilter( rxContext ) ); } // ---------------------------------------------------------------------------- -ExcelFilter::ExcelFilter( const Reference< XMultiServiceFactory >& rxGlobalFactory ) : - XmlFilterBase( rxGlobalFactory ) +ExcelFilter::ExcelFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + XmlFilterBase( rxContext ) { } @@ -161,7 +162,7 @@ GraphicHelper* ExcelFilter::implCreateGraphicHelper() const ::oox::ole::VbaProject* ExcelFilter::implCreateVbaProject() const { - return new ExcelVbaProject( getGlobalFactory(), Reference< XSpreadsheetDocument >( getModel(), UNO_QUERY ) ); + return new ExcelVbaProject( getComponentContext(), Reference< XSpreadsheetDocument >( getModel(), UNO_QUERY ) ); } OUString ExcelFilter::implGetImplementationName() const @@ -173,26 +174,27 @@ OUString ExcelFilter::implGetImplementationName() const OUString SAL_CALL ExcelBiffFilter_getImplementationName() throw() { - return CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelBiffFilter" ); + return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelBiffFilter" ); } Sequence< OUString > SAL_CALL ExcelBiffFilter_getSupportedServiceNames() throw() { - OUString aServiceName = CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelBiffFilter" ); - Sequence< OUString > aSeq( &aServiceName, 1 ); + Sequence< OUString > aSeq( 2 ); + aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" ); + aSeq[ 1 ] = CREATE_OUSTRING( "com.sun.star.document.ExportFilter" ); return aSeq; } Reference< XInterface > SAL_CALL ExcelBiffFilter_createInstance( - const Reference< XMultiServiceFactory >& rxGlobalFactory ) throw( Exception ) + const Reference< XComponentContext >& rxContext ) throw( Exception ) { - return static_cast< ::cppu::OWeakObject* >( new ExcelBiffFilter( rxGlobalFactory ) ); + return static_cast< ::cppu::OWeakObject* >( new ExcelBiffFilter( rxContext ) ); } // ---------------------------------------------------------------------------- -ExcelBiffFilter::ExcelBiffFilter( const Reference< XMultiServiceFactory >& rxGlobalFactory ) : - BinaryFilterBase( rxGlobalFactory ) +ExcelBiffFilter::ExcelBiffFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + BinaryFilterBase( rxContext ) { } @@ -241,7 +243,7 @@ GraphicHelper* ExcelBiffFilter::implCreateGraphicHelper() const ::oox::ole::VbaProject* ExcelBiffFilter::implCreateVbaProject() const { - return new ExcelVbaProject( getGlobalFactory(), Reference< XSpreadsheetDocument >( getModel(), UNO_QUERY ) ); + return new ExcelVbaProject( getComponentContext(), Reference< XSpreadsheetDocument >( getModel(), UNO_QUERY ) ); } OUString ExcelBiffFilter::implGetImplementationName() const diff --git a/oox/source/xls/excelvbaproject.cxx b/oox/source/xls/excelvbaproject.cxx index 3d7d34b87823..8b072d282702 100755 --- a/oox/source/xls/excelvbaproject.cxx +++ b/oox/source/xls/excelvbaproject.cxx @@ -56,8 +56,8 @@ using ::rtl::OUStringBuffer; // ============================================================================ -ExcelVbaProject::ExcelVbaProject( const Reference< XMultiServiceFactory >& rxGlobalFactory, const Reference< XSpreadsheetDocument >& rxDocument ) : - ::oox::ole::VbaProject( rxGlobalFactory, Reference< XModel >( rxDocument, UNO_QUERY ), CREATE_OUSTRING( "Calc" ) ), +ExcelVbaProject::ExcelVbaProject( const Reference< XComponentContext >& rxContext, const Reference< XSpreadsheetDocument >& rxDocument ) : + ::oox::ole::VbaProject( rxContext, Reference< XModel >( rxDocument, UNO_QUERY ), CREATE_OUSTRING( "Calc" ) ), mxDocument( rxDocument ) { } diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx index 5a149961c0e2..3511e0eefad9 100644 --- a/oox/source/xls/stylesbuffer.cxx +++ b/oox/source/xls/stylesbuffer.cxx @@ -26,8 +26,7 @@ ************************************************************************/ #include "oox/xls/stylesbuffer.hxx" -#include -#include + #include #include #include @@ -38,47 +37,43 @@ #include #include #include +#include +#include #include #include #include #include #include -#include "properties.hxx" +#include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" #include "oox/helper/recordinputstream.hxx" -#include "oox/core/filterbase.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/condformatbuffer.hxx" #include "oox/xls/excelhandlers.hxx" #include "oox/xls/themebuffer.hxx" #include "oox/xls/unitconverter.hxx" - -using ::rtl::OUString; -using ::rtl::OUStringBuffer; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; -using ::com::sun::star::container::XIndexAccess; -using ::com::sun::star::container::XNameAccess; -using ::com::sun::star::container::XNamed; -using ::com::sun::star::awt::FontDescriptor; -using ::com::sun::star::awt::XDevice; -using ::com::sun::star::awt::XFont2; -using ::com::sun::star::table::BorderLine; -using ::com::sun::star::table::TableBorder; -using ::com::sun::star::text::XText; -using ::com::sun::star::style::XStyle; -using ::oox::core::FilterBase; +#include "properties.hxx" namespace oox { namespace xls { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::style; +using namespace ::com::sun::star::table; +using namespace ::com::sun::star::text; +using namespace ::com::sun::star::uno; + +using ::oox::core::FilterBase; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +// ============================================================================ + namespace { // OOXML constants ------------------------------------------------------------ @@ -306,7 +301,7 @@ sal_Int32 lclReadRgbColor( BinaryInputStream& rStrm ) // ============================================================================ ExcelGraphicHelper::ExcelGraphicHelper( const WorkbookHelper& rHelper ) : - GraphicHelper( rHelper.getGlobalFactory(), rHelper.getBaseFilter().getTargetFrame(), rHelper.getBaseFilter().getStorage() ), + GraphicHelper( rHelper.getBaseFilter().getComponentContext(), rHelper.getBaseFilter().getTargetFrame(), rHelper.getBaseFilter().getStorage() ), WorkbookHelper( rHelper ) { } @@ -3444,4 +3439,3 @@ void StylesBuffer::writeStyleXfToPropertySet( PropertySet& rPropSet, sal_Int32 n } // namespace xls } // namespace oox - diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx index 5b7e9699d76b..a700d4a444f7 100644 --- a/oox/source/xls/workbookhelper.cxx +++ b/oox/source/xls/workbookhelper.cxx @@ -621,7 +621,7 @@ FilterBase& WorkbookHelper::getBaseFilter() const Reference< XMultiServiceFactory > WorkbookHelper::getGlobalFactory() const { - return mrBookData.getBaseFilter().getGlobalFactory(); + return mrBookData.getBaseFilter().getServiceFactory(); } FilterType WorkbookHelper::getFilterType() const diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx index 911689996b07..a645496b759a 100644 --- a/writerfilter/source/filter/ImportFilter.cxx +++ b/writerfilter/source/filter/ImportFilter.cxx @@ -73,8 +73,7 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes try { // use the oox.core.FilterDetect implementation to extract the decrypted ZIP package - uno::Reference< lang::XMultiServiceFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY_THROW ); - ::oox::core::FilterDetect aDetector( xFactory ); + ::oox::core::FilterDetect aDetector( m_xContext ); xInputStream = aDetector.extractUnencryptedPackage( aMediaDesc ); } catch( uno::Exception& ) -- cgit From e7d423b7c38b1970ae6ba918452e358ef50555ca Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Mon, 30 Aug 2010 16:10:01 +0200 Subject: dr77: change all exported services in oox module from MultiServiceFactory to ComponentContext --- sc/source/filter/excel/excdoc.cxx | 2 +- sc/source/filter/excel/excimp8.cxx | 6 +++--- sc/source/filter/excel/xestream.cxx | 15 ++++++++++----- sc/source/filter/inc/xestream.hxx | 3 ++- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index 2cf2d8f580c0..ec0fc0b60b6e 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -791,7 +791,7 @@ void ExcDocument::WriteXml( SvStream& rStrm ) { InitializeSave(); - XclExpXmlStream aStrm( ::comphelper::getProcessServiceFactory(), rStrm, GetRoot() ); + XclExpXmlStream aStrm( ::comphelper::getProcessComponentContext(), rStrm, GetRoot() ); sax_fastparser::FSHelperPtr& rWorkbook = aStrm.GetCurrentStream(); rWorkbook->startElement( XML_workbook, diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index a61008014ed2..e5d220f0ba4b 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -323,11 +323,11 @@ void ImportExcel8::AttachDocumentEvents() SfxObjectShell* pShell = GetDocShell(); if( HasBasic() && pShell ) { - uno::Reference< lang::XMultiServiceFactory > xGlobalFactory = ::comphelper::getProcessServiceFactory(); + uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); uno::Reference< sheet::XSpreadsheetDocument > xDocument( pShell->GetModel(), uno::UNO_QUERY ); - if( xGlobalFactory.is() && xDocument.is() ) + if( xContext.is() && xDocument.is() ) { - ::oox::xls::ExcelVbaProject aVbaProject( xGlobalFactory, xDocument ); + ::oox::xls::ExcelVbaProject aVbaProject( xContext, xDocument ); aVbaProject.attachToEvents(); } } diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index f828079c8735..4afd5f4ca722 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -46,6 +46,7 @@ #include "compiler.hxx" #include +#include #include #define DEBUG_XL_ENCRYPTION 0 @@ -56,14 +57,13 @@ using ::com::sun::star::io::XStream; using ::com::sun::star::lang::XComponent; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XServiceInfo; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::sheet::XSpreadsheetDocument; using ::rtl::OString; using ::rtl::OUString; using ::utl::OStreamWrapper; using ::std::vector; +using namespace ::com::sun::star::uno; using namespace formula; // ============================================================================ @@ -813,8 +813,8 @@ const char* XclXmlUtils::ToPsz( bool b ) // ============================================================================ -XclExpXmlStream::XclExpXmlStream( const Reference< XMultiServiceFactory >& rSMgr, SvStream& rStrm, const XclExpRoot& rRoot ) - : XmlFilterBase( rSMgr ) +XclExpXmlStream::XclExpXmlStream( const Reference< XComponentContext >& rxContext, SvStream& rStrm, const XclExpRoot& rRoot ) + : XmlFilterBase( rxContext ) , mrRoot( rRoot ) { Sequence< PropertyValue > aArgs( 1 ); @@ -1019,6 +1019,11 @@ bool XclExpXmlStream::exportDocument() throw() return false; } +::oox::ole::VbaProject* XclExpXmlStream::implCreateVbaProject() const +{ + return new ::oox::xls::ExcelVbaProject( getComponentContext(), Reference< XSpreadsheetDocument >( getModel(), UNO_QUERY ) ); +} + ::rtl::OUString XclExpXmlStream::implGetImplementationName() const { return CREATE_OUSTRING( "TODO" ); diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx index 3308827441dd..3f16fc602495 100644 --- a/sc/source/filter/inc/xestream.hxx +++ b/sc/source/filter/inc/xestream.hxx @@ -304,7 +304,7 @@ public: class XclExpXmlStream : public oox::core::XmlFilterBase { public: - XclExpXmlStream( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr, SvStream& rStrm, const XclExpRoot& rRoot ); + XclExpXmlStream( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, SvStream& rStrm, const XclExpRoot& rRoot ); virtual ~XclExpXmlStream(); /** Returns the filter root data. */ @@ -340,6 +340,7 @@ public: void Trace( const char* format, ...); private: + virtual ::oox::ole::VbaProject* implCreateVbaProject() const; virtual ::rtl::OUString implGetImplementationName() const; typedef std::map< ::rtl::OUString, -- cgit From 587d0274e4052ba6b71f798eb6c47a9fd2a3b3d0 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Mon, 30 Aug 2010 16:10:01 +0200 Subject: dr77: change all exported services in oox module from MultiServiceFactory to ComponentContext --- cppuhelper/inc/cppuhelper/factory.hxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cppuhelper/inc/cppuhelper/factory.hxx b/cppuhelper/inc/cppuhelper/factory.hxx index 1b733d7a9170..a2a9bd2c2a69 100644 --- a/cppuhelper/inc/cppuhelper/factory.hxx +++ b/cppuhelper/inc/cppuhelper/factory.hxx @@ -27,9 +27,7 @@ #ifndef _CPPUHELPER_FACTORY_HXX_ #define _CPPUHELPER_FACTORY_HXX_ -#ifndef _RTL_STRING_HXX_ #include -#endif #include #include @@ -54,7 +52,7 @@ typedef struct _uno_Environment uno_Environment; compiled it. If the environment is NOT session specific (needs no additional context), then this function should return the environment type name and leave ppEnv (to 0). - @paramppEnvTypeName environment type name; string must be constant + @param ppEnvTypeName environment type name; string must be constant @param ppEnv function returns its environment if the environment is session specific, i.e. has special context */ -- cgit From d6f27116f1cf8356382b3211fe8dbca4f52cd1be Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Mon, 30 Aug 2010 16:10:01 +0200 Subject: dr77: change all exported services in oox module from MultiServiceFactory to ComponentContext --- sax/source/tools/fshelper.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sax/source/tools/fshelper.cxx b/sax/source/tools/fshelper.cxx index 743f499fb4f0..6956e5b32bf3 100644 --- a/sax/source/tools/fshelper.cxx +++ b/sax/source/tools/fshelper.cxx @@ -12,8 +12,9 @@ namespace sax_fastparser { FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >& xOutputStream ) : mpSerializer(new FastSaxSerializer()) { - Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); - mxTokenHandler = Reference ( xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.FastTokenHandler") ) ), UNO_QUERY_THROW ); + Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext(), UNO_SET_THROW ); + Reference< lang::XMultiComponentFactory > xFactory( xContext->getServiceManager(), UNO_SET_THROW ); + mxTokenHandler.set( xFactory->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.FastTokenHandler") ), xContext ), UNO_QUERY_THROW ); mpSerializer->setFastTokenHandler( mxTokenHandler ); mpSerializer->setOutputStream( xOutputStream ); @@ -23,11 +24,7 @@ FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >& FastSerializerHelper::~FastSerializerHelper() { mpSerializer->endDocument(); - - if (mpSerializer) { - delete mpSerializer; - mpSerializer = NULL; - } + delete mpSerializer; } void FastSerializerHelper::startElement(const char* elementName, ...) -- cgit From 5ed97c42bc1b0825fb7195521f486438e97405ac Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 31 Aug 2010 13:57:19 +0200 Subject: dr77: rebase conflict --- vbahelper/source/vbahelper/vbaeventshelperbase.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx index 16a8671df601..59cb83cd7645 100755 --- a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx +++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx @@ -200,7 +200,7 @@ const VbaEventsHelperBase::EventHandlerInfo& VbaEventsHelperBase::getEventHandle append( sal_Unicode( '.' ) ).append( rInfo.maMacroName ).makeStringAndClear(); break; } - return resolveVBAMacro( mpShell, aMacroName ).ResolvedMacro(); + return resolveVBAMacro( mpShell, aMacroName ).msResolvedMacro; } void VbaEventsHelperBase::stopListening() -- cgit From 18df99d4dbb610e9300e146167127df491d2a4c1 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Thu, 2 Sep 2010 15:18:49 +0200 Subject: dr77: prepare creation of missing modules --- oox/inc/oox/xls/excelvbaproject.hxx | 14 --- oox/source/ole/vbaproject.cxx | 2 +- oox/source/xls/excelvbaproject.cxx | 210 ++++++------------------------------ oox/source/xls/makefile.mk | 1 + 4 files changed, 34 insertions(+), 193 deletions(-) diff --git a/oox/inc/oox/xls/excelvbaproject.hxx b/oox/inc/oox/xls/excelvbaproject.hxx index 490c1d6ad3a1..96dabd08b5d7 100755 --- a/oox/inc/oox/xls/excelvbaproject.hxx +++ b/oox/inc/oox/xls/excelvbaproject.hxx @@ -48,23 +48,9 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument >& rxDocument ); - /** Attaches all document and sheet events to existing VBA macros. */ - void attachToEvents(); - protected: /** Adds dummy modules for sheets without imported code name. */ virtual void prepareImport(); - /** Attaches document and sheet events to macros. */ - virtual void finalizeImport(); - -private: - /** Attaches VBA macros to all supported document events. */ - void attachToDocumentEvents( const ::rtl::OUString& rCodeName ); - - /** Attaches VBA macros to all supported sheet events. */ - void attachToSheetEvents( - const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventsSupplier >& rxEventsSupp, - const ::rtl::OUString& rCodeName ); private: ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument > diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index d7c2c759b47c..0136a223ff6a 100644 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -413,7 +413,7 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap VbaModuleMap aDummyModules; for( DummyModuleMap::iterator aIt = maDummyModules.begin(), aEnd = maDummyModules.end(); aIt != aEnd; ++aIt ) { - OSL_ENSURE( !aModules.has( aIt->first ) && !!aDummyModules.has( aIt->first ), "VbaProject::importVba - multiple modules with the same name" ); + OSL_ENSURE( !aModules.has( aIt->first ) && !aDummyModules.has( aIt->first ), "VbaProject::importVba - multiple modules with the same name" ); VbaModuleMap::mapped_type& rxModule = aDummyModules[ aIt->first ]; rxModule.reset( new VbaModule( mxDocModel, aIt->first, eTextEnc, bExecutable ) ); rxModule->setType( aIt->second ); diff --git a/oox/source/xls/excelvbaproject.cxx b/oox/source/xls/excelvbaproject.cxx index 8b072d282702..8061f1019d96 100755 --- a/oox/source/xls/excelvbaproject.cxx +++ b/oox/source/xls/excelvbaproject.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include "oox/helper/helper.hxx" @@ -48,6 +49,7 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::document; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::script; using namespace ::com::sun::star::sheet; using namespace ::com::sun::star::uno; @@ -62,66 +64,21 @@ ExcelVbaProject::ExcelVbaProject( const Reference< XComponentContext >& rxContex { } -void ExcelVbaProject::attachToEvents() -{ - // do nothing is code is not executable - if( !isImportVbaExecutable() ) - return; - - // document events - PropertySet aDocProp( mxDocument ); - OUString aCodeName; - aDocProp.getProperty( aCodeName, PROP_CodeName ); - attachToDocumentEvents( aCodeName ); - - // sheet events - if( mxDocument.is() ) try - { - Reference< XEnumerationAccess > xSheetsEA( mxDocument->getSheets(), UNO_QUERY_THROW ); - Reference< XEnumeration > xSheetsEnum( xSheetsEA->createEnumeration(), UNO_SET_THROW ); - // own try/catch for every sheet - while( xSheetsEnum->hasMoreElements() ) try - { - // TODO: once we have chart sheets we need a switch/case on sheet type - Reference< XEventsSupplier > xEventsSupp( xSheetsEnum->nextElement(), UNO_QUERY_THROW ); - PropertySet aSheetProp( xEventsSupp ); - aSheetProp.getProperty( aCodeName, PROP_CodeName ); - attachToSheetEvents( xEventsSupp, aCodeName ); - } - catch( Exception& ) - { - } - } - catch( Exception& ) - { - } -} - // protected ------------------------------------------------------------------ namespace { -typedef ::std::set< OUString > CodeNameSet; -typedef ::std::list< PropertySet > SheetPropertySetList; - -void lclGenerateMissingCodeNames( CodeNameSet& rUsedCodeNames, SheetPropertySetList& rSheetsWithout, const OUString& rCodeNamePrefix ) +struct SheetCodeNameInfo { - sal_Int32 nCounter = 1; - for( SheetPropertySetList::iterator aIt = rSheetsWithout.begin(), aEnd = rSheetsWithout.end(); aIt != aEnd; ++aIt ) - { - // search for an unused codename - OUString aCodeName; - do - { - aCodeName = OUStringBuffer( rCodeNamePrefix ).append( nCounter++ ).makeStringAndClear(); - } - while( rUsedCodeNames.count( aCodeName ) > 0 ); - rUsedCodeNames.insert( aCodeName ); + PropertySet maSheetProps; /// Property set of the sheet without codename. + OUString maPrefix; /// Prefix for the codename to be generated. - // set codename at sheet - aIt->setProperty( PROP_CodeName, aCodeName ); - } -} + inline explicit SheetCodeNameInfo( PropertySet& rSheetProps, const OUString& rPrefix ) : + maSheetProps( rSheetProps ), maPrefix( rPrefix ) {} +}; + +typedef ::std::set< OUString > CodeNameSet; +typedef ::std::list< SheetCodeNameInfo > SheetCodeNameInfoList; } // namespace @@ -134,8 +91,8 @@ void ExcelVbaProject::prepareImport() // collect existing codenames (do not use them when creating new codenames) CodeNameSet aUsedCodeNames; - // collect common sheets and chart sheets without codenames - SheetPropertySetList aSheetsWithout, aChartsWithout; + // collect sheets without codenames + SheetCodeNameInfoList aCodeNameInfos; // iterate over all imported sheets Reference< XEnumerationAccess > xSheetsEA( mxDocument->getSheets(), UNO_QUERY_THROW ); @@ -153,7 +110,7 @@ void ExcelVbaProject::prepareImport() else { // TODO: once we have chart sheets we need a switch/case on sheet type ('SheetNNN' vs. 'ChartNNN') - aSheetsWithout.push_back( aSheetProp ); + aCodeNameInfos.push_back( SheetCodeNameInfo( aSheetProp, CREATE_OUSTRING( "Sheet" ) ) ); } } catch( Exception& ) @@ -161,131 +118,28 @@ void ExcelVbaProject::prepareImport() } // create new codenames if sheets do not have one - lclGenerateMissingCodeNames( aUsedCodeNames, aSheetsWithout, CREATE_OUSTRING( "Sheet" ) ); - lclGenerateMissingCodeNames( aUsedCodeNames, aChartsWithout, CREATE_OUSTRING( "Chart" ) ); - } - catch( Exception& ) - { - } -} - -void ExcelVbaProject::finalizeImport() -{ - attachToEvents(); -} - -// private -------------------------------------------------------------------- - -void ExcelVbaProject::attachToDocumentEvents( const OUString& rCodeName ) -{ - if( (rCodeName.getLength() == 0) || !hasModule( rCodeName ) ) - return; - - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnLoad" ), rCodeName, CREATE_OUSTRING( "Workbook_Open" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnFocus" ), rCodeName, CREATE_OUSTRING( "Workbook_Activate" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnUnfocus" ), rCodeName, CREATE_OUSTRING( "Workbook_Deactivate" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnSave" ), rCodeName, CREATE_OUSTRING( "Workbook_BeforeSave" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO False, False" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnSaveAs" ), rCodeName, CREATE_OUSTRING( "Workbook_BeforeSave" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO True, False" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnSaveDone" ), rCodeName, CREATE_OUSTRING( "Workbook_AfterSave" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO True" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnSaveAsDone" ), rCodeName, CREATE_OUSTRING( "Workbook_AfterSave" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO True" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnSaveFailed" ), rCodeName, CREATE_OUSTRING( "Workbook_AfterSave" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO False" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnSaveAsFailed" ), rCodeName, CREATE_OUSTRING( "Workbook_AfterSave" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO False" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnPrint" ), rCodeName, CREATE_OUSTRING( "Workbook_BeforePrint" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO False" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnPrepareUnload" ), rCodeName, CREATE_OUSTRING( "Workbook_BeforeClose" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO False" ) ); -} - -void ExcelVbaProject::attachToSheetEvents( const Reference< XEventsSupplier >& rxEventsSupp, const OUString& rCodeName ) -{ - if( !rxEventsSupp.is() || (rCodeName.getLength() == 0) || !hasModule( rCodeName ) ) - return; - - // attach macros to simple sheet events directly - attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnFocus" ), rCodeName, CREATE_OUSTRING( "Worksheet_Activate" ) ); - attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnUnfocus" ), rCodeName, CREATE_OUSTRING( "Worksheet_Deactivate" ) ); - attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnCalculate" ), rCodeName, CREATE_OUSTRING( "Worksheet_Calculate" ) ); - - /* Attach macros to complex sheet events. The events pass a cell range or - a collection of cell ranges depending on the event type and sheet - selection. The generated proxy macros need to convert these UNO renges - to VBA compatible ranges. - */ - -#define VBA_MACRONAME_RANGECONV "Local_GetVbaRangeFromUnoRange" -#define VBA_MACRONAME_TARGETCONV "Local_GetVbaTargetFromUnoTarget" - - /* If this variable turns to true, the macros that convert UNO cell ranges - to VBA Range objects have to be inserted. - */ - bool bNeedsTargetHelper = false; - - /* Insert the proxy macros attached to sheet events that notify something - has changed (changed selection and changed cell contents). These events - cannot be cancelled. The proxy macro converts the passed UNO cell range - or collection of cell ranges to a VBA Range object, and calls the VBA - event handler. - */ - OUString aChangeProxyArgs = CREATE_OUSTRING( "ByVal unoTarget As Object" ); - OUString aChangeProxyCode = CREATE_OUSTRING( - "\tDim vbaTarget As Range : Set vbaTarget = " VBA_MACRONAME_TARGETCONV "( unoTarget )\n" - "\tIf Not vbaTarget Is Nothing Then $MACRO vbaTarget" ); - bNeedsTargetHelper |= attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnChange" ), rCodeName, CREATE_OUSTRING( "Worksheet_Change" ), aChangeProxyArgs, OUString(), aChangeProxyCode ); - bNeedsTargetHelper |= attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnSelect" ), rCodeName, CREATE_OUSTRING( "Worksheet_SelectionChange" ), aChangeProxyArgs, OUString(), aChangeProxyCode ); + sal_Int32 nCounter = 1; + for( SheetCodeNameInfoList::iterator aIt = aCodeNameInfos.begin(), aEnd = aCodeNameInfos.end(); aIt != aEnd; ++aIt ) + { + // search for an unused codename + OUString aCodeName; + do + { + aCodeName = OUStringBuffer( aIt->maPrefix ).append( nCounter++ ).makeStringAndClear(); + } + while( aUsedCodeNames.count( aCodeName ) > 0 ); + aUsedCodeNames.insert( aCodeName ); - /* Insert the proxy macros attached to sheet events that notify an ongoing - mouse click event (double click and right click). These events can be - cancelled by returning false (in VBA: as a Boolean output parameter, in - UNO: as return value of the Basic function). The proxy macro converts - the passed UNO cell range or collection of cell ranges to a VBA Range - object, calls the VBA event handler, and returns the Boolean value - provided by the VBA event handler. - */ - OUString aClickProxyArgs = CREATE_OUSTRING( "ByVal unoTarget As Object" ); - OUString aClickProxyRetT = CREATE_OUSTRING( "Boolean" ); - OUString aClickProxyCode = CREATE_OUSTRING( - "\tDim Cancel As Boolean : Cancel = False\n" - "\tDim vbaTarget As Range : Set vbaTarget = " VBA_MACRONAME_TARGETCONV "( unoTarget )\n" - "\tIf Not vbaTarget Is Nothing Then $MACRO vbaTarget, Cancel\n" - "\t$PROXY = Cancel" ); - bNeedsTargetHelper |= attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnDoubleClick" ), rCodeName, CREATE_OUSTRING( "Worksheet_BeforeDoubleClick" ), aClickProxyArgs, aClickProxyRetT, aClickProxyCode ); - bNeedsTargetHelper |= attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnRightClick" ), rCodeName, CREATE_OUSTRING( "Worksheet_BeforeRightClick" ), aClickProxyArgs, aClickProxyRetT, aClickProxyCode ); + // set codename at sheet + aIt->maSheetProps.setProperty( PROP_CodeName, aCodeName ); - if( bNeedsTargetHelper ) + // tell base class to create a dummy module + addDummyModule( aCodeName, ModuleType::DOCUMENT ); + } + } + catch( Exception& ) { - /* Generate a helper function that converts a - com.sun.star.sheet.SheetCellRange object to a VBA Range object. - */ - OUString aRangeConvName = CREATE_OUSTRING( VBA_MACRONAME_RANGECONV ); - OUString aRangeConvArgs = CREATE_OUSTRING( "ByVal unoRange As com.sun.star.sheet.SheetCellRange" ); - OUString aRangeConvRetT = CREATE_OUSTRING( "Range" ); - OUString aRangeConvCode = CREATE_OUSTRING( - "\tDim unoAddress As com.sun.star.table.CellRangeAddress : Set unoAddress = unoRange.RangeAddress\n" - "\tDim vbaSheet As Worksheet : Set vbaSheet = Application.ThisWorkbook.Sheets( unoAddress.Sheet + 1 )\n" - "\tSet $MACRO = vbaSheet.Range( vbaSheet.Cells( unoAddress.StartRow + 1, unoAddress.StartColumn + 1 ), vbaSheet.Cells( unoAddress.EndRow + 1, unoAddress.EndColumn + 1 ) )" ); - insertMacro( rCodeName, aRangeConvName, aRangeConvArgs, aRangeConvRetT, aRangeConvCode ); - - /* Generate a helper function that converts a generic range selection - object (com.sun.star.sheet.SheetCellRange or - com.sun.star.sheet.SheetCellRanges) to a VBA Range object. - */ - OUString aTargetConvName = CREATE_OUSTRING( VBA_MACRONAME_TARGETCONV ); - OUString aTargetConvArgs = CREATE_OUSTRING( "ByVal unoTarget As Object" ); - OUString aTargetConvRetT = CREATE_OUSTRING( "Range" ); - OUString aTargetConvCode = CREATE_OUSTRING( - "\tDim vbaTarget As Range\n" - "\tIf unoTarget.supportsService( \"com.sun.star.sheet.SheetCellRange\" ) Then\n" - "\t\tSet vbaTarget = " VBA_MACRONAME_RANGECONV "( unoTarget )\n" - "\tElseIf unoTarget.supportsService( \"com.sun.star.sheet.SheetCellRanges\" ) Then\n" - "\t\tDim unoRangeEnum As Object : Set unoRangeEnum = unoTarget.createEnumeration\n" - "\t\tIf unoRangeEnum.hasMoreElements Then Set vbaTarget = " VBA_MACRONAME_RANGECONV "( unoRangeEnum.nextElement )\n" - "\t\tWhile unoRangeEnum.hasMoreElements\n" - "\t\t\tSet vbaTarget = Application.Union( vbaTarget, " VBA_MACRONAME_RANGECONV "( unoRangeEnum.nextElement ) )\n" - "\t\tWend\n" - "\tEnd If\n" - "\tSet $MACRO = vbaTarget" ); - insertMacro( rCodeName, aTargetConvName, aTargetConvArgs, aTargetConvRetT, aTargetConvCode ); } -#undef VBA_MACRONAME_RANGECONV -#undef VBA_MACRONAME_TARGETCONV } // ============================================================================ diff --git a/oox/source/xls/makefile.mk b/oox/source/xls/makefile.mk index cdb2e18c262d..b5ede953bbfe 100644 --- a/oox/source/xls/makefile.mk +++ b/oox/source/xls/makefile.mk @@ -59,6 +59,7 @@ SLOFILES = \ $(SLO)$/excelchartconverter.obj \ $(SLO)$/excelfilter.obj \ $(SLO)$/excelhandlers.obj \ + $(SLO)$/excelvbaproject.obj \ $(SLO)$/externallinkbuffer.obj \ $(SLO)$/externallinkfragment.obj \ $(SLO)$/formulabase.obj \ -- cgit From 466d0a7883918db3d3d88a7d19fe333d34155b73 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Thu, 2 Sep 2010 15:18:49 +0200 Subject: dr77: prepare creation of missing modules --- sc/inc/document.hxx | 2 +- sc/source/core/data/document.cxx | 2 +- sc/source/filter/excel/xiroot.cxx | 4 +++- sc/source/ui/docshell/docfunc.cxx | 3 +-- sc/source/ui/unoobj/cellsuno.cxx | 3 +-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 5c4685223281..3b01edc59846 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -556,7 +556,7 @@ public: SC_DLLPUBLIC BOOL HasTable( SCTAB nTab ) const; SC_DLLPUBLIC BOOL GetName( SCTAB nTab, String& rName ) const; SC_DLLPUBLIC BOOL GetCodeName( SCTAB nTab, String& rName ) const; - SC_DLLPUBLIC BOOL SetCodeName( SCTAB nTab, String& rName ); + SC_DLLPUBLIC BOOL SetCodeName( SCTAB nTab, const String& rName ); SC_DLLPUBLIC BOOL GetTable( const String& rName, SCTAB& rTab ) const; SC_DLLPUBLIC inline SCTAB GetTableCount() const { return nMaxTableNumber; } SvNumberFormatterIndexTable* GetFormatExchangeList() const { return pFormatExchangeList; } diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 1efe32446eef..0025d05a997c 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -158,7 +158,7 @@ BOOL ScDocument::GetName( SCTAB nTab, String& rName ) const return FALSE; } -BOOL ScDocument::SetCodeName( SCTAB nTab, String& rName ) +BOOL ScDocument::SetCodeName( SCTAB nTab, const String& rName ) { if (VALIDTAB(nTab)) { diff --git a/sc/source/filter/excel/xiroot.cxx b/sc/source/filter/excel/xiroot.cxx index 5f8bcbd481e5..9f83dacf4ca0 100644 --- a/sc/source/filter/excel/xiroot.cxx +++ b/sc/source/filter/excel/xiroot.cxx @@ -107,7 +107,7 @@ void XclImpRoot::SetAppFontEncoding( rtl_TextEncoding eAppFontEnc ) SetTextEncoding( eAppFontEnc ); } -void XclImpRoot::InitializeTable( SCTAB /*nScTab*/ ) +void XclImpRoot::InitializeTable( SCTAB nScTab ) { if( GetBiff() <= EXC_BIFF4 ) { @@ -119,6 +119,8 @@ void XclImpRoot::InitializeTable( SCTAB /*nScTab*/ ) GetXFRangeBuffer().Initialize(); GetPageSettings().Initialize(); GetTabViewSettings().Initialize(); + // delete the automatically generated codename + GetDoc().SetCodeName( nScTab, String::EmptyString() ); } void XclImpRoot::FinalizeTable() diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 36b6641d94a6..27112d8c62c2 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -2650,8 +2650,7 @@ void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String uno::Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, uno::UNO_QUERY ); if ( xVBAModuleInfo.is() ) { - String sCodeName( genModuleName ); - rDoc.SetCodeName( nTab, sCodeName ); + rDoc.SetCodeName( nTab, genModuleName ); script::ModuleInfo sModuleInfo = lcl_InitModuleInfo( rDocSh, genModuleName ); xVBAModuleInfo->insertModuleInfo( genModuleName, sModuleInfo ); xLib->insertByName( genModuleName, aSourceAny ); diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index dea7cc056756..ffef1a914a29 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -8482,8 +8482,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn rtl::OUString aCodeName; if ( pDocSh && ( aValue >>= aCodeName ) ) { - String sNewName( aCodeName ); - pDocSh->GetDocument()->SetCodeName( GetTab_Impl(), sNewName ); + pDocSh->GetDocument()->SetCodeName( GetTab_Impl(), aCodeName ); } } else -- cgit From 21e510a52a8042e5e4d0ae44559eafcf6c885322 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Thu, 2 Sep 2010 16:21:45 +0200 Subject: dr77: reset index for every codename --- oox/source/xls/excelvbaproject.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oox/source/xls/excelvbaproject.cxx b/oox/source/xls/excelvbaproject.cxx index 8061f1019d96..c21a65b75961 100755 --- a/oox/source/xls/excelvbaproject.cxx +++ b/oox/source/xls/excelvbaproject.cxx @@ -118,10 +118,10 @@ void ExcelVbaProject::prepareImport() } // create new codenames if sheets do not have one - sal_Int32 nCounter = 1; for( SheetCodeNameInfoList::iterator aIt = aCodeNameInfos.begin(), aEnd = aCodeNameInfos.end(); aIt != aEnd; ++aIt ) { // search for an unused codename + sal_Int32 nCounter = 1; OUString aCodeName; do { -- cgit From a5a1dc6c3b3c3124a406c703027ca2b7fc68429b Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Thu, 2 Sep 2010 18:19:50 +0200 Subject: dr77: use vba import filter in oox --- sc/source/filter/excel/excimp8.cxx | 56 +++++++++++++++++++++++++++----------- sc/source/filter/excel/xistyle.cxx | 13 +++++++++ sc/source/filter/inc/xistyle.hxx | 3 ++ 3 files changed, 56 insertions(+), 16 deletions(-) diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index d75a0e669603..8041269f16de 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -30,10 +30,9 @@ #include "excimp8.hxx" -#include - #include #include +#include #include #include @@ -54,19 +53,17 @@ #include #include #include -#include -#include #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -102,10 +99,11 @@ #include #include -#include -#include +#include +#include using namespace com::sun::star; +using namespace ::comphelper; using ::rtl::OUString; @@ -232,18 +230,44 @@ void ImportExcel8::ReadBasic( void ) { SfxObjectShell* pShell = GetDocShell(); SotStorageRef xRootStrg = GetRootStorage(); - SvtFilterOptions* pFilterOpt = SvtFilterOptions::Get(); - if( pShell && xRootStrg.Is() && pFilterOpt ) + if( pShell && xRootStrg.Is() ) try { - bool bLoadCode = pFilterOpt->IsLoadExcelBasicCode(); - bool bLoadExecutable = pFilterOpt->IsLoadExcelBasicExecutable(); - bool bLoadStrg = pFilterOpt->IsLoadExcelBasicStorage(); - if( bLoadCode || bLoadStrg ) + uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext(), uno::UNO_SET_THROW ); + uno::Reference< lang::XMultiComponentFactory > xFactory( xContext->getServiceManager(), uno::UNO_SET_THROW ); + uno::Sequence< beans::NamedValue > aArgSeq( 1 ); + aArgSeq[ 0 ].Name = CREATE_OUSTRING( "ColorPalette" ); + aArgSeq[ 0 ].Value <<= GetPalette().CreateColorSequence(); + + uno::Sequence< uno::Any > aArgs( 2 ); + // framework calls filter objects with factory as first argument + aArgs[ 0 ] <<= getProcessServiceFactory(); + aArgs[ 1 ] <<= aArgSeq; + + uno::Reference< document::XImporter > xImporter( xFactory->createInstanceWithArgumentsAndContext( + CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelVbaProjectFilter" ), aArgs, xContext ), uno::UNO_QUERY_THROW ); + + uno::Reference< lang::XComponent > xComponent( pShell->GetModel(), uno::UNO_QUERY_THROW ); + xImporter->setTargetDocument( xComponent ); + + MediaDescriptor aMediaDesc; + SfxMedium& rMedium = GetMedium(); + SfxItemSet* pItemSet = rMedium.GetItemSet(); + if( pItemSet ) { - SvxImportMSVBasic aBasicImport( *pShell, *xRootStrg, bLoadCode, bLoadStrg ); - bool bAsComment = !bLoadExecutable; - aBasicImport.Import( EXC_STORAGE_VBA_PROJECT, EXC_STORAGE_VBA, bAsComment ); + if( const SfxStringItem* pItem = static_cast< const SfxStringItem* >( pItemSet->GetItem( SID_FILE_NAME ) ) ) + aMediaDesc[ MediaDescriptor::PROP_URL() ] <<= ::rtl::OUString( pItem->GetValue() ); + if( const SfxStringItem* pItem = static_cast< const SfxStringItem* >( pItemSet->GetItem( SID_PASSWORD ) ) ) + aMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= ::rtl::OUString( pItem->GetValue() ); } + aMediaDesc[ MediaDescriptor::PROP_INPUTSTREAM() ] <<= rMedium.GetInputStream(); + aMediaDesc[ MediaDescriptor::PROP_INTERACTIONHANDLER() ] <<= rMedium.GetInteractionHandler(); + + // call the filter + uno::Reference< document::XFilter > xFilter( xImporter, uno::UNO_QUERY_THROW ); + xFilter->filter( aMediaDesc.getAsConstPropertyValueList() ); + } + catch( uno::Exception& ) + { } } diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 1559ef5530f5..3045924a7807 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -88,6 +88,19 @@ ColorData XclImpPalette::GetColorData( sal_uInt16 nXclIndex ) const return GetDefColorData( nXclIndex ); } +::com::sun::star::uno::Sequence< sal_Int32 > XclImpPalette::CreateColorSequence() const +{ + sal_Int32 nCount = static_cast< sal_Int32 >( maColorTable.size() ); + ::com::sun::star::uno::Sequence< sal_Int32 > aSeq( nCount ); + if( nCount > 0 ) + { + sal_Int32* pnSeqColor = aSeq.getArray(); + for( ColorDataVec::const_iterator aIt = maColorTable.begin(), aEnd = maColorTable.end(); aIt != aEnd; ++aIt, ++pnSeqColor ) + *pnSeqColor = static_cast< sal_Int32 >( *aIt ); + } + return aSeq; +} + void XclImpPalette::ReadPalette( XclImpStream& rStrm ) { sal_uInt16 nCount; diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx index 104002542a17..80006f354b4b 100644 --- a/sc/source/filter/inc/xistyle.hxx +++ b/sc/source/filter/inc/xistyle.hxx @@ -64,6 +64,9 @@ public: @return The color from current or default palette or COL_AUTO, if nothing else found. */ inline Color GetColor( sal_uInt16 nXclIndex ) const { return Color( GetColorData( nXclIndex ) ); } + /** Returns the palette colors as UNO sequence. */ + ::com::sun::star::uno::Sequence< sal_Int32 > + CreateColorSequence() const; /** Reads a PALETTE record. */ void ReadPalette( XclImpStream& rStrm ); -- cgit From c87dc66c9911a72fe38c7dba9a6fff3123287fa9 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Thu, 2 Sep 2010 18:19:50 +0200 Subject: dr77: use vba import filter in oox --- oox/inc/oox/ole/vbaprojectfilter.hxx | 76 +++++++++++++++++++++++++ oox/inc/oox/xls/excelfilter.hxx | 15 +++++ oox/inc/oox/xls/stylesbuffer.hxx | 5 ++ oox/source/core/facreg.cxx | 4 ++ oox/source/ole/makefile.mk | 3 +- oox/source/ole/vbaprojectfilter.cxx | 106 +++++++++++++++++++++++++++++++++++ oox/source/xls/excelfilter.cxx | 61 ++++++++++++++++++++ oox/source/xls/stylesbuffer.cxx | 17 ++++++ 8 files changed, 286 insertions(+), 1 deletion(-) create mode 100755 oox/inc/oox/ole/vbaprojectfilter.hxx create mode 100755 oox/source/ole/vbaprojectfilter.cxx diff --git a/oox/inc/oox/ole/vbaprojectfilter.hxx b/oox/inc/oox/ole/vbaprojectfilter.hxx new file mode 100755 index 000000000000..c8a0a1b0ce74 --- /dev/null +++ b/oox/inc/oox/ole/vbaprojectfilter.hxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_OLE_VBAPROJECTFILTER_HXX +#define OOX_OLE_VBAPROJECTFILTER_HXX + +#include "oox/core/binaryfilterbase.hxx" + +namespace oox { +namespace ole { + +// ============================================================================ + +class VbaProjectFilterBase : public ::oox::core::BinaryFilterBase +{ +public: + explicit VbaProjectFilterBase( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, + const ::rtl::OUString& rAppName, + const ::rtl::OUString& rStorageName ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual bool importDocument() throw(); + virtual bool exportDocument() throw(); + +private: + virtual VbaProject* implCreateVbaProject() const; + +private: + ::rtl::OUString maAppName; + ::rtl::OUString maStorageName; +}; + +// ============================================================================ + +class WordVbaProjectFilter : public VbaProjectFilterBase +{ +public: + explicit WordVbaProjectFilter( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); + +private: + virtual ::rtl::OUString implGetImplementationName() const; +}; + +// ============================================================================ + +} // namespace ole +} // namespace oox + +#endif diff --git a/oox/inc/oox/xls/excelfilter.hxx b/oox/inc/oox/xls/excelfilter.hxx index 82550ccd34f0..2badfe5cba75 100644 --- a/oox/inc/oox/xls/excelfilter.hxx +++ b/oox/inc/oox/xls/excelfilter.hxx @@ -98,6 +98,21 @@ private: // ============================================================================ +class ExcelVbaProjectFilter : public ExcelBiffFilter +{ +public: + explicit ExcelVbaProjectFilter( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual bool importDocument() throw(); + virtual bool exportDocument() throw(); + +private: + virtual ::rtl::OUString implGetImplementationName() const; +}; + // ============================================================================ + } // namespace xls } // namespace oox diff --git a/oox/inc/oox/xls/stylesbuffer.hxx b/oox/inc/oox/xls/stylesbuffer.hxx index 4fa9c964108e..7b8986472dd6 100644 --- a/oox/inc/oox/xls/stylesbuffer.hxx +++ b/oox/inc/oox/xls/stylesbuffer.hxx @@ -145,6 +145,8 @@ public: void importPaletteColor( RecordInputStream& rStrm ); /** Imports the PALETTE record from the passed stream. */ void importPalette( BiffInputStream& rStrm ); + /** Imports a color palette from a UNO sequence in the passed any. */ + void importPalette( const ::com::sun::star::uno::Any& rPalette ); /** Rturns the RGB value of the color with the passed index. */ sal_Int32 getColor( sal_Int32 nPaletteIdx ) const; @@ -996,6 +998,9 @@ public: /** Imports the STYLE record from the passed stream. */ void importStyle( BiffInputStream& rStrm ); + /** Imports a color palette from a UNO sequence in the passed any. */ + void importPalette( const ::com::sun::star::uno::Any& rPalette ); + /** Final processing after import of all style settings. */ void finalizeImport(); diff --git a/oox/source/core/facreg.cxx b/oox/source/core/facreg.cxx index 99bdffa856f2..3ae1be13defa 100644 --- a/oox/source/core/facreg.cxx +++ b/oox/source/core/facreg.cxx @@ -41,12 +41,14 @@ extern Reference< XInterface > SAL_CALL className##_createInstance( namespace oox { namespace core { DECLARE_FUNCTIONS( FilterDetect ); } namespace docprop { DECLARE_FUNCTIONS( OOXMLDocPropImportImpl ); } + namespace ole { DECLARE_FUNCTIONS( WordVbaProjectFilter ); } namespace ppt { DECLARE_FUNCTIONS( PowerPointImport ); } namespace shape { DECLARE_FUNCTIONS( FastTokenHandlerService ); } namespace shape { DECLARE_FUNCTIONS( ShapeContextHandler ); } namespace xls { DECLARE_FUNCTIONS( BiffDetector ); } namespace xls { DECLARE_FUNCTIONS( ExcelFilter ); } namespace xls { DECLARE_FUNCTIONS( ExcelBiffFilter ); } + namespace xls { DECLARE_FUNCTIONS( ExcelVbaProjectFilter ); } namespace xls { DECLARE_FUNCTIONS( OOXMLFormulaParser ); } } @@ -63,12 +65,14 @@ static ::cppu::ImplementationEntry const spServices[] = { IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ), IMPLEMENTATION_ENTRY( ::oox::docprop::OOXMLDocPropImportImpl ), + IMPLEMENTATION_ENTRY( ::oox::ole::WordVbaProjectFilter ), IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ), IMPLEMENTATION_ENTRY( ::oox::shape::FastTokenHandlerService ), IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ), IMPLEMENTATION_ENTRY( ::oox::xls::BiffDetector ), IMPLEMENTATION_ENTRY( ::oox::xls::ExcelFilter ), IMPLEMENTATION_ENTRY( ::oox::xls::ExcelBiffFilter ), + IMPLEMENTATION_ENTRY( ::oox::xls::ExcelVbaProjectFilter ), IMPLEMENTATION_ENTRY( ::oox::xls::OOXMLFormulaParser ), { 0, 0, 0, 0, 0, 0 } }; diff --git a/oox/source/ole/makefile.mk b/oox/source/ole/makefile.mk index 4e01392d4a57..a5232247cfa5 100644 --- a/oox/source/ole/makefile.mk +++ b/oox/source/ole/makefile.mk @@ -51,7 +51,8 @@ SLOFILES = \ $(SLO)$/vbahelper.obj \ $(SLO)$/vbainputstream.obj \ $(SLO)$/vbamodule.obj \ - $(SLO)$/vbaproject.obj + $(SLO)$/vbaproject.obj \ + $(SLO)$/vbaprojectfilter.obj # --- Targets ------------------------------------------------------- diff --git a/oox/source/ole/vbaprojectfilter.cxx b/oox/source/ole/vbaprojectfilter.cxx new file mode 100755 index 000000000000..ee5b3bf7a715 --- /dev/null +++ b/oox/source/ole/vbaprojectfilter.cxx @@ -0,0 +1,106 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "oox/ole/vbaprojectfilter.hxx" + +#include "oox/ole/vbaproject.hxx" + +namespace oox { +namespace ole { + +// ============================================================================ + +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + +VbaProjectFilterBase::VbaProjectFilterBase( const Reference< XComponentContext >& rxContext, + const OUString& rAppName, const OUString& rStorageName ) throw( RuntimeException ) : + BinaryFilterBase( rxContext ), + maAppName( rAppName ), + maStorageName( rStorageName ) +{ +} + +bool VbaProjectFilterBase::importDocument() throw() +{ + StorageRef xVbaPrjStrg = openSubStorage( maStorageName, false ); + if( !xVbaPrjStrg || !xVbaPrjStrg->isStorage() ) + return false; + + getVbaProject().importVbaProject( *xVbaPrjStrg, getGraphicHelper() ); + return true; +} + +bool VbaProjectFilterBase::exportDocument() throw() +{ + return false; +} + +VbaProject* VbaProjectFilterBase::implCreateVbaProject() const +{ + return new VbaProject( getComponentContext(), getModel(), maAppName ); +} + +// ============================================================================ + +OUString SAL_CALL WordVbaProjectFilter_getImplementationName() throw() +{ + return CREATE_OUSTRING( "com.sun.star.comp.oox.WordVbaProjectFilter" ); +} + +Sequence< OUString > SAL_CALL WordVbaProjectFilter_getSupportedServiceNames() throw() +{ + Sequence< OUString > aSeq( 1 ); + aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" ); + return aSeq; +} + +Reference< XInterface > SAL_CALL WordVbaProjectFilter_createInstance( + const Reference< XComponentContext >& rxContext ) throw( Exception ) +{ + return static_cast< ::cppu::OWeakObject* >( new WordVbaProjectFilter( rxContext ) ); +} + +// ---------------------------------------------------------------------------- + +WordVbaProjectFilter::WordVbaProjectFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + VbaProjectFilterBase( rxContext, CREATE_OUSTRING( "Writer" ), CREATE_OUSTRING( "Macros" ) ) +{ +} + +OUString WordVbaProjectFilter::implGetImplementationName() const +{ + return WordVbaProjectFilter_getImplementationName(); +} + +// ============================================================================ + +} // namespace ole +} // namespace oox diff --git a/oox/source/xls/excelfilter.cxx b/oox/source/xls/excelfilter.cxx index ac182fd33ea3..e136c537c731 100644 --- a/oox/source/xls/excelfilter.cxx +++ b/oox/source/xls/excelfilter.cxx @@ -251,5 +251,66 @@ OUString ExcelBiffFilter::implGetImplementationName() const // ============================================================================ +OUString SAL_CALL ExcelVbaProjectFilter_getImplementationName() throw() +{ + return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelVbaProjectFilter" ); +} + +Sequence< OUString > SAL_CALL ExcelVbaProjectFilter_getSupportedServiceNames() throw() +{ + Sequence< OUString > aSeq( 1 ); + aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" ); + return aSeq; +} + +Reference< XInterface > SAL_CALL ExcelVbaProjectFilter_createInstance( + const Reference< XComponentContext >& rxContext ) throw( Exception ) +{ + return static_cast< ::cppu::OWeakObject* >( new ExcelVbaProjectFilter( rxContext ) ); +} + +// ---------------------------------------------------------------------------- + +ExcelVbaProjectFilter::ExcelVbaProjectFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + ExcelBiffFilter( rxContext ) +{ +} + +bool ExcelVbaProjectFilter::importDocument() throw() +{ + bool bRet = false; + + // detect BIFF version and workbook stream name + OUString aWorkbookName; + BiffType eBiff = BiffDetector::detectStorageBiffVersion( aWorkbookName, getStorage() ); + OSL_ENSURE( eBiff == BIFF8, "ExcelVbaProjectFilter::ExcelVbaProjectFilter - invalid file format" ); + if( eBiff != BIFF8 ) + return false; + + StorageRef xVbaPrjStrg = openSubStorage( CREATE_OUSTRING( "_VBA_PROJECT_CUR" ), false ); + if( !xVbaPrjStrg || !xVbaPrjStrg->isStorage() ) + return false; + + WorkbookHelperRoot aHelper( *this, eBiff ); + // set palette colors passed in service constructor + Any aPalette = getArgument( CREATE_OUSTRING( "ColorPalette" ) ); + aHelper.getStyles().importPalette( aPalette ); + // import the VBA project + getVbaProject().importVbaProject( *xVbaPrjStrg, getGraphicHelper() ); + return true; +} + +bool ExcelVbaProjectFilter::exportDocument() throw() +{ + return false; +} + +OUString ExcelVbaProjectFilter::implGetImplementationName() const +{ + return ExcelVbaProjectFilter_getImplementationName(); +} + +// ============================================================================ + } // namespace xls } // namespace oox diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx index 3511e0eefad9..34cb65546b6c 100644 --- a/oox/source/xls/stylesbuffer.cxx +++ b/oox/source/xls/stylesbuffer.cxx @@ -540,6 +540,18 @@ void ColorPalette::importPalette( BiffInputStream& rStrm ) } } +void ColorPalette::importPalette( const Any& rPalette ) +{ + Sequence< sal_Int32 > rColorSeq; + if( (rPalette >>= rColorSeq) && rColorSeq.hasElements() ) + { + const sal_Int32* pnColor = rColorSeq.getConstArray(); + const sal_Int32* pnColorEnd = pnColor + rColorSeq.getLength(); + for( ; pnColor < pnColorEnd; ++pnColor ) + appendColor( *pnColor & 0xFFFFFF ); + } +} + sal_Int32 ColorPalette::getColor( sal_Int32 nPaletteIdx ) const { sal_Int32 nColor = API_RGB_TRANSPARENT; @@ -3231,6 +3243,11 @@ void StylesBuffer::importStyle( BiffInputStream& rStrm ) maCellStyles.importStyle( rStrm ); } +void StylesBuffer::importPalette( const Any& rPalette ) +{ + maPalette.importPalette( rPalette ); +} + void StylesBuffer::finalizeImport() { // fonts first, are needed to finalize unit converter and XFs below -- cgit From 0347768811284f62ab5f885f689f3028a71fe48b Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 15 Sep 2010 10:00:35 +0200 Subject: jl160 #i114509# installation hangs when installing on nfs volume --- jvmfwk/source/elements.cxx | 93 ++++++++++++++++++++++++++++++++++++---------- jvmfwk/source/elements.hxx | 28 ++++++++++++++ 2 files changed, 102 insertions(+), 19 deletions(-) diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx index c4e44f7ac375..606929375915 100644 --- a/jvmfwk/source/elements.cxx +++ b/jvmfwk/source/elements.cxx @@ -51,16 +51,16 @@ using namespace osl; namespace jfw { -rtl::OString getElementUpdated() +rtl::OString getElement(::rtl::OString const & docPath, + xmlChar const * pathExpression, bool bThrowIfEmpty) { //Prepare the xml document and context - rtl::OString sSettingsPath = jfw::getVendorSettingsPath(); - OSL_ASSERT(sSettingsPath.getLength() > 0); - jfw::CXmlDocPtr doc(xmlParseFile(sSettingsPath.getStr())); + OSL_ASSERT(docPath.getLength() > 0); + jfw::CXmlDocPtr doc(xmlParseFile(docPath.getStr())); if (doc == NULL) throw FrameworkException( JFW_E_ERROR, - rtl::OString("[Java framework] Error in function getElementUpdated " + rtl::OString("[Java framework] Error in function getElement " "(elements.cxx)")); jfw::CXPathContextPtr context(xmlXPathNewContext(doc)); @@ -68,20 +68,42 @@ rtl::OString getElementUpdated() (xmlChar*) NS_JAVA_FRAMEWORK) == -1) throw FrameworkException( JFW_E_ERROR, - rtl::OString("[Java framework] Error in function getElementUpdated " + rtl::OString("[Java framework] Error in function getElement " "(elements.cxx)")); + CXPathObjectPtr pathObj; - pathObj = xmlXPathEvalExpression( - (xmlChar*)"/jf:javaSelection/jf:updated/text()", context); + pathObj = xmlXPathEvalExpression(pathExpression, context); + rtl::OString sValue; if (xmlXPathNodeSetIsEmpty(pathObj->nodesetval)) - throw FrameworkException( - JFW_E_ERROR, - rtl::OString("[Java framework] Error in function getElementUpdated " - "(elements.cxx)")); - rtl::OString sValue = (sal_Char*) pathObj->nodesetval->nodeTab[0]->content; + { + if (bThrowIfEmpty) + throw FrameworkException( + JFW_E_ERROR, + rtl::OString("[Java framework] Error in function getElement " + "(elements.cxx)")); + } + else + { + sValue = (sal_Char*) pathObj->nodesetval->nodeTab[0]->content; + } return sValue; } +rtl::OString getElementUpdated() +{ + return getElement(jfw::getVendorSettingsPath(), + (xmlChar*)"/jf:javaSelection/jf:updated/text()", true); +} + +// Use only in INSTALL mode !!! +rtl::OString getElementModified() +{ + //The modified element is only written in INSTALL mode. + //That is NodeJava::m_layer = INSTALL + return getElement(jfw::getInstallSettingsPath(), + (xmlChar*)"/jf:java/jf:modified/text()", false); +} + void createSettingsStructure(xmlDoc * document, bool * bNeedsSave) { @@ -579,6 +601,21 @@ void NodeJava::write() const xmlAddChild(jreLocationsNode, nodeCrLf); } } + + if (INSTALL == m_layer) + { + //now write the current system time + ::TimeValue curTime = {0,0}; + if (::osl_getSystemTime(& curTime)) + { + rtl::OUString sSeconds = + rtl::OUString::valueOf((sal_Int64) curTime.Seconds); + xmlNewTextChild( + root,NULL, (xmlChar*) "modified", CXmlCharPtr(sSeconds)); + xmlNode * nodeCrLf = xmlNewText((xmlChar*) "\n"); + xmlAddChild(root, nodeCrLf); + } + } if (xmlSaveFormatFile(sSettingsPath.getStr(), docUser, 1) == -1) throw FrameworkException(JFW_E_ERROR, sExcMsg); } @@ -721,7 +758,7 @@ jfw::FileStatus NodeJava::checkSettingsFileStatus() const File::RC rc_stat = item.getFileStatus(stat); if (File::E_None == rc_stat) { - //ToDo we remove the file and create it shortly after. This + // This //function may be called multiple times when a java is started. //If the expiretime is too small then we may loop because everytime //the file is deleted and we need to search for a java again. @@ -732,20 +769,27 @@ jfw::FileStatus NodeJava::checkSettingsFileStatus() const //that after removing the file and shortly later creating it again //did not change the creation time. That is the newly created file //had the creation time of the former file. -// ::TimeValue time = stat.getCreationTime(); - ::TimeValue modTime = stat.getModifyTime(); + // ::TimeValue modTime = stat.getModifyTime(); ::TimeValue curTime = {0,0}; + ret = FILE_OK; if (sal_True == ::osl_getSystemTime(& curTime)) { - if ( curTime.Seconds - modTime.Seconds > + //get the modified time recorded in the element + sal_uInt32 modified = getModifiedTime(); + OSL_ASSERT(modified <= curTime.Seconds); + //Only if modified has a valued then NodeJava::write was called, + //then the xml structure was filled with data. + + if ( modified && curTime.Seconds - modified > BootParams::getInstallDataExpiration()) { #if OSL_DEBUG_LEVEL >=2 + fprintf(stderr, "[Java framework] Settings file is %d seconds old. \n", + (int)( curTime.Seconds - modified)); rtl::OString s = rtl::OUStringToOString(sURL, osl_getThreadTextEncoding()); - fprintf(stderr, "[Java framework] Deleting settings file at \n%s\n", s.getStr()); + fprintf(stderr, "[Java framework] Settings file is exspired. Deleting settings file at \n%s\n", s.getStr()); #endif //delete file -// File::RC rc_rem = File::remove(sURL); File f(sURL); if (File::E_None == f.open(OpenFlag_Write | OpenFlag_Read) && File::E_None == f.setPos(0, 0) @@ -1083,6 +1127,17 @@ JavaInfo * CNodeJavaInfo::makeJavaInfo() const return pInfo; } +sal_uInt32 NodeJava::getModifiedTime() const +{ + sal_uInt32 ret = 0; + if (m_layer != INSTALL) + { + OSL_ASSERT(0); + return ret; + } + rtl::OString modTimeSeconds = getElementModified(); + return (sal_uInt32) modTimeSeconds.toInt64(); +} //================================================================================ MergedSettings::MergedSettings(): diff --git a/jvmfwk/source/elements.hxx b/jvmfwk/source/elements.hxx index a4ca1a83fc3d..ec0e06dc5bab 100644 --- a/jvmfwk/source/elements.hxx +++ b/jvmfwk/source/elements.hxx @@ -195,6 +195,34 @@ private: */ boost::optional< ::std::vector< ::rtl::OUString> > m_JRELocations; + /** Only in INSTALL mode. Then NodeJava.write writes a element + which contains the seconds value of the TimeValue (osl/time.h), obtained + with osl_getSystemTime. + It returns 0 if the value cannot be obtained. + This is used to fix the problem that the modified time of the settings + file is incorrect because it resides on an NFS volume where the NFS + server and NFS client do not have the same system time. For example if + the server time is ahead of the client time then checkSettingsFileStatus + deleted the settings. So even if javaldx determined a Java + (jfw_findAndSelectJRE) then jfw_startVM returned a JFW_E_NO_SELECT. Then + it looked again for a java by calling jfw_findAndSelectJRE, which + returned a JFW_E_NONE. But the following jfw_startVM returned again + JFW_E_NO_SELECT. So it looped. (see issue i114509) + + NFS server and NFS client should have the same time. It is common + practise to enforce this in networks. We actually should not work + around a malconfigured network. We must however, make sure that we do + not loop. Maybe a better approach is, that: + - assume that mtime and system time are reliable + - checkSettingsFile uses system time and mtime of the settings file, + instset of using getModifiedTime. + - allow a small error margin + - jfw_startVM must return a JFW_E_EXPIRED_SETTINGS + - XJavaVM::startVM should prevent the loop by processing the new return+ value + + */ + sal_uInt32 getModifiedTime() const; + public: NodeJava(Layer theLayer = USER_OR_INSTALL); -- cgit From 77e72565aabe0a33b8a57faa6ccd687bdd68df40 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 22 Sep 2010 12:39:48 +0200 Subject: impressdefaults1: #i111998# changing defaults according to ux findings --- sd/source/core/glob.src | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sd/source/core/glob.src b/sd/source/core/glob.src index f1c7058ddf79..3bceed7e904d 100755 --- a/sd/source/core/glob.src +++ b/sd/source/core/glob.src @@ -122,23 +122,23 @@ String STR_PRESOBJ_MPNOTESTITLE }; String STR_PRESOBJ_MPNOTESTEXT { - Text [ en-US ] = "Click to edit the notes format" ; + Text [ en-US ] = "Double-click to edit the notes format" ; }; String STR_PRESOBJ_TITLE { - Text [ en-US ] = "Click to add title" ; + Text [ en-US ] = "Double-click to add title" ; }; String STR_PRESOBJ_OUTLINE { - Text [ en-US ] = "Click to add text" ; + Text [ en-US ] = "Double-click to add text" ; }; String STR_PRESOBJ_TEXT { - Text [ en-US ] = "Click to add text" ; + Text [ en-US ] = "Double-click to add text" ; }; String STR_PRESOBJ_NOTESTEXT { - Text [ en-US ] = "Click to add notes" ; + Text [ en-US ] = "Double-click to add notes" ; }; String STR_PRESOBJ_GRAPHIC { -- cgit From 481824ea28e910f59f2e28e8fcbc81ea0230f2eb Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 22 Sep 2010 12:39:48 +0200 Subject: impressdefaults1: #i111998# changing defaults according to ux findings --- .../schema/org/openoffice/Office/Impress.xcs | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs index 8317e3e0082d..fbc73641d086 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs @@ -331,7 +331,7 @@ Indicates whether moving while holding the Control key makes a copy of the moved object. - false + true @@ -371,7 +371,7 @@ Indicates whether a double-click on an object activates the rotation mode. - false + true @@ -426,7 +426,7 @@ Indicates whether to show big (true) or small (false) handles. - false + true @@ -549,7 +549,7 @@ Indicates whether a simple click on a text object changes it to edit mode. - true + false @@ -679,7 +679,7 @@ Indicates whether to snap at snap lines. - false + true @@ -699,7 +699,7 @@ Indicates whether to justify the outline of an object to that of an adjacent object. - false + true @@ -871,7 +871,7 @@ Defines the horizontal distance between adjacent grid points in 1/100 mm, used when the metric system is active. @@ -895,7 +895,7 @@ Defines the vertical distance between adjacent grid points in 1/100 mm, used when the metric system is active. - 1000 + 2000 @@ -919,7 +919,7 @@ Specifies the number of points between two adjacent grid points on the X axis. - 1 + 9 @@ -930,7 +930,7 @@ Specifies the number of intervals between two adjacent grid points on the Y axis - 1 + 9 @@ -961,7 +961,7 @@ Defines the horizontal distance between adjacent points of the snap grid in 1/100 mm, used when the metric system is selected. @@ -985,7 +985,7 @@ Defines the vertical distance between adjacent points of the snap grid in 1/100 mm, used when the metric system is selected. - 1000 + 100 -- cgit From d8cba2db6ae4a6a073621215515aec6f0c4fc606 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 22 Sep 2010 15:16:26 +0200 Subject: impressdefaults1: #i112000# changing snap toggle modify key from mod1 to mod2 --- sd/source/ui/func/fudraw.cxx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 5cc3cc49ca88..4d03abd7b8bc 100755 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -163,40 +163,40 @@ BOOL FuDraw::MouseButtonDown(const MouseEvent& rMEvt) if (!mpView->IsSnapEnabled()) mpView->SetSnapEnabled(TRUE); - BOOL bCntrl = rMEvt.IsMod1(); + BOOL bSnapModPressed = rMEvt.IsMod1(); BOOL bGridSnap = pFrameView->IsGridSnap(); - bGridSnap = (bCntrl != bGridSnap); + bGridSnap = (bSnapModPressed != bGridSnap); if (mpView->IsGridSnap() != bGridSnap) mpView->SetGridSnap(bGridSnap); BOOL bBordSnap = pFrameView->IsBordSnap(); - bBordSnap = (bCntrl != bBordSnap); + bBordSnap = (bSnapModPressed != bBordSnap); if (mpView->IsBordSnap() != bBordSnap) mpView->SetBordSnap(bBordSnap); BOOL bHlplSnap = pFrameView->IsHlplSnap(); - bHlplSnap = (bCntrl != bHlplSnap); + bHlplSnap = (bSnapModPressed != bHlplSnap); if (mpView->IsHlplSnap() != bHlplSnap) mpView->SetHlplSnap(bHlplSnap); BOOL bOFrmSnap = pFrameView->IsOFrmSnap(); - bOFrmSnap = (bCntrl != bOFrmSnap); + bOFrmSnap = (bSnapModPressed != bOFrmSnap); if (mpView->IsOFrmSnap() != bOFrmSnap) mpView->SetOFrmSnap(bOFrmSnap); BOOL bOPntSnap = pFrameView->IsOPntSnap(); - bOPntSnap = (bCntrl != bOPntSnap); + bOPntSnap = (bSnapModPressed != bOPntSnap); if (mpView->IsOPntSnap() != bOPntSnap) mpView->SetOPntSnap(bOPntSnap); BOOL bOConSnap = pFrameView->IsOConSnap(); - bOConSnap = (bCntrl != bOConSnap); + bOConSnap = (bSnapModPressed != bOConSnap); if (mpView->IsOConSnap() != bOConSnap) mpView->SetOConSnap(bOConSnap); @@ -229,7 +229,7 @@ BOOL FuDraw::MouseButtonDown(const MouseEvent& rMEvt) if ( bHelpLine && !mpView->IsCreateObj() - && ((mpView->GetEditMode() == SDREDITMODE_EDIT && !bHitHdl) || (rMEvt.IsShift() && bCntrl)) ) + && ((mpView->GetEditMode() == SDREDITMODE_EDIT && !bHitHdl) || (rMEvt.IsShift() && bSnapModPressed)) ) { mpWindow->CaptureMouse(); mpView->BegDragHelpLine(nHelpLine, pPV); @@ -285,41 +285,41 @@ BOOL FuDraw::MouseMove(const MouseEvent& rMEvt) bOrtho = rMEvt.IsShift() != pFrameView->IsOrtho(); } - BOOL bCntrl = rMEvt.IsMod1(); + BOOL bSnapModPressed = rMEvt.IsMod2(); mpView->SetDragWithCopy(rMEvt.IsMod1() && pFrameView->IsDragWithCopy()); BOOL bGridSnap = pFrameView->IsGridSnap(); - bGridSnap = (bCntrl != bGridSnap); + bGridSnap = (bSnapModPressed != bGridSnap); if (mpView->IsGridSnap() != bGridSnap) mpView->SetGridSnap(bGridSnap); BOOL bBordSnap = pFrameView->IsBordSnap(); - bBordSnap = (bCntrl != bBordSnap); + bBordSnap = (bSnapModPressed != bBordSnap); if (mpView->IsBordSnap() != bBordSnap) mpView->SetBordSnap(bBordSnap); BOOL bHlplSnap = pFrameView->IsHlplSnap(); - bHlplSnap = (bCntrl != bHlplSnap); + bHlplSnap = (bSnapModPressed != bHlplSnap); if (mpView->IsHlplSnap() != bHlplSnap) mpView->SetHlplSnap(bHlplSnap); BOOL bOFrmSnap = pFrameView->IsOFrmSnap(); - bOFrmSnap = (bCntrl != bOFrmSnap); + bOFrmSnap = (bSnapModPressed != bOFrmSnap); if (mpView->IsOFrmSnap() != bOFrmSnap) mpView->SetOFrmSnap(bOFrmSnap); BOOL bOPntSnap = pFrameView->IsOPntSnap(); - bOPntSnap = (bCntrl != bOPntSnap); + bOPntSnap = (bSnapModPressed != bOPntSnap); if (mpView->IsOPntSnap() != bOPntSnap) mpView->SetOPntSnap(bOPntSnap); BOOL bOConSnap = pFrameView->IsOConSnap(); - bOConSnap = (bCntrl != bOConSnap); + bOConSnap = (bSnapModPressed != bOConSnap); if (mpView->IsOConSnap() != bOConSnap) mpView->SetOConSnap(bOConSnap); -- cgit From 4301e7117ecd4cce62483cd17b81c1ebdacce072 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 22 Sep 2010 17:52:19 +0200 Subject: impressdefaults1: #i112004# toggle rotation mode --- sd/source/ui/func/fusel.cxx | 3 +++ sd/source/ui/view/drviewse.cxx | 10 ++++++++++ 2 files changed, 13 insertions(+) mode change 100644 => 100755 sd/source/ui/func/fusel.cxx diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx old mode 100644 new mode 100755 index 2ddf6a5fb885..332f9971c611 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -436,6 +436,9 @@ BOOL FuSelection::MouseButtonDown(const MouseEvent& rMEvt) mpView->BegMarkObj(aMDPos); } } + + if( bMarked && (nSlotId == SID_OBJECT_ROTATE) && !rMEvt.IsShift() ) + mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SYNCHRON); } } } diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 6f6f49fdc93c..020f95b5af89 100755 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -329,6 +329,16 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) { short nSlotId = rReq.GetSlot(); + if( nSlotId == SID_OBJECT_ROTATE ) + { + // togle rotation + if( nOldSId == nSlotId ) + { + nSlotId = SID_OBJECT_SELECT; + rReq.SetSlot( nSlotId ); + } + } + if (nSlotId == SID_OBJECT_CROOK_ROTATE || nSlotId == SID_OBJECT_CROOK_SLANT || nSlotId == SID_OBJECT_CROOK_STRETCH) -- cgit From ee656c5f7002bd50f8915372a9cb4591c70a6c14 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 23 Sep 2010 13:28:01 +0200 Subject: impressdefaults1: #i112006# changing defaults for a finer grid in impress/draw --- officecfg/registry/schema/org/openoffice/Office/Draw.xcs | 4 ++-- officecfg/registry/schema/org/openoffice/Office/Impress.xcs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs index e133b7a5a957..7a6c649474ee 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs @@ -824,7 +824,7 @@ Specifies the number of points between two grid points on the X axis. - 1 + 9 @@ -836,7 +836,7 @@ Specifies the number of points between two grid points on the Y axis. - 1 + 9 diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs index fbc73641d086..afcee251e91a 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs @@ -878,7 +878,7 @@ Defines the horizontal distance between adjacent grid points in 1/100 mm, used when the non-metric system is active. @@ -902,7 +902,7 @@ Defines the vertical distance between adjacent grid points in 1/100 mm, used when the non-metric system is active. -- cgit From 6e07e2bc6c242ccd5899194b86d3d521ae208ace Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 23 Sep 2010 15:20:37 +0200 Subject: impressdefaults1: #i113957# enable full width by default for 'Default' style and 'Background Objects' style --- sd/source/core/drawdoc4.cxx | 1 + sd/source/core/stlpool.cxx | 1 + 2 files changed, 2 insertions(+) diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 89f74de30494..96ced9f7a55e 100755 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -181,6 +181,7 @@ void SdDrawDocument::CreateLayoutTemplates() rISet.Put(XLineEndWidthItem(300)); rISet.Put(XLineStartCenterItem()); rISet.Put(XLineEndCenterItem()); + rISet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK)); // Fuellattribute (Extended OutputDevice) rISet.Put(XFillStyleItem(XFILL_SOLID)); diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 138863cc313a..071b0d04911d 100755 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -522,6 +522,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo rBackgroundObjectsSet.Put(SdrShadowYDistItem(300)); // #i16874# enable kerning by default but only for new documents rBackgroundObjectsSet.Put( SvxAutoKernItem( TRUE, EE_CHAR_PAIRKERNING ) ); + rBackgroundObjectsSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK)); } /************************************************************************** -- cgit From 5876446a3676757726faab0698a9d5bd146355f0 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 28 Sep 2010 20:04:20 +0200 Subject: dr77: dump hyperlinks from document summary stream, corrected filter name --- sc/source/filter/excel/excel.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx index 3a43a23cd624..380a81123f12 100644 --- a/sc/source/filter/excel/excel.cxx +++ b/sc/source/filter/excel/excel.cxx @@ -92,7 +92,7 @@ FltError ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument aArgs[ 0 ] <<= getProcessServiceFactory(); aArgs[ 1 ] <<= aArgSeq; uno::Reference< document::XImporter > xImporter( ScfApiHelper::CreateInstanceWithArgs( - CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelBiffFilter" ), aArgs ), uno::UNO_QUERY_THROW ); + CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelBiffFilter" ), aArgs ), uno::UNO_QUERY_THROW ); xImporter->setTargetDocument( xComponent ); MediaDescriptor aMediaDesc; -- cgit From d85bdb1f436b345efd632992150a4915e00e1227 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 28 Sep 2010 20:04:20 +0200 Subject: dr77: dump hyperlinks from document summary stream, corrected filter name --- oox/inc/oox/dump/oledumper.hxx | 12 ++-- oox/source/dump/oledumper.cxx | 139 +++++++++++++++++++++++++++-------------- 2 files changed, 101 insertions(+), 50 deletions(-) diff --git a/oox/inc/oox/dump/oledumper.hxx b/oox/inc/oox/dump/oledumper.hxx index a0e9cd55e337..8f706f4c40f1 100644 --- a/oox/inc/oox/dump/oledumper.hxx +++ b/oox/inc/oox/dump/oledumper.hxx @@ -141,15 +141,19 @@ private: void dumpCodePageProperty( sal_uInt32 nStartPos ); void dumpDictionaryProperty( sal_uInt32 nStartPos ); - void dumpPropertyContents( sal_Int32 nPropId ); - void dumpPropertyValue( sal_Int32 nPropId, sal_Int32 nBaseType ); + sal_uInt16 dumpPropertyContents( sal_Int32 nPropId ); + void dumpPropertyValue( sal_Int32 nPropId, sal_uInt16 nBaseType ); + void dumpPropertyVector( sal_Int32 nPropId, sal_uInt16 nBaseType ); + void dumpPropertyArray( sal_Int32 nPropId, sal_uInt16 nBaseType ); - sal_Int32 dumpPropertyType(); - void dumpBlob( const String& rName ); + sal_uInt16 dumpPropertyType(); + void dumpBlob( sal_Int32 nPropId, const String& rName ); ::rtl::OUString dumpString8( const String& rName ); ::rtl::OUString dumpCharArray8( const String& rName, sal_Int32 nLen ); ::rtl::OUString dumpString16( const String& rName ); ::rtl::OUString dumpCharArray16( const String& rName, sal_Int32 nLen ); + bool dumpTypedProperty( const String& rName, sal_uInt16 nExpectedType ); + void dumpHlinks( sal_Int32 nSize ); bool startElement( sal_uInt32 nStartPos ); void writeSectionHeader( const ::rtl::OUString& rGuid, sal_uInt32 nStartPos ); diff --git a/oox/source/dump/oledumper.cxx b/oox/source/dump/oledumper.cxx index eb7abef6c29d..bd2a0e05ecce 100644 --- a/oox/source/dump/oledumper.cxx +++ b/oox/source/dump/oledumper.cxx @@ -305,28 +305,32 @@ namespace { const sal_Int32 OLEPROP_ID_DICTIONARY = 0; const sal_Int32 OLEPROP_ID_CODEPAGE = 1; -const sal_Int32 OLEPROP_TYPE_INT16 = 2; -const sal_Int32 OLEPROP_TYPE_INT32 = 3; -const sal_Int32 OLEPROP_TYPE_FLOAT = 4; -const sal_Int32 OLEPROP_TYPE_DOUBLE = 5; -const sal_Int32 OLEPROP_TYPE_DATE = 7; -const sal_Int32 OLEPROP_TYPE_STRING = 8; -const sal_Int32 OLEPROP_TYPE_STATUS = 10; -const sal_Int32 OLEPROP_TYPE_BOOL = 11; -const sal_Int32 OLEPROP_TYPE_VARIANT = 12; -const sal_Int32 OLEPROP_TYPE_INT8 = 16; -const sal_Int32 OLEPROP_TYPE_UINT8 = 17; -const sal_Int32 OLEPROP_TYPE_UINT16 = 18; -const sal_Int32 OLEPROP_TYPE_UINT32 = 19; -const sal_Int32 OLEPROP_TYPE_INT64 = 20; -const sal_Int32 OLEPROP_TYPE_UINT64 = 21; -const sal_Int32 OLEPROP_TYPE_STRING8 = 30; -const sal_Int32 OLEPROP_TYPE_STRING16 = 31; -const sal_Int32 OLEPROP_TYPE_FILETIME = 64; -const sal_Int32 OLEPROP_TYPE_BLOB = 65; -const sal_Int32 OLEPROP_TYPE_STREAM = 66; -const sal_Int32 OLEPROP_TYPE_STORAGE = 67; -const sal_Int32 OLEPROP_TYPE_CLIPFMT = 71; +const sal_uInt16 OLEPROP_TYPE_INT16 = 2; +const sal_uInt16 OLEPROP_TYPE_INT32 = 3; +const sal_uInt16 OLEPROP_TYPE_FLOAT = 4; +const sal_uInt16 OLEPROP_TYPE_DOUBLE = 5; +const sal_uInt16 OLEPROP_TYPE_DATE = 7; +const sal_uInt16 OLEPROP_TYPE_STRING = 8; +const sal_uInt16 OLEPROP_TYPE_STATUS = 10; +const sal_uInt16 OLEPROP_TYPE_BOOL = 11; +const sal_uInt16 OLEPROP_TYPE_VARIANT = 12; +const sal_uInt16 OLEPROP_TYPE_INT8 = 16; +const sal_uInt16 OLEPROP_TYPE_UINT8 = 17; +const sal_uInt16 OLEPROP_TYPE_UINT16 = 18; +const sal_uInt16 OLEPROP_TYPE_UINT32 = 19; +const sal_uInt16 OLEPROP_TYPE_INT64 = 20; +const sal_uInt16 OLEPROP_TYPE_UINT64 = 21; +const sal_uInt16 OLEPROP_TYPE_STRING8 = 30; +const sal_uInt16 OLEPROP_TYPE_STRING16 = 31; +const sal_uInt16 OLEPROP_TYPE_FILETIME = 64; +const sal_uInt16 OLEPROP_TYPE_BLOB = 65; +const sal_uInt16 OLEPROP_TYPE_STREAM = 66; +const sal_uInt16 OLEPROP_TYPE_STORAGE = 67; +const sal_uInt16 OLEPROP_TYPE_CLIPFMT = 71; + +const sal_uInt16 OLEPROP_TYPE_SIMPLE = 0x0000; +const sal_uInt16 OLEPROP_TYPE_VECTOR = 0x1000; +const sal_uInt16 OLEPROP_TYPE_ARRAY = 0x2000; const sal_uInt16 CODEPAGE_UNICODE = 1200; @@ -461,7 +465,7 @@ void OlePropertyStreamObject::dumpCodePageProperty( sal_uInt32 nStartPos ) IndentGuard aIndGuard( mxOut ); if( startElement( nStartPos ) ) { - sal_Int32 nType = dumpPropertyType(); + sal_uInt16 nType = dumpPropertyType(); if( nType == OLEPROP_TYPE_INT16 ) { sal_uInt16 nCodePage = dumpDec< sal_uInt16 >( "codepage", "CODEPAGES" ); @@ -496,28 +500,21 @@ void OlePropertyStreamObject::dumpDictionaryProperty( sal_uInt32 nStartPos ) mxOut->emptyLine(); } -void OlePropertyStreamObject::dumpPropertyContents( sal_Int32 nPropId ) +sal_uInt16 OlePropertyStreamObject::dumpPropertyContents( sal_Int32 nPropId ) { - sal_Int32 nType = dumpPropertyType(); - if( getFlag< sal_Int32 >( nType, 0x1000 ) ) // vector + sal_uInt16 nType = dumpPropertyType(); + sal_uInt16 nBaseType = static_cast< sal_uInt16 >( nType & 0x0FFF ); + sal_uInt16 nArrayType = static_cast< sal_uInt16 >( nType & 0xF000 ); + switch( nArrayType ) { - sal_Int32 nBaseType = nType & 0x0FFF; - sal_Int32 nElemCount = dumpDec< sal_Int32 >( "element-count" ); - for( sal_Int32 nElemIdx = 0; !mxStrm->isEof() && (nElemIdx < nElemCount); ++nElemIdx ) - { - mxOut->resetItemIndex( nElemIdx ); - writeEmptyItem( "#element" ); - IndentGuard aIndGuard( mxOut ); - dumpPropertyValue( nPropId, nBaseType ); - } - } - else if( !getFlag< sal_Int32 >( nType, 0x7000 ) ) - { - dumpPropertyValue( nPropId, nType ); + case OLEPROP_TYPE_SIMPLE: dumpPropertyValue( nPropId, nBaseType ); break; + case OLEPROP_TYPE_VECTOR: dumpPropertyVector( nPropId, nBaseType ); break; + case OLEPROP_TYPE_ARRAY: dumpPropertyArray( nPropId, nBaseType ); break; } + return nType; } -void OlePropertyStreamObject::dumpPropertyValue( sal_Int32 nPropId, sal_Int32 nBaseType ) +void OlePropertyStreamObject::dumpPropertyValue( sal_Int32 nPropId, sal_uInt16 nBaseType ) { switch( nBaseType ) { @@ -539,23 +536,46 @@ void OlePropertyStreamObject::dumpPropertyValue( sal_Int32 nPropId, sal_Int32 nB case OLEPROP_TYPE_STRING8: dumpString8( "value" ); break; case OLEPROP_TYPE_STRING16: dumpString16( "value" ); break; case OLEPROP_TYPE_FILETIME: dumpFileTime( "file-time" ); break; - case OLEPROP_TYPE_BLOB: dumpBlob( "data" ); break; + case OLEPROP_TYPE_BLOB: dumpBlob( nPropId, "data" ); break; case OLEPROP_TYPE_STREAM: dumpString8( "stream-name" ); break; case OLEPROP_TYPE_STORAGE: dumpString8( "storage-name" ); break; - case OLEPROP_TYPE_CLIPFMT: dumpBlob( "clip-data" ); break; + case OLEPROP_TYPE_CLIPFMT: dumpBlob( nPropId, "clip-data" ); break; + } +} + +void OlePropertyStreamObject::dumpPropertyVector( sal_Int32 nPropId, sal_uInt16 nBaseType ) +{ + sal_Int32 nElemCount = dumpDec< sal_Int32 >( "element-count" ); + for( sal_Int32 nElemIdx = 0; !mxStrm->isEof() && (nElemIdx < nElemCount); ++nElemIdx ) + { + mxOut->resetItemIndex( nElemIdx ); + writeEmptyItem( "#element" ); + IndentGuard aIndGuard( mxOut ); + dumpPropertyValue( nPropId, nBaseType ); } } -sal_Int32 OlePropertyStreamObject::dumpPropertyType() +void OlePropertyStreamObject::dumpPropertyArray( sal_Int32 /*nPropId*/, sal_uInt16 /*nBaseType*/ ) +{ + // TODO +} + +sal_uInt16 OlePropertyStreamObject::dumpPropertyType() { - return dumpHex< sal_Int32 >( "type", "OLEPROP-TYPE" ); + return static_cast< sal_uInt16 >( dumpHex< sal_Int32 >( "type", "OLEPROP-TYPE" ) & 0xFFFF ); } -void OlePropertyStreamObject::dumpBlob( const String& rName ) +void OlePropertyStreamObject::dumpBlob( sal_Int32 nPropId, const String& rName ) { sal_Int32 nSize = dumpDec< sal_Int32 >( "data-size" ); if( nSize > 0 ) - dumpBinary( rName, nSize ); + { + OUString aPropName = mxPropIds->getName( cfg(), nPropId ); + if( aPropName == CREATE_OUSTRING( "'_PID_HLINKS'" ) ) + dumpHlinks( nSize ); + else + dumpBinary( rName, nSize ); + } } OUString OlePropertyStreamObject::dumpString8( const String& rName ) @@ -599,6 +619,33 @@ OUString OlePropertyStreamObject::dumpCharArray16( const String& rName, sal_Int3 return aData; } +bool OlePropertyStreamObject::dumpTypedProperty( const String& rName, sal_uInt16 nExpectedType ) +{ + writeEmptyItem( rName ); + IndentGuard aIndGuard( mxOut ); + return (dumpPropertyContents( -1 ) == nExpectedType) && !mxStrm->isEof(); +} + +void OlePropertyStreamObject::dumpHlinks( sal_Int32 nSize ) +{ + sal_Int64 nEndPos = mxStrm->tell() + nSize; + sal_Int32 nCount = dumpDec< sal_Int32 >( "property-count" ); + bool bValid = true; + for( sal_Int32 nHlinkIndex = 0, nHlinkCount = nCount / 6; bValid && !mxStrm->isEof() && (nHlinkIndex < nHlinkCount); ++nHlinkIndex ) + { + writeEmptyItem( "HYPERLINK" ); + IndentGuard aIndGuard( mxOut ); + bValid = + dumpTypedProperty( "hash", OLEPROP_TYPE_INT32 ) && + dumpTypedProperty( "app", OLEPROP_TYPE_INT32 ) && + dumpTypedProperty( "shape-id", OLEPROP_TYPE_INT32 ) && + dumpTypedProperty( "info", OLEPROP_TYPE_INT32 ) && + dumpTypedProperty( "target", OLEPROP_TYPE_STRING16 ) && + dumpTypedProperty( "location", OLEPROP_TYPE_STRING16 ); + } + dumpRemainingTo( nEndPos ); +} + bool OlePropertyStreamObject::startElement( sal_uInt32 nStartPos ) { mxStrm->seek( nStartPos ); -- cgit From 985fde0fa91498cf165d482ed306740adfb9a5e8 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 29 Sep 2010 09:11:20 +0200 Subject: jl160 #i114794# registration data folder of bundled extensions in the user installation references PREREG registration data in brand/share/prereg/bundled folder --- desktop/scripts/unopkg.sh | 15 +- desktop/source/app/app.cxx | 47 ++- .../deployment/manager/dp_extensionmanager.cxx | 118 ++++-- .../deployment/manager/dp_extensionmanager.hxx | 17 +- desktop/source/deployment/manager/dp_manager.cxx | 33 +- .../registry/component/dp_compbackenddb.cxx | 43 ++- .../deployment/registry/component/dp_component.cxx | 31 +- .../registry/configuration/dp_configuration.cxx | 128 +++--- .../configuration/dp_configurationbackenddb.cxx | 13 +- desktop/source/deployment/registry/dp_backend.cxx | 10 + .../source/deployment/registry/dp_backenddb.cxx | 108 +++++- desktop/source/deployment/registry/dp_registry.cxx | 18 + .../registry/executable/dp_executable.cxx | 38 +- .../source/deployment/registry/help/dp_help.cxx | 427 +++++++++++---------- .../deployment/registry/help/dp_helpbackenddb.cxx | 11 +- .../deployment/registry/help/dp_helpbackenddb.hxx | 2 + .../source/deployment/registry/inc/dp_backend.h | 20 +- .../deployment/registry/inc/dp_backenddb.hxx | 12 + .../registry/package/dp_extbackenddb.cxx | 22 +- .../deployment/registry/package/dp_package.cxx | 26 +- .../deployment/registry/script/dp_script.cxx | 45 ++- .../source/deployment/registry/sfwk/dp_sfwk.cxx | 17 + desktop/source/pkgchk/unopkg/unopkg_app.cxx | 34 +- 23 files changed, 837 insertions(+), 398 deletions(-) diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh index 0fe319735c06..76f7b3a84204 100644 --- a/desktop/scripts/unopkg.sh +++ b/desktop/scripts/unopkg.sh @@ -45,16 +45,27 @@ cd "$sd_cwd" #collect all bootstrap variables specified on the command line #so that they can be passed as arguments to javaldx later on +#Recognize the "sync" option. sync must be applied without any other +#options except bootstrap variables. for arg in $@ do case "$arg" in -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";; + sync) OPTSYNC=true;; + *) OPTOTHER=true;; esac done +if [ -n $OPTSYNC ] && [ -z $OPTOTHER ] +then + JVMFWKPARAMS='-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml -env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' +else + echo "unopkg script: Check usage of sync command". +fi + # extend the ld_library_path for java: javaldx checks the sofficerc for us if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then - my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS \ + my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS $JVMFWKPARAMS \ "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"` if [ -n "$my_path" ] ; then LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH} @@ -71,6 +82,6 @@ unset XENVIRONMENT # SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS # execute binary -exec "$sd_prog/unopkg.bin" "$@" \ +exec "$sd_prog/unopkg.bin" "$@" "$JVMFWKPARAMS" \ "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc" diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index e0f976df34ed..aec805ed9d33 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -201,6 +201,7 @@ static const ::rtl::OUString CFG_PATH_REG ( RTL_CONSTASCII_USTRINGP static const ::rtl::OUString CFG_ENTRY_REGURL ( RTL_CONSTASCII_USTRINGPARAM( "URL" )); static const ::rtl::OUString CFG_ENTRY_TEMPLATEREGURL ( RTL_CONSTASCII_USTRINGPARAM( "TemplateURL" )); +static ::rtl::OUString getBrandSharePreregBundledPathURL(); // ---------------------------------------------------------------------------- ResMgr* Desktop::GetDesktopResManager() @@ -579,6 +580,44 @@ static ::rtl::OUString getLastSyncFileURLFromUserInstallation() return aTmp.makeStringAndClear(); } +//Checks if the argument src is the folder of the help or configuration +//backend in the prereg folder +static bool excludeTmpFilesAndFolders(const rtl::OUString & src) +{ + const char helpBackend[] = "com.sun.star.comp.deployment.help.PackageRegistryBackend"; + const char configBackend[] = "com.sun.star.comp.deployment.configuration.PackageRegistryBackend"; + if (src.endsWithAsciiL(helpBackend, sizeof(helpBackend) - 1 ) + || src.endsWithAsciiL(configBackend, sizeof(configBackend) - 1)) + { + return true; + } + return false; +} + +//If we are about to copy the contents of some special folder as determined +//by excludeTmpFilesAndFolders, then we omit those files or folders with a name +//derived from temporary folders. +static bool isExcludedFileOrFolder( const rtl::OUString & name) +{ + char const * allowed[] = { + "backenddb.xml", + "configmgr.ini", + "registered_packages.db" + }; + + const unsigned int size = sizeof(allowed) / sizeof (char const *); + bool bExclude = true; + for (unsigned int i= 0; i < size; i ++) + { + ::rtl::OUString allowedName = ::rtl::OUString::createFromAscii(allowed[i]); + if (allowedName.equals(name)) + { + bExclude = false; + break; + } + } + return bExclude; +} static osl::FileBase::RC copy_bundled_recursive( const rtl::OUString& srcUnqPath, @@ -606,6 +645,7 @@ throw() sal_Int32 n_Mask = FileStatusMask_FileURL | FileStatusMask_FileName | FileStatusMask_Type; osl::DirectoryItem aDirItem; + bool bExcludeFiles = excludeTmpFilesAndFolders(srcUnqPath); while( err == osl::FileBase::E_None && ( next = aDir.getNextItem( aDirItem ) ) == osl::FileBase::E_None ) { @@ -635,7 +675,12 @@ throw() // Special treatment for "lastsychronized" file. Must not be // copied from the bundled folder! - if ( IsDoc && aFileName.equalsAscii( pLastSyncFileName )) + //Also do not copy *.tmp files and *.tmp_ folders. This affects the files/folders + //from the help and configuration backend + if ( IsDoc && (aFileName.equalsAscii( pLastSyncFileName ) + || bExcludeFiles && isExcludedFileOrFolder(aFileName))) + bFilter = true; + else if (!IsDoc && bExcludeFiles && isExcludedFileOrFolder(aFileName)) bFilter = true; } diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index c82973f1b680..492bab566aeb 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -152,12 +152,8 @@ ExtensionManager::ExtensionManager( Reference< uno::XComponentContext > const& x ::cppu::WeakComponentImplHelper1< css::deployment::XExtensionManager >(getMutex()), m_xContext( xContext ) { - Reference xPackageManagerFactory( - deploy::thePackageManagerFactory::get(m_xContext)); - m_userRepository = xPackageManagerFactory->getPackageManager(OUSTR("user")); - m_sharedRepository = xPackageManagerFactory->getPackageManager(OUSTR("shared")); - m_bundledRepository = xPackageManagerFactory->getPackageManager(OUSTR("bundled")); - m_tmpRepository = xPackageManagerFactory->getPackageManager(OUSTR("tmp")); + m_xPackageManagerFactory = deploy::thePackageManagerFactory::get(m_xContext); + OSL_ASSERT(m_xPackageManagerFactory.is()); m_repositoryNames.push_back(OUSTR("user")); m_repositoryNames.push_back(OUSTR("shared")); @@ -170,6 +166,23 @@ ExtensionManager::~ExtensionManager() { } +Reference ExtensionManager::getUserRepository() +{ + return m_xPackageManagerFactory->getPackageManager(OUSTR("user")); +} +Reference ExtensionManager::getSharedRepository() +{ + return m_xPackageManagerFactory->getPackageManager(OUSTR("shared")); +} +Reference ExtensionManager::getBundledRepository() +{ + return m_xPackageManagerFactory->getPackageManager(OUSTR("bundled")); +} +Reference ExtensionManager::getTmpRepository() +{ + return m_xPackageManagerFactory->getPackageManager(OUSTR("tmp")); +} + Reference ExtensionManager::createAbortChannel() throw (uno::RuntimeException) { @@ -182,11 +195,11 @@ ExtensionManager::getPackageManager(::rtl::OUString const & repository) { Reference xPackageManager; if (repository.equals(OUSTR("user"))) - xPackageManager = m_userRepository; + xPackageManager = getUserRepository(); else if (repository.equals(OUSTR("shared"))) - xPackageManager = m_sharedRepository; + xPackageManager = getSharedRepository(); else if (repository.equals(OUSTR("bundled"))) - xPackageManager = m_bundledRepository; + xPackageManager = getBundledRepository(); else throw lang::IllegalArgumentException( OUSTR("No valid repository name provided."), @@ -257,7 +270,7 @@ void ExtensionManager::addExtensionsToMap( ::std::list > extensionList; try { //will throw an exception if the extension does not exist - extensionList.push_back(m_userRepository->getDeployedPackage( + extensionList.push_back(getUserRepository()->getDeployedPackage( identifier, fileName, Reference())); } catch(lang::IllegalArgumentException &) { @@ -265,7 +278,7 @@ void ExtensionManager::addExtensionsToMap( } try { - extensionList.push_back(m_sharedRepository->getDeployedPackage( + extensionList.push_back(getSharedRepository()->getDeployedPackage( identifier, fileName, Reference())); } catch (lang::IllegalArgumentException &) { @@ -273,7 +286,7 @@ void ExtensionManager::addExtensionsToMap( } try { - extensionList.push_back(m_bundledRepository->getDeployedPackage( + extensionList.push_back(getBundledRepository()->getDeployedPackage( identifier, fileName, Reference())); } catch (lang::IllegalArgumentException &) { @@ -477,7 +490,7 @@ Reference ExtensionManager::backupExtension( if (xOldExtension.is()) { - xBackup = m_tmpRepository->addPackage( + xBackup = getTmpRepository()->addPackage( xOldExtension->getURL(), uno::Sequence(), OUString(), Reference(), tmpCmdEnv); @@ -498,7 +511,7 @@ uno::Sequence< Reference > ExtensionManager::getSupportedPackageTypes() throw (uno::RuntimeException) { - return m_userRepository->getSupportedPackageTypes(); + return getUserRepository()->getSupportedPackageTypes(); } // Only add to shared and user repository @@ -517,9 +530,9 @@ Reference ExtensionManager::addExtension( //Determine the repository to use Reference xPackageManager; if (repository.equals(OUSTR("user"))) - xPackageManager = m_userRepository; + xPackageManager = getUserRepository(); else if (repository.equals(OUSTR("shared"))) - xPackageManager = m_sharedRepository; + xPackageManager = getSharedRepository(); else throw lang::IllegalArgumentException( OUSTR("No valid repository name provided."), @@ -609,7 +622,7 @@ Reference ExtensionManager::addExtension( //importing the old extension in the tmp repository will remove //the xTmpExtension xTmpExtension = 0; - xExtensionBackup = m_tmpRepository->importExtension( + xExtensionBackup = getTmpRepository()->importExtension( xOldExtension, Reference(), tmpCmdEnv); } @@ -668,7 +681,7 @@ Reference ExtensionManager::addExtension( sIdentifier, sFileName, bUserDisabled, false, Reference(), tmpCmdEnv); if (xTmpExtension.is() || xExtensionBackup.is()) - m_tmpRepository->removePackage( + getTmpRepository()->removePackage( sIdentifier, OUString(), xAbortChannel, xCmdEnv); fireModified(); } @@ -678,7 +691,7 @@ Reference ExtensionManager::addExtension( ::cppu::throwException(excOccurred2); } if (xTmpExtension.is() || xExtensionBackup.is()) - m_tmpRepository->removePackage( + getTmpRepository()->removePackage( sIdentifier,OUString(), xAbortChannel, xCmdEnv); if (excOccurred1.hasValue()) @@ -707,9 +720,9 @@ void ExtensionManager::removeExtension( { //Determine the repository to use if (repository.equals(OUSTR("user"))) - xPackageManager = m_userRepository; + xPackageManager = getUserRepository(); else if (repository.equals(OUSTR("shared"))) - xPackageManager = m_sharedRepository; + xPackageManager = getSharedRepository(); else throw lang::IllegalArgumentException( OUSTR("No valid repository name provided."), @@ -769,7 +782,7 @@ void ExtensionManager::removeExtension( Reference(), tmpCmdEnv); - m_tmpRepository->removePackage( + getTmpRepository()->removePackage( dp_misc::getIdentifier(xExtensionBackup), xExtensionBackup->getName(), xAbortChannel, xCmdEnv); fireModified(); @@ -782,7 +795,7 @@ void ExtensionManager::removeExtension( } if (xExtensionBackup.is()) - m_tmpRepository->removePackage( + getTmpRepository()->removePackage( dp_misc::getIdentifier(xExtensionBackup), xExtensionBackup->getName(), xAbortChannel, xCmdEnv); } @@ -1010,13 +1023,13 @@ uno::Sequence< uno::Sequence > > id2extensions mapExt; uno::Sequence > userExt = - m_userRepository->getDeployedPackages(xAbort, xCmdEnv); + getUserRepository()->getDeployedPackages(xAbort, xCmdEnv); addExtensionsToMap(mapExt, userExt, OUSTR("user")); uno::Sequence > sharedExt = - m_sharedRepository->getDeployedPackages(xAbort, xCmdEnv); + getSharedRepository()->getDeployedPackages(xAbort, xCmdEnv); addExtensionsToMap(mapExt, sharedExt, OUSTR("shared")); uno::Sequence > bundledExt = - m_bundledRepository->getDeployedPackages(xAbort, xCmdEnv); + getBundledRepository()->getDeployedPackages(xAbort, xCmdEnv); addExtensionsToMap(mapExt, bundledExt, OUSTR("bundled")); //copy the values of the map to a vector for sorting @@ -1110,6 +1123,53 @@ void ExtensionManager::reinstallDeployedExtensions( } } +/** Works on the bundled repository. That is using the variables + BUNDLED_EXTENSIONS and BUNDLED_EXTENSIONS_USER. + */ +void ExtensionManager::synchronizeBundledPrereg( + Reference const & xAbortChannel, + Reference const & xCmdEnv ) + throw (deploy::DeploymentException, + uno::RuntimeException) +{ + try + { + String sSynchronizingBundled(StrSyncRepository::get()); + sSynchronizingBundled.SearchAndReplaceAllAscii( "%NAME", OUSTR("bundled")); + dp_misc::ProgressLevel progressBundled(xCmdEnv, sSynchronizingBundled); + + Reference xPackageManagerFactory( + deploy::thePackageManagerFactory::get(m_xContext)); + + Reference xMgr = + xPackageManagerFactory->getPackageManager(OUSTR("bundled_prereg")); + xMgr->synchronize(xAbortChannel, xCmdEnv); + progressBundled.update(OUSTR("\n\n")); + + uno::Sequence > extensions = xMgr->getDeployedPackages( + xAbortChannel, xCmdEnv); + for (sal_Int32 i = 0; i < extensions.getLength(); i++) + { + extensions[i]->registerPackage(true, xAbortChannel, xCmdEnv); + } + } catch (deploy::DeploymentException& ) { + throw; + } catch (ucb::CommandFailedException & ) { + throw; + } catch (ucb::CommandAbortedException & ) { + throw; + } catch (lang::IllegalArgumentException &) { + throw; + } catch (uno::RuntimeException &) { + throw; + } catch (...) { + uno::Any exc = ::cppu::getCaughtException(); + throw deploy::DeploymentException( + OUSTR("Extension Manager: exception in synchronize"), + static_cast(this), exc); + } +} + sal_Bool ExtensionManager::synchronize( Reference const & xAbortChannel, Reference const & xCmdEnv ) @@ -1127,13 +1187,13 @@ sal_Bool ExtensionManager::synchronize( String sSynchronizingShared(StrSyncRepository::get()); sSynchronizingShared.SearchAndReplaceAllAscii( "%NAME", OUSTR("shared")); dp_misc::ProgressLevel progressShared(xCmdEnv, sSynchronizingShared); - bModified = m_sharedRepository->synchronize(xAbortChannel, xCmdEnv); + bModified = getSharedRepository()->synchronize(xAbortChannel, xCmdEnv); progressShared.update(OUSTR("\n\n")); String sSynchronizingBundled(StrSyncRepository::get()); sSynchronizingBundled.SearchAndReplaceAllAscii( "%NAME", OUSTR("bundled")); dp_misc::ProgressLevel progressBundled(xCmdEnv, sSynchronizingBundled); - bModified |= m_bundledRepository->synchronize(xAbortChannel, xCmdEnv); + bModified |= getBundledRepository()->synchronize(xAbortChannel, xCmdEnv); progressBundled.update(OUSTR("\n\n")); //Always determine the active extension. This is necessary for the @@ -1260,7 +1320,7 @@ Reference ExtensionManager::getTempExtension( { Reference tmpCmdEnvA(new TmpRepositoryCommandEnv()); - Reference xTmpPackage = m_tmpRepository->addPackage( + Reference xTmpPackage = getTmpRepository()->addPackage( url, uno::Sequence(),OUString(), xAbortChannel, tmpCmdEnvA); if (!xTmpPackage.is()) { diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx index 64cada7da3ac..b3570e311828 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.hxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx @@ -205,6 +205,12 @@ public: css::lang::IllegalArgumentException, css::uno::RuntimeException); + virtual void SAL_CALL synchronizeBundledPrereg( + css::uno::Reference const & xAbortChannel, + css::uno::Reference const & xCmdEnv ) + throw (css::deployment::DeploymentException, + css::uno::RuntimeException); + virtual css::uno::Sequence > SAL_CALL getExtensionsWithUnacceptedLicenses( ::rtl::OUString const & repository, @@ -229,11 +235,7 @@ private: }; css::uno::Reference< css::uno::XComponentContext> m_xContext; - - css::uno::Reference m_userRepository; - css::uno::Reference m_sharedRepository; - css::uno::Reference m_bundledRepository; - css::uno::Reference m_tmpRepository; + css::uno::Reference m_xPackageManagerFactory; /* contains the names of all repositories (except tmp) in order of there priority. That is, the first element is "user" follod by "shared" and @@ -241,6 +243,11 @@ private: */ ::std::list< ::rtl::OUString > m_repositoryNames; + css::uno::Reference getUserRepository(); + css::uno::Reference getSharedRepository(); + css::uno::Reference getBundledRepository(); + css::uno::Reference getTmpRepository(); + bool isUserDisabled(::rtl::OUString const & identifier, ::rtl::OUString const & filename); diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 44bc4d469f2f..2e2c5e2a2f53 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -370,6 +370,24 @@ Reference PackageManagerImpl::create( //No stamp file. We assume that bundled is always readonly. It must not be //modified from ExtensionManager but only by the installer } + else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bundled_prereg") )) { + //This is a bundled repository but the registration data + //is in the brand layer: share/prereg + //It is special because the registration data are copied at the first startup + //into the user installation. The processed help and xcu files are not + //copied. Instead the backenddb.xml for the help backend references the help + //by using $BUNDLED_EXTENSION_PREREG instead $BUNDLED_EXTENSIONS_USER. The + //configmgr.ini also used $BUNDLED_EXTENSIONS_PREREG to refer to the xcu file + //which contain the replacement for %origin%. + that->m_activePackages = OUSTR( + "vnd.sun.star.expand:$BUNDLED_EXTENSIONS"); + that->m_registrationData = OUSTR( + "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_PREREG"); + that->m_registryCache = OUSTR( + "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_PREREG/registry"); + logFile = OUSTR( + "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_PREREG/log.txt"); + } else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("tmp") )) { that->m_activePackages = OUSTR( "vnd.sun.star.expand:$TMP_EXTENSIONS/extensions"); @@ -949,6 +967,8 @@ void PackageManagerImpl::removePackage( contentRemoved.writeStream( xData, true /* replace existing */ ); } m_activePackagesDB->erase( id, fileName ); // to be removed upon next start + //remove any cached data hold by the backend + m_xRegistry->packageRemoved(xPackage->getURL(), xPackage->getPackageType()->getMediaType()); } try_dispose( xPackage ); @@ -989,7 +1009,8 @@ OUString PackageManagerImpl::getDeployPath( ActivePackages::Data const & data ) //The bundled extensions are not contained in an additional folder //with a unique name. data.temporaryName contains already the //UTF8 encoded folder name. See PackageManagerImpl::synchronize - if (!m_context.equals(OUSTR("bundled"))) + if (!m_context.equals(OUSTR("bundled")) + && !m_context.equals(OUSTR("bundled_prereg"))) { buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("_/") ); buf.append( ::rtl::Uri::encode( data.fileName, rtl_UriCharClassPchar, @@ -1341,6 +1362,8 @@ bool PackageManagerImpl::synchronizeAddedExtensions( Reference const & xCmdEnv) { bool bModified = false; + OSL_ASSERT(!m_context.equals(OUSTR("user"))); + ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() ); //check if the folder exist at all. The shared extension folder //may not exist for a normal user. @@ -1366,8 +1389,8 @@ bool PackageManagerImpl::synchronizeAddedExtensions( //The temporary folders of user and shared have an '_' at then end. //But the name in ActivePackages.temporaryName is saved without. OUString title2 = title; - bool bNotBundled = !m_context.equals(OUSTR("bundled")); - if (bNotBundled) + bool bShared = m_context.equals(OUSTR("shared")); + if (bShared) { OSL_ASSERT(title2[title2.getLength() -1] == '_'); title2 = title2.copy(0, title2.getLength() -1); @@ -1389,7 +1412,7 @@ bool PackageManagerImpl::synchronizeAddedExtensions( // an added extension OUString url(m_activePackages_expanded + OUSTR("/") + titleEncoded); OUString sExtFolder; - if (bNotBundled) //that is, shared + if (bShared) //that is, shared { //Check if the extension was not "deleted" already which is indicated //by a xxx.tmpremoved file @@ -1411,7 +1434,7 @@ bool PackageManagerImpl::synchronizeAddedExtensions( ActivePackages::Data dbData; dbData.temporaryName = titleEncoded; - if (bNotBundled) + if (bShared) dbData.fileName = sExtFolder; else dbData.fileName = title; diff --git a/desktop/source/deployment/registry/component/dp_compbackenddb.cxx b/desktop/source/deployment/registry/component/dp_compbackenddb.cxx index 898e7c931f6d..458ece3d0bd8 100644 --- a/desktop/source/deployment/registry/component/dp_compbackenddb.cxx +++ b/desktop/source/deployment/registry/component/dp_compbackenddb.cxx @@ -82,26 +82,29 @@ OUString ComponentBackendDb::getKeyElementName() void ComponentBackendDb::addEntry(::rtl::OUString const & url, Data const & data) { try{ - Reference componentNode = writeKeyElement(url); - writeSimpleElement(OUSTR("java-type-library"), - OUString::valueOf((sal_Bool) data.javaTypeLibrary), - componentNode); - - writeSimpleList( - data.implementationNames, - OUSTR("implementation-names"), - OUSTR("name"), - componentNode); - - writeVectorOfPair( - data.singletons, - OUSTR("singletons"), - OUSTR("item"), - OUSTR("key"), - OUSTR("value"), - componentNode); - - save(); + if (!activateEntry(url)) + { + Reference componentNode = writeKeyElement(url); + writeSimpleElement(OUSTR("java-type-library"), + OUString::valueOf((sal_Bool) data.javaTypeLibrary), + componentNode); + + writeSimpleList( + data.implementationNames, + OUSTR("implementation-names"), + OUSTR("name"), + componentNode); + + writeVectorOfPair( + data.singletons, + OUSTR("singletons"), + OUSTR("item"), + OUSTR("key"), + OUSTR("value"), + componentNode); + + save(); + } } catch(css::uno::Exception &) { diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index e0844c227669..d15b4bc25980 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -231,8 +231,8 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend std::auto_ptr m_backendDb; void addDataToDb(OUString const & url, ComponentBackendDb::Data const & data); - void deleteDataFromDb(OUString const & url); ComponentBackendDb::Data readDataFromDb(OUString const & url); + void revokeEntryFromDb(OUString const & url); //These rdbs are for writing new service entries. The rdb files are copies @@ -270,6 +270,10 @@ public: virtual Sequence< Reference > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); + virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType) + throw (deployment::DeploymentException, + uno::RuntimeException); + using PackageRegistryBackend::disposing; //Will be called from ComponentPackageImpl @@ -601,12 +605,6 @@ void BackendImpl::addDataToDb( m_backendDb->addEntry(url, data); } -void BackendImpl::deleteDataFromDb(OUString const & url) -{ - if (m_backendDb.get()) - m_backendDb->removeEntry(url); -} - ComponentBackendDb::Data BackendImpl::readDataFromDb(OUString const & url) { ComponentBackendDb::Data data; @@ -615,6 +613,12 @@ ComponentBackendDb::Data BackendImpl::readDataFromDb(OUString const & url) return data; } +void BackendImpl::revokeEntryFromDb(OUString const & url) +{ + if (m_backendDb.get()) + m_backendDb->revokeEntry(url); +} + // XPackageRegistry //______________________________________________________________________________ Sequence< Reference > @@ -623,6 +627,14 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException) return m_typeInfos; } +void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/) + throw (deployment::DeploymentException, + uno::RuntimeException) +{ + if (m_backendDb.get()) + m_backendDb->removeEntry(url); +} + // PackageRegistryBackend //______________________________________________________________________________ Reference BackendImpl::bindPackage_( @@ -1136,6 +1148,9 @@ BackendImpl::ComponentPackageImpl::getComponentInfo( // Package //______________________________________________________________________________ +//We could use here BackendImpl::hasActiveEntry. However, this check is just as well. +//And it also shows the problem if another extension has overwritten an implementation +//entry, because it contains the same service implementation beans::Optional< beans::Ambiguous > BackendImpl::ComponentPackageImpl::isRegistered_( ::osl::ResettableMutexGuard &, @@ -1438,7 +1453,7 @@ void BackendImpl::ComponentPackageImpl::processPackage_( that->releaseObject( url ); m_registered = REG_NOT_REGISTERED; - getMyBackend()->deleteDataFromDb(url); + getMyBackend()->revokeEntryFromDb(url); } } diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 1e7ee5bfac8a..24e5587cd0cc 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -132,15 +132,21 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend Reference const & xCmdEnv ); void configmgrini_flush( Reference const & xCmdEnv ); - bool addToConfigmgrIni( bool isSchema, OUString const & url, + /* The paramter isURL is false in the case of adding the conf:ini-entry + value from the backend db. This entry already contains the path as it + is used in the configmgr.ini. + */ + bool addToConfigmgrIni( bool isSchema, bool isURL, OUString const & url, Reference const & xCmdEnv ); bool removeFromConfigmgrIni( bool isSchema, OUString const & url, Reference const & xCmdEnv ); void addDataToDb(OUString const & url, ConfigurationBackendDb::Data const & data); ::boost::optional readDataFromDb(OUString const & url); - OUString deleteDataFromDb(OUString const & url); + void revokeEntryFromDb(OUString const & url); ::std::list getAllIniEntries(); + bool hasActiveEntry(OUString const & url); + bool activateEntry(OUString const & url); public: BackendImpl( Sequence const & args, @@ -149,6 +155,9 @@ public: // XPackageRegistry virtual Sequence< Reference > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); + virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType) + throw (deployment::DeploymentException, + uno::RuntimeException); using PackageRegistryBackend::disposing; }; @@ -240,18 +249,10 @@ void BackendImpl::addDataToDb( return data; } -OUString BackendImpl::deleteDataFromDb(OUString const & url) +void BackendImpl::revokeEntryFromDb(OUString const & url) { - OUString url2(url); - if (m_backendDb.get()) { - boost::optional< ConfigurationBackendDb::Data > data( - m_backendDb->getEntry(url)); - if (data) { - url2 = expandUnoRcTerm(data->iniEntry); - } - m_backendDb->removeEntry(url); - } - return url2; + if (m_backendDb.get()) + m_backendDb->revokeEntry(url); } ::std::list BackendImpl::getAllIniEntries() @@ -262,6 +263,20 @@ OUString BackendImpl::deleteDataFromDb(OUString const & url) return ::std::list(); } +bool BackendImpl::hasActiveEntry(OUString const & url) +{ + if (m_backendDb.get()) + return m_backendDb->hasActiveEntry(url); + return false; +} + +bool BackendImpl::activateEntry(OUString const & url) +{ + if (m_backendDb.get()) + return m_backendDb->activateEntry(url); + return false; +} + // XPackageRegistry @@ -271,6 +286,13 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException) { return m_typeInfos; } +void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/) + throw (deployment::DeploymentException, + uno::RuntimeException) +{ + if (m_backendDb.get()) + m_backendDb->removeEntry(url); +} // PackageRegistryBackend //______________________________________________________________________________ @@ -457,10 +479,10 @@ void BackendImpl::configmgrini_flush( } //______________________________________________________________________________ -bool BackendImpl::addToConfigmgrIni( bool isSchema, OUString const & url_, +bool BackendImpl::addToConfigmgrIni( bool isSchema, bool isURL, OUString const & url_, Reference const & xCmdEnv ) { - const OUString rcterm( dp_misc::makeRcTerm(url_) ); + const OUString rcterm( isURL ? dp_misc::makeRcTerm(url_) : url_ ); const ::osl::MutexGuard guard( getMutex() ); configmgrini_verify_init( xCmdEnv ); t_stringlist & rSet = getFiles(isSchema); @@ -509,6 +531,7 @@ bool BackendImpl::removeFromConfigmgrIni( // Package //______________________________________________________________________________ + BackendImpl * BackendImpl::PackageImpl::getMyBackend() const { BackendImpl * pBackend = static_cast(m_myBackend.get()); @@ -534,7 +557,7 @@ BackendImpl::PackageImpl::isRegistered_( const rtl::OUString url(getURL()); bool bReg = false; - if (that->readDataFromDb(getURL())) + if (that->hasActiveEntry(getURL())) bReg = true; if (!bReg) //fallback for user extension registered in berkeley DB @@ -677,38 +700,48 @@ void BackendImpl::PackageImpl::processPackage_( if (doRegisterPackage) { - ConfigurationBackendDb::Data data; - if (!m_isSchema) + if (getMyBackend()->activateEntry(getURL())) { - const OUString sModFolder = that->createFolder(OUString(), xCmdEnv); - bool out_replaced = false; - url = replaceOrigin(url, sModFolder, xCmdEnv, out_replaced); - if (out_replaced) - data.dataUrl = sModFolder; - else - deleteTempFolder(sModFolder); + ::boost::optional data = that->readDataFromDb(url); + OSL_ASSERT(data); + that->addToConfigmgrIni( m_isSchema, false, data->iniEntry, xCmdEnv ); } - //No need for live-deployment for bundled extension, because OOo - //restarts after installation - if (that->m_eContext != CONTEXT_BUNDLED - && !startup) + else { - if (m_isSchema) + ConfigurationBackendDb::Data data; + if (!m_isSchema) { - com::sun::star::configuration::Update::get( - that->m_xComponentContext)->insertExtensionXcsFile( - that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); + const OUString sModFolder = that->createFolder(OUString(), xCmdEnv); + bool out_replaced = false; + url = replaceOrigin(url, sModFolder, xCmdEnv, out_replaced); + if (out_replaced) + data.dataUrl = sModFolder; + else + deleteTempFolder(sModFolder); } - else + //No need for live-deployment for bundled extension, because OOo + //restarts after installation + if (that->m_eContext != CONTEXT_BUNDLED + && that->m_eContext != CONTEXT_BUNDLED_PREREG + && !startup) { - com::sun::star::configuration::Update::get( - that->m_xComponentContext)->insertExtensionXcuFile( - that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); + if (m_isSchema) + { + com::sun::star::configuration::Update::get( + that->m_xComponentContext)->insertExtensionXcsFile( + that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); + } + else + { + com::sun::star::configuration::Update::get( + that->m_xComponentContext)->insertExtensionXcuFile( + that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); + } } + that->addToConfigmgrIni( m_isSchema, true, url, xCmdEnv ); + data.iniEntry = dp_misc::makeRcTerm(url); + that->addDataToDb(getURL(), data); } - that->addToConfigmgrIni( m_isSchema, url, xCmdEnv ); - data.iniEntry = dp_misc::makeRcTerm(url); - that->addDataToDb(getURL(), data); } else // revoke { @@ -741,7 +774,7 @@ void BackendImpl::PackageImpl::processPackage_( else deleteTempFolder(sModFolder); } - that->addToConfigmgrIni(schema, url_replaced, xCmdEnv); + that->addToConfigmgrIni(schema, true, url_replaced, xCmdEnv); data.iniEntry = dp_misc::makeRcTerm(url_replaced); that->addDataToDb(url2, data); } @@ -759,12 +792,17 @@ void BackendImpl::PackageImpl::processPackage_( OSL_ASSERT(0); } } - url = that->deleteDataFromDb(url); - if (!m_isSchema) { + + ::boost::optional data = that->readDataFromDb(url); + //If an xcu file was life deployed then always a data entry is written. + //If the xcu file was already in the configmr.ini then there is also + //a data entry + if (!m_isSchema && data) + { com::sun::star::configuration::Update::get( - that->m_xComponentContext)->removeExtensionXcuFile( - expandUnoRcUrl(url)); + that->m_xComponentContext)->removeExtensionXcuFile(expandUnoRcTerm(data->iniEntry)); } + that->revokeEntryFromDb(url); } } diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx index 2a02c6d8efa0..2437c54ec734 100644 --- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx @@ -83,12 +83,15 @@ OUString ConfigurationBackendDb::getKeyElementName() void ConfigurationBackendDb::addEntry(::rtl::OUString const & url, Data const & data) { try{ - Reference helpNode - = writeKeyElement(url); + if (!activateEntry(url)) + { + Reference helpNode + = writeKeyElement(url); - writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode); - writeSimpleElement(OUSTR("ini-entry"), data.iniEntry, helpNode); - save(); + writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode); + writeSimpleElement(OUSTR("ini-entry"), data.iniEntry, helpNode); + save(); + } } catch (css::deployment::DeploymentException& ) { diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index d781ba9e40ef..aebe56622f6b 100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -39,6 +39,7 @@ #include "ucbhelper/content.hxx" #include "com/sun/star/lang/WrappedTargetRuntimeException.hpp" #include "com/sun/star/deployment/InvalidRemovedParameterException.hpp" +#include "com/sun/star/deployment/thePackageManagerFactory.hpp" #include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp" #include "com/sun/star/ucb/IOErrorCode.hpp" #include "com/sun/star/beans/StringPair.hpp" @@ -99,6 +100,8 @@ PackageRegistryBackend::PackageRegistryBackend( m_eContext = CONTEXT_BUNDLED; else if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("tmp") )) m_eContext = CONTEXT_TMP; + else if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bundled_prereg") )) + m_eContext = CONTEXT_BUNDLED_PREREG; else if (m_context.matchIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.tdoc:/") )) m_eContext = CONTEXT_DOCUMENT; @@ -308,6 +311,13 @@ void PackageRegistryBackend::deleteUnusedFolders( } +// void PackageRegistryBackend::packageRemoved( +// ::rtl::OUString const & /*url*/, ::rtl::OUString const & /*mediaType*/) +// throw (css::deployment::DeploymentException, +// css::uno::RuntimeException) +// { +// } + //############################################################################## //______________________________________________________________________________ diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx index 14b4f2374c5b..9629855aaf11 100644 --- a/desktop/source/deployment/registry/dp_backenddb.cxx +++ b/desktop/source/deployment/registry/dp_backenddb.cxx @@ -187,6 +187,74 @@ void BackendDb::removeEntry(::rtl::OUString const & url) removeElement(sExpression.makeStringAndClear()); } +void BackendDb::revokeEntry(::rtl::OUString const & url) +{ + try + { + Reference entry = Reference(getKeyElement(url), UNO_QUERY); + if (entry.is()) + { + entry->setAttribute(OUSTR("revoked"), OUSTR("true")); + save(); + } + } + catch(css::uno::Exception &) + { + Any exc( ::cppu::getCaughtException() ); + throw css::deployment::DeploymentException( + OUSTR("Extension Manager: failed to revoke data entry in backend db: ") + + m_urlDb, 0, exc); + } +} + +bool BackendDb::activateEntry(::rtl::OUString const & url) +{ + try + { + bool ret = false; + Reference entry = Reference(getKeyElement(url), UNO_QUERY); + if (entry.is()) + { + //no attribute "active" means it is active, that is, registered. + entry->removeAttribute(OUSTR("revoked")); + save(); + ret = true; + } + return ret; + } + catch(css::uno::Exception &) + { + Any exc( ::cppu::getCaughtException() ); + throw css::deployment::DeploymentException( + OUSTR("Extension Manager: failed to revoke data entry in backend db: ") + + m_urlDb, 0, exc); + } +} + +bool BackendDb::hasActiveEntry(::rtl::OUString const & url) +{ + try + { + bool ret = false; + Reference entry = Reference(getKeyElement(url), UNO_QUERY); + if (entry.is()) + { + OUString sActive = entry->getAttribute(OUSTR("revoked")); + if (!sActive.equals(OUSTR("true"))) + ret = true; + } + return ret; + + } + catch(css::uno::Exception &) + { + Any exc( ::cppu::getCaughtException() ); + throw css::deployment::DeploymentException( + OUSTR("Extension Manager: failed to determine an active entry in backend db: ") + + m_urlDb, 0, exc); + } +} + Reference BackendDb::getKeyElement( ::rtl::OUString const & url) { @@ -577,32 +645,34 @@ RegisteredDb::RegisteredDb( void RegisteredDb::addEntry(::rtl::OUString const & url) { try{ + if (!activateEntry(url)) + { + const OUString sNameSpace = getDbNSName(); + const OUString sPrefix = getNSPrefix(); + const OUString sEntry = getKeyElementName(); - const OUString sNameSpace = getDbNSName(); - const OUString sPrefix = getNSPrefix(); - const OUString sEntry = getKeyElementName(); - - Reference doc = getDocument(); - Reference root = doc->getFirstChild(); + Reference doc = getDocument(); + Reference root = doc->getFirstChild(); #if OSL_DEBUG_LEVEL > 0 - //There must not be yet an entry with the same url - OUString sExpression( - sPrefix + OUSTR(":") + sEntry + OUSTR("[@url = \"") + url + OUSTR("\"]")); - Reference _extensionNode = - getXPathAPI()->selectSingleNode(root, sExpression); - OSL_ASSERT(! _extensionNode.is()); + //There must not be yet an entry with the same url + OUString sExpression( + sPrefix + OUSTR(":") + sEntry + OUSTR("[@url = \"") + url + OUSTR("\"]")); + Reference _extensionNode = + getXPathAPI()->selectSingleNode(root, sExpression); + OSL_ASSERT(! _extensionNode.is()); #endif - Reference helpElement( - doc->createElementNS(sNameSpace, sPrefix + OUSTR(":") + sEntry)); + Reference helpElement( + doc->createElementNS(sNameSpace, sPrefix + OUSTR(":") + sEntry)); - helpElement->setAttribute(OUSTR("url"), url); + helpElement->setAttribute(OUSTR("url"), url); - Reference helpNode( - helpElement, UNO_QUERY_THROW); - root->appendChild(helpNode); + Reference helpNode( + helpElement, UNO_QUERY_THROW); + root->appendChild(helpNode); - save(); + save(); + } } catch(css::uno::Exception &) { diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx index 0f309a5b729f..eecae4e391b7 100644 --- a/desktop/source/deployment/registry/dp_registry.cxx +++ b/desktop/source/deployment/registry/dp_registry.cxx @@ -135,6 +135,10 @@ public: lang::IllegalArgumentException, RuntimeException); virtual Sequence< Reference > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); + virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType) + throw (deployment::DeploymentException, + RuntimeException); + }; //______________________________________________________________________________ @@ -185,6 +189,20 @@ OUString normalizeMediaType( OUString const & mediaType ) //______________________________________________________________________________ +void PackageRegistryImpl::packageRemoved( + ::rtl::OUString const & url, ::rtl::OUString const & mediaType) + throw (css::deployment::DeploymentException, + css::uno::RuntimeException) +{ + const t_string2registry::const_iterator i = + m_mediaType2backend.find(mediaType); + + if (i != m_mediaType2backend.end()) + { + i->second->packageRemoved(url, mediaType); + } +} + void PackageRegistryImpl::insertBackend( Reference const & xBackend ) { diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx index 968ee7297b0f..5ec739153831 100644 --- a/desktop/source/deployment/registry/executable/dp_executable.cxx +++ b/desktop/source/deployment/registry/executable/dp_executable.cxx @@ -71,6 +71,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend bool getFileAttributes(sal_uInt64& out_Attributes); bool isUrlTargetInExtension(); + public: inline ExecutablePackageImpl( ::rtl::Reference const & myBackend, @@ -92,8 +93,8 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend OUString const & identifier, Reference const & xCmdEnv ); void addDataToDb(OUString const & url); - bool isRegisteredInDb(OUString const & url); - void deleteDataFromDb(OUString const & url); + bool hasActiveEntry(OUString const & url); + void revokeEntryFromDb(OUString const & url); Reference m_xExecutableTypeInfo; std::auto_ptr m_backendDb; @@ -104,6 +105,9 @@ public: // XPackageRegistry virtual Sequence< Reference > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); + virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType) + throw (deployment::DeploymentException, + uno::RuntimeException); using PackageRegistryBackend::disposing; }; @@ -134,20 +138,20 @@ void BackendImpl::addDataToDb(OUString const & url) m_backendDb->addEntry(url); } -bool BackendImpl::isRegisteredInDb(OUString const & url) +void BackendImpl::revokeEntryFromDb(OUString const & url) { - bool ret = false; if (m_backendDb.get()) - ret = m_backendDb->getEntry(url); - return ret; + m_backendDb->revokeEntry(url); } -void BackendImpl::deleteDataFromDb(OUString const & url) +bool BackendImpl::hasActiveEntry(OUString const & url) { if (m_backendDb.get()) - m_backendDb->removeEntry(url); + return m_backendDb->hasActiveEntry(url); + return false; } + // XPackageRegistry Sequence< Reference > BackendImpl::getSupportedPackageTypes() throw (RuntimeException) @@ -156,6 +160,14 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException) & m_xExecutableTypeInfo, 1); } +void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/) + throw (deployment::DeploymentException, + uno::RuntimeException) +{ + if (m_backendDb.get()) + m_backendDb->removeEntry(url); +} + // PackageRegistryBackend Reference BackendImpl::bindPackage_( OUString const & url, OUString const & mediaType, sal_Bool bRemoved, @@ -217,7 +229,7 @@ BackendImpl::ExecutablePackageImpl::isRegistered_( ::rtl::Reference const &, Reference const & ) { - bool registered = getMyBackend()->isRegisteredInDb(getURL()); + bool registered = getMyBackend()->hasActiveEntry(getURL()); return beans::Optional< beans::Ambiguous >( sal_True /* IsPresent */, beans::Ambiguous( @@ -248,7 +260,8 @@ void BackendImpl::ExecutablePackageImpl::processPackage_( else if (getMyBackend()->m_context.equals(OUSTR("shared"))) attributes |= (osl_File_Attribute_OwnExe | osl_File_Attribute_GrpExe | osl_File_Attribute_OthExe); - else if (!getMyBackend()->m_context.equals(OUSTR("bundled"))) + else if (!getMyBackend()->m_context.equals(OUSTR("bundled")) + && !getMyBackend()->m_context.equals(OUSTR("bundled_prereg"))) //Bundled extension are required to be in the properly //installed. That is an executable must have the right flags OSL_ASSERT(0); @@ -261,7 +274,7 @@ void BackendImpl::ExecutablePackageImpl::processPackage_( } else { - getMyBackend()->deleteDataFromDb(getURL()); + getMyBackend()->revokeEntryFromDb(getURL()); } } @@ -277,7 +290,8 @@ bool BackendImpl::ExecutablePackageImpl::isUrlTargetInExtension() sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$UNO_USER_PACKAGES_CACHE")); else if (getMyBackend()->m_context.equals(OUSTR("shared"))) sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$UNO_SHARED_PACKAGES_CACHE")); - else if (getMyBackend()->m_context.equals(OUSTR("bundled"))) + else if (getMyBackend()->m_context.equals(OUSTR("bundled")) + || getMyBackend()->m_context.equals(OUSTR("bundled_prereg"))) sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$BUNDLED_EXTENSIONS")); else OSL_ASSERT(0); diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index 5a5efe825cfb..5949dc0dd634 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -80,7 +80,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend ::rtl::Reference const & abortChannel, Reference const & xCmdEnv ); - bool extensionContainsCompiledHelp(); + public: PackageImpl( ::rtl::Reference const & myBackend, @@ -88,6 +88,8 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend Reference const & xPackageType, bool bRemoved, OUString const & identifier); + bool extensionContainsCompiledHelp(); + //XPackage virtual css::beans::Optional< ::rtl::OUString > SAL_CALL getRegistrationDataURL() throw (deployment::ExtensionRemovedException, css::uno::RuntimeException); @@ -100,14 +102,16 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend sal_Bool bRemoved, OUString const & identifier, Reference const & xCmdEnv ); - void implProcessHelp( Reference< deployment::XPackage > xPackage, bool doRegisterPackage, - bool compiledHelp, Reference const & xCmdEnv); + void implProcessHelp( PackageImpl * package, bool doRegisterPackage, + Reference const & xCmdEnv); void implCollectXhpFiles( const rtl::OUString& aDir, std::vector< rtl::OUString >& o_rXhpFileVector ); void addDataToDb(OUString const & url, HelpBackendDb::Data const & data); ::boost::optional readDataFromDb(OUString const & url); - void deleteDataFromDb(OUString const & url); + bool hasActiveEntry(OUString const & url); + void revokeEntryFromDb(OUString const & url); + bool activateEntry(OUString const & url); Reference< ucb::XSimpleFileAccess > getFileAccess( void ); Reference< ucb::XSimpleFileAccess > m_xSFA; @@ -123,6 +127,10 @@ public: // XPackageRegistry virtual Sequence< Reference > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); + virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType) + throw (deployment::DeploymentException, + uno::RuntimeException); + }; //______________________________________________________________________________ @@ -162,6 +170,14 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException) return m_typeInfos; } +void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/) + throw (deployment::DeploymentException, + uno::RuntimeException) +{ + if (m_backendDb.get()) + m_backendDb->removeEntry(url); +} + // PackageRegistryBackend //______________________________________________________________________________ Reference BackendImpl::bindPackage_( @@ -220,12 +236,27 @@ void BackendImpl::addDataToDb( return data; } -void BackendImpl::deleteDataFromDb(OUString const & url) +bool BackendImpl::hasActiveEntry(OUString const & url) { if (m_backendDb.get()) - m_backendDb->removeEntry(url); + return m_backendDb->hasActiveEntry(url); + return false; +} + +void BackendImpl::revokeEntryFromDb(OUString const & url) +{ + if (m_backendDb.get()) + m_backendDb->revokeEntry(url); } +bool BackendImpl::activateEntry(OUString const & url) +{ + if (m_backendDb.get()) + return m_backendDb->activateEntry(url); + return false; +} + + //############################################################################## BackendImpl::PackageImpl::PackageImpl( ::rtl::Reference const & myBackend, @@ -235,13 +266,6 @@ BackendImpl::PackageImpl::PackageImpl( : Package( myBackend, url, name, name, xPackageType, bRemoved, identifier) { -// if (bRemoved) -// { -// ::boost::optional opt = -// getMyBackend()->readDataFromDb(url); -// if (opt) -// m_dbData = *opt; -// } } // Package @@ -260,7 +284,6 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const return pBackend; } - bool BackendImpl::PackageImpl::extensionContainsCompiledHelp() { bool bCompiled = true; @@ -311,6 +334,7 @@ bool BackendImpl::PackageImpl::extensionContainsCompiledHelp() } return bCompiled; } + //______________________________________________________________________________ beans::Optional< beans::Ambiguous > BackendImpl::PackageImpl::isRegistered_( @@ -321,7 +345,7 @@ BackendImpl::PackageImpl::isRegistered_( BackendImpl * that = getMyBackend(); bool bReg = false; - if (that->readDataFromDb(getURL())) + if (that->hasActiveEntry(getURL())) bReg = true; return beans::Optional< beans::Ambiguous >( true, beans::Ambiguous( bReg, false ) ); @@ -340,9 +364,7 @@ void BackendImpl::PackageImpl::processPackage_( (void)xCmdEnv; BackendImpl* that = getMyBackend(); - Reference< deployment::XPackage > xThisPackage( this ); - that->implProcessHelp( xThisPackage, doRegisterPackage, - extensionContainsCompiledHelp(), xCmdEnv); + that->implProcessHelp( this, doRegisterPackage, xCmdEnv); } beans::Optional< OUString > BackendImpl::PackageImpl::getRegistrationDataURL() @@ -355,7 +377,7 @@ beans::Optional< OUString > BackendImpl::PackageImpl::getRegistrationDataURL() ::boost::optional data = getMyBackend()->readDataFromDb(getURL()); - if (data) + if (data && getMyBackend()->hasActiveEntry(getURL())) return beans::Optional(true, data->dataUrl); return beans::Optional(true, OUString()); @@ -368,224 +390,225 @@ static rtl::OUString aSlash( rtl::OUString::createFromAscii( "/" ) ); static rtl::OUString aHelpStr( rtl::OUString::createFromAscii( "help" ) ); -void BackendImpl::implProcessHelp -( Reference< deployment::XPackage > xPackage, bool doRegisterPackage, bool compiledHelp, - Reference const & xCmdEnv) +void BackendImpl::implProcessHelp( + PackageImpl * package, bool doRegisterPackage, + Reference const & xCmdEnv) { + Reference< deployment::XPackage > xPackage(package); OSL_ASSERT(xPackage.is()); if (doRegisterPackage) { - HelpBackendDb::Data data; - - if (compiledHelp) + //revive already processed help if possible + if ( !activateEntry(xPackage->getURL())) { + HelpBackendDb::Data data; data.dataUrl = xPackage->getURL(); - } - else - { - const OUString sHelpFolder = createFolder(OUString(), xCmdEnv); - data.dataUrl = sHelpFolder; - - Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess(); - rtl::OUString aHelpURL = xPackage->getURL(); - rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL ); - rtl::OUString aName = xPackage->getName(); - if( !xSFA->isFolder( aExpandedHelpURL ) ) + if (!package->extensionContainsCompiledHelp()) { - rtl::OUString aErrStr = getResourceString( RID_STR_HELPPROCESSING_GENERAL_ERROR ); - aErrStr += rtl::OUString::createFromAscii( "No help folder" ); - OWeakObject* oWeakThis = static_cast(this); - throw deployment::DeploymentException( rtl::OUString(), oWeakThis, - makeAny( uno::Exception( aErrStr, oWeakThis ) ) ); - } - - Reference const & xContext = getComponentContext(); - Reference< script::XInvocation > xInvocation; - if( xContext.is() ) - { - try + const OUString sHelpFolder = createFolder(OUString(), xCmdEnv); + data.dataUrl = sHelpFolder; + + Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess(); + rtl::OUString aHelpURL = xPackage->getURL(); + rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL ); + rtl::OUString aName = xPackage->getName(); + if( !xSFA->isFolder( aExpandedHelpURL ) ) { - xInvocation = Reference< script::XInvocation >( - xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii( - "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY ); + rtl::OUString aErrStr = getResourceString( RID_STR_HELPPROCESSING_GENERAL_ERROR ); + aErrStr += rtl::OUString::createFromAscii( "No help folder" ); + OWeakObject* oWeakThis = static_cast(this); + throw deployment::DeploymentException( rtl::OUString(), oWeakThis, + makeAny( uno::Exception( aErrStr, oWeakThis ) ) ); } - catch (Exception &) + + Reference const & xContext = getComponentContext(); + Reference< script::XInvocation > xInvocation; + if( xContext.is() ) { - // i98680: Survive missing lucene + try + { + xInvocation = Reference< script::XInvocation >( + xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii( + "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY ); + } + catch (Exception &) + { + // i98680: Survive missing lucene + } } - } - // Scan languages - Sequence< rtl::OUString > aLanguageFolderSeq = xSFA->getFolderContents( aExpandedHelpURL, true ); - sal_Int32 nLangCount = aLanguageFolderSeq.getLength(); - const rtl::OUString* pSeq = aLanguageFolderSeq.getConstArray(); - for( sal_Int32 iLang = 0 ; iLang < nLangCount ; ++iLang ) - { - rtl::OUString aLangURL = pSeq[iLang]; - if( xSFA->isFolder( aLangURL ) ) + // Scan languages + Sequence< rtl::OUString > aLanguageFolderSeq = xSFA->getFolderContents( aExpandedHelpURL, true ); + sal_Int32 nLangCount = aLanguageFolderSeq.getLength(); + const rtl::OUString* pSeq = aLanguageFolderSeq.getConstArray(); + for( sal_Int32 iLang = 0 ; iLang < nLangCount ; ++iLang ) { - std::vector< rtl::OUString > aXhpFileVector; - - // calculate jar file URL - sal_Int32 indexStartSegment = aLangURL.lastIndexOf('/'); - // for example "/en" - OUString langFolderURLSegment( - aLangURL.copy( - indexStartSegment + 1, aLangURL.getLength() - indexStartSegment - 1)); - - //create the folder in the "temporary folder" - ::ucbhelper::Content langFolderContent; - const OUString langFolderDest = makeURL(sHelpFolder, langFolderURLSegment); - const OUString langFolderDestExpanded = ::dp_misc::expandUnoRcUrl(langFolderDest); - ::dp_misc::create_folder( - &langFolderContent, - langFolderDest, xCmdEnv); - - rtl::OUString aJarFile( - makeURL(sHelpFolder, langFolderURLSegment + aSlash + aHelpStr + - OUSTR(".jar"))); - aJarFile = ::dp_misc::expandUnoRcUrl(aJarFile); - - rtl::OUString aEncodedJarFilePath = rtl::Uri::encode( - aJarFile, rtl_UriCharClassPchar, - rtl_UriEncodeIgnoreEscapes, - RTL_TEXTENCODING_UTF8 ); - rtl::OUString aDestBasePath = rtl::OUString::createFromAscii( "vnd.sun.star.pkg://" ); - aDestBasePath += aEncodedJarFilePath; - aDestBasePath += rtl::OUString::createFromAscii( "/" ); - - sal_Int32 nLenLangFolderURL = aLangURL.getLength() + 1; - - Sequence< rtl::OUString > aSubLangSeq = xSFA->getFolderContents( aLangURL, true ); - sal_Int32 nSubLangCount = aSubLangSeq.getLength(); - const rtl::OUString* pSubLangSeq = aSubLangSeq.getConstArray(); - for( sal_Int32 iSubLang = 0 ; iSubLang < nSubLangCount ; ++iSubLang ) + rtl::OUString aLangURL = pSeq[iLang]; + if( xSFA->isFolder( aLangURL ) ) { - rtl::OUString aSubFolderURL = pSubLangSeq[iSubLang]; - if( !xSFA->isFolder( aSubFolderURL ) ) - continue; - - implCollectXhpFiles( aSubFolderURL, aXhpFileVector ); + std::vector< rtl::OUString > aXhpFileVector; + + // calculate jar file URL + sal_Int32 indexStartSegment = aLangURL.lastIndexOf('/'); + // for example "/en" + OUString langFolderURLSegment( + aLangURL.copy( + indexStartSegment + 1, aLangURL.getLength() - indexStartSegment - 1)); + + //create the folder in the "temporary folder" + ::ucbhelper::Content langFolderContent; + const OUString langFolderDest = makeURL(sHelpFolder, langFolderURLSegment); + const OUString langFolderDestExpanded = ::dp_misc::expandUnoRcUrl(langFolderDest); + ::dp_misc::create_folder( + &langFolderContent, + langFolderDest, xCmdEnv); + + rtl::OUString aJarFile( + makeURL(sHelpFolder, langFolderURLSegment + aSlash + aHelpStr + + OUSTR(".jar"))); + aJarFile = ::dp_misc::expandUnoRcUrl(aJarFile); + + rtl::OUString aEncodedJarFilePath = rtl::Uri::encode( + aJarFile, rtl_UriCharClassPchar, + rtl_UriEncodeIgnoreEscapes, + RTL_TEXTENCODING_UTF8 ); + rtl::OUString aDestBasePath = rtl::OUString::createFromAscii( "vnd.sun.star.pkg://" ); + aDestBasePath += aEncodedJarFilePath; + aDestBasePath += rtl::OUString::createFromAscii( "/" ); + + sal_Int32 nLenLangFolderURL = aLangURL.getLength() + 1; + + Sequence< rtl::OUString > aSubLangSeq = xSFA->getFolderContents( aLangURL, true ); + sal_Int32 nSubLangCount = aSubLangSeq.getLength(); + const rtl::OUString* pSubLangSeq = aSubLangSeq.getConstArray(); + for( sal_Int32 iSubLang = 0 ; iSubLang < nSubLangCount ; ++iSubLang ) + { + rtl::OUString aSubFolderURL = pSubLangSeq[iSubLang]; + if( !xSFA->isFolder( aSubFolderURL ) ) + continue; - // Copy to package (later: move?) - rtl::OUString aDestPath = aDestBasePath; - rtl::OUString aPureFolderName = aSubFolderURL.copy( nLenLangFolderURL ); - aDestPath += aPureFolderName; - xSFA->copy( aSubFolderURL, aDestPath ); - } + implCollectXhpFiles( aSubFolderURL, aXhpFileVector ); - // Call compiler - sal_Int32 nXhpFileCount = aXhpFileVector.size(); - rtl::OUString* pXhpFiles = new rtl::OUString[nXhpFileCount]; - for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) - { - rtl::OUString aXhpFile = aXhpFileVector[iXhp]; - rtl::OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL ); - pXhpFiles[iXhp] = aXhpRelFile; - } + // Copy to package (later: move?) + rtl::OUString aDestPath = aDestBasePath; + rtl::OUString aPureFolderName = aSubFolderURL.copy( nLenLangFolderURL ); + aDestPath += aPureFolderName; + xSFA->copy( aSubFolderURL, aDestPath ); + } - rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() ); - rtl::OUString aOfficeHelpPathFileURL; - ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL ); + // Call compiler + sal_Int32 nXhpFileCount = aXhpFileVector.size(); + rtl::OUString* pXhpFiles = new rtl::OUString[nXhpFileCount]; + for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) + { + rtl::OUString aXhpFile = aXhpFileVector[iXhp]; + rtl::OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL ); + pXhpFiles[iXhp] = aXhpRelFile; + } - HelpProcessingErrorInfo aErrorInfo; - bool bSuccess = compileExtensionHelp( - aOfficeHelpPathFileURL, aHelpStr, aLangURL, - nXhpFileCount, pXhpFiles, - langFolderDestExpanded, aErrorInfo ); + rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() ); + rtl::OUString aOfficeHelpPathFileURL; + ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL ); - if( bSuccess && xInvocation.is() ) - { - Sequence aParamsSeq( 6 ); - - aParamsSeq[0] = uno::makeAny( rtl::OUString::createFromAscii( "-lang" ) ); - - rtl::OUString aLang; - sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' ); - if( nLastSlash != -1 ) - aLang = aLangURL.copy( nLastSlash + 1 ); - else - aLang = rtl::OUString::createFromAscii( "en" ); - aParamsSeq[1] = uno::makeAny( aLang ); - - aParamsSeq[2] = uno::makeAny( rtl::OUString::createFromAscii( "-mod" ) ); - aParamsSeq[3] = uno::makeAny( rtl::OUString::createFromAscii( "help" ) ); - - aParamsSeq[4] = uno::makeAny( rtl::OUString::createFromAscii( "-zipdir" ) ); - rtl::OUString aSystemPath; - osl::FileBase::getSystemPathFromFileURL( - langFolderDestExpanded, aSystemPath ); - aParamsSeq[5] = uno::makeAny( aSystemPath ); - - Sequence< sal_Int16 > aOutParamIndex; - Sequence< uno::Any > aOutParam; - uno::Any aRet = xInvocation->invoke( rtl::OUString::createFromAscii( "createIndex" ), - aParamsSeq, aOutParamIndex, aOutParam ); - } + HelpProcessingErrorInfo aErrorInfo; + bool bSuccess = compileExtensionHelp( + aOfficeHelpPathFileURL, aHelpStr, aLangURL, + nXhpFileCount, pXhpFiles, + langFolderDestExpanded, aErrorInfo ); - if( !bSuccess ) - { - USHORT nErrStrId = 0; - switch( aErrorInfo.m_eErrorClass ) + if( bSuccess && xInvocation.is() ) { - case HELPPROCESSING_GENERAL_ERROR: - case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break; - case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break; - default: ; - }; - - rtl::OUString aErrStr; - if( nErrStrId != 0 ) + Sequence aParamsSeq( 6 ); + + aParamsSeq[0] = uno::makeAny( rtl::OUString::createFromAscii( "-lang" ) ); + + rtl::OUString aLang; + sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' ); + if( nLastSlash != -1 ) + aLang = aLangURL.copy( nLastSlash + 1 ); + else + aLang = rtl::OUString::createFromAscii( "en" ); + aParamsSeq[1] = uno::makeAny( aLang ); + + aParamsSeq[2] = uno::makeAny( rtl::OUString::createFromAscii( "-mod" ) ); + aParamsSeq[3] = uno::makeAny( rtl::OUString::createFromAscii( "help" ) ); + + aParamsSeq[4] = uno::makeAny( rtl::OUString::createFromAscii( "-zipdir" ) ); + rtl::OUString aSystemPath; + osl::FileBase::getSystemPathFromFileURL( + langFolderDestExpanded, aSystemPath ); + aParamsSeq[5] = uno::makeAny( aSystemPath ); + + Sequence< sal_Int16 > aOutParamIndex; + Sequence< uno::Any > aOutParam; + uno::Any aRet = xInvocation->invoke( rtl::OUString::createFromAscii( "createIndex" ), + aParamsSeq, aOutParamIndex, aOutParam ); + } + + if( !bSuccess ) { - aErrStr = getResourceString( nErrStrId ); - - // Remoce CR/LF - rtl::OUString aErrMsg( aErrorInfo.m_aErrorMsg ); - sal_Unicode nCR = 13, nLF = 10; - sal_Int32 nSearchCR = aErrMsg.indexOf( nCR ); - sal_Int32 nSearchLF = aErrMsg.indexOf( nLF ); - sal_Int32 nCopy; - if( nSearchCR != -1 || nSearchLF != -1 ) + USHORT nErrStrId = 0; + switch( aErrorInfo.m_eErrorClass ) { - if( nSearchCR == -1 ) - nCopy = nSearchLF; - else if( nSearchLF == -1 ) - nCopy = nSearchCR; - else - nCopy = ( nSearchCR < nSearchLF ) ? nSearchCR : nSearchLF; - - aErrMsg = aErrMsg.copy( 0, nCopy ); - } - aErrStr += aErrMsg; - if( nErrStrId == RID_STR_HELPPROCESSING_XMLPARSING_ERROR && aErrorInfo.m_aXMLParsingFile.getLength() ) + case HELPPROCESSING_GENERAL_ERROR: + case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break; + case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break; + default: ; + }; + + rtl::OUString aErrStr; + if( nErrStrId != 0 ) { - aErrStr += rtl::OUString::createFromAscii( " in " ); - - rtl::OUString aDecodedFile = rtl::Uri::decode( aErrorInfo.m_aXMLParsingFile, - rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ); - aErrStr += aDecodedFile; - if( aErrorInfo.m_nXMLParsingLine != -1 ) + aErrStr = getResourceString( nErrStrId ); + + // Remoce CR/LF + rtl::OUString aErrMsg( aErrorInfo.m_aErrorMsg ); + sal_Unicode nCR = 13, nLF = 10; + sal_Int32 nSearchCR = aErrMsg.indexOf( nCR ); + sal_Int32 nSearchLF = aErrMsg.indexOf( nLF ); + sal_Int32 nCopy; + if( nSearchCR != -1 || nSearchLF != -1 ) + { + if( nSearchCR == -1 ) + nCopy = nSearchLF; + else if( nSearchLF == -1 ) + nCopy = nSearchCR; + else + nCopy = ( nSearchCR < nSearchLF ) ? nSearchCR : nSearchLF; + + aErrMsg = aErrMsg.copy( 0, nCopy ); + } + aErrStr += aErrMsg; + if( nErrStrId == RID_STR_HELPPROCESSING_XMLPARSING_ERROR && aErrorInfo.m_aXMLParsingFile.getLength() ) { - aErrStr += rtl::OUString::createFromAscii( ", line " ); - aErrStr += ::rtl::OUString::valueOf( aErrorInfo.m_nXMLParsingLine ); + aErrStr += rtl::OUString::createFromAscii( " in " ); + + rtl::OUString aDecodedFile = rtl::Uri::decode( aErrorInfo.m_aXMLParsingFile, + rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ); + aErrStr += aDecodedFile; + if( aErrorInfo.m_nXMLParsingLine != -1 ) + { + aErrStr += rtl::OUString::createFromAscii( ", line " ); + aErrStr += ::rtl::OUString::valueOf( aErrorInfo.m_nXMLParsingLine ); + } } } - } - OWeakObject* oWeakThis = static_cast(this); - throw deployment::DeploymentException( rtl::OUString(), oWeakThis, - makeAny( uno::Exception( aErrStr, oWeakThis ) ) ); + OWeakObject* oWeakThis = static_cast(this); + throw deployment::DeploymentException( rtl::OUString(), oWeakThis, + makeAny( uno::Exception( aErrStr, oWeakThis ) ) ); + } } } } + //Writing the data entry replaces writing the flag file. If we got to this + //point the registration was successful. + addDataToDb(xPackage->getURL(), data); } - //Writing the data entry replaces writing the flag file. If we got to this - //point the registration was successful. - addDataToDb(xPackage->getURL(), data); } //if (doRegisterPackage) else { - deleteDataFromDb(xPackage->getURL()); + revokeEntryFromDb(xPackage->getURL()); } } diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx index 8ec9a39d5050..81057f744640 100644 --- a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx +++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx @@ -83,11 +83,14 @@ OUString HelpBackendDb::getKeyElementName() void HelpBackendDb::addEntry(::rtl::OUString const & url, Data const & data) { try{ - Reference helpNode - = writeKeyElement(url); + if (!activateEntry(url)) + { + Reference helpNode + = writeKeyElement(url); - writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode); - save(); + writeSimpleElement(OUSTR("data-url"), data.dataUrl, helpNode); + save(); + } } catch (css::deployment::DeploymentException& ) { diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx index c7b730fd1b99..bcff008c00ae 100644 --- a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx +++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx @@ -76,6 +76,8 @@ public: void addEntry(::rtl::OUString const & url, Data const & data); ::boost::optional getEntry(::rtl::OUString const & url); + //must also return the data urls for entries with @activ="false". That is, + //those are currently revoked. ::std::list< ::rtl::OUString> getAllDataUrls(); }; diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h index 3d3bf7cf912c..2561c3a32b66 100644 --- a/desktop/source/deployment/registry/inc/dp_backend.h +++ b/desktop/source/deployment/registry/inc/dp_backend.h @@ -296,7 +296,7 @@ protected: // currently only for library containers: enum context { CONTEXT_UNKNOWN, - CONTEXT_USER, CONTEXT_SHARED,CONTEXT_BUNDLED, CONTEXT_TMP, + CONTEXT_USER, CONTEXT_SHARED,CONTEXT_BUNDLED, CONTEXT_TMP, CONTEXT_BUNDLED_PREREG, CONTEXT_DOCUMENT } m_eContext; bool m_readOnly; @@ -342,6 +342,18 @@ protected: static void deleteTempFolder( ::rtl::OUString const & folderUrl); + ::rtl::OUString getSharedRegistrationDataURL( + css::uno::Reference const & extension, + css::uno::Reference const & item); + + /* The backends must implement this function, which is called + from XPackageRegistry::packageRemoved (also implemented here). + This ensure that the backends clean up their registration data + when an extension was removed. + */ +// virtual void deleteDbEntry( ::rtl::OUString const & url) = 0; + + public: struct StrRegisteringPackage : public ::dp_misc::StaticResourceString< @@ -370,6 +382,12 @@ public: css::deployment::InvalidRemovedParameterException, css::ucb::CommandFailedException, css::lang::IllegalArgumentException, css::uno::RuntimeException); + +// virtual void SAL_CALL packageRemoved( +// ::rtl::OUString const & url, ::rtl::OUString const & mediaType) +// throw (css::deployment::DeploymentException, +// css::uno::RuntimeException); + }; } diff --git a/desktop/source/deployment/registry/inc/dp_backenddb.hxx b/desktop/source/deployment/registry/inc/dp_backenddb.hxx index a0e477979f8c..299a6ec328ce 100644 --- a/desktop/source/deployment/registry/inc/dp_backenddb.hxx +++ b/desktop/source/deployment/registry/inc/dp_backenddb.hxx @@ -147,6 +147,18 @@ public: virtual ~BackendDb() {}; void removeEntry(::rtl::OUString const & url); + + /* This is called to write the "revoked" attribute to the entry. + This is done when XPackage::revokePackage is called. + */ + void revokeEntry(::rtl::OUString const & url); + + /* returns false if the entry does not exist yet. + */ + bool activateEntry(::rtl::OUString const & url); + + bool hasActiveEntry(::rtl::OUString const & url); + }; class RegisteredDb: public BackendDb diff --git a/desktop/source/deployment/registry/package/dp_extbackenddb.cxx b/desktop/source/deployment/registry/package/dp_extbackenddb.cxx index 2e92a907f8fb..660d6bb374c3 100644 --- a/desktop/source/deployment/registry/package/dp_extbackenddb.cxx +++ b/desktop/source/deployment/registry/package/dp_extbackenddb.cxx @@ -82,15 +82,19 @@ OUString ExtensionBackendDb::getKeyElementName() void ExtensionBackendDb::addEntry(::rtl::OUString const & url, Data const & data) { try{ - Reference extensionNodeNode = writeKeyElement(url); - writeVectorOfPair( - data.items, - OUSTR("extension-items"), - OUSTR("item"), - OUSTR("url"), - OUSTR("media-type"), - extensionNodeNode); - save(); + //reactive revoked entry if possible. + if (!activateEntry(url)) + { + Reference extensionNodeNode = writeKeyElement(url); + writeVectorOfPair( + data.items, + OUSTR("extension-items"), + OUSTR("item"), + OUSTR("url"), + OUSTR("media-type"), + extensionNodeNode); + save(); + } } catch(css::uno::Exception &) { diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index feb55d0af3bf..302b36603619 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -247,7 +247,7 @@ class BackendImpl : public ImplBaseT void addDataToDb(OUString const & url, ExtensionBackendDb::Data const & data); ExtensionBackendDb::Data readDataFromDb(OUString const & url); - void deleteDataFromDb(OUString const & url); + void revokeEntryFromDb(OUString const & url); // PackageRegistryBackend virtual Reference bindPackage_( @@ -273,6 +273,9 @@ public: // XPackageRegistry virtual Sequence< Reference > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); + virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType) + throw (deployment::DeploymentException, + uno::RuntimeException); using ImplBaseT::disposing; }; @@ -357,6 +360,21 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException) return m_typeInfos; } +void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/) + throw (deployment::DeploymentException, + uno::RuntimeException) +{ + //Notify the backend responsible for processing the different media + //types that this extension was removed. + ExtensionBackendDb::Data data = readDataFromDb(url); + for (ExtensionBackendDb::Data::ITC_ITEMS i = data.items.begin(); i != data.items.end(); i++) + { + m_xRootRegistry->packageRemoved(i->first, i->second); + } + + if (m_backendDb.get()) + m_backendDb->removeEntry(url); +} // PackageRegistryBackend @@ -457,10 +475,10 @@ ExtensionBackendDb::Data BackendImpl::readDataFromDb( return data; } -void BackendImpl::deleteDataFromDb(OUString const & url) +void BackendImpl::revokeEntryFromDb(OUString const & url) { if (m_backendDb.get()) - m_backendDb->removeEntry(url); + m_backendDb->revokeEntry(url); } @@ -970,7 +988,7 @@ void BackendImpl::PackageImpl::processPackage_( // selected } } - getMyBackend()->deleteDataFromDb(getURL()); + getMyBackend()->revokeEntryFromDb(getURL()); } } diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx index edeae256cbaf..dddf82e09790 100644 --- a/desktop/source/deployment/registry/script/dp_script.cxx +++ b/desktop/source/deployment/registry/script/dp_script.cxx @@ -101,13 +101,8 @@ class BackendImpl : public t_helper Reference const & xCmdEnv ); void addDataToDb(OUString const & url); - void deleteDataFromDb(OUString const & url); - bool isRegisteredInDb(OUString const & url); - - - -// Reference< ucb::XSimpleFileAccess > getFileAccess( void ); -// Reference< ucb::XSimpleFileAccess > m_xSFA; + bool hasActiveEntry(OUString const & url); + void revokeEntryFromDb(OUString const & url); const Reference m_xBasicLibTypeInfo; const Reference m_xDialogLibTypeInfo; @@ -123,6 +118,10 @@ public: // XPackageRegistry virtual Sequence< Reference > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); + virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType) + throw (deployment::DeploymentException, + uno::RuntimeException); + }; //______________________________________________________________________________ @@ -191,18 +190,11 @@ void BackendImpl::addDataToDb(OUString const & url) m_backendDb->addEntry(url); } -bool BackendImpl::isRegisteredInDb(OUString const & url) +bool BackendImpl::hasActiveEntry(OUString const & url) { - bool registered = false; if (m_backendDb.get()) - registered = m_backendDb->getEntry(url); - return registered; -} - -void BackendImpl::deleteDataFromDb(OUString const & url) -{ - if (m_backendDb.get()) - m_backendDb->removeEntry(url); + return m_backendDb->hasActiveEntry(url); + return false; } // XUpdatable @@ -219,6 +211,19 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException) { return m_typeInfos; } +void BackendImpl::revokeEntryFromDb(OUString const & url) +{ + if (m_backendDb.get()) + m_backendDb->revokeEntry(url); +} + +void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/) + throw (deployment::DeploymentException, + uno::RuntimeException) +{ + if (m_backendDb.get()) + m_backendDb->removeEntry(url); +} // PackageRegistryBackend //______________________________________________________________________________ @@ -321,7 +326,7 @@ BackendImpl::PackageImpl::isRegistered_( BackendImpl * that = getMyBackend(); Reference< deployment::XPackage > xThisPackage( this ); - bool registered = that->isRegisteredInDb(getURL()); + bool registered = that->hasActiveEntry(getURL()); return beans::Optional< beans::Ambiguous >( true /* IsPresent */, beans::Ambiguous( registered, false /* IsAmbiguous */ ) ); @@ -367,7 +372,7 @@ void BackendImpl::PackageImpl::processPackage_( xComponentContext ), UNO_QUERY_THROW ); } } - bool bRegistered = getMyBackend()->isRegisteredInDb(getURL()); + bool bRegistered = getMyBackend()->hasActiveEntry(getURL()); if( !doRegisterPackage ) { //We cannot just call removeLibrary(name) because this could remove a @@ -399,7 +404,7 @@ void BackendImpl::PackageImpl::processPackage_( xDialogLibs->removeLibrary(m_dialogName); } } - getMyBackend()->deleteDataFromDb(getURL()); + getMyBackend()->revokeEntryFromDb(getURL()); return; } } diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx index 8a4ee1b45fbc..a24512095bc0 100644 --- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx +++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx @@ -99,6 +99,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend const Reference m_xTypeInfo; + public: BackendImpl( Sequence const & args, @@ -107,6 +108,9 @@ public: // XPackageRegistry virtual Sequence< Reference > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); + virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType) + throw (deployment::DeploymentException, + uno::RuntimeException); }; BackendImpl * BackendImpl::PackageImpl::getMyBackend() const @@ -211,6 +215,8 @@ BackendImpl::BackendImpl( } } + + // XPackageRegistry //______________________________________________________________________________ Sequence< Reference > @@ -219,6 +225,12 @@ BackendImpl::getSupportedPackageTypes() throw (RuntimeException) return Sequence< Reference >(&m_xTypeInfo, 1); } +void BackendImpl::packageRemoved(OUString const & /*url*/, OUString const & /*mediaType*/) + throw (deployment::DeploymentException, + uno::RuntimeException) +{ +} + // PackageRegistryBackend //______________________________________________________________________________ Reference BackendImpl::bindPackage_( @@ -331,6 +343,11 @@ void BackendImpl::PackageImpl:: initPackageHandler() { aContext <<= OUSTR("bundled"); } + else if ( that->m_eContext == CONTEXT_BUNDLED_PREREG ) + { + aContext <<= OUSTR("bundled_prereg"); + } + else { OSL_ASSERT( 0 ); diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 4545ed862271..315316fe475a 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -380,7 +380,12 @@ extern "C" int unopkg_main() } else if (subCommand.equals(OUSTR("sync"))) { - //sync is private!!!! Only for bundled extensions!!! + //sync is private!!!! Only to be called from setup!!! + //The UserInstallation is diverted to the prereg folder. But only + //the lock file is written! This requires that + //-env:UNO_JAVA_JFW_INSTALL_DATA is passed to javaldx and unopkg otherwise the + //javasettings file is written to the prereg folder. + // //For performance reasons unopkg sync is called during the setup and //creates the registration data for the repository of the bundled //extensions. It is then copied to the user installation during @@ -399,6 +404,17 @@ extern "C" int unopkg_main() //return otherwise we create the registration data again return 0; } + //redirect the UserInstallation, so we do not create a + //user installation for the admin and we also do not need + //to call unopkg with -env:UserInstallation + ::rtl::Bootstrap::set(OUSTR("UserInstallation"), + OUSTR("$BUNDLED_EXTENSIONS_PREREG/..")); + //Setting UNO_JAVA_JFW_INSTALL_DATA causes the javasettings to be written + //in the office installation. We do not want to create the user data folder + //for the admin. The value must also be set in the unopkg script (Linux, etc.) + //when calling javaldx + ::rtl::Bootstrap::set(OUSTR("UNO_JAVA_JFW_INSTALL_DATA"), + OUSTR("$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml")); } @@ -418,6 +434,7 @@ extern "C" int unopkg_main() //prevent the deletion of the registry data folder //synching is done in XExtensionManager.reinstall if (!subcmd_gui && ! subCommand.equals(OUSTR("reinstall")) + && ! subCommand.equals(OUSTR("sync")) && ! dp_misc::office_is_running()) dp_misc::syncRepositories(xCmdEnv); @@ -613,12 +630,15 @@ extern "C" int unopkg_main() } else if (subCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("sync"))) { - //This sub command may be removed later and is only there to have a - //possibility to start extension synching without any output. - //This is just here so we do not get an error, because of an unknown - //sub-command. We do synching before - //the sub-commands are processed. - + if (! dp_misc::office_is_running()) + { + xExtensionManager->synchronizeBundledPrereg( + Reference(), xCmdEnv); + } + else + { + dp_misc::writeConsoleError(OUSTR("\nError: office is running")); + } } else { -- cgit From 1dc4184c9bc6bbb32a657d205c90422b9790ae38 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 29 Sep 2010 09:11:20 +0200 Subject: jl160 #i114794# registration data folder of bundled extensions in the user installation references PREREG registration data in brand/share/prereg/bundled folder --- .../source/packinfo/shellscripts_extensions.txt | 168 +---------------- .../shellextensions/registerextensions.cxx | 208 ++++++++++----------- 2 files changed, 108 insertions(+), 268 deletions(-) diff --git a/setup_native/source/packinfo/shellscripts_extensions.txt b/setup_native/source/packinfo/shellscripts_extensions.txt index c73e7fae5838..0be870990b71 100755 --- a/setup_native/source/packinfo/shellscripts_extensions.txt +++ b/setup_native/source/packinfo/shellscripts_extensions.txt @@ -2,26 +2,6 @@ %postinstall << END -if [ -n "$$TMPDIR" ]; then - UNOPKGTMP="$$TMPDIR" -elif [ -n "$$TMP" ]; then - UNOPKGTMP="$$TMP" -elif [ -d "/tmp" ]; then - UNOPKGTMP="/tmp" -else - echo "No tmp directory found!" - exit 1 -fi - -#Create the command which creates a temporary directory -if [ -x "/usr/bin/mktemp" ] -then - INSTDIR=`/usr/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"` -else - INSTDIR="$${UNOPKGTMP}/userinstall.$$$$" - mkdir "$$INSTDIR" -fi - # # Need to check diskless service install and make sure use the correct unpkg # @@ -38,7 +18,7 @@ fi if [ -x $$POSTRUN ]; then ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0" echo "umask 022" - echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" + echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync" echo "find \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;" ) | $$POSTRUN -b -c UNOPKG if [ "$$?" != "0" ]; then @@ -48,7 +28,7 @@ if [ -x $$POSTRUN ]; then fi else # No postrun available, try running unopkg directly - "$$UNOPKG" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$UNOPKG" sync find "$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; if [ "$$?" != "0" ]; then echo "\nERROR: Installation of UNO extensions failed." @@ -58,48 +38,23 @@ else fi fi -if [ -n "$$INSTDIR" ]; then - rm -rf "$$INSTDIR" -fi - exit 0 END %postremove << END -if [ -n "$$TMPDIR" ]; then - UNOPKGTMP="$$TMPDIR" -elif [ -n "$$TMP" ]; then - UNOPKGTMP="$$TMP" -elif [ -d "/tmp" ]; then - UNOPKGTMP="/tmp" -else - echo "No tmp directory found!" - exit 1 -fi - -#Create the command which creates a temporary directory -if [ -x "/usr/bin/mktemp" ] -then - INSTDIR=`/usr/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"` -else - INSTDIR="$${UNOPKGTMP}/userinstall.$$$$" - mkdir "$$INSTDIR" -fi - # Use postrun command on Solaris where available (OpenSolaris) if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0" echo "cd \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program\"" echo "umask 022" - echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" + echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync" echo "find \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;" - echo "rm -rf \"$$INSTDIR\"" ) | $$PKG_INSTALL_ROOT/usr/lib/postrun -c UNOPKG else # No postrun available, try running unopkg directly test -x $$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg || exit 0 - "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync echo "find \"$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;" if [ "$$?" != "0" ]; then echo "\nERROR: Removal of UNO extension failed." @@ -109,9 +64,6 @@ else fi fi -if [ -n "$$INSTDIR" ]; then - rm -rf "$$INSTDIR" -fi exit 0 END @@ -121,151 +73,47 @@ END %format rpm %postinstall << END -#Find the temp dir -if [ -n "$$TMPDIR" ]; then - UNOPKGTMP="$$TMPDIR" -elif [ -n "$$TMP" ]; then - UNOPKGTMP="$$TMP" -elif [ -d "/tmp" ]; then - UNOPKGTMP="/tmp" -else - echo "No tmp directory found!" - exit 1 -fi - -#Create the command which creates a temporary directory -if [ -x "/bin/mktemp" ] -then - INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"` -else - INSTDIR="$${UNOPKGTMP}/userinstall.$$$$" - mkdir "$$INSTDIR" -fi if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then - "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync find "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; fi -if [ -n "$$INSTDIR" ]; then - rm -rf "$$INSTDIR" -fi - exit 0 END %postremove << END -#Find the temp dir -if [ -n "$$TMPDIR" ]; then - UNOPKGTMP="$$TMPDIR" -elif [ -n "$$TMP" ]; then - UNOPKGTMP="$$TMP" -elif [ -d "/tmp" ]; then - UNOPKGTMP="/tmp" -else - echo "No tmp directory found!" - exit 1 -fi - -#Create the command which creates a temporary directory -if [ -x "/bin/mktemp" ] -then - INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"` -else - INSTDIR="$${UNOPKGTMP}/userinstall.$$$$" - mkdir "$$INSTDIR" -fi if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then - "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync find "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; fi -if [ -n "$$INSTDIR" ]; then - rm -rf "$$INSTDIR" -fi - exit 0 END %format deb %postinstall << END -#Find the temp dir -if [ -n "$$TMPDIR" ] -then - UNOPKGTMP="$$TMPDIR" -elif [ -n "$$TMP" ] -then - UNOPKGTMP="$$TMP" -elif [ -d "/tmp" ] -then - UNOPKGTMP="/tmp" -else - echo "No tmp directory found!" - exit 1 -fi - -#Create the command which creates a temporary directory -if [ -x "/bin/mktemp" ] -then - INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"` -else - INSTDIR="$${UNOPKGTMP}/userinstall.$$$$" - mkdir "$$INSTDIR" -fi if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]; then - "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "PRODUCTDIRECTORYNAME/program/unopkg" sync find "PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; fi -if [ -n "$$INSTDIR" ] -then - rm -rf "$$INSTDIR" -fi - exit 0 END %postremove << END -# Find the temp dir -if [ -n "$$TMPDIR" ] -then - UNOPKGTMP="$$TMPDIR" -elif [ -n "$$TMP" ] -then - UNOPKGTMP="$$TMP" -elif [ -d "/tmp" ] -then - UNOPKGTMP="/tmp" -else - echo "No tmp directory found!" - exit 1 -fi - -#Create the command which creates a temporary directory -if [ -x "/bin/mktemp" ] -then - INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"` -else - INSTDIR="$${UNOPKGTMP}/userinstall.$$$$" - mkdir "$$INSTDIR" -fi if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ] then - "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "PRODUCTDIRECTORYNAME/program/unopkg" sync find "PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; fi -if [ -n "$$INSTDIR" ] -then - rm -rf "$$INSTDIR" -fi - exit 0 END diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx index 9eaad6959a63..9a748e9f2008 100644 --- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx +++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx @@ -58,112 +58,112 @@ The returned string is a file URL. */ -static std::_tstring createTempFolder() -{ - BOOL bExist = FALSE; - TCHAR szTempName[MAX_PATH]; - do - { - bExist = FALSE; - // Get the temp path. - TCHAR lpPathBuffer[MAX_PATH]; - DWORD dwRetVal = GetTempPath(MAX_PATH, lpPathBuffer); - if (dwRetVal > MAX_PATH || (dwRetVal == 0)) - { - //fprintf (stderr, "GetTempPath failed with error %d.\n", GetLastError()); - return TEXT(""); - } - // Create a temporary file. - UINT uRetVal = GetTempFileName(lpPathBuffer, // directory for tmp files - "upg", // temp file name prefix - 0, // create unique name - szTempName); // buffer for name - if (uRetVal == 0) - { - //fprintf (stderr, "GetTempFileName failed with error %d.\n", GetLastError()); - return TEXT(""); - } - //Delete the file - BOOL bDel = DeleteFile(szTempName); - if (FALSE == bDel) - { - //fprintf(stderr, "Could not delete temp file. Error %d.\n", GetLastError()); - return TEXT(""); - } - // Create the directory - BOOL bDir = CreateDirectory(szTempName, NULL); - if (FALSE == bDir) - { - DWORD error =GetLastError(); - if (ERROR_ALREADY_EXISTS == error) - { - bExist = TRUE; - } - else - { - //fprintf(stderr, "CreateDirectory failed with error %d.\n", error); - return TEXT(""); - } - } - } while(bExist); +// static std::_tstring createTempFolder() +// { +// BOOL bExist = FALSE; +// TCHAR szTempName[MAX_PATH]; +// do +// { +// bExist = FALSE; +// // Get the temp path. +// TCHAR lpPathBuffer[MAX_PATH]; +// DWORD dwRetVal = GetTempPath(MAX_PATH, lpPathBuffer); +// if (dwRetVal > MAX_PATH || (dwRetVal == 0)) +// { +// //fprintf (stderr, "GetTempPath failed with error %d.\n", GetLastError()); +// return TEXT(""); +// } +// // Create a temporary file. +// UINT uRetVal = GetTempFileName(lpPathBuffer, // directory for tmp files +// "upg", // temp file name prefix +// 0, // create unique name +// szTempName); // buffer for name +// if (uRetVal == 0) +// { +// //fprintf (stderr, "GetTempFileName failed with error %d.\n", GetLastError()); +// return TEXT(""); +// } +// //Delete the file +// BOOL bDel = DeleteFile(szTempName); +// if (FALSE == bDel) +// { +// //fprintf(stderr, "Could not delete temp file. Error %d.\n", GetLastError()); +// return TEXT(""); +// } +// // Create the directory +// BOOL bDir = CreateDirectory(szTempName, NULL); +// if (FALSE == bDir) +// { +// DWORD error =GetLastError(); +// if (ERROR_ALREADY_EXISTS == error) +// { +// bExist = TRUE; +// } +// else +// { +// //fprintf(stderr, "CreateDirectory failed with error %d.\n", error); +// return TEXT(""); +// } +// } +// } while(bExist); - std::_tstring cur(szTempName); - //make a file URL from the path - std::_tstring ret(TEXT("file:///")); - for (std::_tstring::iterator i = cur.begin(); i != cur.end(); i++) - { - if (*i == '\\') - ret.append(TEXT("/")); - else - ret.push_back(*i); - } -// MessageBox(NULL, ret.c_str(), "createTempFolder", MB_OK); - return ret.c_str(); -} +// std::_tstring cur(szTempName); +// //make a file URL from the path +// std::_tstring ret(TEXT("file:///")); +// for (std::_tstring::iterator i = cur.begin(); i != cur.end(); i++) +// { +// if (*i == '\\') +// ret.append(TEXT("/")); +// else +// ret.push_back(*i); +// } +// // MessageBox(NULL, ret.c_str(), "createTempFolder", MB_OK); +// return ret.c_str(); +// } /** deletes the temporary folder. The argument must be a file URL. */ -static void deleteTempFolder(const std::_tstring& sTempFolder) -{ - if (sTempFolder.size() == 0) - return; - //convert the file URL to a path - const std::_tstring path(sTempFolder.substr(8)); - std::_tstring path2; -// MessageBox(NULL, path.c_str(), "del1", MB_OK); - for (std::_tstring::const_iterator i = path.begin(); i != path.end(); i++) - { - if (*i == '/') - path2.append(TEXT("\\")); - else - path2.push_back(*i); - } +// static void deleteTempFolder(const std::_tstring& sTempFolder) +// { +// if (sTempFolder.size() == 0) +// return; +// //convert the file URL to a path +// const std::_tstring path(sTempFolder.substr(8)); +// std::_tstring path2; +// // MessageBox(NULL, path.c_str(), "del1", MB_OK); +// for (std::_tstring::const_iterator i = path.begin(); i != path.end(); i++) +// { +// if (*i == '/') +// path2.append(TEXT("\\")); +// else +// path2.push_back(*i); +// } - //We need a null terminated string with two nulls in the end - //for the SHFILEOPSTRUCT - const TCHAR * szTemp = path2.c_str(); - size_t size = path2.size(); - TCHAR * szTemp2 = new TCHAR[size + 2]; - ZeroMemory(szTemp2, (size + 2) * sizeof(TCHAR)); - memcpy(szTemp2, szTemp, size * sizeof(TCHAR)); +// //We need a null terminated string with two nulls in the end +// //for the SHFILEOPSTRUCT +// const TCHAR * szTemp = path2.c_str(); +// size_t size = path2.size(); +// TCHAR * szTemp2 = new TCHAR[size + 2]; +// ZeroMemory(szTemp2, (size + 2) * sizeof(TCHAR)); +// memcpy(szTemp2, szTemp, size * sizeof(TCHAR)); -// MessageBox(NULL, szTemp2, "del3", MB_OK); - SHFILEOPSTRUCT operation = - { - NULL, - FO_DELETE, - szTemp2, - NULL, - FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR, - FALSE, - NULL, - NULL - }; - - SHFileOperation( &operation); - delete [] szTemp2; -} +// // MessageBox(NULL, szTemp2, "del3", MB_OK); +// SHFILEOPSTRUCT operation = +// { +// NULL, +// FO_DELETE, +// szTemp2, +// NULL, +// FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR, +// FALSE, +// NULL, +// NULL +// }; + +// SHFileOperation( &operation); +// delete [] szTemp2; +// } @@ -332,21 +332,13 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle) if ( hFindUnopkg != INVALID_HANDLE_VALUE ) { // unopkg.exe exists in program directory - - const std::_tstring sTempFolder(createTempFolder()); - std::_tstring sCommandPart1 = sUnoPkgFile + " sync"; - std::_tstring sCommand = sCommandPart1 - + TEXT(" -env:BUNDLED_EXTENSIONS_USER=$BRAND_BASE_DIR/share/prereg/bundled") - + TEXT(" -env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml") - + TEXT(" -env:UserInstallation=") + sTempFolder; + std::_tstring sCommand = sUnoPkgFile + " sync"; mystr = "Command: " + sCommand; //MessageBox(NULL, mystr.c_str(), "Command", MB_OK); DWORD exitCode = 0; bool fSuccess = ExecuteCommand( sCommand.c_str(), & exitCode); - deleteTempFolder(sTempFolder); - // if ( fSuccess ) // { // mystr = "Executed successfully!"; -- cgit From 22d35b3da3f3711a35da8ea26599823e4a0491b1 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 29 Sep 2010 09:11:20 +0200 Subject: jl160 #i114794# registration data folder of bundled extensions in the user installation references PREREG registration data in brand/share/prereg/bundled folder --- scp2/source/ooo/common_brand.scp | 8 ++++++++ scp2/source/ooo/profileitem_ooo.scp | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp index 5ed8c9739f9c..4267fbffc2c8 100644 --- a/scp2/source/ooo/common_brand.scp +++ b/scp2/source/ooo/common_brand.scp @@ -1249,6 +1249,14 @@ ProfileItem gid_Brand_Profileitem_Fundamental_Uno_Bundled_Extensions_User Value = "${${OOO_BASE_DIR}/program/" PROFILENAME(fundamentalbasis) ":BUNDLED_EXTENSIONS_USER}"; End +ProfileItem gid_Brand_Profileitem_Fundamental_Uno_Bundled_Extensions_Prereg + ModuleID = gid_Module_Root_Brand; + ProfileID = gid_Brand_Profile_Fundamental_Ini; + Section = "Bootstrap"; + Key = "BUNDLED_EXTENSIONS_PREREG"; + Value = "${${OOO_BASE_DIR}/program/" PROFILENAME(fundamentalbasis) ":BUNDLED_EXTENSIONS_PREREG}"; +End + ProfileItem gid_Brand_Profileitem_Fundamental_Uno_Shared_Packages_Cache ModuleID = gid_Module_Root_Brand; ProfileID = gid_Brand_Profile_Fundamental_Ini; diff --git a/scp2/source/ooo/profileitem_ooo.scp b/scp2/source/ooo/profileitem_ooo.scp index 724316ba6f5e..81bfb6a8dd2d 100644 --- a/scp2/source/ooo/profileitem_ooo.scp +++ b/scp2/source/ooo/profileitem_ooo.scp @@ -191,6 +191,16 @@ ProfileItem gid_Profileitem_Uno_Uno_Bundled_Extensions_User Value = "${$BRAND_BASE_DIR/program/" PROFILENAME(bootstrap) ":UserInstallation}/user/extensions/bundled"; End +ProfileItem gid_Profileitem_Uno_Uno_Bundled_Extensions_Prereg + ProfileID = gid_Profile_Uno_Ini; + ModuleID = gid_Module_Root; + Section = "Bootstrap"; + Order = 1; + Key = "BUNDLED_EXTENSIONS_PREREG"; + Value = "$BRAND_BASE_DIR/share/prereg/bundled"; +End + + ProfileItem gid_Profileitem_Uno_Uno_Shared_Packages ProfileID = gid_Profile_Uno_Ini; ModuleID = gid_Module_Root; @@ -287,6 +297,14 @@ ProfileItem gid_Profileitem_Fundamentalbasis_Uno_Bundled_Extensions_User Value = "${$ORIGIN/" PROFILENAME(uno) ":BUNDLED_EXTENSIONS_USER}"; End +ProfileItem gid_Profileitem_Fundamentalbasis_Uno_Bundled_Extensions_Prereg + ModuleID = gid_Module_Root; + ProfileID = gid_Profile_Fundamentalbasis_Ini; + Section = "Bootstrap"; + Key = "BUNDLED_EXTENSIONS_PREREG"; + Value = "${$ORIGIN/" PROFILENAME(uno) ":BUNDLED_EXTENSIONS_PREREG}"; +End + ProfileItem gid_Profileitem_Fundamentalbasis_Uno_Shared_Packages_Cache ModuleID = gid_Module_Root; ProfileID = gid_Profile_Fundamentalbasis_Ini; -- cgit From c8108e906f998f14a0a7f0125674970b55def952 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 29 Sep 2010 09:11:20 +0200 Subject: jl160 #i114794# registration data folder of bundled extensions in the user installation references PREREG registration data in brand/share/prereg/bundled folder --- .../com/sun/star/deployment/XExtensionManager.idl | 21 +++++++++++++++++++++ offapi/com/sun/star/deployment/XPackageRegistry.idl | 7 +++++++ 2 files changed, 28 insertions(+) diff --git a/offapi/com/sun/star/deployment/XExtensionManager.idl b/offapi/com/sun/star/deployment/XExtensionManager.idl index b807df54af65..679ba2ba5a66 100644 --- a/offapi/com/sun/star/deployment/XExtensionManager.idl +++ b/offapi/com/sun/star/deployment/XExtensionManager.idl @@ -281,6 +281,8 @@ interface XExtensionManager Added extensions will be added to the database and removed extensions will be removed from the database. + The active extensions are determined. That is, shared or bundled extensions + are not necessaryly registered (XPackage::registerPackage). @return If true - then at least one extension was removed or added. Otherwise @@ -295,6 +297,25 @@ interface XExtensionManager com::sun::star::lang::IllegalArgumentException); + /** synchronizes the special bundled_prereg repository, which is based on + the bundled extensions and has its registration data folder at + $BUNDLED_EXTENSIONS_PREREG (for example openoffice.org3/share/prereg). + + All bundled extensions are registered (XPackage::registerPackage). + The active extensions are NOT determined, because this function only works + with bundled extensions. + + This function is intended to be called during the installation of OOo. + OOo will copy parts of the registration data folder to the user installation at the + first startup. + */ + + void synchronizeBundledPrereg( + [in] com::sun::star::task::XAbortChannel xAbortChannel, + [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv ) + raises (DeploymentException); + + /** returns all extensions which are currently not in use because the user did not accept the license. diff --git a/offapi/com/sun/star/deployment/XPackageRegistry.idl b/offapi/com/sun/star/deployment/XPackageRegistry.idl index c84f37625ec5..a8e3f556781d 100644 --- a/offapi/com/sun/star/deployment/XPackageRegistry.idl +++ b/offapi/com/sun/star/deployment/XPackageRegistry.idl @@ -115,6 +115,13 @@ interface XPackageRegistry supported XPackageTypeInfos. */ sequence getSupportedPackageTypes(); + + void packageRemoved( + [in] string url, + [in] string mediaType) + raises (DeploymentException, + com::sun::star::lang::IllegalArgumentException); + }; }; }; }; }; -- cgit From 0e9b0a1f1282d9accc255f93fd3053d1f256087d Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 30 Sep 2010 12:03:02 +0200 Subject: jl160 #i114550# crash in extension update dialog or updchk thread when an extension was removed and OOo was not synchronized at startup --- .../source/deployment/gui/dp_gui_updatedialog.cxx | 4 +++ .../deployment/manager/dp_informationprovider.cxx | 33 ++++------------------ 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index b27cd8da81fe..37bc836a345d 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -399,6 +399,10 @@ void UpdateDialog::Thread::execute() css::uno::Reference()); } catch (css::lang::IllegalArgumentException& ) { OSL_ASSERT(0); + continue; + } catch (css::ucb::CommandFailedException& ) { + OSL_ASSERT(0); + continue; } OSL_ASSERT(extensions.getLength() == 3); if (extensions[0].is() ) diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx b/desktop/source/deployment/manager/dp_informationprovider.cxx index 4cc43a8386d8..6d4750bb2447 100644 --- a/desktop/source/deployment/manager/dp_informationprovider.cxx +++ b/desktop/source/deployment/manager/dp_informationprovider.cxx @@ -40,9 +40,8 @@ #include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/registry/XRegistryKey.hpp" #include "com/sun/star/task/XAbortChannel.hpp" -#include "com/sun/star/ucb/CommandFailedException.hpp" -#include "com/sun/star/ucb/XCommandEnvironment.hpp" #include "com/sun/star/uno/XComponentContext.hpp" +#include "com/sun/star/ucb/XCommandEnvironment.hpp" #include "com/sun/star/xml/dom/XElement.hpp" #include "com/sun/star/xml/dom/XNode.hpp" @@ -71,9 +70,8 @@ namespace xml = com::sun::star::xml ; namespace dp_info { class PackageInformationProvider : - public ::cppu::WeakImplHelper3< deployment::XPackageInformationProvider, - css_ucb::XCommandEnvironment, - task::XInteractionHandler > + public ::cppu::WeakImplHelper1< deployment::XPackageInformationProvider > + { public: PackageInformationProvider( uno::Reference< uno::XComponentContext >const& xContext); @@ -82,16 +80,6 @@ class PackageInformationProvider : static uno::Sequence< rtl::OUString > getServiceNames(); static rtl::OUString getImplName(); - // XInteractionHandler - virtual void SAL_CALL handle( const uno::Reference< task::XInteractionRequest >& Request ) - throw( uno::RuntimeException ); - // XCommandEnvironment - virtual uno::Reference< task::XInteractionHandler > SAL_CALL getInteractionHandler() - throw ( uno::RuntimeException ) { return static_cast(this); }; - - virtual uno::Reference< css_ucb::XProgressHandler > SAL_CALL getProgressHandler() - throw ( uno::RuntimeException ) { return uno::Reference< css_ucb::XProgressHandler >(); }; - // XPackageInformationProvider virtual rtl::OUString SAL_CALL getPackageLocation( const rtl::OUString& extensionId ) throw ( uno::RuntimeException ); @@ -124,17 +112,6 @@ PackageInformationProvider::~PackageInformationProvider() { } -//------------------------------------------------------------------------------ -void SAL_CALL PackageInformationProvider::handle( uno::Reference< task::XInteractionRequest > const & rRequest) - throw (uno::RuntimeException) -{ - uno::Sequence< uno::Reference< task::XInteractionContinuation > > xContinuations = rRequest->getContinuations(); - if ( xContinuations.getLength() == 1 ) - { - xContinuations[0]->select(); - } -} - //------------------------------------------------------------------------------ rtl::OUString PackageInformationProvider::getPackageLocation( const rtl::OUString & repository, @@ -150,7 +127,7 @@ rtl::OUString PackageInformationProvider::getPackageLocation( xManager->getDeployedExtensions( repository, uno::Reference< task::XAbortChannel >(), - static_cast < XCommandEnvironment *> (this) ) ); + uno::Reference< css_ucb::XCommandEnvironment > () ) ); for ( int pos = packages.getLength(); pos--; ) { @@ -320,7 +297,7 @@ uno::Sequence< uno::Sequence< rtl::OUString > > SAL_CALL PackageInformationProvi const uno::Sequence< uno::Sequence< uno::Reference > > allExt = mgr->getAllExtensions( uno::Reference< task::XAbortChannel >(), - static_cast < XCommandEnvironment *> (this) ); + uno::Reference< css_ucb::XCommandEnvironment > () ); uno::Sequence< uno::Sequence< rtl::OUString > > retList; -- cgit From b7f61395f7318ddb0f228815e525614f3bb9e7ee Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 30 Sep 2010 13:51:42 +0200 Subject: jl160 #i114853# replace use of XPackageManager by XExtensionManager in xmlhelp --- xmlhelp/source/cxxhelp/provider/databases.cxx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index f1113c1e114f..d798f6c42f81 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -42,6 +42,7 @@ #include // Extensible help +#include "com/sun/star/deployment/ExtensionManager.hpp" #include "com/sun/star/deployment/thePackageManagerFactory.hpp" #include #include @@ -1587,10 +1588,9 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextUserHelpPack if( !m_bUserPackagesLoaded ) { - Reference< XPackageManager > xUserManager = - thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("user") ); - m_aUserPackagesSeq = xUserManager->getDeployedPackages - ( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() ); + Reference< XExtensionManager > xExtensionManager = ExtensionManager::get(m_xContext); + m_aUserPackagesSeq = xExtensionManager->getDeployedExtensions + ( rtl::OUString::createFromAscii("user"), Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() ); m_bUserPackagesLoaded = true; } @@ -1616,10 +1616,9 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextSharedHelpPa if( !m_bSharedPackagesLoaded ) { - Reference< XPackageManager > xSharedManager = - thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("shared") ); - m_aSharedPackagesSeq = xSharedManager->getDeployedPackages - ( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() ); + Reference< XExtensionManager > xExtensionManager = ExtensionManager::get(m_xContext); + m_aSharedPackagesSeq = xExtensionManager->getDeployedExtensions + ( rtl::OUString::createFromAscii("shared"), Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() ); m_bSharedPackagesLoaded = true; } @@ -1645,10 +1644,9 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextBundledHelpP if( !m_bBundledPackagesLoaded ) { - Reference< XPackageManager > xBundledManager = - thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("bundled") ); - m_aBundledPackagesSeq = xBundledManager->getDeployedPackages - ( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() ); + Reference< XExtensionManager > xExtensionManager = ExtensionManager::get(m_xContext); + m_aBundledPackagesSeq = xExtensionManager->getDeployedExtensions + ( rtl::OUString::createFromAscii("bundled"), Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() ); m_bBundledPackagesLoaded = true; } -- cgit From 101f7deee2d17eb5df8bd3687d50e818c363a2e1 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 30 Sep 2010 14:05:22 +0200 Subject: jl160 #i114568# reinstall should use start flag = true --- desktop/source/deployment/manager/dp_extensionmanager.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index 492bab566aeb..a6acde82a365 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -1099,7 +1099,7 @@ void ExtensionManager::reinstallDeployedExtensions( const OUString id = dp_misc::getIdentifier(extensions[ pos ]); const OUString fileName = extensions[ pos ]->getName(); OSL_ASSERT(id.getLength()); - activateExtension(id, fileName, false, false, xAbortChannel, xCmdEnv ); + activateExtension(id, fileName, false, true, xAbortChannel, xCmdEnv ); } catch (lang::DisposedException &) { -- cgit From 6649d8cc20b8147175ef59d3c870cfd2e47d72d8 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 30 Sep 2010 14:26:35 +0200 Subject: jl160 #i114782# make libxmlsec buildable with older lixml2 versions --- libxmlsec/xmlsec1-olderlibxml2.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libxmlsec/xmlsec1-olderlibxml2.patch b/libxmlsec/xmlsec1-olderlibxml2.patch index b5f3d5747586..f2bd85f5113b 100644 --- a/libxmlsec/xmlsec1-olderlibxml2.patch +++ b/libxmlsec/xmlsec1-olderlibxml2.patch @@ -4,7 +4,7 @@ return(0); } -+#if !defined(LIBXML_VERSION) || LIBXML_VERSION < 20706 ++#if !defined(LIBXML_VERSION) || LIBXML_VERSION < 20704 +/* + * xmlC14NMode: + * -- cgit From 2d6acff255b7dc6ffcde06d51b29256498b0a400 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 30 Sep 2010 16:58:42 +0200 Subject: jl160 #i112787# XPackage objects were not destroyed when shutting down OOo. --- desktop/source/deployment/registry/dp_backend.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index aebe56622f6b..144ec53d14ba 100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -65,6 +65,7 @@ PackageRegistryBackend::~PackageRegistryBackend() void PackageRegistryBackend::disposing( lang::EventObject const & event ) throw (RuntimeException) { + check(); Reference xPackage( event.Source, UNO_QUERY_THROW ); OUString url( xPackage->getURL() ); @@ -124,6 +125,9 @@ void PackageRegistryBackend::check() void PackageRegistryBackend::disposing() { try { + for ( t_string2ref::const_iterator i = m_bound.begin(); i != m_bound.end(); i++) + i->second->removeEventListener(this); + m_bound.clear(); m_xComponentContext.clear(); WeakComponentImplHelperBase::disposing(); } -- cgit From 3fad4cfd0d8d6b7854db4e5864fa3fba7092be65 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Fri, 1 Oct 2010 11:30:18 +0200 Subject: jl160 #i112760# deinitialize ucb when shutting down unopkg --- desktop/source/pkgchk/unopkg/unopkg_misc.cxx | 1 + desktop/source/pkgchk/unopkg/unopkg_shared.h | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index d7b6e1ca2336..d1471866206c 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -396,6 +396,7 @@ Reference bootstrapStandAlone( if (! ::ucbhelper::ContentBroker::initialize( xServiceManager, ucb_args )) throw RuntimeException( OUSTR("cannot initialize UCB!"), 0 ); + disposeGuard.setDeinitUCB(); return xContext; } diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h index 4975cc4c087b..55c86260ca8f 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_shared.h +++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h @@ -34,6 +34,7 @@ #include "tools/resmgr.hxx" #include "rtl/ustring.hxx" #include "unotools/configmgr.hxx" +#include "ucbhelper/contentbroker.hxx" #define APP_NAME "unopkg" @@ -137,15 +138,14 @@ bool isBootstrapVariable(sal_uInt32 * pIndex); class DisposeGuard { css::uno::Reference m_xComp; - + bool m_bDeinitUCB; public: - inline DisposeGuard() {} - inline DisposeGuard( - css::uno::Reference const & xComp ) - : m_xComp( xComp ) {} - + DisposeGuard(): m_bDeinitUCB(false) {} inline ~DisposeGuard() { + if (m_bDeinitUCB) + ::ucbhelper::ContentBroker::deinitialize(); + if (m_xComp.is()) m_xComp->dispose(); } @@ -155,6 +155,12 @@ public: { m_xComp = xComp; } + + inline void setDeinitUCB() + { + m_bDeinitUCB = true; + } + }; //============================================================================== -- cgit From 029f8036eff227a357d8a3a6ef51de74c8afe643 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Fri, 1 Oct 2010 16:42:18 +0200 Subject: jl160 #i114794# unpkg script better recognizes option sync --- desktop/scripts/unopkg.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh index 76f7b3a84204..0828c7f9dbb1 100644 --- a/desktop/scripts/unopkg.sh +++ b/desktop/scripts/unopkg.sh @@ -46,21 +46,21 @@ cd "$sd_cwd" #collect all bootstrap variables specified on the command line #so that they can be passed as arguments to javaldx later on #Recognize the "sync" option. sync must be applied without any other -#options except bootstrap variables. +#options except bootstrap variables or the verbose option for arg in $@ do case "$arg" in -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";; sync) OPTSYNC=true;; - *) OPTOTHER=true;; + -v) VERBOSE=true;; + --verbose) VERBOSE=true;; + *) OPTOTHER=$arg;; esac done -if [ -n $OPTSYNC ] && [ -z $OPTOTHER ] +if [ "$OPTSYNC" = "true" ] && [ -z "$OPTOTHER" ] then JVMFWKPARAMS='-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml -env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' -else - echo "unopkg script: Check usage of sync command". fi # extend the ld_library_path for java: javaldx checks the sofficerc for us -- cgit From 6651ea37c1a356b894850ad14cfd22c8a90e1caf Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 4 Oct 2010 11:50:08 +0200 Subject: jl160 #114794# remove share/prereg/bundled folder after removing the last bundled extensions --- desktop/source/pkgchk/unopkg/unopkg_app.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 315316fe475a..83552cb7c4c6 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -400,7 +400,7 @@ extern "C" int unopkg_main() //$BUNDLED_EXTENSIONS_USER if (hasNoFolder(OUSTR("$BRAND_BASE_DIR/share/extensions"))) { - removeFolder(OUSTR("$BUNDLED_EXTENSIONS_USER")); + removeFolder(OUSTR("$BUNDLED_EXTENSIONS_PREREG")); //return otherwise we create the registration data again return 0; } -- cgit From 270ecfa2e51723882b57b77910c99c3f5e64ddc5 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 4 Oct 2010 15:24:01 +0200 Subject: jl160 #i112787# removed call to check in PackageRegistryBackend::disposing which was added in this cws in changeset 272197:0006b54dc7e8 --- desktop/source/deployment/registry/dp_backend.cxx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index 144ec53d14ba..9aeb656eb65c 100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -65,7 +65,6 @@ PackageRegistryBackend::~PackageRegistryBackend() void PackageRegistryBackend::disposing( lang::EventObject const & event ) throw (RuntimeException) { - check(); Reference xPackage( event.Source, UNO_QUERY_THROW ); OUString url( xPackage->getURL() ); @@ -315,13 +314,6 @@ void PackageRegistryBackend::deleteUnusedFolders( } -// void PackageRegistryBackend::packageRemoved( -// ::rtl::OUString const & /*url*/, ::rtl::OUString const & /*mediaType*/) -// throw (css::deployment::DeploymentException, -// css::uno::RuntimeException) -// { -// } - //############################################################################## //______________________________________________________________________________ -- cgit From 85ae59e8c0a0bd320e0883c61a08fc46311264c0 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Mon, 4 Oct 2010 16:18:38 +0200 Subject: dr77: #i113668# don't create cyclic references between ScTableConditionalFormat and ScTableConditionalEntry --- sc/inc/fmtuno.hxx | 6 +----- sc/source/ui/unoobj/fmtuno.cxx | 41 +++-------------------------------------- 2 files changed, 4 insertions(+), 43 deletions(-) diff --git a/sc/inc/fmtuno.hxx b/sc/inc/fmtuno.hxx index eebd808c30a4..6b79f88f4263 100644 --- a/sc/inc/fmtuno.hxx +++ b/sc/inc/fmtuno.hxx @@ -95,7 +95,6 @@ public: void FillFormat( ScConditionalFormat& rFormat, ScDocument* pDoc, formula::FormulaGrammar::Grammar eGrammar) const; - void DataChanged(); // XSheetConditionalEntries virtual void SAL_CALL addNew( const ::com::sun::star::uno::Sequence< @@ -157,13 +156,11 @@ class ScTableConditionalEntry : public cppu::WeakImplHelper3< com::sun::star::lang::XServiceInfo > { private: - ScTableConditionalFormat* pParent; ScCondFormatEntryItem aData; ScTableConditionalEntry(); // disabled public: - ScTableConditionalEntry(ScTableConditionalFormat* pPar, - const ScCondFormatEntryItem& aItem); + ScTableConditionalEntry(const ScCondFormatEntryItem& aItem); virtual ~ScTableConditionalEntry(); void GetData(ScCondFormatEntryItem& rData) const; @@ -241,7 +238,6 @@ public: ScValidationData* CreateValidationData( ScDocument* pDoc, formula::FormulaGrammar::Grammar eGrammar ) const; - void DataChanged(); // XSheetCondition virtual ::com::sun::star::sheet::ConditionOperator SAL_CALL getOperator() diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx index 392533c7cf93..6da02cf9e4e3 100644 --- a/sc/source/ui/unoobj/fmtuno.cxx +++ b/sc/source/ui/unoobj/fmtuno.cxx @@ -236,16 +236,11 @@ ScTableConditionalFormat::~ScTableConditionalFormat() void ScTableConditionalFormat::AddEntry_Impl(const ScCondFormatEntryItem& aEntry) { - ScTableConditionalEntry* pNew = new ScTableConditionalEntry(this, aEntry); + ScTableConditionalEntry* pNew = new ScTableConditionalEntry(aEntry); pNew->acquire(); aEntries.Insert( pNew, LIST_APPEND ); } -void ScTableConditionalFormat::DataChanged() -{ - // wenn's mal das "lebende Objekt" ist, muss hier was passieren... -} - // XSheetConditionalFormat ScTableConditionalEntry* ScTableConditionalFormat::GetObjectByIndex_Impl(USHORT nIndex) const @@ -348,7 +343,6 @@ void SAL_CALL ScTableConditionalFormat::addNew( } AddEntry_Impl(aEntry); - DataChanged(); } void SAL_CALL ScTableConditionalFormat::removeByIndex( sal_Int32 nIndex ) @@ -360,7 +354,6 @@ void SAL_CALL ScTableConditionalFormat::removeByIndex( sal_Int32 nIndex ) { aEntries.Remove(pEntry); pEntry->release(); - DataChanged(); } } @@ -371,8 +364,6 @@ void SAL_CALL ScTableConditionalFormat::clear() throw(uno::RuntimeException) aEntries.First(); while ( ( pEntry = (ScTableConditionalEntry*)aEntries.Remove() ) != NULL ) pEntry->release(); - - DataChanged(); } // XEnumerationAccess @@ -525,19 +516,14 @@ ScTableConditionalFormat* ScTableConditionalFormat::getImplementation( //UNUSED2008-05 { //UNUSED2008-05 } -ScTableConditionalEntry::ScTableConditionalEntry(ScTableConditionalFormat* pPar, - const ScCondFormatEntryItem& aItem) : - pParent( pPar ), +ScTableConditionalEntry::ScTableConditionalEntry(const ScCondFormatEntryItem& aItem) : aData( aItem ) { - if (pParent) - pParent->acquire(); + // #i113668# only store the settings, keep no reference to parent object } ScTableConditionalEntry::~ScTableConditionalEntry() { - if (pParent) - pParent->release(); } void ScTableConditionalEntry::GetData(ScCondFormatEntryItem& rData) const @@ -559,8 +545,6 @@ void SAL_CALL ScTableConditionalEntry::setOperator( sheet::ConditionOperator nOp { ScUnoGuard aGuard; aData.meMode = lcl_ConditionOperatorToMode( nOperator ); - if (pParent) - pParent->DataChanged(); } rtl::OUString SAL_CALL ScTableConditionalEntry::getFormula1() throw(uno::RuntimeException) @@ -574,8 +558,6 @@ void SAL_CALL ScTableConditionalEntry::setFormula1( const rtl::OUString& aFormul { ScUnoGuard aGuard; aData.maExpr1 = String( aFormula1 ); - if (pParent) - pParent->DataChanged(); } rtl::OUString SAL_CALL ScTableConditionalEntry::getFormula2() throw(uno::RuntimeException) @@ -589,8 +571,6 @@ void SAL_CALL ScTableConditionalEntry::setFormula2( const rtl::OUString& aFormul { ScUnoGuard aGuard; aData.maExpr2 = String( aFormula2 ); - if (pParent) - pParent->DataChanged(); } table::CellAddress SAL_CALL ScTableConditionalEntry::getSourcePosition() throw(uno::RuntimeException) @@ -608,8 +588,6 @@ void SAL_CALL ScTableConditionalEntry::setSourcePosition( const table::CellAddre { ScUnoGuard aGuard; aData.maPos.Set( (SCCOL)aSourcePosition.Column, (SCROW)aSourcePosition.Row, aSourcePosition.Sheet ); - if (pParent) - pParent->DataChanged(); } // XSheetConditionalEntry @@ -625,8 +603,6 @@ void SAL_CALL ScTableConditionalEntry::setStyleName( const rtl::OUString& aStyle { ScUnoGuard aGuard; aData.maStyle = ScStyleNameConversion::ProgrammaticToDisplayName( aStyleName, SFX_STYLE_FAMILY_PARA ); - if (pParent) - pParent->DataChanged(); } //------------------------------------------------------------------------ @@ -739,11 +715,6 @@ ScTableValidationObj::~ScTableValidationObj() { } -void ScTableValidationObj::DataChanged() -{ - // wenn's mal das "lebende Objekt" ist, muss hier was passieren... -} - // XSheetCondition sheet::ConditionOperator SAL_CALL ScTableValidationObj::getOperator() @@ -758,7 +729,6 @@ void SAL_CALL ScTableValidationObj::setOperator( sheet::ConditionOperator nOpera { ScUnoGuard aGuard; nMode = sal::static_int_cast( lcl_ConditionOperatorToMode( nOperator ) ); - DataChanged(); } rtl::OUString SAL_CALL ScTableValidationObj::getFormula1() throw(uno::RuntimeException) @@ -772,7 +742,6 @@ void SAL_CALL ScTableValidationObj::setFormula1( const rtl::OUString& aFormula1 { ScUnoGuard aGuard; aExpr1 = String( aFormula1 ); - DataChanged(); } rtl::OUString SAL_CALL ScTableValidationObj::getFormula2() throw(uno::RuntimeException) @@ -786,7 +755,6 @@ void SAL_CALL ScTableValidationObj::setFormula2( const rtl::OUString& aFormula2 { ScUnoGuard aGuard; aExpr2 = String( aFormula2 ); - DataChanged(); } table::CellAddress SAL_CALL ScTableValidationObj::getSourcePosition() throw(uno::RuntimeException) @@ -804,7 +772,6 @@ void SAL_CALL ScTableValidationObj::setSourcePosition( const table::CellAddress& { ScUnoGuard aGuard; aSrcPos.Set( (SCCOL)aSourcePosition.Column, (SCROW)aSourcePosition.Row, aSourcePosition.Sheet ); - DataChanged(); } uno::Sequence SAL_CALL ScTableValidationObj::getTokens( sal_Int32 nIndex ) @@ -963,8 +930,6 @@ void SAL_CALL ScTableValidationObj::setPropertyValue( if ( aValue >>= nVal ) meGrammar2 = static_cast< FormulaGrammar::Grammar >(nVal); } - - DataChanged(); } uno::Any SAL_CALL ScTableValidationObj::getPropertyValue( const rtl::OUString& aPropertyName ) -- cgit From c74764520fb2c4e3da25a097a1c37ee7d21e5690 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Mon, 4 Oct 2010 17:22:10 +0200 Subject: dr77: #i106768# check edit cell's object pointer for null before cloning (patch from cmc) --- sc/source/ui/view/viewfun4.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 123464cd5fda..ded411aca9ed 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -392,9 +392,11 @@ void ScViewFunc::DoThesaurus( BOOL bRecord ) if (pCell) { ((ScEditCell*) pCell)->GetData(pTObject); - pOldTObj = pTObject->Clone(); if (pTObject) + { + pOldTObj = pTObject->Clone(); pThesaurusEngine->SetText(*pTObject); + } } } else -- cgit -- cgit From 6d00f634120cb80a59b54b28641293dba68ee2ba Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Tue, 5 Oct 2010 19:34:47 +0200 Subject: dr77: #i113662# delete the caption object in ScPostIt::RemoveCaption --- sc/source/core/data/postit.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index a4bc9a473768..999a3194eaa6 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -762,10 +762,13 @@ void ScPostIt::RemoveCaption() { pDrawPage->RecalcObjOrdNums(); // create drawing undo action (before removing the object to have valid draw page in undo action) - if( pDrawLayer && pDrawLayer->IsRecording() ) + bool bRecording = ( pDrawLayer && pDrawLayer->IsRecording() ); + if( bRecording ) pDrawLayer->AddCalcUndo( pDrawLayer->GetSdrUndoFactory().CreateUndoDeleteObject( *maNoteData.mpCaption ) ); // remove the object from the drawing page, delete if undo is disabled - pDrawPage->RemoveObject( maNoteData.mpCaption->GetOrdNum() ); + SdrObject* pObj = pDrawPage->RemoveObject( maNoteData.mpCaption->GetOrdNum() ); + if( !bRecording ) + SdrObject::Free( pObj ); } } maNoteData.mpCaption = 0; -- cgit From d91cd18c2bc6995ce3098f5aaa6b48eb7b4a5ed0 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 6 Oct 2010 17:13:14 +0200 Subject: impressdefaults1: #i113012# use same spacing and indend for default style bullets level 0 as the other levels --- sd/source/core/stlpool.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 071b0d04911d..2923573f2811 100755 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -1029,12 +1029,8 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT); SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10 , FALSE); - aNumberFormat.SetLSpace( 0 ); - aNumberFormat.SetAbsLSpace( 0 ); - aNumberFormat.SetFirstLineOffset( 0 ); - aNumRule.SetLevel( 0, aNumberFormat ); - for( USHORT i = 1; i < aNumRule.GetLevelCount(); i++ ) + for( USHORT i = 0; i < aNumRule.GetLevelCount(); i++ ) { const short nLSpace = (i + 1) * 600; aNumberFormat.SetLSpace(nLSpace); -- cgit From e4352c7202ce833668146b242eaaaabe030f10e5 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Thu, 7 Oct 2010 19:21:24 +0200 Subject: dr77: #i107273# dispose accessibility text data before deleting EditView/EditEngine (patch from cmc) --- sc/source/ui/app/inputwin.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index b028a0a153ce..4dcd7eb4da86 100755 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -770,11 +770,11 @@ ScTextWnd::ScTextWnd( Window* pParent ) __EXPORT ScTextWnd::~ScTextWnd() { - delete pEditView; - delete pEditEngine; while (!maAccTextDatas.empty()) { maAccTextDatas.back()->Dispose(); } + delete pEditView; + delete pEditEngine; } void __EXPORT ScTextWnd::Paint( const Rectangle& rRec ) -- cgit From 941d7bf0af850298d0c281f122176e6c3bc69be5 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Fri, 8 Oct 2010 17:27:12 +0200 Subject: dr77: missing header in d.lst --- oox/prj/d.lst | 1 + 1 file changed, 1 insertion(+) diff --git a/oox/prj/d.lst b/oox/prj/d.lst index f20db064d7b2..482a270926a3 100644 --- a/oox/prj/d.lst +++ b/oox/prj/d.lst @@ -36,6 +36,7 @@ mkdir: %_DEST%\inc%_EXT%\oox\xls ..\inc\oox\ole\vbaproject.hxx %_DEST%\inc%_EXT%\oox\ole\vbaproject.hxx ..\inc\oox\vml\vmldrawing.hxx %_DEST%\inc%_EXT%\oox\vml\vmldrawing.hxx ..\inc\oox\vml\vmlshape.hxx %_DEST%\inc%_EXT%\oox\vml\vmlshape.hxx +..\inc\oox\xls\excelvbaproject.hxx %_DEST%\inc%_EXT%\oox\xls\excelvbaproject.hxx dos: sh -c "if test %OS% = MACOSX; then create-bundle %_DEST%\lib%_EXT%\*.dylib; fi" -- cgit From 2e54587cb31ebf2c747297ffd86cd79e2d54a4a0 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 13 Oct 2010 10:25:03 +0200 Subject: jl160 #i114794# unopkg sync did not write lastsycronized file --- desktop/source/deployment/manager/dp_extensionmanager.cxx | 15 +++++++++++++-- desktop/source/pkgchk/unopkg/unopkg_misc.cxx | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index a6acde82a365..81c0751fc4cd 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -1148,10 +1148,21 @@ void ExtensionManager::synchronizeBundledPrereg( uno::Sequence > extensions = xMgr->getDeployedPackages( xAbortChannel, xCmdEnv); - for (sal_Int32 i = 0; i < extensions.getLength(); i++) + try { - extensions[i]->registerPackage(true, xAbortChannel, xCmdEnv); + for (sal_Int32 i = 0; i < extensions.getLength(); i++) + { + extensions[i]->registerPackage(true, xAbortChannel, xCmdEnv); + } } + catch (...) + { + OSL_ASSERT(0); + } + OUString lastSyncBundled(RTL_CONSTASCII_USTRINGPARAM( + "$BUNDLED_EXTENSIONS_PREREG/lastsynchronized")); + writeLastModified(lastSyncBundled, xCmdEnv); + } catch (deploy::DeploymentException& ) { throw; } catch (ucb::CommandFailedException & ) { diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index d1471866206c..f6773b768062 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -628,7 +628,7 @@ void removeFolder(OUString const & folderUrl) dir.close(); ::osl::Directory::remove(url); } - else + else if (rc != osl::File::E_NOENT) { dp_misc::writeConsole( OUSTR("unopkg: Error while removing ") + url + OUSTR("\n")); -- cgit From 708c1ed37dd34037ecfc9f229270c10bb0366f74 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 19 Oct 2010 19:41:33 +0200 Subject: dr77: oox: improve consistency of class/struct names and constant names, improvements for web queries --- sc/source/core/tool/formulaparserpool.cxx | 21 ++++++--------------- sc/source/filter/excel/xicontent.cxx | 5 ++--- sc/source/ui/docshell/docfunc.cxx | 8 +++++--- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/sc/source/core/tool/formulaparserpool.cxx b/sc/source/core/tool/formulaparserpool.cxx index 75d1c874eba8..c4c2f3b5a4ab 100644 --- a/sc/source/core/tool/formulaparserpool.cxx +++ b/sc/source/core/tool/formulaparserpool.cxx @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -62,27 +61,19 @@ public: const OUString& rNamespace ); private: - typedef ::std::hash_map< - OUString, - Reference< XSingleComponentFactory >, - OUStringHash, - ::std::equal_to< OUString > > FactoryMap; + typedef ::std::hash_map< OUString, Reference< XSingleComponentFactory >, OUStringHash > FactoryMap; - Reference< XComponentContext > mxContext; /// Default context of global process factory. + Reference< XComponentContext > mxContext; /// Global component context. FactoryMap maFactories; /// All parser factories, mapped by formula namespace. }; -ScParserFactoryMap::ScParserFactoryMap() +ScParserFactoryMap::ScParserFactoryMap() : + mxContext( ::comphelper::getProcessComponentContext() ) { - try + if( mxContext.is() ) try { - // get process factory and default component context - Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_SET_THROW ); - Reference< XPropertySet > xPropSet( xFactory, UNO_QUERY_THROW ); - mxContext.set( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ), UNO_QUERY_THROW ); - // enumerate all implementations of the FormulaParser service - Reference< XContentEnumerationAccess > xFactoryEA( xFactory, UNO_QUERY_THROW ); + Reference< XContentEnumerationAccess > xFactoryEA( mxContext->getServiceManager(), UNO_QUERY_THROW ); Reference< XEnumeration > xEnum( xFactoryEA->createContentEnumeration( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.FilterFormulaParser" ) ) ), UNO_SET_THROW ); while( xEnum->hasMoreElements() ) try // single try/catch for every element { diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index fb1eb9a3bf44..bfd6a787ff36 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -917,14 +917,13 @@ void XclImpWebQuery::ReadWqtables( XclImpStream& rStrm ) String aTables( rStrm.ReadUniString() ); const sal_Unicode cSep = ';'; - aTables.SearchAndReplaceAll( ',', cSep ); String aQuotedPairs( RTL_CONSTASCII_USTRINGPARAM( "\"\"" ) ); - xub_StrLen nTokenCnt = aTables.GetQuotedTokenCount( aQuotedPairs, cSep ); + xub_StrLen nTokenCnt = aTables.GetQuotedTokenCount( aQuotedPairs, ',' ); maTables.Erase(); xub_StrLen nStringIx = 0; for( xub_StrLen nToken = 0; nToken < nTokenCnt; ++nToken ) { - String aToken( aTables.GetQuotedToken( 0, aQuotedPairs, cSep, nStringIx ) ); + String aToken( aTables.GetQuotedToken( 0, aQuotedPairs, ',', nStringIx ) ); sal_Int32 nTabNum = CharClass::isAsciiNumeric( aToken ) ? aToken.ToInt32() : 0; if( nTabNum > 0 ) ScGlobal::AddToken( maTables, ScfTools::GetNameFromHTMLIndex( static_cast< sal_uInt32 >( nTabNum ) ), cSep ); diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 27112d8c62c2..4677eecbf20c 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -4861,9 +4861,11 @@ BOOL ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter, } // Update hat sein eigenes Undo - - pLink->SetDoInsert(bFitBlock); // beim ersten Update ggf. nichts einfuegen - pLink->Update(); // kein SetInCreate -> Update ausfuehren + if (pDoc->IsExecuteLinkEnabled()) + { + pLink->SetDoInsert(bFitBlock); // beim ersten Update ggf. nichts einfuegen + pLink->Update(); // kein SetInCreate -> Update ausfuehren + } pLink->SetDoInsert(TRUE); // Default = TRUE SfxBindings* pBindings = rDocShell.GetViewBindings(); -- cgit From 873aef4d5a92da475f84d72a0004d2a815abaf7a Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 19 Oct 2010 19:41:33 +0200 Subject: dr77: oox: improve consistency of class/struct names and constant names, improvements for web queries --- oox/inc/oox/core/contexthandler2.hxx | 6 +- oox/inc/oox/dump/biffdumper.hxx | 3 + oox/inc/oox/helper/recordinputstream.hxx | 2 +- oox/inc/oox/xls/addressconverter.hxx | 3 +- oox/inc/oox/xls/autofiltercontext.hxx | 6 +- oox/inc/oox/xls/biffcodec.hxx | 1 - oox/inc/oox/xls/biffdetector.hxx | 3 +- oox/inc/oox/xls/biffhelper.hxx | 450 +++++++++++---------- oox/inc/oox/xls/biffinputstream.hxx | 1 - oox/inc/oox/xls/biffoutputstream.hxx | 1 - oox/inc/oox/xls/chartsheetfragment.hxx | 13 +- oox/inc/oox/xls/commentsbuffer.hxx | 1 - oox/inc/oox/xls/commentsfragment.hxx | 9 +- oox/inc/oox/xls/condformatbuffer.hxx | 9 +- oox/inc/oox/xls/condformatcontext.hxx | 7 +- oox/inc/oox/xls/connectionsbuffer.hxx | 179 +++++++++ oox/inc/oox/xls/connectionsfragment.hxx | 30 +- oox/inc/oox/xls/defnamesbuffer.hxx | 42 +- oox/inc/oox/xls/drawingfragment.hxx | 14 +- oox/inc/oox/xls/excelchartconverter.hxx | 1 - oox/inc/oox/xls/excelfilter.hxx | 2 +- oox/inc/oox/xls/excelhandlers.hxx | 191 +++------ oox/inc/oox/xls/externallinkbuffer.hxx | 8 +- oox/inc/oox/xls/externallinkfragment.hxx | 57 +-- oox/inc/oox/xls/formulabase.hxx | 108 +++-- oox/inc/oox/xls/formulaparser.hxx | 10 +- oox/inc/oox/xls/numberformatsbuffer.hxx | 1 - oox/inc/oox/xls/ooxformulaparser.hxx | 1 - oox/inc/oox/xls/pagesettings.hxx | 5 +- oox/inc/oox/xls/pivotcachebuffer.hxx | 13 +- oox/inc/oox/xls/pivotcachefragment.hxx | 17 +- oox/inc/oox/xls/pivottablebuffer.hxx | 22 +- oox/inc/oox/xls/pivottablefragment.hxx | 21 +- oox/inc/oox/xls/querytablebuffer.hxx | 109 +++++ oox/inc/oox/xls/querytablefragment.hxx | 31 +- oox/inc/oox/xls/richstring.hxx | 3 +- oox/inc/oox/xls/richstringcontext.hxx | 13 +- oox/inc/oox/xls/scenariobuffer.hxx | 1 - oox/inc/oox/xls/scenariocontext.hxx | 9 +- oox/inc/oox/xls/sharedformulabuffer.hxx | 3 +- oox/inc/oox/xls/sharedstringsbuffer.hxx | 1 - oox/inc/oox/xls/sharedstringsfragment.hxx | 10 +- oox/inc/oox/xls/sheetdatacontext.hxx | 41 +- oox/inc/oox/xls/stylesbuffer.hxx | 56 ++- oox/inc/oox/xls/stylesfragment.hxx | 43 +- oox/inc/oox/xls/tablebuffer.hxx | 5 +- oox/inc/oox/xls/tablefragment.hxx | 9 +- oox/inc/oox/xls/themebuffer.hxx | 1 - oox/inc/oox/xls/unitconverter.hxx | 3 +- oox/inc/oox/xls/viewsettings.hxx | 1 - oox/inc/oox/xls/webquerybuffer.hxx | 127 ------ oox/inc/oox/xls/workbookfragment.hxx | 9 +- oox/inc/oox/xls/workbookhelper.hxx | 75 ++-- oox/inc/oox/xls/workbooksettings.hxx | 5 +- oox/inc/oox/xls/worksheetbuffer.hxx | 9 +- oox/inc/oox/xls/worksheetfragment.hxx | 57 ++- oox/inc/oox/xls/worksheethelper.hxx | 34 +- oox/inc/oox/xls/worksheetsettings.hxx | 3 +- oox/source/dump/biffdumper.cxx | 162 +++++++- oox/source/dump/biffdumper.ini | 148 ++++++- oox/source/dump/xlsbdumper.cxx | 376 +++++++++-------- oox/source/dump/xlsbdumper.ini | 90 ++++- oox/source/token/properties.txt | 5 + oox/source/xls/addressconverter.cxx | 36 +- oox/source/xls/autofiltercontext.cxx | 65 ++- oox/source/xls/biffcodec.cxx | 12 +- oox/source/xls/biffdetector.cxx | 2 +- oox/source/xls/biffhelper.cxx | 28 +- oox/source/xls/biffinputstream.cxx | 10 +- oox/source/xls/biffoutputstream.cxx | 1 - oox/source/xls/chartsheetfragment.cxx | 159 ++++---- oox/source/xls/commentsbuffer.cxx | 26 +- oox/source/xls/commentsfragment.cxx | 70 ++-- oox/source/xls/condformatbuffer.cxx | 274 ++++++------- oox/source/xls/condformatcontext.cxx | 33 +- oox/source/xls/connectionsbuffer.cxx | 491 +++++++++++++++++++++++ oox/source/xls/connectionsfragment.cxx | 133 +++++-- oox/source/xls/defnamesbuffer.cxx | 100 +++-- oox/source/xls/drawingfragment.cxx | 28 +- oox/source/xls/excelchartconverter.cxx | 26 +- oox/source/xls/excelfilter.cxx | 2 +- oox/source/xls/excelhandlers.cxx | 174 ++++---- oox/source/xls/externallinkbuffer.cxx | 83 ++-- oox/source/xls/externallinkfragment.cxx | 281 ++++++------- oox/source/xls/formulabase.cxx | 106 +++-- oox/source/xls/formulaparser.cxx | 157 ++++---- oox/source/xls/makefile.mk | 3 +- oox/source/xls/numberformatsbuffer.cxx | 43 +- oox/source/xls/ooxformulaparser.cxx | 28 +- oox/source/xls/pagesettings.cxx | 147 ++++--- oox/source/xls/pivotcachebuffer.cxx | 288 +++++++------- oox/source/xls/pivotcachefragment.cxx | 184 ++++----- oox/source/xls/pivottablebuffer.cxx | 383 +++++++++--------- oox/source/xls/pivottablefragment.cxx | 188 ++++----- oox/source/xls/querytablebuffer.cxx | 396 ++++++++++++++++++ oox/source/xls/querytablefragment.cxx | 68 +++- oox/source/xls/richstring.cxx | 36 +- oox/source/xls/richstringcontext.cxx | 16 +- oox/source/xls/scenariobuffer.cxx | 28 +- oox/source/xls/scenariocontext.cxx | 42 +- oox/source/xls/sharedformulabuffer.cxx | 25 +- oox/source/xls/sharedstringsbuffer.cxx | 10 +- oox/source/xls/sharedstringsfragment.cxx | 40 +- oox/source/xls/sheetdatacontext.cxx | 397 +++++++++--------- oox/source/xls/stylesbuffer.cxx | 334 ++++++++-------- oox/source/xls/stylesfragment.cxx | 158 ++++---- oox/source/xls/tablebuffer.cxx | 40 +- oox/source/xls/tablefragment.cxx | 29 +- oox/source/xls/themebuffer.cxx | 10 +- oox/source/xls/unitconverter.cxx | 28 +- oox/source/xls/viewsettings.cxx | 198 +++++---- oox/source/xls/webquerybuffer.cxx | 199 --------- oox/source/xls/workbookfragment.cxx | 301 +++++++------- oox/source/xls/workbookhelper.cxx | 123 ++---- oox/source/xls/workbooksettings.cxx | 74 ++-- oox/source/xls/worksheetbuffer.cxx | 30 +- oox/source/xls/worksheetfragment.cxx | 642 +++++++++++++++--------------- oox/source/xls/worksheethelper.cxx | 210 +++++----- oox/source/xls/worksheetsettings.cxx | 21 +- 119 files changed, 5404 insertions(+), 4288 deletions(-) create mode 100755 oox/inc/oox/xls/connectionsbuffer.hxx create mode 100644 oox/inc/oox/xls/querytablebuffer.hxx delete mode 100644 oox/inc/oox/xls/webquerybuffer.hxx create mode 100755 oox/source/xls/connectionsbuffer.cxx create mode 100644 oox/source/xls/querytablebuffer.cxx delete mode 100644 oox/source/xls/webquerybuffer.cxx diff --git a/oox/inc/oox/core/contexthandler2.hxx b/oox/inc/oox/core/contexthandler2.hxx index 61c4ad9aa2da..59da648883b0 100644 --- a/oox/inc/oox/core/contexthandler2.hxx +++ b/oox/inc/oox/core/contexthandler2.hxx @@ -120,7 +120,7 @@ public: /** Will be called to create a context handler for the passed record. Usually 'this' can be returned to improve performance by reusing the - same instance to process several records. Used by OOBIN import only. + same instance to process several records. Used by BIFF import only. */ virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) = 0; @@ -128,14 +128,14 @@ public: started. The current record identifier can be accessed with getCurrentElement() - or isCurrentElement(). Used by OOBIN import only. + or isCurrentElement(). Used by BIFF import only. */ virtual void onStartRecord( RecordInputStream& rStrm ) = 0; /** Will be called when the current record block is about to be left. The current record identifier can be accessed with getCurrentElement() - or isCurrentElement(). Used by OOBIN import only. + or isCurrentElement(). Used by BIFF import only. */ virtual void onEndRecord() = 0; diff --git a/oox/inc/oox/dump/biffdumper.hxx b/oox/inc/oox/dump/biffdumper.hxx index e3e712a52a25..078330cb8dbe 100644 --- a/oox/inc/oox/dump/biffdumper.hxx +++ b/oox/inc/oox/dump/biffdumper.hxx @@ -190,6 +190,9 @@ protected: ::oox::xls::BiffStringFlags nUniFlags = ::oox::xls::BIFF_STR_DEFAULT, rtl_TextEncoding eDefaultTextEnc = RTL_TEXTENCODING_DONTKNOW ); + ::rtl::OUString dumpSegmentedUniString( const String& rName ); + void dumpSegmentedUniStringArray( const String& rName ); + sal_uInt8 dumpBoolean( const String& rName = EMPTY_STRING ); sal_uInt8 dumpErrorCode( const String& rName = EMPTY_STRING ); diff --git a/oox/inc/oox/helper/recordinputstream.hxx b/oox/inc/oox/helper/recordinputstream.hxx index 0c5c1279a7c7..3cf8514897ec 100644 --- a/oox/inc/oox/helper/recordinputstream.hxx +++ b/oox/inc/oox/helper/recordinputstream.hxx @@ -34,7 +34,7 @@ namespace oox { // ============================================================================ -/** Reads the contents of a record from a binary OOBIN stream. */ +/** Reads the contents of a record from a BIFF stream. */ class RecordInputStream : public SequenceInputStream { public: diff --git a/oox/inc/oox/xls/addressconverter.hxx b/oox/inc/oox/xls/addressconverter.hxx index c11bd31bbf22..8ce4388db2f2 100644 --- a/oox/inc/oox/xls/addressconverter.hxx +++ b/oox/inc/oox/xls/addressconverter.hxx @@ -221,7 +221,7 @@ enum BiffTargetType // ============================================================================ // ============================================================================ -/** Converter for cell addresses and cell ranges for OOX and BIFF filters. +/** Converter for cell addresses and cell ranges for OOXML and BIFF filters. */ class AddressConverter : public WorkbookHelper { @@ -689,4 +689,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/autofiltercontext.hxx b/oox/inc/oox/xls/autofiltercontext.hxx index 83b1f4ff0ee8..5efe0da2a9e8 100644 --- a/oox/inc/oox/xls/autofiltercontext.hxx +++ b/oox/inc/oox/xls/autofiltercontext.hxx @@ -75,14 +75,12 @@ struct FilterFieldItem // ============================================================================ -class OoxAutoFilterContext : public OoxWorksheetContextBase +class AutoFilterContext : public WorksheetContextBase { public: - explicit OoxAutoFilterContext( OoxWorksheetFragmentBase& rFragment ); + explicit AutoFilterContext( WorksheetFragmentBase& rFragment ); protected: - // oox.core.ContextHandler2Helper interface ------------------------------- - virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); virtual void onEndElement(); diff --git a/oox/inc/oox/xls/biffcodec.hxx b/oox/inc/oox/xls/biffcodec.hxx index 21b3e82006fd..438eb7e359be 100644 --- a/oox/inc/oox/xls/biffcodec.hxx +++ b/oox/inc/oox/xls/biffcodec.hxx @@ -182,4 +182,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/biffdetector.hxx b/oox/inc/oox/xls/biffdetector.hxx index e50b68e0d938..df372c76d7cc 100644 --- a/oox/inc/oox/xls/biffdetector.hxx +++ b/oox/inc/oox/xls/biffdetector.hxx @@ -28,8 +28,8 @@ #ifndef OOX_XLS_BIFFDETECTOR_HXX #define OOX_XLS_BIFFDETECTOR_HXX -#include #include +#include #include #include "oox/helper/storagebase.hxx" #include "oox/xls/biffhelper.hxx" @@ -95,4 +95,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/biffhelper.hxx b/oox/inc/oox/xls/biffhelper.hxx index ce43e44fb613..ba0228b761bb 100644 --- a/oox/inc/oox/xls/biffhelper.hxx +++ b/oox/inc/oox/xls/biffhelper.hxx @@ -35,212 +35,218 @@ namespace xls { class BiffInputStream; -// OOBIN record identifiers =================================================== - -const sal_Int32 OOBIN_ID_ARRAY = 0x01AA; -const sal_Int32 OOBIN_ID_AUTOFILTER = 0x00A1; -const sal_Int32 OOBIN_ID_AUTOSORTSCOPE = 0x01CB; -const sal_Int32 OOBIN_ID_BINARYINDEXBLOCK = 0x002A; -const sal_Int32 OOBIN_ID_BINARYINDEXROWS = 0x0028; -const sal_Int32 OOBIN_ID_BOOKVIEWS = 0x0087; -const sal_Int32 OOBIN_ID_BORDER = 0x002E; -const sal_Int32 OOBIN_ID_BORDERS = 0x0265; -const sal_Int32 OOBIN_ID_BRK = 0x018C; -const sal_Int32 OOBIN_ID_CALCPR = 0x009D; -const sal_Int32 OOBIN_ID_CELL_BLANK = 0x0001; -const sal_Int32 OOBIN_ID_CELL_BOOL = 0x0004; -const sal_Int32 OOBIN_ID_CELL_DOUBLE = 0x0005; -const sal_Int32 OOBIN_ID_CELL_ERROR = 0x0003; -const sal_Int32 OOBIN_ID_CELL_RK = 0x0002; -const sal_Int32 OOBIN_ID_CELL_RSTRING = 0x003E; -const sal_Int32 OOBIN_ID_CELL_SI = 0x0007; -const sal_Int32 OOBIN_ID_CELL_STRING = 0x0006; -const sal_Int32 OOBIN_ID_CELLSTYLE = 0x0030; -const sal_Int32 OOBIN_ID_CELLSTYLES = 0x026B; -const sal_Int32 OOBIN_ID_CELLSTYLEXFS = 0x0272; -const sal_Int32 OOBIN_ID_CELLXFS = 0x0269; -const sal_Int32 OOBIN_ID_CFCOLOR = 0x0234; -const sal_Int32 OOBIN_ID_CFRULE = 0x01CF; -const sal_Int32 OOBIN_ID_CHARTPAGESETUP = 0x028C; -const sal_Int32 OOBIN_ID_CHARTPROTECTION = 0x029D; -const sal_Int32 OOBIN_ID_CHARTSHEETPR = 0x028B; -const sal_Int32 OOBIN_ID_CHARTSHEETVIEW = 0x008D; -const sal_Int32 OOBIN_ID_CHARTSHEETVIEWS = 0x008B; -const sal_Int32 OOBIN_ID_COL = 0x003C; -const sal_Int32 OOBIN_ID_COLBREAKS = 0x018A; -const sal_Int32 OOBIN_ID_COLOR = 0x023C; -const sal_Int32 OOBIN_ID_COLORS = 0x01D9; -const sal_Int32 OOBIN_ID_COLORSCALE = 0x01D5; -const sal_Int32 OOBIN_ID_COLS = 0x0186; -const sal_Int32 OOBIN_ID_COMMENT = 0x027B; -const sal_Int32 OOBIN_ID_COMMENTAUTHOR = 0x0278; -const sal_Int32 OOBIN_ID_COMMENTAUTHORS = 0x0276; -const sal_Int32 OOBIN_ID_COMMENTLIST = 0x0279; -const sal_Int32 OOBIN_ID_COMMENTS = 0x0274; -const sal_Int32 OOBIN_ID_COMMENTTEXT = 0x027D; -const sal_Int32 OOBIN_ID_CONDFORMATTING = 0x01CD; -const sal_Int32 OOBIN_ID_CONTROL = 0x0284; -const sal_Int32 OOBIN_ID_CONTROLS = 0x0283; -const sal_Int32 OOBIN_ID_CUSTOMCHARTVIEW = 0x028F; -const sal_Int32 OOBIN_ID_CUSTOMCHARTVIEWS = 0x028D; -const sal_Int32 OOBIN_ID_CUSTOMSHEETVIEW = 0x01A7; -const sal_Int32 OOBIN_ID_CUSTOMSHEETVIEWS = 0x01A6; -const sal_Int32 OOBIN_ID_CUSTOMWORKBOOKVIEW = 0x018D; -const sal_Int32 OOBIN_ID_DATABAR = 0x01D3; -const sal_Int32 OOBIN_ID_DATATABLE = 0x01AC; -const sal_Int32 OOBIN_ID_DATAVALIDATION = 0x0040; -const sal_Int32 OOBIN_ID_DATAVALIDATIONS = 0x023D; -const sal_Int32 OOBIN_ID_DDEITEMVALUES = 0x0242; -const sal_Int32 OOBIN_ID_DDEITEM_BOOL = 0x0248; -const sal_Int32 OOBIN_ID_DDEITEM_DOUBLE = 0x0244; -const sal_Int32 OOBIN_ID_DDEITEM_ERROR = 0x0245; -const sal_Int32 OOBIN_ID_DDEITEM_STRING = 0x0246; -const sal_Int32 OOBIN_ID_DEFINEDNAME = 0x0027; -const sal_Int32 OOBIN_ID_DIMENSION = 0x0094; -const sal_Int32 OOBIN_ID_DRAWING = 0x0226; -const sal_Int32 OOBIN_ID_DXF = 0x01FB; -const sal_Int32 OOBIN_ID_DXFS = 0x01F9; -const sal_Int32 OOBIN_ID_EXTCELL_BLANK = 0x016F; -const sal_Int32 OOBIN_ID_EXTCELL_BOOL = 0x0171; -const sal_Int32 OOBIN_ID_EXTCELL_DOUBLE = 0x0170; -const sal_Int32 OOBIN_ID_EXTCELL_ERROR = 0x0172; -const sal_Int32 OOBIN_ID_EXTCELL_STRING = 0x0173; -const sal_Int32 OOBIN_ID_EXTERNALADDIN = 0x029B; -const sal_Int32 OOBIN_ID_EXTERNALBOOK = 0x0168; -const sal_Int32 OOBIN_ID_EXTERNALNAME = 0x0241; -const sal_Int32 OOBIN_ID_EXTERNALREF = 0x0163; -const sal_Int32 OOBIN_ID_EXTERNALREFS = 0x0161; -const sal_Int32 OOBIN_ID_EXTERNALSELF = 0x0165; -const sal_Int32 OOBIN_ID_EXTERNALSAME = 0x0166; -const sal_Int32 OOBIN_ID_EXTERNALSHEETS = 0x016A; -const sal_Int32 OOBIN_ID_EXTROW = 0x016E; -const sal_Int32 OOBIN_ID_EXTSHEETDATA = 0x016B; -const sal_Int32 OOBIN_ID_EXTERNALNAMEFLAGS = 0x024A; -const sal_Int32 OOBIN_ID_EXTSHEETNAMES = 0x0167; -const sal_Int32 OOBIN_ID_FILESHARING = 0x0224; -const sal_Int32 OOBIN_ID_FILEVERSION = 0x0080; -const sal_Int32 OOBIN_ID_FILL = 0x002D; -const sal_Int32 OOBIN_ID_FILLS = 0x025B; -const sal_Int32 OOBIN_ID_FILTERCOLUMN = 0x00A3; -const sal_Int32 OOBIN_ID_FONT = 0x002B; -const sal_Int32 OOBIN_ID_FONTS = 0x0263; -const sal_Int32 OOBIN_ID_FORMULA_STRING = 0x0008; -const sal_Int32 OOBIN_ID_FORMULA_DOUBLE = 0x0009; -const sal_Int32 OOBIN_ID_FORMULA_BOOL = 0x000A; -const sal_Int32 OOBIN_ID_FORMULA_ERROR = 0x000B; -const sal_Int32 OOBIN_ID_FUNCTIONGROUP = 0x0299; -const sal_Int32 OOBIN_ID_FUNCTIONGROUPS = 0x0298; -const sal_Int32 OOBIN_ID_HEADERFOOTER = 0x01DF; -const sal_Int32 OOBIN_ID_HYPERLINK = 0x01EE; -const sal_Int32 OOBIN_ID_ICONSET = 0x01D1; -const sal_Int32 OOBIN_ID_INDEXEDCOLORS = 0x0235; -const sal_Int32 OOBIN_ID_INPUTCELLS = 0x01F8; -const sal_Int32 OOBIN_ID_LEGACYDRAWING = 0x0227; -const sal_Int32 OOBIN_ID_MERGECELL = 0x00B0; -const sal_Int32 OOBIN_ID_MERGECELLS = 0x00B1; -const sal_Int32 OOBIN_ID_MRUCOLORS = 0x0239; -const sal_Int32 OOBIN_ID_MULTCELL_BLANK = 0x000C; -const sal_Int32 OOBIN_ID_MULTCELL_BOOL = 0x000F; -const sal_Int32 OOBIN_ID_MULTCELL_DOUBLE = 0x0010; -const sal_Int32 OOBIN_ID_MULTCELL_ERROR = 0x000E; -const sal_Int32 OOBIN_ID_MULTCELL_RK = 0x000D; -const sal_Int32 OOBIN_ID_MULTCELL_RSTRING = 0x003D; -const sal_Int32 OOBIN_ID_MULTCELL_SI = 0x0012; -const sal_Int32 OOBIN_ID_MULTCELL_STRING = 0x0011; -const sal_Int32 OOBIN_ID_NUMFMT = 0x002C; -const sal_Int32 OOBIN_ID_NUMFMTS = 0x0267; -const sal_Int32 OOBIN_ID_OLEOBJECT = 0x027F; -const sal_Int32 OOBIN_ID_OLEOBJECTS = 0x027E; -const sal_Int32 OOBIN_ID_OLESIZE = 0x0225; -const sal_Int32 OOBIN_ID_PAGEMARGINS = 0x01DC; -const sal_Int32 OOBIN_ID_PAGESETUP = 0x01DE; -const sal_Int32 OOBIN_ID_PANE = 0x0097; -const sal_Int32 OOBIN_ID_PCDEFINITION = 0x00B3; -const sal_Int32 OOBIN_ID_PCDFDISCRETEPR = 0x00E1; -const sal_Int32 OOBIN_ID_PCDFGROUPITEMS = 0x00DD; -const sal_Int32 OOBIN_ID_PCDFIELD = 0x00B7; -const sal_Int32 OOBIN_ID_PCDFIELDGROUP = 0x00DB; -const sal_Int32 OOBIN_ID_PCDFIELDS = 0x00B5; -const sal_Int32 OOBIN_ID_PCDFRANGEPR = 0x00DF; -const sal_Int32 OOBIN_ID_PCDFSHAREDITEMS = 0x00BD; -const sal_Int32 OOBIN_ID_PCDSHEETSOURCE = 0x00BB; -const sal_Int32 OOBIN_ID_PCDSOURCE = 0x00B9; -const sal_Int32 OOBIN_ID_PCITEM_ARRAY = 0x00BF; -const sal_Int32 OOBIN_ID_PCITEM_BOOL = 0x0016; -const sal_Int32 OOBIN_ID_PCITEM_DATE = 0x0019; -const sal_Int32 OOBIN_ID_PCITEM_DOUBLE = 0x0015; -const sal_Int32 OOBIN_ID_PCITEM_ERROR = 0x0017; -const sal_Int32 OOBIN_ID_PCITEM_INDEX = 0x001A; -const sal_Int32 OOBIN_ID_PCITEM_MISSING = 0x0014; -const sal_Int32 OOBIN_ID_PCITEM_STRING = 0x0018; -const sal_Int32 OOBIN_ID_PCITEMA_BOOL = 0x001D; -const sal_Int32 OOBIN_ID_PCITEMA_DATE = 0x0020; -const sal_Int32 OOBIN_ID_PCITEMA_DOUBLE = 0x001C; -const sal_Int32 OOBIN_ID_PCITEMA_ERROR = 0x001E; -const sal_Int32 OOBIN_ID_PCITEMA_MISSING = 0x001B; -const sal_Int32 OOBIN_ID_PCITEMA_STRING = 0x001F; -const sal_Int32 OOBIN_ID_PCRECORD = 0x0021; -const sal_Int32 OOBIN_ID_PCRECORDDT = 0x0022; -const sal_Int32 OOBIN_ID_PCRECORDS = 0x00C1; -const sal_Int32 OOBIN_ID_PHONETICPR = 0x0219; -const sal_Int32 OOBIN_ID_PICTURE = 0x0232; -const sal_Int32 OOBIN_ID_PIVOTAREA = 0x00F7; -const sal_Int32 OOBIN_ID_PIVOTCACHE = 0x0182; -const sal_Int32 OOBIN_ID_PIVOTCACHES = 0x0180; -const sal_Int32 OOBIN_ID_PRINTOPTIONS = 0x01DD; -const sal_Int32 OOBIN_ID_PTCOLFIELDS = 0x0137; -const sal_Int32 OOBIN_ID_PTDATAFIELD = 0x0125; -const sal_Int32 OOBIN_ID_PTDATAFIELDS = 0x0127; -const sal_Int32 OOBIN_ID_PTDEFINITION = 0x0118; -const sal_Int32 OOBIN_ID_PTFIELD = 0x011D; -const sal_Int32 OOBIN_ID_PTFIELDS = 0x011F; -const sal_Int32 OOBIN_ID_PTFILTER = 0x0259; -const sal_Int32 OOBIN_ID_PTFILTERS = 0x0257; -const sal_Int32 OOBIN_ID_PTFITEM = 0x011A; -const sal_Int32 OOBIN_ID_PTFITEMS = 0x011B; -const sal_Int32 OOBIN_ID_PTLOCATION = 0x013A; -const sal_Int32 OOBIN_ID_PTPAGEFIELD = 0x0121; -const sal_Int32 OOBIN_ID_PTPAGEFIELDS = 0x0123; -const sal_Int32 OOBIN_ID_PTREFERENCE = 0x00FB; -const sal_Int32 OOBIN_ID_PTREFERENCEITEM = 0x017E; -const sal_Int32 OOBIN_ID_PTREFERENCES = 0x00F9; -const sal_Int32 OOBIN_ID_PTROWFIELDS = 0x0135; -const sal_Int32 OOBIN_ID_RGBCOLOR = 0x01DB; -const sal_Int32 OOBIN_ID_ROW = 0x0000; -const sal_Int32 OOBIN_ID_ROWBREAKS = 0x0188; -const sal_Int32 OOBIN_ID_SCENARIO = 0x01F6; -const sal_Int32 OOBIN_ID_SCENARIOS = 0x01F4; -const sal_Int32 OOBIN_ID_SELECTION = 0x0098; -const sal_Int32 OOBIN_ID_SHAREDFMLA = 0x01AB; -const sal_Int32 OOBIN_ID_SHEET = 0x009C; -const sal_Int32 OOBIN_ID_SHEETDATA = 0x0091; -const sal_Int32 OOBIN_ID_SHEETFORMATPR = 0x01E5; -const sal_Int32 OOBIN_ID_SHEETPR = 0x0093; -const sal_Int32 OOBIN_ID_SHEETPROTECTION = 0x0217; -const sal_Int32 OOBIN_ID_SHEETS = 0x008F; -const sal_Int32 OOBIN_ID_SHEETVIEW = 0x0089; -const sal_Int32 OOBIN_ID_SHEETVIEWS = 0x0085; -const sal_Int32 OOBIN_ID_SI = 0x0013; -const sal_Int32 OOBIN_ID_SST = 0x009F; -const sal_Int32 OOBIN_ID_STYLESHEET = 0x0116; -const sal_Int32 OOBIN_ID_TABLE = 0x0157; -const sal_Int32 OOBIN_ID_TABLEPART = 0x0295; -const sal_Int32 OOBIN_ID_TABLEPARTS = 0x0294; -const sal_Int32 OOBIN_ID_TABLESTYLEINFO = 0x0201; -const sal_Int32 OOBIN_ID_TABLESTYLES = 0x01FC; -const sal_Int32 OOBIN_ID_TOP10FILTER = 0x00AA; -const sal_Int32 OOBIN_ID_VOLTYPE = 0x0204; -const sal_Int32 OOBIN_ID_VOLTYPEMAIN = 0x0206; -const sal_Int32 OOBIN_ID_VOLTYPES = 0x0202; -const sal_Int32 OOBIN_ID_VOLTYPESTP = 0x020A; -const sal_Int32 OOBIN_ID_VOLTYPETR = 0x020B; -const sal_Int32 OOBIN_ID_WORKBOOK = 0x0083; -const sal_Int32 OOBIN_ID_WORKBOOKPR = 0x0099; -const sal_Int32 OOBIN_ID_WORKBOOKVIEW = 0x009E; -const sal_Int32 OOBIN_ID_WORKSHEET = 0x0081; -const sal_Int32 OOBIN_ID_XF = 0x002F; +// BIFF12 record identifiers ================================================== -// ============================================================================ +const sal_Int32 BIFF12_ID_ARRAY = 0x01AA; +const sal_Int32 BIFF12_ID_AUTOFILTER = 0x00A1; +const sal_Int32 BIFF12_ID_AUTOSORTSCOPE = 0x01CB; +const sal_Int32 BIFF12_ID_BINARYINDEXBLOCK = 0x002A; +const sal_Int32 BIFF12_ID_BINARYINDEXROWS = 0x0028; +const sal_Int32 BIFF12_ID_BOOKVIEWS = 0x0087; +const sal_Int32 BIFF12_ID_BORDER = 0x002E; +const sal_Int32 BIFF12_ID_BORDERS = 0x0265; +const sal_Int32 BIFF12_ID_BRK = 0x018C; +const sal_Int32 BIFF12_ID_CALCPR = 0x009D; +const sal_Int32 BIFF12_ID_CELL_BLANK = 0x0001; +const sal_Int32 BIFF12_ID_CELL_BOOL = 0x0004; +const sal_Int32 BIFF12_ID_CELL_DOUBLE = 0x0005; +const sal_Int32 BIFF12_ID_CELL_ERROR = 0x0003; +const sal_Int32 BIFF12_ID_CELL_RK = 0x0002; +const sal_Int32 BIFF12_ID_CELL_RSTRING = 0x003E; +const sal_Int32 BIFF12_ID_CELL_SI = 0x0007; +const sal_Int32 BIFF12_ID_CELL_STRING = 0x0006; +const sal_Int32 BIFF12_ID_CELLSTYLE = 0x0030; +const sal_Int32 BIFF12_ID_CELLSTYLES = 0x026B; +const sal_Int32 BIFF12_ID_CELLSTYLEXFS = 0x0272; +const sal_Int32 BIFF12_ID_CELLXFS = 0x0269; +const sal_Int32 BIFF12_ID_CFCOLOR = 0x0234; +const sal_Int32 BIFF12_ID_CFRULE = 0x01CF; +const sal_Int32 BIFF12_ID_CHARTPAGESETUP = 0x028C; +const sal_Int32 BIFF12_ID_CHARTPROTECTION = 0x029D; +const sal_Int32 BIFF12_ID_CHARTSHEETPR = 0x028B; +const sal_Int32 BIFF12_ID_CHARTSHEETVIEW = 0x008D; +const sal_Int32 BIFF12_ID_CHARTSHEETVIEWS = 0x008B; +const sal_Int32 BIFF12_ID_COL = 0x003C; +const sal_Int32 BIFF12_ID_COLBREAKS = 0x018A; +const sal_Int32 BIFF12_ID_COLOR = 0x023C; +const sal_Int32 BIFF12_ID_COLORS = 0x01D9; +const sal_Int32 BIFF12_ID_COLORSCALE = 0x01D5; +const sal_Int32 BIFF12_ID_COLS = 0x0186; +const sal_Int32 BIFF12_ID_COMMENT = 0x027B; +const sal_Int32 BIFF12_ID_COMMENTAUTHOR = 0x0278; +const sal_Int32 BIFF12_ID_COMMENTAUTHORS = 0x0276; +const sal_Int32 BIFF12_ID_COMMENTLIST = 0x0279; +const sal_Int32 BIFF12_ID_COMMENTS = 0x0274; +const sal_Int32 BIFF12_ID_COMMENTTEXT = 0x027D; +const sal_Int32 BIFF12_ID_CONDFORMATTING = 0x01CD; +const sal_Int32 BIFF12_ID_CONNECTION = 0x00C9; +const sal_Int32 BIFF12_ID_CONNECTIONS = 0x01AD; +const sal_Int32 BIFF12_ID_CONTROL = 0x0284; +const sal_Int32 BIFF12_ID_CONTROLS = 0x0283; +const sal_Int32 BIFF12_ID_CUSTOMCHARTVIEW = 0x028F; +const sal_Int32 BIFF12_ID_CUSTOMCHARTVIEWS = 0x028D; +const sal_Int32 BIFF12_ID_CUSTOMSHEETVIEW = 0x01A7; +const sal_Int32 BIFF12_ID_CUSTOMSHEETVIEWS = 0x01A6; +const sal_Int32 BIFF12_ID_CUSTOMWORKBOOKVIEW= 0x018D; +const sal_Int32 BIFF12_ID_DATABAR = 0x01D3; +const sal_Int32 BIFF12_ID_DATATABLE = 0x01AC; +const sal_Int32 BIFF12_ID_DATAVALIDATION = 0x0040; +const sal_Int32 BIFF12_ID_DATAVALIDATIONS = 0x023D; +const sal_Int32 BIFF12_ID_DDEITEMVALUES = 0x0242; +const sal_Int32 BIFF12_ID_DDEITEM_BOOL = 0x0248; +const sal_Int32 BIFF12_ID_DDEITEM_DOUBLE = 0x0244; +const sal_Int32 BIFF12_ID_DDEITEM_ERROR = 0x0245; +const sal_Int32 BIFF12_ID_DDEITEM_STRING = 0x0246; +const sal_Int32 BIFF12_ID_DEFINEDNAME = 0x0027; +const sal_Int32 BIFF12_ID_DIMENSION = 0x0094; +const sal_Int32 BIFF12_ID_DRAWING = 0x0226; +const sal_Int32 BIFF12_ID_DXF = 0x01FB; +const sal_Int32 BIFF12_ID_DXFS = 0x01F9; +const sal_Int32 BIFF12_ID_EXTCELL_BLANK = 0x016F; +const sal_Int32 BIFF12_ID_EXTCELL_BOOL = 0x0171; +const sal_Int32 BIFF12_ID_EXTCELL_DOUBLE = 0x0170; +const sal_Int32 BIFF12_ID_EXTCELL_ERROR = 0x0172; +const sal_Int32 BIFF12_ID_EXTCELL_STRING = 0x0173; +const sal_Int32 BIFF12_ID_EXTERNALADDIN = 0x029B; +const sal_Int32 BIFF12_ID_EXTERNALBOOK = 0x0168; +const sal_Int32 BIFF12_ID_EXTERNALNAME = 0x0241; +const sal_Int32 BIFF12_ID_EXTERNALREF = 0x0163; +const sal_Int32 BIFF12_ID_EXTERNALREFS = 0x0161; +const sal_Int32 BIFF12_ID_EXTERNALSELF = 0x0165; +const sal_Int32 BIFF12_ID_EXTERNALSAME = 0x0166; +const sal_Int32 BIFF12_ID_EXTERNALSHEETS = 0x016A; +const sal_Int32 BIFF12_ID_EXTROW = 0x016E; +const sal_Int32 BIFF12_ID_EXTSHEETDATA = 0x016B; +const sal_Int32 BIFF12_ID_EXTERNALNAMEFLAGS = 0x024A; +const sal_Int32 BIFF12_ID_EXTSHEETNAMES = 0x0167; +const sal_Int32 BIFF12_ID_FILESHARING = 0x0224; +const sal_Int32 BIFF12_ID_FILEVERSION = 0x0080; +const sal_Int32 BIFF12_ID_FILL = 0x002D; +const sal_Int32 BIFF12_ID_FILLS = 0x025B; +const sal_Int32 BIFF12_ID_FILTERCOLUMN = 0x00A3; +const sal_Int32 BIFF12_ID_FONT = 0x002B; +const sal_Int32 BIFF12_ID_FONTS = 0x0263; +const sal_Int32 BIFF12_ID_FORMULA_STRING = 0x0008; +const sal_Int32 BIFF12_ID_FORMULA_DOUBLE = 0x0009; +const sal_Int32 BIFF12_ID_FORMULA_BOOL = 0x000A; +const sal_Int32 BIFF12_ID_FORMULA_ERROR = 0x000B; +const sal_Int32 BIFF12_ID_FUNCTIONGROUP = 0x0299; +const sal_Int32 BIFF12_ID_FUNCTIONGROUPS = 0x0298; +const sal_Int32 BIFF12_ID_HEADERFOOTER = 0x01DF; +const sal_Int32 BIFF12_ID_HYPERLINK = 0x01EE; +const sal_Int32 BIFF12_ID_ICONSET = 0x01D1; +const sal_Int32 BIFF12_ID_INDEXEDCOLORS = 0x0235; +const sal_Int32 BIFF12_ID_INPUTCELLS = 0x01F8; +const sal_Int32 BIFF12_ID_LEGACYDRAWING = 0x0227; +const sal_Int32 BIFF12_ID_MERGECELL = 0x00B0; +const sal_Int32 BIFF12_ID_MERGECELLS = 0x00B1; +const sal_Int32 BIFF12_ID_MRUCOLORS = 0x0239; +const sal_Int32 BIFF12_ID_MULTCELL_BLANK = 0x000C; +const sal_Int32 BIFF12_ID_MULTCELL_BOOL = 0x000F; +const sal_Int32 BIFF12_ID_MULTCELL_DOUBLE = 0x0010; +const sal_Int32 BIFF12_ID_MULTCELL_ERROR = 0x000E; +const sal_Int32 BIFF12_ID_MULTCELL_RK = 0x000D; +const sal_Int32 BIFF12_ID_MULTCELL_RSTRING = 0x003D; +const sal_Int32 BIFF12_ID_MULTCELL_SI = 0x0012; +const sal_Int32 BIFF12_ID_MULTCELL_STRING = 0x0011; +const sal_Int32 BIFF12_ID_NUMFMT = 0x002C; +const sal_Int32 BIFF12_ID_NUMFMTS = 0x0267; +const sal_Int32 BIFF12_ID_OLEOBJECT = 0x027F; +const sal_Int32 BIFF12_ID_OLEOBJECTS = 0x027E; +const sal_Int32 BIFF12_ID_OLESIZE = 0x0225; +const sal_Int32 BIFF12_ID_PAGEMARGINS = 0x01DC; +const sal_Int32 BIFF12_ID_PAGESETUP = 0x01DE; +const sal_Int32 BIFF12_ID_PANE = 0x0097; +const sal_Int32 BIFF12_ID_PCDEFINITION = 0x00B3; +const sal_Int32 BIFF12_ID_PCDFDISCRETEPR = 0x00E1; +const sal_Int32 BIFF12_ID_PCDFGROUPITEMS = 0x00DD; +const sal_Int32 BIFF12_ID_PCDFIELD = 0x00B7; +const sal_Int32 BIFF12_ID_PCDFIELDGROUP = 0x00DB; +const sal_Int32 BIFF12_ID_PCDFIELDS = 0x00B5; +const sal_Int32 BIFF12_ID_PCDFRANGEPR = 0x00DF; +const sal_Int32 BIFF12_ID_PCDFSHAREDITEMS = 0x00BD; +const sal_Int32 BIFF12_ID_PCDSHEETSOURCE = 0x00BB; +const sal_Int32 BIFF12_ID_PCDSOURCE = 0x00B9; +const sal_Int32 BIFF12_ID_PCITEM_ARRAY = 0x00BF; +const sal_Int32 BIFF12_ID_PCITEM_BOOL = 0x0016; +const sal_Int32 BIFF12_ID_PCITEM_DATE = 0x0019; +const sal_Int32 BIFF12_ID_PCITEM_DOUBLE = 0x0015; +const sal_Int32 BIFF12_ID_PCITEM_ERROR = 0x0017; +const sal_Int32 BIFF12_ID_PCITEM_INDEX = 0x001A; +const sal_Int32 BIFF12_ID_PCITEM_MISSING = 0x0014; +const sal_Int32 BIFF12_ID_PCITEM_STRING = 0x0018; +const sal_Int32 BIFF12_ID_PCITEMA_BOOL = 0x001D; +const sal_Int32 BIFF12_ID_PCITEMA_DATE = 0x0020; +const sal_Int32 BIFF12_ID_PCITEMA_DOUBLE = 0x001C; +const sal_Int32 BIFF12_ID_PCITEMA_ERROR = 0x001E; +const sal_Int32 BIFF12_ID_PCITEMA_MISSING = 0x001B; +const sal_Int32 BIFF12_ID_PCITEMA_STRING = 0x001F; +const sal_Int32 BIFF12_ID_PCRECORD = 0x0021; +const sal_Int32 BIFF12_ID_PCRECORDDT = 0x0022; +const sal_Int32 BIFF12_ID_PCRECORDS = 0x00C1; +const sal_Int32 BIFF12_ID_PHONETICPR = 0x0219; +const sal_Int32 BIFF12_ID_PICTURE = 0x0232; +const sal_Int32 BIFF12_ID_PIVOTAREA = 0x00F7; +const sal_Int32 BIFF12_ID_PIVOTCACHE = 0x0182; +const sal_Int32 BIFF12_ID_PIVOTCACHES = 0x0180; +const sal_Int32 BIFF12_ID_PRINTOPTIONS = 0x01DD; +const sal_Int32 BIFF12_ID_PTCOLFIELDS = 0x0137; +const sal_Int32 BIFF12_ID_PTDATAFIELD = 0x0125; +const sal_Int32 BIFF12_ID_PTDATAFIELDS = 0x0127; +const sal_Int32 BIFF12_ID_PTDEFINITION = 0x0118; +const sal_Int32 BIFF12_ID_PTFIELD = 0x011D; +const sal_Int32 BIFF12_ID_PTFIELDS = 0x011F; +const sal_Int32 BIFF12_ID_PTFILTER = 0x0259; +const sal_Int32 BIFF12_ID_PTFILTERS = 0x0257; +const sal_Int32 BIFF12_ID_PTFITEM = 0x011A; +const sal_Int32 BIFF12_ID_PTFITEMS = 0x011B; +const sal_Int32 BIFF12_ID_PTLOCATION = 0x013A; +const sal_Int32 BIFF12_ID_PTPAGEFIELD = 0x0121; +const sal_Int32 BIFF12_ID_PTPAGEFIELDS = 0x0123; +const sal_Int32 BIFF12_ID_PTREFERENCE = 0x00FB; +const sal_Int32 BIFF12_ID_PTREFERENCEITEM = 0x017E; +const sal_Int32 BIFF12_ID_PTREFERENCES = 0x00F9; +const sal_Int32 BIFF12_ID_PTROWFIELDS = 0x0135; +const sal_Int32 BIFF12_ID_QUERYTABLE = 0x01BF; +const sal_Int32 BIFF12_ID_QUERYTABLEREFRESH = 0x01C1; +const sal_Int32 BIFF12_ID_RGBCOLOR = 0x01DB; +const sal_Int32 BIFF12_ID_ROW = 0x0000; +const sal_Int32 BIFF12_ID_ROWBREAKS = 0x0188; +const sal_Int32 BIFF12_ID_SCENARIO = 0x01F6; +const sal_Int32 BIFF12_ID_SCENARIOS = 0x01F4; +const sal_Int32 BIFF12_ID_SELECTION = 0x0098; +const sal_Int32 BIFF12_ID_SHAREDFMLA = 0x01AB; +const sal_Int32 BIFF12_ID_SHEET = 0x009C; +const sal_Int32 BIFF12_ID_SHEETDATA = 0x0091; +const sal_Int32 BIFF12_ID_SHEETFORMATPR = 0x01E5; +const sal_Int32 BIFF12_ID_SHEETPR = 0x0093; +const sal_Int32 BIFF12_ID_SHEETPROTECTION = 0x0217; +const sal_Int32 BIFF12_ID_SHEETS = 0x008F; +const sal_Int32 BIFF12_ID_SHEETVIEW = 0x0089; +const sal_Int32 BIFF12_ID_SHEETVIEWS = 0x0085; +const sal_Int32 BIFF12_ID_SI = 0x0013; +const sal_Int32 BIFF12_ID_SST = 0x009F; +const sal_Int32 BIFF12_ID_STYLESHEET = 0x0116; +const sal_Int32 BIFF12_ID_TABLE = 0x0157; +const sal_Int32 BIFF12_ID_TABLEPART = 0x0295; +const sal_Int32 BIFF12_ID_TABLEPARTS = 0x0294; +const sal_Int32 BIFF12_ID_TABLESTYLEINFO = 0x0201; +const sal_Int32 BIFF12_ID_TABLESTYLES = 0x01FC; +const sal_Int32 BIFF12_ID_TOP10FILTER = 0x00AA; +const sal_Int32 BIFF12_ID_VOLTYPE = 0x0204; +const sal_Int32 BIFF12_ID_VOLTYPEMAIN = 0x0206; +const sal_Int32 BIFF12_ID_VOLTYPES = 0x0202; +const sal_Int32 BIFF12_ID_VOLTYPESTP = 0x020A; +const sal_Int32 BIFF12_ID_VOLTYPETR = 0x020B; +const sal_Int32 BIFF12_ID_WEBPR = 0x0105; +const sal_Int32 BIFF12_ID_WEBPRTABLES = 0x0107; +const sal_Int32 BIFF12_ID_WORKBOOK = 0x0083; +const sal_Int32 BIFF12_ID_WORKBOOKPR = 0x0099; +const sal_Int32 BIFF12_ID_WORKBOOKVIEW = 0x009E; +const sal_Int32 BIFF12_ID_WORKSHEET = 0x0081; +const sal_Int32 BIFF12_ID_XF = 0x002F; + +// BIFF2-BIFF8 record identifiers ============================================= /** An enumeration for all binary Excel file format types (BIFF types). */ enum BiffType @@ -352,6 +358,7 @@ const sal_uInt16 BIFF_ID_COLINFO = 0x007D; const sal_uInt16 BIFF_ID_COLUMNDEFAULT = 0x0020; const sal_uInt16 BIFF_ID_COLWIDTH = 0x0024; const sal_uInt16 BIFF_ID_COMPRESSPICS = 0x089B; +const sal_uInt16 BIFF_ID_CONNECTION = 0x0876; const sal_uInt16 BIFF_ID_CONT = 0x003C; const sal_uInt16 BIFF_ID_COORDLIST = 0x00A9; const sal_uInt16 BIFF_ID_COUNTRY = 0x008C; @@ -363,6 +370,7 @@ const sal_uInt16 BIFF_ID_DATAVALIDATION = 0x01BE; const sal_uInt16 BIFF_ID_DATAVALIDATIONS = 0x01B2; const sal_uInt16 BIFF_ID_DATEMODE = 0x0022; const sal_uInt16 BIFF_ID_DBCELL = 0x00D7; +const sal_uInt16 BIFF_ID_DBQUERY = 0x00DC; const sal_uInt16 BIFF_ID_DCONBINAME = 0x01B5; const sal_uInt16 BIFF_ID_DCONNAME = 0x0052; const sal_uInt16 BIFF_ID_DCONREF = 0x0051; @@ -434,6 +442,7 @@ const sal_uInt16 BIFF_ID_PAGELAYOUTVIEW = 0x088B; const sal_uInt16 BIFF_ID_PAGESETUP = 0x00A1; const sal_uInt16 BIFF_ID_PALETTE = 0x0092; const sal_uInt16 BIFF_ID_PANE = 0x0041; +const sal_uInt16 BIFF_ID_PARAMQUERY = 0x00DC; const sal_uInt16 BIFF_ID_PASSWORD = 0x0013; const sal_uInt16 BIFF_ID_PCDEFINITION = 0x00C6; const sal_uInt16 BIFF_ID_PCDEFINITION2 = 0x0122; @@ -469,6 +478,10 @@ const sal_uInt16 BIFF_ID_PTFITEM = 0x00B2; const sal_uInt16 BIFF_ID_PTPAGEFIELDS = 0x00B6; const sal_uInt16 BIFF_ID_PTROWCOLFIELDS = 0x00B4; const sal_uInt16 BIFF_ID_PTROWCOLITEMS = 0x00B5; +const sal_uInt16 BIFF_ID_QUERYTABLE = 0x01AD; +const sal_uInt16 BIFF_ID_QUERYTABLEREFRESH = 0x0802; +const sal_uInt16 BIFF_ID_QUERYTABLESETTINGS = 0x0803; +const sal_uInt16 BIFF_ID_QUERYTABLESTRING = 0x0804; const sal_uInt16 BIFF_ID_RECALCID = 0x01C1; const sal_uInt16 BIFF_ID_REFMODE = 0x000F; const sal_uInt16 BIFF_ID_RIGHTMARGIN = 0x0027; @@ -495,7 +508,6 @@ const sal_uInt16 BIFF2_ID_STRING = 0x0007; const sal_uInt16 BIFF3_ID_STRING = 0x0207; const sal_uInt16 BIFF_ID_STYLE = 0x0293; const sal_uInt16 BIFF_ID_STYLEEXT = 0x0892; -const sal_uInt16 BIFF_ID_SXEXT = 0x00DC; const sal_uInt16 BIFF_ID_TABLESTYLES = 0x088E; const sal_uInt16 BIFF_ID_THEME = 0x0896; const sal_uInt16 BIFF_ID_TOPMARGIN = 0x0028; @@ -520,6 +532,8 @@ const sal_uInt16 BIFF_ID_XFEXT = 0x087D; const sal_uInt16 BIFF_ID_UNKNOWN = SAL_MAX_UINT16; +// OBJ subrecord identifiers -------------------------------------------------- + const sal_uInt16 BIFF_ID_OBJEND = 0x0000; /// End of OBJ. const sal_uInt16 BIFF_ID_OBJMACRO = 0x0004; /// Macro link. const sal_uInt16 BIFF_ID_OBJBUTTON = 0x0005; /// Button data. @@ -562,7 +576,7 @@ const sal_uInt8 BIFF_DATATYPE_STRING = 2; const sal_uInt8 BIFF_DATATYPE_BOOL = 4; const sal_uInt8 BIFF_DATATYPE_ERROR = 16; -// unicode strings ------------------------------------------------------------ +// BIFF8 unicode strings ------------------------------------------------------ const sal_uInt8 BIFF_STRF_16BIT = 0x01; const sal_uInt8 BIFF_STRF_PHONETIC = 0x04; @@ -591,6 +605,27 @@ public: /** Returns a Windows code page from a text encoding. */ static sal_uInt16 calcCodePageFromTextEncoding( rtl_TextEncoding eTextEnc ); + // import ----------------------------------------------------------------- + + /** Returns true, if the current record of the stream is a BOF record. */ + static bool isBofRecord( BiffInputStream& rStrm ); + + /** Skips a block of records up to the specified end record. + + Skips all records until next end record. When this function returns, + the stream points to the end record, and the next call of the function + startNextRecord() at the stream will start the record following the end + record. + + The identifier of the record that is active while this function is + called is used as start record identifier. This identifier is used to + correctly skip embedded record blocks with the same start and end + record identifier. + + @return True = stream points to the end record. + */ + static bool skipRecordBlock( BiffInputStream& rStrm, sal_uInt16 nEndRecId ); + /** Imports a picture from an IMGDATA record. */ static void importImgData( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, BiffType eBiff ); @@ -605,4 +640,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/biffinputstream.hxx b/oox/inc/oox/xls/biffinputstream.hxx index c804d2c9c6e0..003ab28be34f 100644 --- a/oox/inc/oox/xls/biffinputstream.hxx +++ b/oox/inc/oox/xls/biffinputstream.hxx @@ -444,4 +444,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/biffoutputstream.hxx b/oox/inc/oox/xls/biffoutputstream.hxx index 6e36b08d3592..ada646bd879a 100644 --- a/oox/inc/oox/xls/biffoutputstream.hxx +++ b/oox/inc/oox/xls/biffoutputstream.hxx @@ -162,4 +162,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/chartsheetfragment.hxx b/oox/inc/oox/xls/chartsheetfragment.hxx index 58a6fdb5b54a..6609618a8b7d 100644 --- a/oox/inc/oox/xls/chartsheetfragment.hxx +++ b/oox/inc/oox/xls/chartsheetfragment.hxx @@ -35,25 +35,21 @@ namespace xls { // ============================================================================ -class OoxChartsheetFragment : public OoxWorksheetFragmentBase +class ChartsheetFragment : public WorksheetFragmentBase { public: - explicit OoxChartsheetFragment( + explicit ChartsheetFragment( const WorkbookHelper& rHelper, const ::rtl::OUString& rFragmentPath, - ISegmentProgressBarRef xProgressBar, + const ISegmentProgressBarRef& rxProgressBar, sal_Int16 nSheet ); protected: - // oox.core.ContextHandler2Helper interface ------------------------------- - virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - // oox.core.FragmentHandler2 interface ------------------------------------ - virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void initializeImport(); virtual void finalizeImport(); @@ -72,7 +68,7 @@ class BiffChartsheetFragment : public BiffWorksheetFragmentBase public: explicit BiffChartsheetFragment( const BiffWorkbookFragmentBase& rParent, - ISegmentProgressBarRef xProgressBar, + const ISegmentProgressBarRef& rxProgressBar, sal_Int16 nSheet ); /** Imports the entire sheet fragment, returns true, if EOF record has been reached. */ @@ -85,4 +81,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/commentsbuffer.hxx b/oox/inc/oox/xls/commentsbuffer.hxx index 8a43eb7fe9fe..bc03fcdc1c0c 100644 --- a/oox/inc/oox/xls/commentsbuffer.hxx +++ b/oox/inc/oox/xls/commentsbuffer.hxx @@ -99,4 +99,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/commentsfragment.hxx b/oox/inc/oox/xls/commentsfragment.hxx index 97788d635c15..ba0870f85503 100644 --- a/oox/inc/oox/xls/commentsfragment.hxx +++ b/oox/inc/oox/xls/commentsfragment.hxx @@ -36,15 +36,13 @@ namespace xls { // ============================================================================ -class OoxCommentsFragment : public OoxWorksheetFragmentBase +class CommentsFragment : public WorksheetFragmentBase { public: - explicit OoxCommentsFragment( + explicit CommentsFragment( const WorksheetHelper& rHelper, const ::rtl::OUString& rFragmentPath ); protected: - // oox.core.ContextHandler2Helper interface ------------------------------- - virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onEndElement(); @@ -52,8 +50,6 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); virtual void onEndRecord(); - // oox.core.FragmentHandler2 interface ------------------------------------ - virtual const ::oox::core::RecordInfo* getRecordInfos() const; private: @@ -72,4 +68,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/condformatbuffer.hxx b/oox/inc/oox/xls/condformatbuffer.hxx index 25259ce04295..da844f8c3669 100644 --- a/oox/inc/oox/xls/condformatbuffer.hxx +++ b/oox/inc/oox/xls/condformatbuffer.hxx @@ -64,11 +64,11 @@ struct CondFormatRuleModel explicit CondFormatRuleModel(); - /** Sets the passed OOBIN or BIFF operator for condition type cellIs. */ - void setBinOperator( sal_Int32 nOperator ); + /** Sets the passed BIFF operator for condition type cellIs. */ + void setBiffOperator( sal_Int32 nOperator ); - /** Sets the passed OOBIN text comparison type and operator. */ - void setOobTextType( sal_Int32 nOperator ); + /** Sets the passed BIFF12 text comparison type and operator. */ + void setBiff12TextType( sal_Int32 nOperator ); }; // ============================================================================ @@ -192,4 +192,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/condformatcontext.hxx b/oox/inc/oox/xls/condformatcontext.hxx index 492c1db1beb7..72953bffe423 100644 --- a/oox/inc/oox/xls/condformatcontext.hxx +++ b/oox/inc/oox/xls/condformatcontext.hxx @@ -36,14 +36,12 @@ namespace xls { // ============================================================================ -class OoxCondFormatContext : public OoxWorksheetContextBase +class CondFormatContext : public WorksheetContextBase { public: - explicit OoxCondFormatContext( OoxWorksheetFragmentBase& rFragment ); + explicit CondFormatContext( WorksheetFragmentBase& rFragment ); protected: - // oox.core.ContextHandler2Helper interface ------------------------------- - virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); @@ -62,4 +60,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/xls/connectionsbuffer.hxx b/oox/inc/oox/xls/connectionsbuffer.hxx new file mode 100755 index 000000000000..bfab732fa7fc --- /dev/null +++ b/oox/inc/oox/xls/connectionsbuffer.hxx @@ -0,0 +1,179 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_XLS_CONNECTIONSBUFFER_HXX +#define OOX_XLS_CONNECTIONSBUFFER_HXX + +#include "oox/xls/workbookhelper.hxx" + +namespace oox { +namespace xls { + +// ============================================================================ + +const sal_Int32 BIFF12_CONNECTION_UNKNOWN = 0; +const sal_Int32 BIFF12_CONNECTION_ODBC = 1; +const sal_Int32 BIFF12_CONNECTION_DAO = 2; +const sal_Int32 BIFF12_CONNECTION_FILE = 3; +const sal_Int32 BIFF12_CONNECTION_HTML = 4; +const sal_Int32 BIFF12_CONNECTION_OLEDB = 5; +const sal_Int32 BIFF12_CONNECTION_TEXT = 6; +const sal_Int32 BIFF12_CONNECTION_ADO = 7; +const sal_Int32 BIFF12_CONNECTION_DSP = 8; + +// ============================================================================ + +/** Special properties for data connections representing web queries. */ +struct WebPrModel +{ + typedef ::std::vector< ::com::sun::star::uno::Any > TablesVector; + + TablesVector maTables; /// Names or indexes of the web query tables. + ::rtl::OUString maUrl; /// Source URL to refresh the data. + ::rtl::OUString maPostMethod; /// POST method to query data. + ::rtl::OUString maEditPage; /// Web page showing query data (for XML queries). + sal_Int32 mnHtmlFormat; /// Plain text, rich text, or HTML. + bool mbXml; /// True = XML query, false = HTML query. + bool mbSourceData; /// True = import XML source data referred by HTML table. + bool mbParsePre; /// True = parse preformatted sections (
 tag).
+    bool                mbConsecutive;      /// True = join consecutive delimiters.
+    bool                mbFirstRow;         /// True = use column withs of first row for entire 
 tag.
+    bool                mbXl97Created;      /// True = web query created with Excel 97.
+    bool                mbTextDates;        /// True = read date values as text, false = parse dates.
+    bool                mbXl2000Refreshed;  /// True = refreshed with Excel 2000 or newer.
+    bool                mbHtmlTables;       /// True = HTML tables, false = entire document.
+
+    explicit            WebPrModel();
+};
+
+// ----------------------------------------------------------------------------
+
+/** Common properties of an external data connection. */
+struct ConnectionModel
+{
+    typedef ::std::auto_ptr< WebPrModel > WebPrModelPtr;
+
+    WebPrModelPtr       mxWebPr;            /// Special settings for web queries.
+    ::rtl::OUString     maName;             /// Unique name of this connection.
+    ::rtl::OUString     maDescription;      /// User description of this connection.
+    ::rtl::OUString     maSourceFile;       /// URL of a source data file.
+    ::rtl::OUString     maSourceConnFile;   /// URL of a source connection file.
+    ::rtl::OUString     maSsoId;            /// Single sign-on identifier.
+    sal_Int32           mnId;               /// Unique connection identifier.
+    sal_Int32           mnType;             /// Data source type.
+    sal_Int32           mnReconnectMethod;  /// Reconnection method.
+    sal_Int32           mnInterval;         /// Refresh interval in minutes.
+    bool                mbKeepAlive;        /// True = keep connection open after import.
+    bool                mbNew;              /// True = new connection, never updated.
+    bool                mbDeleted;          /// True = connection has been deleted.
+    bool                mbOnlyUseConnFile;  /// True = use maSourceConnFile, ignore mnReconnectMethod.
+    bool                mbBackground;       /// True = background refresh enabled.
+    bool                mbRefreshOnLoad;    /// True = refresh connection on import.
+    bool                mbSaveData;         /// True = save cached data with connection.
+
+    explicit            ConnectionModel();
+
+    WebPrModel&         createWebPr();
+};
+
+// ----------------------------------------------------------------------------
+
+/** An external data connection (database, web query, etc.). */
+class Connection : public WorkbookHelper
+{
+public:
+    explicit            Connection( const WorkbookHelper& rHelper, sal_Int32 nConnId = -1 );
+
+    /** Imports connection settings from the connection element. */
+    void                importConnection( const AttributeList& rAttribs );
+    /** Imports web query settings from the webPr element. */
+    void                importWebPr( const AttributeList& rAttribs );
+    /** Imports web query table settings from the tables element. */
+    void                importTables( const AttributeList& rAttribs );
+    /** Imports a web query table identifier from the m, s, or x element. */
+    void                importTable( const AttributeList& rAttribs, sal_Int32 nElement );
+
+    /** Imports connection settings from the CONNECTION record. */
+    void                importConnection( RecordInputStream& rStrm );
+    /** Imports web query settings from the WEBPR record. */
+    void                importWebPr( RecordInputStream& rStrm );
+    /** Imports web query table settings from the WEBPRTABLES record. */
+    void                importWebPrTables( RecordInputStream& rStrm );
+    /** Imports a web query table identifier from the PCITEM_MISSING, PCITEM_STRING, or PCITEM_INDEX record. */
+    void                importWebPrTable( RecordInputStream& rStrm, sal_Int32 nRecId );
+
+    /** Imports connection settings from the DBQUERY record. */
+    void                importDbQuery( BiffInputStream& rStrm );
+    /** Imports connection settings from the QUERYTABLESETTINGS record. */
+    void                importQueryTableSettings( BiffInputStream& rStrm );
+
+    /** Returns the unique connection identifier. */
+    inline sal_Int32    getConnectionId() const { return maModel.mnId; }
+    /** Returns the source data type of the connection. */
+    inline sal_Int32    getConnectionType() const { return maModel.mnType; }
+    /** Returns read-only access to the connection model data. */
+    const ConnectionModel& getModel() const { return maModel; }
+
+private:
+    ConnectionModel     maModel;
+};
+
+typedef ::boost::shared_ptr< Connection > ConnectionRef;
+
+// ============================================================================
+
+class ConnectionsBuffer : public WorkbookHelper
+{
+public:
+    explicit            ConnectionsBuffer( const WorkbookHelper& rHelper );
+
+    /** Imports connection settings from the connection element. */
+    ConnectionRef       importConnection( const AttributeList& rAttribs );
+    /** Imports connection settings from the CONNECTION record. */
+    ConnectionRef       importConnection( RecordInputStream& rStrm );
+    /** Creates a new empty connection with an unused identifier. */
+    ConnectionRef       createConnection();
+
+    /** Returns a data connection by its unique identifier. */
+    ConnectionRef       getConnection( sal_Int32 nConnId ) const;
+
+private:
+    /** Inserts the passed connection object. */
+    void                insertConnection( const ConnectionRef& rxConnection );
+
+private:
+    typedef RefMap< sal_Int32, Connection > ConnectionMap;
+    ConnectionMap       maConnections;
+    sal_Int32           mnUnusedId;
+};
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/xls/connectionsfragment.hxx b/oox/inc/oox/xls/connectionsfragment.hxx
index 85951a5bbfc7..a104daf050d5 100644
--- a/oox/inc/oox/xls/connectionsfragment.hxx
+++ b/oox/inc/oox/xls/connectionsfragment.hxx
@@ -29,31 +29,44 @@
 #define OOX_XLS_CONNECTIONSFRAGMENT_HXX
 
 #include "oox/xls/excelhandlers.hxx"
-#include "oox/xls/workbookhelper.hxx"
+#include "oox/xls/connectionsbuffer.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
-class OoxConnectionsFragment : public OoxWorkbookFragmentBase
+class ConnectionContext : public WorkbookContextBase
 {
 public:
-    explicit            OoxConnectionsFragment(
+    explicit            ConnectionContext( WorkbookFragmentBase& rParent, const ConnectionRef& rxConnection );
+
+protected:
+    virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+    virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+
+private:
+    ConnectionRef       mxConnection;
+};
+
+// ============================================================================
+
+class ConnectionsFragment : public WorkbookFragmentBase
+{
+public:
+    explicit            ConnectionsFragment(
                             const WorkbookHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath );
 
 protected:
-    // oox.core.ContextHandler2Helper interface -------------------------------
-
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+    virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+
+    virtual const ::oox::core::RecordInfo* getRecordInfos() const;
 
 private:
     void                importConnection( const AttributeList& rAttribs );
     void                importWebPr( const AttributeList& rAttribs );
-    void                importTables( const AttributeList& rAttribs );
-    void                importS( const AttributeList& rAttribs );
-    void                importX( const AttributeList& rAttribs );
 };
 
 // ============================================================================
@@ -62,4 +75,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/defnamesbuffer.hxx b/oox/inc/oox/xls/defnamesbuffer.hxx
index fa9715022c9f..2aca217fc28d 100644
--- a/oox/inc/oox/xls/defnamesbuffer.hxx
+++ b/oox/inc/oox/xls/defnamesbuffer.hxx
@@ -45,21 +45,21 @@ class BiffInputStreamPos;
 // ============================================================================
 
 // codes for built-in names
-const sal_Unicode OOX_DEFNAME_CONSOLIDATEAREA   = '\x00';
-const sal_Unicode OOX_DEFNAME_AUTOOPEN          = '\x01';
-const sal_Unicode OOX_DEFNAME_AUTOCLOSE         = '\x02';
-const sal_Unicode OOX_DEFNAME_EXTRACT           = '\x03';
-const sal_Unicode OOX_DEFNAME_DATABASE          = '\x04';
-const sal_Unicode OOX_DEFNAME_CRITERIA          = '\x05';
-const sal_Unicode OOX_DEFNAME_PRINTAREA         = '\x06';
-const sal_Unicode OOX_DEFNAME_PRINTTITLES       = '\x07';
-const sal_Unicode OOX_DEFNAME_RECORDER          = '\x08';
-const sal_Unicode OOX_DEFNAME_DATAFORM          = '\x09';
-const sal_Unicode OOX_DEFNAME_AUTOACTIVATE      = '\x0A';
-const sal_Unicode OOX_DEFNAME_AUTODEACTIVATE    = '\x0B';
-const sal_Unicode OOX_DEFNAME_SHEETTITLE        = '\x0C';
-const sal_Unicode OOX_DEFNAME_FILTERDATABASE    = '\x0D';
-const sal_Unicode OOX_DEFNAME_UNKNOWN           = '\x0E';
+const sal_Unicode BIFF_DEFNAME_CONSOLIDATEAREA  = '\x00';
+const sal_Unicode BIFF_DEFNAME_AUTOOPEN         = '\x01';
+const sal_Unicode BIFF_DEFNAME_AUTOCLOSE        = '\x02';
+const sal_Unicode BIFF_DEFNAME_EXTRACT          = '\x03';
+const sal_Unicode BIFF_DEFNAME_DATABASE         = '\x04';
+const sal_Unicode BIFF_DEFNAME_CRITERIA         = '\x05';
+const sal_Unicode BIFF_DEFNAME_PRINTAREA        = '\x06';
+const sal_Unicode BIFF_DEFNAME_PRINTTITLES      = '\x07';
+const sal_Unicode BIFF_DEFNAME_RECORDER         = '\x08';
+const sal_Unicode BIFF_DEFNAME_DATAFORM         = '\x09';
+const sal_Unicode BIFF_DEFNAME_AUTOACTIVATE     = '\x0A';
+const sal_Unicode BIFF_DEFNAME_AUTODEACTIVATE   = '\x0B';
+const sal_Unicode BIFF_DEFNAME_SHEETTITLE       = '\x0C';
+const sal_Unicode BIFF_DEFNAME_FILTERDATABASE   = '\x0D';
+const sal_Unicode BIFF_DEFNAME_UNKNOWN          = '\x0E';
 
 // ============================================================================
 
@@ -96,10 +96,10 @@ public:
     ::com::sun::star::uno::Any getReference( const ::com::sun::star::table::CellAddress& rBaseAddress ) const;
 
 protected:
-    /** Imports the OOX formula string, using the passed formula context. */
+    /** Imports the OOXML formula string, using the passed formula context. */
     void                importOoxFormula( FormulaContext& rContext, sal_Int16 nBaseSheet );
-    /** Imports the OOBIN formula, using the passed formula context. */
-    void                importOobFormula( FormulaContext& rContext, sal_Int16 nBaseSheet, RecordInputStream& rStrm );
+    /** Imports the BIFF12 formula, using the passed formula context. */
+    void                importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, RecordInputStream& rStrm );
     /** Imports the BIFF formula, using the passed formula context. */
     void                importBiffFormula( FormulaContext& rContext, sal_Int16 nBaseSheet, BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize = 0 );
 
@@ -135,7 +135,7 @@ public:
     void                convertFormula();
 
     /** Returns true, if this defined name is a special builtin name. */
-    inline bool         isBuiltinName() const { return mcBuiltinId != OOX_DEFNAME_UNKNOWN; }
+    inline bool         isBuiltinName() const { return mcBuiltinId != BIFF_DEFNAME_UNKNOWN; }
     /** Returns true, if this defined name is a macro function call. */
     inline bool         isMacroFunction() const { return maModel.mbMacro && maModel.mbFunction; }
     /** Returns true, if this defined name is a reference to a VBA macro. */
@@ -151,7 +151,7 @@ public:
     bool                getAbsoluteRange( ::com::sun::star::table::CellRangeAddress& orRange ) const;
 
 private:
-    /** Imports the OOX or OOBIN formula, using the passed formula context. */
+    /** Imports the OOXML or BIFF12 formula, using the passed formula context. */
     void                implImportOoxFormula( FormulaContext& rContext );
     /** Imports the BIFF formula, using the passed formula context. */
     void                implImportBiffFormula( FormulaContext& rContext );
@@ -165,7 +165,7 @@ private:
     sal_Int32           mnTokenIndex;       /// Name index used in API token array.
     sal_Int16           mnCalcSheet;        /// Calc sheet index for sheet-local names.
     sal_Unicode         mcBuiltinId;        /// Identifier for built-in defined names.
-    StreamDataSeqPtr    mxFormula;          /// Formula data for OOBIN import.
+    StreamDataSeqPtr    mxFormula;          /// Formula data for BIFF12 import.
     BiffStreamPosPtr    mxBiffStrm;         /// Cached BIFF stream for formula import.
     sal_uInt16          mnFmlaSize;         /// Cached BIFF formula size for formula import.
 };
diff --git a/oox/inc/oox/xls/drawingfragment.hxx b/oox/inc/oox/xls/drawingfragment.hxx
index 0b4dba0bbd53..3d14b78349c7 100644
--- a/oox/inc/oox/xls/drawingfragment.hxx
+++ b/oox/inc/oox/xls/drawingfragment.hxx
@@ -178,10 +178,10 @@ private:
 // ============================================================================
 
 /** Context handler for creation of shapes embedded in group shapes. */
-class OoxGroupShapeContext : public ::oox::drawingml::ShapeGroupContext, public WorksheetHelper
+class GroupShapeContext : public ::oox::drawingml::ShapeGroupContext, public WorksheetHelper
 {
 public:
-    explicit            OoxGroupShapeContext(
+    explicit            GroupShapeContext(
                             ::oox::core::ContextHandler& rParent,
                             const WorksheetHelper& rHelper,
                             const ::oox::drawingml::ShapePtr& rxShape );
@@ -205,16 +205,14 @@ protected:
 // ============================================================================
 
 /** Fragment handler for a complete sheet drawing. */
-class OoxDrawingFragment : public OoxWorksheetFragmentBase
+class DrawingFragment : public WorksheetFragmentBase
 {
 public:
-    explicit            OoxDrawingFragment(
+    explicit            DrawingFragment(
                             const WorksheetHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath );
 
 protected:
-    // oox.core.ContextHandler2Helper interface -------------------------------
-
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
     virtual void        onCharacters( const ::rtl::OUString& rChars );
     virtual void        onEndElement();
@@ -307,10 +305,10 @@ private:
 
 // ============================================================================
 
-class OoxVmlDrawingFragment : public ::oox::vml::DrawingFragment, public WorksheetHelper
+class VmlDrawingFragment : public ::oox::vml::DrawingFragment, public WorksheetHelper
 {
 public:
-    explicit            OoxVmlDrawingFragment(
+    explicit            VmlDrawingFragment(
                             const WorksheetHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath );
 
diff --git a/oox/inc/oox/xls/excelchartconverter.hxx b/oox/inc/oox/xls/excelchartconverter.hxx
index 08c3398a5718..a46d484f2074 100644
--- a/oox/inc/oox/xls/excelchartconverter.hxx
+++ b/oox/inc/oox/xls/excelchartconverter.hxx
@@ -59,4 +59,3 @@ public:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/excelfilter.hxx b/oox/inc/oox/xls/excelfilter.hxx
index 2badfe5cba75..789cbc99cb07 100644
--- a/oox/inc/oox/xls/excelfilter.hxx
+++ b/oox/inc/oox/xls/excelfilter.hxx
@@ -28,8 +28,8 @@
 #ifndef OOX_XLS_EXCELFILTER_HXX
 #define OOX_XLS_EXCELFILTER_HXX
 
-#include "oox/core/xmlfilterbase.hxx"
 #include "oox/core/binaryfilterbase.hxx"
+#include "oox/core/xmlfilterbase.hxx"
 
 namespace oox {
 namespace xls {
diff --git a/oox/inc/oox/xls/excelhandlers.hxx b/oox/inc/oox/xls/excelhandlers.hxx
index 986f42aadba4..864f5f9a9e44 100644
--- a/oox/inc/oox/xls/excelhandlers.hxx
+++ b/oox/inc/oox/xls/excelhandlers.hxx
@@ -41,17 +41,17 @@ namespace xls {
 
     Used to import contexts in global workbook fragments.
  */
-class OoxWorkbookContextBase : public ::oox::core::ContextHandler2, public WorkbookHelper
+class WorkbookContextBase : public ::oox::core::ContextHandler2, public WorkbookHelper
 {
 public:
     template< typename ParentType >
-    explicit            OoxWorkbookContextBase( ParentType& rParent );
+    explicit            WorkbookContextBase( ParentType& rParent );
 };
 
 // ----------------------------------------------------------------------------
 
 template< typename ParentType >
-OoxWorkbookContextBase::OoxWorkbookContextBase( ParentType& rParent ) :
+WorkbookContextBase::WorkbookContextBase( ParentType& rParent ) :
     ::oox::core::ContextHandler2( rParent ),
     WorkbookHelper( rParent )
 {
@@ -63,32 +63,32 @@ OoxWorkbookContextBase::OoxWorkbookContextBase( ParentType& rParent ) :
 
     Used to import contexts in sheet fragments.
  */
-class OoxWorksheetContextBase : public ::oox::core::ContextHandler2, public WorksheetHelperRoot
+class WorksheetContextBase : public ::oox::core::ContextHandler2, public WorksheetHelperRoot
 {
 public:
     template< typename ParentType >
-    explicit            OoxWorksheetContextBase(
+    explicit            WorksheetContextBase(
                             ParentType& rParent,
-                            ISegmentProgressBarRef xProgressBar,
+                            const ISegmentProgressBarRef& rxProgressBar,
                             WorksheetType eSheetType,
                             sal_Int16 nSheet );
 
     template< typename ParentType >
-    explicit            OoxWorksheetContextBase( ParentType& rParent );
+    explicit            WorksheetContextBase( ParentType& rParent );
 };
 
 // ----------------------------------------------------------------------------
 
 template< typename ParentType >
-OoxWorksheetContextBase::OoxWorksheetContextBase( ParentType& rParent,
-        ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+WorksheetContextBase::WorksheetContextBase( ParentType& rParent,
+        const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
     ::oox::core::ContextHandler2( rParent ),
-    WorksheetHelperRoot( rParent, xProgressBar, eSheetType, nSheet )
+    WorksheetHelperRoot( rParent, rxProgressBar, eSheetType, nSheet )
 {
 }
 
 template< typename ParentType >
-OoxWorksheetContextBase::OoxWorksheetContextBase( ParentType& rParent ) :
+WorksheetContextBase::WorksheetContextBase( ParentType& rParent ) :
     ::oox::core::ContextHandler2( rParent ),
     WorksheetHelperRoot( rParent )
 {
@@ -100,10 +100,10 @@ OoxWorksheetContextBase::OoxWorksheetContextBase( ParentType& rParent ) :
 
     Used to import global workbook fragments.
  */
-class OoxWorkbookFragmentBase : public ::oox::core::FragmentHandler2, public WorkbookHelper
+class WorkbookFragmentBase : public ::oox::core::FragmentHandler2, public WorkbookHelper
 {
 public:
-    explicit            OoxWorkbookFragmentBase(
+    explicit            WorkbookFragmentBase(
                             const WorkbookHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath );
 };
@@ -114,17 +114,17 @@ public:
 
     Used to import sheet fragments.
  */
-class OoxWorksheetFragmentBase : public ::oox::core::FragmentHandler2, public WorksheetHelperRoot
+class WorksheetFragmentBase : public ::oox::core::FragmentHandler2, public WorksheetHelperRoot
 {
 public:
-    explicit            OoxWorksheetFragmentBase(
+    explicit            WorksheetFragmentBase(
                             const WorkbookHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath,
-                            ISegmentProgressBarRef xProgressBar,
+                            const ISegmentProgressBarRef& rxProgressBar,
                             WorksheetType eSheetType,
                             sal_Int16 nSheet );
 
-    explicit            OoxWorksheetFragmentBase(
+    explicit            WorksheetFragmentBase(
                             const WorksheetHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath );
 };
@@ -132,72 +132,21 @@ public:
 // ============================================================================
 // ============================================================================
 
-/** An enumeration for all types of fragments in a BIFF workbook stream. */
-enum BiffFragmentType
-{
-    BIFF_FRAGMENT_GLOBALS,      /// Workbook globals fragment.
-    BIFF_FRAGMENT_WORKSHEET,    /// Worksheet fragment.
-    BIFF_FRAGMENT_CHARTSHEET,   /// Chart sheet fragment.
-    BIFF_FRAGMENT_MACROSHEET,   /// Macro sheet fragment.
-    BIFF_FRAGMENT_MODULESHEET,  /// BIFF5 VB module fragment.
-    BIFF_FRAGMENT_EMPTYSHEET,   /// Sheet fragment of unsupported type.
-    BIFF_FRAGMENT_WORKSPACE,    /// BIFF4 workspace/workbook globals.
-    BIFF_FRAGMENT_UNKNOWN       /// Unknown fragment/error.
-};
-
-// ============================================================================
-
-/** Base class for all BIFF context handlers and fragment handlers.
-
-    This base class holds a reference to the BIFF input stream which can be
-    accessed in all derived classes.
- */
-class BiffHandlerBase
-{
-protected:
-    inline explicit     BiffHandlerBase( BiffInputStream& rStrm ) : mrStrm( rStrm ) {}
-    virtual             ~BiffHandlerBase();
-
-    /** Skips a block of records up to the specified end record.
-
-        Skips all records until next end record. When this function returns,
-        stream points to the end record, and the next call of startNextRecord()
-        at the stream will start the record following the end record.
-
-        The identifier of the record that is active while this function is
-        called is used as start record identifier. This identifier is used to
-        correctly skip embedded record blocks with the same start and end
-        record identifier.
-
-        @return  True = stream points to the end record.
-     */
-    bool                skipRecordBlock( sal_uInt16 nEndRecId );
-
-    /** @return  True = current record identifier is a BOF record. */
-    bool                isBofRecord() const;
-
-protected:
-    BiffInputStream&    mrStrm;
-};
-
-// ============================================================================
-
 /** Base class for all BIFF context handlers.
 
     Derived handlers have to implement the importRecord() function that has to
-    import the record the BIFF input stream currently points to.
+    import the record the passed BIFF input stream currently points to.
  */
-class BiffContextHandler : public BiffHandlerBase
+class BiffContextHandler
 {
 public:
-    /** Derived classes have to implement importing the current record. */
-    virtual void        importRecord() = 0;
+    virtual             ~BiffContextHandler();
 
-protected:
-    explicit            BiffContextHandler( const BiffHandlerBase& rParent );
+    /** Derived classes have to implement importing the current record. */
+    virtual void        importRecord( BiffInputStream& rStrm ) = 0;
 };
 
-// ============================================================================
+// ----------------------------------------------------------------------------
 
 /** Context handler derived from the WorkbookHelper helper class.
 
@@ -206,21 +155,11 @@ protected:
 class BiffWorkbookContextBase : public BiffContextHandler, public WorkbookHelper
 {
 protected:
-    template< typename ParentType >
-    explicit            BiffWorkbookContextBase( const ParentType& rParent );
+    explicit            BiffWorkbookContextBase( const WorkbookHelper& rHelper );
 };
 
 // ----------------------------------------------------------------------------
 
-template< typename ParentType >
-BiffWorkbookContextBase::BiffWorkbookContextBase( const ParentType& rParent ) :
-    BiffContextHandler( rParent ),
-    WorkbookHelper( rParent )
-{
-}
-
-// ============================================================================
-
 /** Context handler derived from the WorksheetHelper helper class.
 
     Used to import contexts in sheet fragments.
@@ -228,68 +167,48 @@ BiffWorkbookContextBase::BiffWorkbookContextBase( const ParentType& rParent ) :
 class BiffWorksheetContextBase : public BiffContextHandler, public WorksheetHelperRoot
 {
 protected:
-    template< typename ParentType >
     explicit            BiffWorksheetContextBase(
-                            const ParentType& rParent,
-                            ISegmentProgressBarRef xProgressBar,
+                            const WorkbookHelper& rHelper,
+                            const ISegmentProgressBarRef& rxProgressBar,
                             WorksheetType eSheetType,
                             sal_Int16 nSheet );
 
-    template< typename ParentType >
-    explicit            BiffWorksheetContextBase( const ParentType& rParent );
+    explicit            BiffWorksheetContextBase( const WorksheetHelper& rHelper );
 };
 
-// ----------------------------------------------------------------------------
-
-template< typename ParentType >
-BiffWorksheetContextBase::BiffWorksheetContextBase( const ParentType& rParent,
-        ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
-    BiffContextHandler( rParent ),
-    WorksheetHelperRoot( rParent, xProgressBar, eSheetType, nSheet )
-{
-}
-
-template< typename ParentType >
-BiffWorksheetContextBase::BiffWorksheetContextBase( const ParentType& rParent ) :
-    BiffContextHandler( rParent ),
-    WorksheetHelperRoot( rParent )
-{
-}
-
 // ============================================================================
 
-namespace prv {
-
-struct BiffFragmentStreamOwner
+/** An enumeration for all types of fragments in a BIFF workbook stream. */
+enum BiffFragmentType
 {
-    typedef ::boost::shared_ptr< BinaryXInputStream >   XInputStreamRef;
-    typedef ::boost::shared_ptr< BiffInputStream >      BiffInputStreamRef;
-
-    XInputStreamRef     mxXInStrm;
-    BiffInputStreamRef  mxBiffStrm;
-
-    explicit            BiffFragmentStreamOwner( const ::oox::core::FilterBase& rFilter, const ::rtl::OUString& rStrmName );
-    virtual             ~BiffFragmentStreamOwner();
+    BIFF_FRAGMENT_GLOBALS,      /// Workbook globals fragment.
+    BIFF_FRAGMENT_WORKSHEET,    /// Worksheet fragment.
+    BIFF_FRAGMENT_CHARTSHEET,   /// Chart sheet fragment.
+    BIFF_FRAGMENT_MACROSHEET,   /// Macro sheet fragment.
+    BIFF_FRAGMENT_MODULESHEET,  /// BIFF5 VB module fragment.
+    BIFF_FRAGMENT_EMPTYSHEET,   /// Sheet fragment of unsupported type.
+    BIFF_FRAGMENT_WORKSPACE,    /// BIFF4 workspace/workbook globals.
+    BIFF_FRAGMENT_UNKNOWN       /// Unknown fragment/error.
 };
 
-} // namespace prv
-
 // ----------------------------------------------------------------------------
 
-class BiffFragmentHandler : private prv::BiffFragmentStreamOwner, public BiffHandlerBase
+class BiffFragmentHandler
 {
 public:
-    /** Imports the fragment, returns true, if EOF record has been reached. */
-    virtual bool        importFragment() = 0;
-
-protected:
     /** Opens the stream with the passed full name. */
     explicit            BiffFragmentHandler(
                             const ::oox::core::FilterBase& rFilter,
                             const ::rtl::OUString& rStrmName );
 
-    /** Reuses the stream of the passed fragment. */
-    explicit            BiffFragmentHandler( const BiffFragmentHandler& rHandler );
+    virtual             ~BiffFragmentHandler();
+
+    /** Imports the fragment, returns true, if EOF record has been reached. */
+    virtual bool        importFragment() = 0;
+
+protected:
+    /** Returns the BIFF input stream of this fragment. */
+    inline BiffInputStream& getInputStream() { return *mxBiffStrm; }
 
     /** Starts a new fragment in a workbbok stream and returns the fragment type.
 
@@ -326,11 +245,14 @@ protected:
     bool                skipFragment();
 
 private:
-    /** Implementation helper for the startFragment() functions. */
-    BiffFragmentType    implStartFragment( BiffType eBiff );
+    typedef ::boost::shared_ptr< BinaryXInputStream >   XInputStreamRef;
+    typedef ::boost::shared_ptr< BiffInputStream >      BiffInputStreamRef;
+
+    XInputStreamRef     mxXInStrm;
+    BiffInputStreamRef  mxBiffStrm;
 };
 
-// ============================================================================
+// ----------------------------------------------------------------------------
 
 /** Fragment handler derived from the WorkbookHelper helper class.
 
@@ -345,7 +267,7 @@ protected:
                             bool bCloneDecoder = false );
 };
 
-// ============================================================================
+// ----------------------------------------------------------------------------
 
 /** Fragment handler derived from the WorksheetHelper helper class.
 
@@ -356,12 +278,12 @@ class BiffWorksheetFragmentBase : public BiffFragmentHandler, public WorksheetHe
 protected:
     explicit            BiffWorksheetFragmentBase(
                             const BiffWorkbookFragmentBase& rParent,
-                            ISegmentProgressBarRef xProgressBar,
+                            const ISegmentProgressBarRef& rxProgressBar,
                             WorksheetType eSheetType,
                             sal_Int16 nSheet );
 };
 
-// ============================================================================
+// ----------------------------------------------------------------------------
 
 /** Special fragment handler for worksheets that have to be skipped.
  */
@@ -370,7 +292,7 @@ class BiffSkipWorksheetFragment : public BiffWorksheetFragmentBase
 public:
     explicit            BiffSkipWorksheetFragment(
                             const BiffWorkbookFragmentBase& rParent,
-                            ISegmentProgressBarRef xProgressBar,
+                            const ISegmentProgressBarRef& rxProgressBar,
                             sal_Int16 nSheet );
 
     virtual bool        importFragment();
@@ -383,4 +305,3 @@ public:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/externallinkbuffer.hxx b/oox/inc/oox/xls/externallinkbuffer.hxx
index 7a4cf26fecb2..efa99440594f 100644
--- a/oox/inc/oox/xls/externallinkbuffer.hxx
+++ b/oox/inc/oox/xls/externallinkbuffer.hxx
@@ -317,10 +317,10 @@ typedef ::boost::shared_ptr< ExternalLink > ExternalLinkRef;
 
 // ============================================================================
 
-/** Represents a REF entry in the OOBIN EXTERNALSHEETS or in the BIFF8
+/** Represents a REF entry in the BIFF12 EXTERNALSHEETS or in the BIFF8
     EXTERNSHEET record.
 
-    This struct is used to map ref identifiers to external books (OOBIN:
+    This struct is used to map ref identifiers to external books (BIFF12:
     EXTERNALREF records, BIFF8: EXTERNALBOOK records), and provides sheet
     indexes into the sheet list of the external document.
  */
@@ -332,7 +332,7 @@ struct RefSheetsModel
 
     explicit            RefSheetsModel();
 
-    void                readOobData( RecordInputStream& rStrm );
+    void                readBiff12Data( RecordInputStream& rStrm );
     void                readBiff8Data( BiffInputStream& rStrm );
 };
 
@@ -393,7 +393,7 @@ private:
     ExternalLinkVec     maLinks;            /// List of link structures for all kinds of links.
     ExternalLinkVec     maExtLinks;         /// Real external links needed for formula parser.
     RefSheetsModelVec   maRefSheets;        /// Sheet indexes for reference ids.
-    bool                mbUseRefSheets;     /// True = use maRefSheets list (OOBIN only).
+    bool                mbUseRefSheets;     /// True = use maRefSheets list (BIFF12 only).
 };
 
 // ============================================================================
diff --git a/oox/inc/oox/xls/externallinkfragment.hxx b/oox/inc/oox/xls/externallinkfragment.hxx
index c651f4f2f0a5..1a89e17c96a4 100644
--- a/oox/inc/oox/xls/externallinkfragment.hxx
+++ b/oox/inc/oox/xls/externallinkfragment.hxx
@@ -36,6 +36,7 @@ namespace xls {
 
 class ExternalLink;
 
+// ============================================================================
 // ============================================================================
 
 /** This class implements importing the sheetData element in external sheets.
@@ -43,16 +44,14 @@ class ExternalLink;
     The sheetData element embedded in the externalBook element contains cached
     cells from externally linked sheets.
  */
-class OoxExternalSheetDataContext : public OoxWorkbookContextBase
+class ExternalSheetDataContext : public WorkbookContextBase
 {
 public:
-    explicit            OoxExternalSheetDataContext(
-                            OoxWorkbookFragmentBase& rFragment,
+    explicit            ExternalSheetDataContext(
+                            WorkbookFragmentBase& rFragment,
                             const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XExternalSheetCache >& rxSheetCache );
 
 protected:
-    // oox.core.ContextHandler2Helper interface -------------------------------
-
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
     virtual void        onCharacters( const ::rtl::OUString& rChars );
 
@@ -85,25 +84,21 @@ private:
 
 // ============================================================================
 
-class OoxExternalLinkFragment : public OoxWorkbookFragmentBase
+class ExternalLinkFragment : public WorkbookFragmentBase
 {
 public:
-    explicit            OoxExternalLinkFragment(
+    explicit            ExternalLinkFragment(
                             const WorkbookHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath,
                             ExternalLink& rExtLink );
 
 protected:
-    // oox.core.ContextHandler2Helper interface -------------------------------
-
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
     virtual void        onCharacters( const ::rtl::OUString& rChars );
     virtual void        onEndElement();
 
     virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
 
-    // oox.core.FragmentHandler2 interface ------------------------------------
-
     virtual const ::oox::core::RecordInfo* getRecordInfos() const;
 
 private:
@@ -116,30 +111,25 @@ private:
     sal_Int32           mnResultType;
 };
 
+// ============================================================================
 // ============================================================================
 
-class BiffExternalLinkFragment : public BiffWorkbookFragmentBase
+class BiffExternalSheetDataContext : public BiffWorkbookContextBase
 {
 public:
-    explicit            BiffExternalLinkFragment( const BiffWorkbookFragmentBase& rParent, bool bImportDefNames );
-    virtual             ~BiffExternalLinkFragment();
-
-    /** Imports all records related to external links. */
-    virtual bool        importFragment();
+    explicit            BiffExternalSheetDataContext( const WorkbookHelper& rHelper, bool bImportDefNames );
+    virtual             ~BiffExternalSheetDataContext();
 
     /** Tries to import a record related to external links and defined names. */
-    void                importRecord();
-
-    /** Finalizes buffers related to external links and defined names. */
-    void                finalizeImport();
+    virtual void        importRecord( BiffInputStream& rStrm );
 
 private:
-    void                importExternSheet();
-    void                importExternalBook();
-    void                importExternalName();
-    void                importXct();
-    void                importCrn();
-    void                importDefinedName();
+    void                importExternSheet( BiffInputStream& rStrm );
+    void                importExternalBook( BiffInputStream& rStrm );
+    void                importExternalName( BiffInputStream& rStrm );
+    void                importXct( BiffInputStream& rStrm );
+    void                importCrn( BiffInputStream& rStrm );
+    void                importDefinedName( BiffInputStream& rStrm );
 
     /** Sets the passed cell value to the passed position in the sheet cache. */
     void                setCellValue( const BinAddress& rBinAddr, const ::com::sun::star::uno::Any& rValue );
@@ -153,8 +143,19 @@ private:
 
 // ============================================================================
 
+class BiffExternalLinkFragment : public BiffWorkbookFragmentBase
+{
+public:
+    explicit            BiffExternalLinkFragment( const BiffWorkbookFragmentBase& rParent );
+
+    /** Imports all records related to external links. */
+    virtual bool        importFragment();
+};
+
+// ============================================================================
+// ============================================================================
+
 } // namespace xls
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/formulabase.hxx b/oox/inc/oox/xls/formulabase.hxx
index 510404d2b662..d9fdf34cfbbb 100644
--- a/oox/inc/oox/xls/formulabase.hxx
+++ b/oox/inc/oox/xls/formulabase.hxx
@@ -28,19 +28,19 @@
 #ifndef OOX_XLS_FORMULABASE_HXX
 #define OOX_XLS_FORMULABASE_HXX
 
-#include 
+#include 
+#include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include "oox/helper/containerhelper.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/xls/addressconverter.hxx"
 
 namespace com { namespace sun { namespace star {
+    namespace sheet { class XFormulaOpCodeMapper; }
     namespace sheet { class XFormulaParser; }
     namespace sheet { class XFormulaTokens; }
-    namespace sheet { class XFormulaOpCodeMapper; }
 } } }
 
 namespace oox { template< typename Type > class Matrix; }
@@ -126,24 +126,14 @@ const sal_uInt8 BIFF_TOKID_AREAERR3D            = 0x1D;     /// Deleted 3D area
 
 // specific token constants ---------------------------------------------------
 
-const sal_uInt8 OOBIN_TOK_ARRAY_DOUBLE          = 0;
-const sal_uInt8 OOBIN_TOK_ARRAY_STRING          = 1;
-const sal_uInt8 OOBIN_TOK_ARRAY_BOOL            = 2;
-const sal_uInt8 OOBIN_TOK_ARRAY_ERROR           = 4;
+const sal_uInt8 BIFF_TOK_ARRAY_DOUBLE           = 0;        /// Double value in an array.
+const sal_uInt8 BIFF_TOK_ARRAY_STRING           = 1;        /// String value in an array.
+const sal_uInt8 BIFF_TOK_ARRAY_BOOL             = 2;        /// Boolean value in an array.
+const sal_uInt8 BIFF_TOK_ARRAY_ERROR            = 4;        /// Error code in an array.
 
 const sal_uInt8 BIFF_TOK_BOOL_FALSE             = 0;        /// FALSE value of a tBool token.
 const sal_uInt8 BIFF_TOK_BOOL_TRUE              = 1;        /// TRUE value of a tBool token.
 
-const sal_uInt8 OOBIN_TOK_ATTR_VOLATILE         = 0x01;     /// Volatile function.
-const sal_uInt8 OOBIN_TOK_ATTR_IF               = 0x02;     /// Start of true condition in IF function.
-const sal_uInt8 OOBIN_TOK_ATTR_CHOOSE           = 0x04;     /// Jump array of CHOOSE function.
-const sal_uInt8 OOBIN_TOK_ATTR_SKIP             = 0x08;     /// Skip tokens.
-const sal_uInt8 OOBIN_TOK_ATTR_SUM              = 0x10;     /// SUM function with one parameter.
-const sal_uInt8 OOBIN_TOK_ATTR_ASSIGN           = 0x20;     /// BASIC style assignment.
-const sal_uInt8 OOBIN_TOK_ATTR_SPACE            = 0x40;     /// Spaces in formula representation.
-const sal_uInt8 OOBIN_TOK_ATTR_SPACE_VOLATILE   = 0x41;     /// Leading spaces and volatile formula.
-const sal_uInt8 OOBIN_TOK_ATTR_IFERROR          = 0x80;     /// Start of condition in IFERROR function.
-
 const sal_uInt8 BIFF_TOK_ATTR_VOLATILE          = 0x01;     /// Volatile function.
 const sal_uInt8 BIFF_TOK_ATTR_IF                = 0x02;     /// Start of true condition in IF function.
 const sal_uInt8 BIFF_TOK_ATTR_CHOOSE            = 0x04;     /// Jump array of CHOOSE function.
@@ -152,6 +142,7 @@ const sal_uInt8 BIFF_TOK_ATTR_SUM               = 0x10;     /// SUM function wit
 const sal_uInt8 BIFF_TOK_ATTR_ASSIGN            = 0x20;     /// BASIC style assignment.
 const sal_uInt8 BIFF_TOK_ATTR_SPACE             = 0x40;     /// Spaces in formula representation.
 const sal_uInt8 BIFF_TOK_ATTR_SPACE_VOLATILE    = 0x41;     /// Leading spaces and volatile formula.
+const sal_uInt8 BIFF_TOK_ATTR_IFERROR           = 0x80;     /// Start of condition in IFERROR function (BIFF12 only).
 
 const sal_uInt8 BIFF_TOK_ATTR_SPACE_SP          = 0x00;     /// Spaces before next token.
 const sal_uInt8 BIFF_TOK_ATTR_SPACE_BR          = 0x01;     /// Line breaks before next token.
@@ -166,27 +157,27 @@ const sal_uInt16 BIFF_TOK_FUNCVAR_FUNCIDMASK    = 0x7FFF;   /// Mask for functio
 const sal_uInt8 BIFF_TOK_FUNCVAR_CMDPROMPT      = 0x80;     /// User prompt for macro commands.
 const sal_uInt8 BIFF_TOK_FUNCVAR_COUNTMASK      = 0x7F;     /// Mask for parameter count.
 
-const sal_uInt16 OOBIN_TOK_REF_COLMASK          = 0x3FFF;   /// Mask to extract column from reference.
-const sal_Int32 OOBIN_TOK_REF_ROWMASK           = 0xFFFFF;  /// Mask to extract row from reference.
-const sal_uInt16 OOBIN_TOK_REF_COLREL           = 0x4000;   /// True = column is relative.
-const sal_uInt16 OOBIN_TOK_REF_ROWREL           = 0x8000;   /// True = row is relative.
+const sal_uInt16 BIFF12_TOK_REF_COLMASK         = 0x3FFF;   /// Mask to extract column from reference (BIFF12).
+const sal_Int32 BIFF12_TOK_REF_ROWMASK          = 0xFFFFF;  /// Mask to extract row from reference (BIFF12).
+const sal_uInt16 BIFF12_TOK_REF_COLREL          = 0x4000;   /// True = column is relative (BIFF12).
+const sal_uInt16 BIFF12_TOK_REF_ROWREL          = 0x8000;   /// True = row is relative (BIFF12).
 
 const sal_uInt16 BIFF_TOK_REF_COLMASK           = 0x00FF;   /// Mask to extract BIFF8 column from reference.
 const sal_uInt16 BIFF_TOK_REF_ROWMASK           = 0x3FFF;   /// Mask to extract BIFF2-BIFF5 row from reference.
 const sal_uInt16 BIFF_TOK_REF_COLREL            = 0x4000;   /// True = column is relative.
 const sal_uInt16 BIFF_TOK_REF_ROWREL            = 0x8000;   /// True = row is relative.
 
-const sal_uInt16 OOBIN_TOK_TABLE_COLUMN         = 0x0001;   /// Table reference: Single column.
-const sal_uInt16 OOBIN_TOK_TABLE_COLRANGE       = 0x0002;   /// Table reference: Range of columns.
-const sal_uInt16 OOBIN_TOK_TABLE_ALL            = 0x0004;   /// Table reference: Special [#All] range.
-const sal_uInt16 OOBIN_TOK_TABLE_HEADERS        = 0x0008;   /// Table reference: Special [#Headers] range.
-const sal_uInt16 OOBIN_TOK_TABLE_DATA           = 0x0010;   /// Table reference: Special [#Data] range.
-const sal_uInt16 OOBIN_TOK_TABLE_TOTALS         = 0x0020;   /// Table reference: Special [#Totals] range.
-const sal_uInt16 OOBIN_TOK_TABLE_THISROW        = 0x0040;   /// Table reference: Special [#This Row] range.
-const sal_uInt16 OOBIN_TOK_TABLE_SP_BRACKETS    = 0x0080;   /// Table reference: Spaces in outer brackets.
-const sal_uInt16 OOBIN_TOK_TABLE_SP_SEP         = 0x0100;   /// Table reference: Spaces after separators.
-const sal_uInt16 OOBIN_TOK_TABLE_ROW            = 0x0200;   /// Table reference: Single row.
-const sal_uInt16 OOBIN_TOK_TABLE_CELL           = 0x0400;   /// Table reference: Single cell.
+const sal_uInt16 BIFF12_TOK_TABLE_COLUMN         = 0x0001;   /// Table reference: Single column.
+const sal_uInt16 BIFF12_TOK_TABLE_COLRANGE       = 0x0002;   /// Table reference: Range of columns.
+const sal_uInt16 BIFF12_TOK_TABLE_ALL            = 0x0004;   /// Table reference: Special [#All] range.
+const sal_uInt16 BIFF12_TOK_TABLE_HEADERS        = 0x0008;   /// Table reference: Special [#Headers] range.
+const sal_uInt16 BIFF12_TOK_TABLE_DATA           = 0x0010;   /// Table reference: Special [#Data] range.
+const sal_uInt16 BIFF12_TOK_TABLE_TOTALS         = 0x0020;   /// Table reference: Special [#Totals] range.
+const sal_uInt16 BIFF12_TOK_TABLE_THISROW        = 0x0040;   /// Table reference: Special [#This Row] range.
+const sal_uInt16 BIFF12_TOK_TABLE_SP_BRACKETS    = 0x0080;   /// Table reference: Spaces in outer brackets.
+const sal_uInt16 BIFF12_TOK_TABLE_SP_SEP         = 0x0100;   /// Table reference: Spaces after separators.
+const sal_uInt16 BIFF12_TOK_TABLE_ROW            = 0x0200;   /// Table reference: Single row.
+const sal_uInt16 BIFF12_TOK_TABLE_CELL           = 0x0400;   /// Table reference: Single cell.
 
 const sal_uInt8 BIFF_TOK_NLR_ERR                = 0x01;     /// NLR: Invalid/deleted.
 const sal_uInt8 BIFF_TOK_NLR_ROWR               = 0x02;     /// NLR: Row index.
@@ -209,23 +200,21 @@ const sal_uInt32 BIFF_TOK_NLR_ADDMASK           = 0x3FFFFFFF;   /// Mask for num
 
 // function constants ---------------------------------------------------------
 
-const sal_uInt8 OOX_MAX_PARAMCOUNT              = 255;      /// Maximum parameter count for OOXML/OOBIN files.
-const sal_uInt8 BIFF_MAX_PARAMCOUNT             = 30;       /// Maximum parameter count for BIFF files.
-
-const sal_uInt16 OOBIN_FUNC_IF                  = 1;        /// OOBIN function id of the IF function.
-const sal_uInt16 OOBIN_FUNC_SUM                 = 4;        /// OOBIN function id of the SUM function.
-const sal_uInt16 OOBIN_FUNC_TRUE                = 34;       /// OOBIN function id of the TRUE function.
-const sal_uInt16 OOBIN_FUNC_FALSE               = 35;       /// OOBIN function id of the FALSE function.
-const sal_uInt16 OOBIN_FUNC_ROWS                = 76;       /// OOBIN function id of the ROWS function.
-const sal_uInt16 OOBIN_FUNC_COLUMNS             = 77;       /// OOBIN function id of the COLUMNS function.
-const sal_uInt16 OOBIN_FUNC_OFFSET              = 78;       /// OOBIN function id of the OFFSET function.
-const sal_uInt16 OOBIN_FUNC_FLOOR               = 285;      /// OOBIN function id of the FLOOR function.
-const sal_uInt16 OOBIN_FUNC_CEILING             = 288;      /// OOBIN function id of the CEILING function.
-const sal_uInt16 OOBIN_FUNC_HYPERLINK           = 359;      /// OOBIN function id of the HYPERLINK function.
-const sal_uInt16 OOBIN_FUNC_WEEKNUM             = 465;      /// OOBIN function id of the WEEKNUM function.
-
-const sal_uInt16 BIFF_FUNC_SUM                  = 4;        /// BIFF function id of the SUM function.
+const sal_uInt8 OOX_MAX_PARAMCOUNT              = 255;      /// Maximum parameter count for OOXML/BIFF12 files.
+const sal_uInt8 BIFF_MAX_PARAMCOUNT             = 30;       /// Maximum parameter count for BIFF2-BIFF8 files.
+
+const sal_uInt16 BIFF_FUNC_IF                   = 1;        /// Function identifier of the IF function.
+const sal_uInt16 BIFF_FUNC_SUM                  = 4;        /// Function identifier of the SUM function.
+const sal_uInt16 BIFF_FUNC_TRUE                 = 34;       /// Function identifier of the TRUE function.
+const sal_uInt16 BIFF_FUNC_FALSE                = 35;       /// Function identifier of the FALSE function.
+const sal_uInt16 BIFF_FUNC_ROWS                 = 76;       /// Function identifier of the ROWS function.
+const sal_uInt16 BIFF_FUNC_COLUMNS              = 77;       /// Function identifier of the COLUMNS function.
+const sal_uInt16 BIFF_FUNC_OFFSET               = 78;       /// Function identifier of the OFFSET function.
 const sal_uInt16 BIFF_FUNC_EXTERNCALL           = 255;      /// BIFF function id of the EXTERN.CALL function.
+const sal_uInt16 BIFF_FUNC_FLOOR                = 285;      /// Function identifier of the FLOOR function.
+const sal_uInt16 BIFF_FUNC_CEILING              = 288;      /// Function identifier of the CEILING function.
+const sal_uInt16 BIFF_FUNC_HYPERLINK            = 359;      /// Function identifier of the HYPERLINK function.
+const sal_uInt16 BIFF_FUNC_WEEKNUM              = 465;      /// Function identifier of the WEEKNUM function.
 
 // reference helpers ==========================================================
 
@@ -239,11 +228,11 @@ struct BinSingleRef2d
 
     explicit            BinSingleRef2d();
 
-    void                setOobData( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset );
+    void                setBiff12Data( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset );
     void                setBiff2Data( sal_uInt8 nCol, sal_uInt16 nRow, bool bRelativeAsOffset );
     void                setBiff8Data( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelativeAsOffset );
 
-    void                readOobData( RecordInputStream& rStrm, bool bRelativeAsOffset );
+    void                readBiff12Data( RecordInputStream& rStrm, bool bRelativeAsOffset );
     void                readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
     void                readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
 };
@@ -256,7 +245,7 @@ struct BinComplexRef2d
     BinSingleRef2d      maRef1;             /// Start (top-left) cell address.
     BinSingleRef2d      maRef2;             /// End (bottom-right) cell address.
 
-    void                readOobData( RecordInputStream& rStrm, bool bRelativeAsOffset );
+    void                readBiff12Data( RecordInputStream& rStrm, bool bRelativeAsOffset );
     void                readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
     void                readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
 };
@@ -495,8 +484,8 @@ struct FunctionInfo
     ::rtl::OUString     maExtProgName;      /// Programmatic function name for external functions.
     FunctionLibraryType meFuncLibType;      /// The external library this function is part of.
     sal_Int32           mnApiOpCode;        /// API function opcode.
-    sal_uInt16          mnOobFuncId;        /// OOBIN function identifier.
-    sal_uInt16          mnBiffFuncId;       /// BIFF function identifier.
+    sal_uInt16          mnBiff12FuncId;     /// BIFF12 function identifier.
+    sal_uInt16          mnBiffFuncId;       /// BIFF2-BIFF8 function identifier.
     sal_uInt8           mnMinParamCount;    /// Minimum number of parameters.
     sal_uInt8           mnMaxParamCount;    /// Maximum number of parameters.
     sal_uInt8           mnRetClass;         /// BIFF token class of the return value.
@@ -551,13 +540,13 @@ public:
     /** Returns the function info for an ODF function name, or 0 on error. */
     const FunctionInfo* getFuncInfoFromOdfFuncName( const ::rtl::OUString& rFuncName ) const;
 
-    /** Returns the function info for an OOX function name, or 0 on error. */
+    /** Returns the function info for an OOXML function name, or 0 on error. */
     const FunctionInfo* getFuncInfoFromOoxFuncName( const ::rtl::OUString& rFuncName ) const;
 
-    /** Returns the function info for an OOBIN function index, or 0 on error. */
-    const FunctionInfo* getFuncInfoFromOobFuncId( sal_uInt16 nFuncId ) const;
+    /** Returns the function info for a BIFF12 function index, or 0 on error. */
+    const FunctionInfo* getFuncInfoFromBiff12FuncId( sal_uInt16 nFuncId ) const;
 
-    /** Returns the function info for a BIFF function index, or 0 on error. */
+    /** Returns the function info for a BIFF2-BIFF8 function index, or 0 on error. */
     const FunctionInfo* getFuncInfoFromBiffFuncId( sal_uInt16 nFuncId ) const;
 
     /** Returns the function info for a macro function referred by the
@@ -599,7 +588,7 @@ public:
     /** Returns the function info for an API token, or 0 on error. */
     const FunctionInfo* getFuncInfoFromApiToken( const ApiToken& rToken ) const;
 
-    /** Returns the op-code map that is used by the OOX formula parser. */
+    /** Returns the op-code map that is used by the OOXML formula parser. */
     ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaOpCodeMapEntry >
                         getOoxParserMap() const;
 
@@ -933,4 +922,3 @@ public:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/formulaparser.hxx b/oox/inc/oox/xls/formulaparser.hxx
index 599a8af7bf46..6368606282b6 100644
--- a/oox/inc/oox/xls/formulaparser.hxx
+++ b/oox/inc/oox/xls/formulaparser.hxx
@@ -100,9 +100,9 @@ private:
 
 class FormulaParserImpl;
 
-/** Import formula parser for OOX and BIFF filters.
+/** Import formula parser for OOXML and BIFF filters.
 
-    This class implements formula import for the OOX and BIFF filter. One
+    This class implements formula import for the OOXML and BIFF filter. One
     instance is contained in the global filter data to prevent construction and
     destruction of internal buffers for every imported formula.
  */
@@ -112,17 +112,17 @@ public:
     explicit            FormulaParser( const WorkbookHelper& rHelper );
     virtual             ~FormulaParser();
 
-    /** Converts an XML formula string. */
+    /** Converts an OOXML formula string. */
     void                importFormula(
                             FormulaContext& rContext,
                             const ::rtl::OUString& rFormulaString ) const;
 
-    /** Imports and converts a OOBIN token array from the passed stream. */
+    /** Imports and converts a BIFF12 token array from the passed stream. */
     void                importFormula(
                             FormulaContext& rContext,
                             RecordInputStream& rStrm ) const;
 
-    /** Imports and converts a BIFF token array from the passed stream.
+    /** Imports and converts a BIFF2-BIFF8 token array from the passed stream.
         @param pnFmlaSize  Size of the token array. If null is passed, reads
         it from stream (1 byte in BIFF2, 2 bytes otherwise) first. */
     void                importFormula(
diff --git a/oox/inc/oox/xls/numberformatsbuffer.hxx b/oox/inc/oox/xls/numberformatsbuffer.hxx
index 59a2c4e9324e..4db4bddafc09 100644
--- a/oox/inc/oox/xls/numberformatsbuffer.hxx
+++ b/oox/inc/oox/xls/numberformatsbuffer.hxx
@@ -137,4 +137,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/ooxformulaparser.hxx b/oox/inc/oox/xls/ooxformulaparser.hxx
index 1c20febf5f43..7bc1bbdd4909 100644
--- a/oox/inc/oox/xls/ooxformulaparser.hxx
+++ b/oox/inc/oox/xls/ooxformulaparser.hxx
@@ -109,4 +109,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/pagesettings.hxx b/oox/inc/oox/xls/pagesettings.hxx
index eb163daf94c8..cbb92aa01244 100644
--- a/oox/inc/oox/xls/pagesettings.hxx
+++ b/oox/inc/oox/xls/pagesettings.hxx
@@ -83,8 +83,8 @@ struct PageSettingsModel
 
     explicit            PageSettingsModel();
 
-    /** Sets the OOBIN or BIFF print errors mode. */
-    void                setBinPrintErrors( sal_uInt8 nPrintErrors );
+    /** Sets the BIFF print errors mode. */
+    void                setBiffPrintErrors( sal_uInt8 nPrintErrors );
 };
 
 // ============================================================================
@@ -217,4 +217,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/pivotcachebuffer.hxx b/oox/inc/oox/xls/pivotcachebuffer.hxx
index 8f79ab0685b3..0c33516746ca 100644
--- a/oox/inc/oox/xls/pivotcachebuffer.hxx
+++ b/oox/inc/oox/xls/pivotcachebuffer.hxx
@@ -28,9 +28,9 @@
 #ifndef OOX_XLS_PIVOTCACHEBUFFER_HXX
 #define OOX_XLS_PIVOTCACHEBUFFER_HXX
 
-#include 
 #include 
 #include 
+#include 
 #include "oox/helper/containerhelper.hxx"
 #include "oox/xls/workbookhelper.hxx"
 
@@ -100,7 +100,7 @@ public:
 
 private:
     ::com::sun::star::uno::Any maValue;     /// Value of the item.
-    sal_Int32           mnType;             /// Value type (OOX token identifier).
+    sal_Int32           mnType;             /// Value type (OOXML token identifier).
 };
 
 // ----------------------------------------------------------------------------
@@ -196,8 +196,8 @@ struct PCFieldGroupModel
 
     explicit            PCFieldGroupModel();
 
-    /** Sets the group-by value for BIFF/OOBIN import. */
-    void                setBinGroupBy( sal_uInt8 nGroupBy );
+    /** Sets the group-by value for BIFF import. */
+    void                setBiffGroupBy( sal_uInt8 nGroupBy );
 };
 
 // ----------------------------------------------------------------------------
@@ -479,9 +479,9 @@ class PivotCacheBuffer : public WorkbookHelper
 public:
     explicit            PivotCacheBuffer( const WorkbookHelper& rHelper );
 
-    /** Registers a pivot cache definition fragment. The fragment will be loaded on demand (OOX/OOBIN only). */
+    /** Registers a pivot cache definition fragment. The fragment will be loaded on demand (OOXML/BIFF12 only). */
     void                registerPivotCacheFragment( sal_Int32 nCacheId, const ::rtl::OUString& rFragmentPath );
-    /** Reads the reference to a pivot cache stream. The stream will be loaded on demand (BIFF only). */
+    /** Reads the reference to a pivot cache stream. The stream will be loaded on demand (BIFF2-BIFF8 only). */
     void                importPivotCacheRef( BiffInputStream& rStrm );
 
     /** Imports and stores a pivot cache definition fragment on first call,
@@ -508,4 +508,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/pivotcachefragment.hxx b/oox/inc/oox/xls/pivotcachefragment.hxx
index 745208f485e6..d2a5ab4d7ace 100644
--- a/oox/inc/oox/xls/pivotcachefragment.hxx
+++ b/oox/inc/oox/xls/pivotcachefragment.hxx
@@ -38,11 +38,11 @@ class PivotCacheField;
 
 // ============================================================================
 
-class OoxPivotCacheFieldContext : public OoxWorkbookContextBase
+class PivotCacheFieldContext : public WorkbookContextBase
 {
 public:
-    explicit            OoxPivotCacheFieldContext(
-                            OoxWorkbookFragmentBase& rFragment,
+    explicit            PivotCacheFieldContext(
+                            WorkbookFragmentBase& rFragment,
                             PivotCacheField& rCacheField );
 
 protected:
@@ -57,10 +57,10 @@ private:
 
 // ============================================================================
 
-class OoxPivotCacheDefinitionFragment : public OoxWorkbookFragmentBase
+class PivotCacheDefinitionFragment : public WorkbookFragmentBase
 {
 public:
-    explicit            OoxPivotCacheDefinitionFragment(
+    explicit            PivotCacheDefinitionFragment(
                             const WorkbookHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath,
                             PivotCache& rPivotCache );
@@ -77,10 +77,10 @@ private:
 
 // ============================================================================
 
-class OoxPivotCacheRecordsFragment : public OoxWorksheetFragmentBase
+class PivotCacheRecordsFragment : public WorksheetFragmentBase
 {
 public:
-    explicit            OoxPivotCacheRecordsFragment(
+    explicit            PivotCacheRecordsFragment(
                             const WorkbookHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath,
                             const PivotCache& rPivotCache );
@@ -131,7 +131,7 @@ public:
 
     /** Reads the current record from stream and tries to insert a cell into
         the source data sheet. */
-    virtual void        importRecord();
+    virtual void        importRecord( BiffInputStream& rStrm );
 
 private:
     void                startNextRow();
@@ -153,4 +153,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/pivottablebuffer.hxx b/oox/inc/oox/xls/pivottablebuffer.hxx
index 6fde212f0018..cd62c6fb0a8b 100644
--- a/oox/inc/oox/xls/pivottablebuffer.hxx
+++ b/oox/inc/oox/xls/pivottablebuffer.hxx
@@ -31,7 +31,7 @@
 #include 
 #include "oox/helper/containerhelper.hxx"
 #include "oox/xls/pivotcachebuffer.hxx"
-#include "oox/xls/workbookhelper.hxx"
+#include "oox/xls/stylesbuffer.hxx"
 
 namespace com { namespace sun { namespace star {
     namespace sheet { class XDataPilotDescriptor; }
@@ -54,8 +54,8 @@ struct PTFieldItemModel
 
     explicit            PTFieldItemModel();
 
-    /** Sets item type for BIFF/OOBIN import. */
-    void                setBinType( sal_uInt16 nType );
+    /** Sets item type for BIFF import. */
+    void                setBiffType( sal_uInt16 nType );
 };
 
 // ----------------------------------------------------------------------------
@@ -93,8 +93,8 @@ struct PTFieldModel
 
     explicit            PTFieldModel();
 
-    /** Sets axis type for BIFF/OOBIN import. */
-    void                setBinAxis( sal_uInt8 nAxisFlags );
+    /** Sets axis type for BIFF import. */
+    void                setBiffAxis( sal_uInt8 nAxisFlags );
 };
 
 // ----------------------------------------------------------------------------
@@ -122,10 +122,10 @@ struct PTDataFieldModel
 
     explicit            PTDataFieldModel();
 
-    /** Sets the subtotal aggregation function for BIFF/OOBIN import. */
-    void                setBinSubtotal( sal_Int32 nSubtotal );
-    /** Sets the 'show data as' type for BIFF/OOBIN import. */
-    void                setBinShowDataAs( sal_Int32 nShowDataAs );
+    /** Sets the subtotal aggregation function for BIFF import. */
+    void                setBiffSubtotal( sal_Int32 nSubtotal );
+    /** Sets the 'show data as' type for BIFF import. */
+    void                setBiffShowDataAs( sal_Int32 nShowDataAs );
 };
 
 // ----------------------------------------------------------------------------
@@ -249,7 +249,7 @@ private:
 
 // ============================================================================
 
-struct PTDefinitionModel
+struct PTDefinitionModel : public AutoFormatModel
 {
     ::rtl::OUString     maName;
     ::rtl::OUString     maDataCaption;
@@ -281,6 +281,7 @@ struct PTDefinitionModel
     bool                mbPrintDrill;
     bool                mbEnableDrill;
     bool                mbPreserveFormatting;
+    bool                mbUseAutoFormat;
     bool                mbPageOverThenDown;
     bool                mbSubtotalHiddenItems;
     bool                mbRowGrandTotals;
@@ -446,4 +447,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/pivottablefragment.hxx b/oox/inc/oox/xls/pivottablefragment.hxx
index 59c86b4ba3cb..a6cfe7ef2c64 100644
--- a/oox/inc/oox/xls/pivottablefragment.hxx
+++ b/oox/inc/oox/xls/pivottablefragment.hxx
@@ -40,11 +40,11 @@ class PivotTableFilter;
 
 // ============================================================================
 
-class OoxPivotTableFieldContext : public OoxWorksheetContextBase
+class PivotTableFieldContext : public WorksheetContextBase
 {
 public:
-    explicit            OoxPivotTableFieldContext(
-                            OoxWorksheetFragmentBase& rFragment,
+    explicit            PivotTableFieldContext(
+                            WorksheetFragmentBase& rFragment,
                             PivotTableField& rTableField );
 
 protected:
@@ -59,11 +59,11 @@ private:
 
 // ============================================================================
 
-class OoxPivotTableFilterContext : public OoxWorksheetContextBase
+class PivotTableFilterContext : public WorksheetContextBase
 {
 public:
-    explicit            OoxPivotTableFilterContext(
-                            OoxWorksheetFragmentBase& rFragment,
+    explicit            PivotTableFilterContext(
+                            WorksheetFragmentBase& rFragment,
                             PivotTableFilter& rTableFilter );
 
 protected:
@@ -78,10 +78,10 @@ private:
 
 // ============================================================================
 
-class OoxPivotTableFragment : public OoxWorksheetFragmentBase
+class PivotTableFragment : public WorksheetFragmentBase
 {
 public:
-    explicit            OoxPivotTableFragment(
+    explicit            PivotTableFragment(
                             const WorksheetHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath );
 
@@ -100,10 +100,10 @@ private:
 class BiffPivotTableContext : public BiffWorksheetContextBase
 {
 public:
-    explicit            BiffPivotTableContext( const BiffWorksheetFragmentBase& rFragment, PivotTable& rPivotTable );
+    explicit            BiffPivotTableContext( const BiffWorksheetFragmentBase& rFragment );
 
     /** Imports all records related to the current pivot table. */
-    virtual void        importRecord();
+    virtual void        importRecord( BiffInputStream& rStrm );
 
 private:
     PivotTable&         mrPivotTable;
@@ -115,4 +115,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/querytablebuffer.hxx b/oox/inc/oox/xls/querytablebuffer.hxx
new file mode 100644
index 000000000000..0034a3b44c82
--- /dev/null
+++ b/oox/inc/oox/xls/querytablebuffer.hxx
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * 
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_XLS_QUERYTABLEBUFFER_HXX
+#define OOX_XLS_QUERYTABLEBUFFER_HXX
+
+#include "oox/xls/stylesbuffer.hxx"
+#include "oox/xls/worksheethelper.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+struct QueryTableModel : public AutoFormatModel
+{
+    ::rtl::OUString     maDefName;          /// Defined name containing the target cell range.
+    sal_Int32           mnConnId;           /// Identifier of the external connection used to query the data.
+    sal_Int32           mnGrowShrinkType;   /// Behaviour when source data size changes.
+    bool                mbHeaders;          /// True = source data contains a header row.
+    bool                mbRowNumbers;       /// True = first column contains row numbers.
+    bool                mbDisableRefresh;   /// True = refreshing data disabled.
+    bool                mbBackground;       /// True = refresh asynchronously.
+    bool                mbFirstBackground;  /// True = first background refresh not yet finished.
+    bool                mbRefreshOnLoad;    /// True = refresh table after import.
+    bool                mbFillFormulas;     /// True = expand formulas next to range when source data grows.
+    bool                mbRemoveDataOnSave; /// True = remove querried data before saving.
+    bool                mbDisableEdit;      /// True = connection locked for editing.
+    bool                mbPreserveFormat;   /// True = use existing formatting for new rows.
+    bool                mbAdjustColWidth;   /// True = adjust column widths after refresh.
+    bool                mbIntermediate;     /// True = query table defined but not built yet.
+
+    explicit            QueryTableModel();
+};
+
+// ----------------------------------------------------------------------------
+
+class QueryTable : public WorksheetHelper
+{
+public:
+    explicit            QueryTable( const WorksheetHelper& rHelper );
+
+    /** Imports query table settings from the queryTable element. */
+    void                importQueryTable( const AttributeList& rAttribs );
+    /** Imports query table settings from the QUERYTABLE record. */
+    void                importQueryTable( RecordInputStream& rStrm );
+
+    /** Imports query table settings from the QUERYTABLE record. */
+    void                importQueryTable( BiffInputStream& rStrm );
+    /** Imports query table settings from the QUERYTABLEREFRESH record. */
+    void                importQueryTableRefresh( BiffInputStream& rStrm );
+    /** Imports query table settings from the QUERYTABLESETTINGS record. */
+    void                importQueryTableSettings( BiffInputStream& rStrm );
+
+    /** Inserts a web query into the sheet. */
+    void                finalizeImport();
+
+private:
+    QueryTableModel     maModel;
+};
+
+// ============================================================================
+
+class QueryTableBuffer : public WorksheetHelper
+{
+public:
+    explicit            QueryTableBuffer( const WorksheetHelper& rHelper );
+
+    /** Creates a new query table and stores it into the internal vector. */
+    QueryTable&         createQueryTable();
+
+    /** Inserts all web queries into the sheet. */
+    void                finalizeImport();
+
+private:
+    typedef RefVector< QueryTable > QueryTableVector;
+    QueryTableVector    maQueryTables;
+};
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/xls/querytablefragment.hxx b/oox/inc/oox/xls/querytablefragment.hxx
index 3702069b4859..65727fb87351 100644
--- a/oox/inc/oox/xls/querytablefragment.hxx
+++ b/oox/inc/oox/xls/querytablefragment.hxx
@@ -33,19 +33,39 @@
 namespace oox {
 namespace xls {
 
+class QueryTable;
+
 // ============================================================================
 
-class OoxQueryTableFragment : public OoxWorkbookFragmentBase
+class QueryTableFragment : public WorksheetFragmentBase
 {
 public:
-    explicit            OoxQueryTableFragment(
-                            const WorkbookHelper& rHelper,
+    explicit            QueryTableFragment(
+                            const WorksheetHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath );
 
 protected:
-    // oox.core.ContextHandler2Helper interface -------------------------------
-
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+    virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+
+    virtual const ::oox::core::RecordInfo* getRecordInfos() const;
+
+private:
+    QueryTable&         mrQueryTable;
+};
+
+// ============================================================================
+
+class BiffQueryTableContext : public BiffWorksheetContextBase
+{
+public:
+    explicit            BiffQueryTableContext( const BiffWorksheetFragmentBase& rFragment );
+
+    /** Imports all records related to the current query table. */
+    virtual void        importRecord( BiffInputStream& rStrm );
+
+private:
+    QueryTable&         mrQueryTable;
 };
 
 // ============================================================================
@@ -54,4 +74,3 @@ protected:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/richstring.hxx b/oox/inc/oox/xls/richstring.hxx
index 6293aac4d340..8bf371ed448d 100644
--- a/oox/inc/oox/xls/richstring.hxx
+++ b/oox/inc/oox/xls/richstring.hxx
@@ -143,7 +143,7 @@ struct PhoneticDataModel
     explicit            PhoneticDataModel();
 
     /** Sets the passed data from binary import. */
-    void                setBinData( sal_Int32 nType, sal_Int32 nAlignment );
+    void                setBiffData( sal_Int32 nType, sal_Int32 nAlignment );
 };
 
 // ----------------------------------------------------------------------------
@@ -292,4 +292,3 @@ typedef ::boost::shared_ptr< RichString > RichStringRef;
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/richstringcontext.hxx b/oox/inc/oox/xls/richstringcontext.hxx
index 7b5992db2871..df3f412d87ec 100644
--- a/oox/inc/oox/xls/richstringcontext.hxx
+++ b/oox/inc/oox/xls/richstringcontext.hxx
@@ -36,15 +36,13 @@ namespace xls {
 
 // ============================================================================
 
-class OoxRichStringContext : public OoxWorkbookContextBase
+class RichStringContext : public WorkbookContextBase
 {
 public:
     template< typename ParentType >
-    explicit            OoxRichStringContext( ParentType& rParent, RichStringRef xString );
+    explicit            RichStringContext( ParentType& rParent, RichStringRef xString );
 
 protected:
-    // oox.core.ContextHandler2Helper interface -------------------------------
-
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
     virtual void        onCharacters( const ::rtl::OUString& rChars );
 
@@ -58,11 +56,11 @@ private:
 // ----------------------------------------------------------------------------
 
 template< typename ParentType >
-OoxRichStringContext::OoxRichStringContext( ParentType& rParent, RichStringRef xString ) :
-    OoxWorkbookContextBase( rParent ),
+RichStringContext::RichStringContext( ParentType& rParent, RichStringRef xString ) :
+    WorkbookContextBase( rParent ),
     mxString( xString )
 {
-    OSL_ENSURE( mxString.get(), "OoxRichStringContext::OoxRichStringContext - missing string object" );
+    OSL_ENSURE( mxString.get(), "RichStringContext::RichStringContext - missing string object" );
 }
 
 // ============================================================================
@@ -71,4 +69,3 @@ OoxRichStringContext::OoxRichStringContext( ParentType& rParent, RichStringRef x
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/scenariobuffer.hxx b/oox/inc/oox/xls/scenariobuffer.hxx
index 8c2e0b0f1065..390844f6a706 100644
--- a/oox/inc/oox/xls/scenariobuffer.hxx
+++ b/oox/inc/oox/xls/scenariobuffer.hxx
@@ -152,4 +152,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/scenariocontext.hxx b/oox/inc/oox/xls/scenariocontext.hxx
index f3286f144656..00570ad23016 100644
--- a/oox/inc/oox/xls/scenariocontext.hxx
+++ b/oox/inc/oox/xls/scenariocontext.hxx
@@ -38,10 +38,10 @@ class SheetScenarios;
 
 // ============================================================================
 
-class OoxScenarioContext : public OoxWorksheetContextBase
+class ScenarioContext : public WorksheetContextBase
 {
 public:
-    explicit            OoxScenarioContext( OoxWorksheetContextBase& rParent, SheetScenarios& rSheetScenarios );
+    explicit            ScenarioContext( WorksheetContextBase& rParent, SheetScenarios& rSheetScenarios );
 
 protected:
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -56,10 +56,10 @@ private:
 
 // ============================================================================
 
-class OoxScenariosContext : public OoxWorksheetContextBase
+class ScenariosContext : public WorksheetContextBase
 {
 public:
-    explicit            OoxScenariosContext( OoxWorksheetFragmentBase& rFragment );
+    explicit            ScenariosContext( WorksheetFragmentBase& rFragment );
 
 protected:
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -78,4 +78,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/sharedformulabuffer.hxx b/oox/inc/oox/xls/sharedformulabuffer.hxx
index 0f9fb0bb093e..455fa781a41d 100644
--- a/oox/inc/oox/xls/sharedformulabuffer.hxx
+++ b/oox/inc/oox/xls/sharedformulabuffer.hxx
@@ -61,7 +61,7 @@ class SharedFormulaBuffer : public WorksheetHelper
 public:
     explicit            SharedFormulaBuffer( const WorksheetHelper& rHelper );
 
-    /** Imports a shared formula from a OOX formula string. */
+    /** Imports a shared formula from a OOXML formula string. */
     void                importSharedFmla( const ::rtl::OUString& rFormula,
                             const ::rtl::OUString& rSharedRange, sal_Int32 nId,
                             const ::com::sun::star::table::CellAddress& rBaseAddr );
@@ -109,4 +109,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/sharedstringsbuffer.hxx b/oox/inc/oox/xls/sharedstringsbuffer.hxx
index 27827ec215ed..d5ec04c956a3 100644
--- a/oox/inc/oox/xls/sharedstringsbuffer.hxx
+++ b/oox/inc/oox/xls/sharedstringsbuffer.hxx
@@ -67,4 +67,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/sharedstringsfragment.hxx b/oox/inc/oox/xls/sharedstringsfragment.hxx
index 7294643b7df5..30b5e341866a 100644
--- a/oox/inc/oox/xls/sharedstringsfragment.hxx
+++ b/oox/inc/oox/xls/sharedstringsfragment.hxx
@@ -35,22 +35,17 @@ namespace xls {
 
 // ============================================================================
 
-class OoxSharedStringsFragment : public OoxWorkbookFragmentBase
+class SharedStringsFragment : public WorkbookFragmentBase
 {
 public:
-    explicit            OoxSharedStringsFragment(
+    explicit            SharedStringsFragment(
                             const WorkbookHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath );
 
 protected:
-    // oox.core.ContextHandler2Helper interface -------------------------------
-
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
-
     virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
 
-    // oox.core.FragmentHandler2 interface ------------------------------------
-
     virtual const ::oox::core::RecordInfo* getRecordInfos() const;
     virtual void        finalizeImport();
 };
@@ -61,4 +56,3 @@ protected:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/sheetdatacontext.hxx b/oox/inc/oox/xls/sheetdatacontext.hxx
index 7fd7c9b915b5..54f4b64fb64b 100644
--- a/oox/inc/oox/xls/sheetdatacontext.hxx
+++ b/oox/inc/oox/xls/sheetdatacontext.hxx
@@ -45,14 +45,12 @@ namespace xls {
     The sheetData element contains all row settings and all cells in a single
     sheet of a spreadsheet document.
  */
-class OoxSheetDataContext : public OoxWorksheetContextBase
+class SheetDataContext : public WorksheetContextBase
 {
 public:
-    explicit            OoxSheetDataContext( OoxWorksheetFragmentBase& rFragment );
+    explicit            SheetDataContext( WorksheetFragmentBase& rFragment );
 
 protected:
-    // oox.core.ContextHandler2Helper interface -------------------------------
-
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
     virtual void        onCharacters( const ::rtl::OUString& rChars );
     virtual void        onEndElement();
@@ -118,46 +116,46 @@ public:
     explicit            BiffSheetDataContext( const BiffWorksheetFragmentBase& rParent );
 
     /** Tries to import a sheet data record. */
-    virtual void        importRecord();
+    virtual void        importRecord( BiffInputStream& rStrm );
 
 private:
     /** Sets current cell according to the passed address. */
     void                setCurrCell( const BinAddress& rAddr );
 
     /** Imports an XF identifier and sets the mnXfId member. */
-    void                importXfId( bool bBiff2 );
+    void                importXfId( BiffInputStream& rStrm, bool bBiff2 );
     /** Imports a BIFF cell address and the following XF identifier. */
-    void                importCellHeader( bool bBiff2 );
+    void                importCellHeader( BiffInputStream& rStrm, bool bBiff2 );
 
     /** Imports a BLANK record describing a blank but formatted cell. */
-    void                importBlank();
+    void                importBlank( BiffInputStream& rStrm );
     /** Imports a BOOLERR record describing a boolean or error code cell. */
-    void                importBoolErr();
+    void                importBoolErr( BiffInputStream& rStrm );
     /** Imports a FORMULA record describing a formula cell. */
-    void                importFormula();
+    void                importFormula( BiffInputStream& rStrm );
     /** Imports an INTEGER record describing a BIFF2 integer cell. */
-    void                importInteger();
+    void                importInteger( BiffInputStream& rStrm );
     /** Imports a LABEL record describing an unformatted string cell. */
-    void                importLabel();
+    void                importLabel( BiffInputStream& rStrm );
     /** Imports a LABELSST record describing a string cell using the shared string list. */
-    void                importLabelSst();
+    void                importLabelSst( BiffInputStream& rStrm );
     /** Imports a MULTBLANK record describing a range of blank but formatted cells. */
-    void                importMultBlank();
+    void                importMultBlank( BiffInputStream& rStrm );
     /** Imports a MULTRK record describing a range of numeric cells. */
-    void                importMultRk();
+    void                importMultRk( BiffInputStream& rStrm );
     /** Imports a NUMBER record describing a floating-point cell. */
-    void                importNumber();
+    void                importNumber( BiffInputStream& rStrm );
     /** Imports an RK record describing a numeric cell. */
-    void                importRk();
+    void                importRk( BiffInputStream& rStrm );
 
     /** Imports row settings from a ROW record. */
-    void                importRow();
+    void                importRow( BiffInputStream& rStrm );
     /** Imports an ARRAY record describing an array formula of a cell range. */
-    void                importArray();
+    void                importArray( BiffInputStream& rStrm );
     /** Imports a SHAREDFMLA record describing a shared formula in a cell range. */
-    void                importSharedFmla();
+    void                importSharedFmla( BiffInputStream& rStrm );
     /** Imports table operation from a DATATABLE or DATATABLE2 record. */
-    void                importDataTable();
+    void                importDataTable( BiffInputStream& rStrm );
 
 private:
     CellModel           maCurrCell;             /// Position and formatting of current imported cell.
@@ -172,4 +170,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/stylesbuffer.hxx b/oox/inc/oox/xls/stylesbuffer.hxx
index 7b8986472dd6..59279749994f 100644
--- a/oox/inc/oox/xls/stylesbuffer.hxx
+++ b/oox/inc/oox/xls/stylesbuffer.hxx
@@ -29,14 +29,14 @@
 #define OOX_XLS_STYLESBUFFER_HXX
 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include "oox/drawingml/color.hxx"
 #include "oox/helper/containerhelper.hxx"
 #include "oox/helper/graphichelper.hxx"
-#include "oox/drawingml/color.hxx"
 #include "oox/xls/numberformatsbuffer.hxx"
 
 namespace com { namespace sun { namespace star {
@@ -112,9 +112,9 @@ public:
 
     /** Imports a 64-bit color from the passed binary stream. */
     void                importColor( RecordInputStream& rStrm );
-    /** Imports a 32-bit palette color identifier from the passed OOBIN stream. */
+    /** Imports a 32-bit palette color identifier from the passed BIFF12 stream. */
     void                importColorId( RecordInputStream& rStrm );
-    /** Imports a 32-bit RGBA color value from the passed OOBIN stream. */
+    /** Imports a 32-bit RGBA color value from the passed BIFF12 stream. */
     void                importColorRgb( RecordInputStream& rStrm );
 
     /** Imports an 8-bit or 16-bit palette color identifier from the passed BIFF stream. */
@@ -181,7 +181,7 @@ struct FontModel
 
     explicit            FontModel();
 
-    void                setBinScheme( sal_uInt8 nScheme );
+    void                setBiff12Scheme( sal_uInt8 nScheme );
     void                setBiffHeight( sal_uInt16 nHeight );
     void                setBiffWeight( sal_uInt16 nWeight );
     void                setBiffUnderline( sal_uInt16 nUnderline );
@@ -348,12 +348,12 @@ struct AlignmentModel
 
     explicit            AlignmentModel();
 
-    /** Sets horizontal alignment from the passed OOBIN or BIFF data. */
-    void                setBinHorAlign( sal_uInt8 nHorAlign );
-    /** Sets vertical alignment from the passed OOBIN or BIFF data. */
-    void                setBinVerAlign( sal_uInt8 nVerAlign );
-    /** Sets rotation from the passed OOBIN or BIFF text orientation. */
-    void                setBinTextOrient( sal_uInt8 nTextOrient );
+    /** Sets horizontal alignment from the passed BIFF data. */
+    void                setBiffHorAlign( sal_uInt8 nHorAlign );
+    /** Sets vertical alignment from the passed BIFF data. */
+    void                setBiffVerAlign( sal_uInt8 nVerAlign );
+    /** Sets rotation from the passed BIFF text orientation. */
+    void                setBiffTextOrient( sal_uInt8 nTextOrient );
 };
 
 // ----------------------------------------------------------------------------
@@ -389,8 +389,8 @@ public:
     /** Sets all attributes from the alignment element. */
     void                importAlignment( const AttributeList& rAttribs );
 
-    /** Sets the alignment attributes from the passed OOBIN XF record data. */
-    void                setBinData( sal_uInt32 nFlags );
+    /** Sets the alignment attributes from the passed BIFF12 XF record data. */
+    void                setBiff12Data( sal_uInt32 nFlags );
     /** Sets the alignment attributes from the passed BIFF2 XF record data. */
     void                setBiff2Data( sal_uInt8 nFlags );
     /** Sets the alignment attributes from the passed BIFF3 XF record data. */
@@ -455,8 +455,8 @@ public:
     /** Sets all attributes from the protection element. */
     void                importProtection( const AttributeList& rAttribs );
 
-    /** Sets the protection attributes from the passed OOBIN XF record data. */
-    void                setBinData( sal_uInt32 nFlags );
+    /** Sets the protection attributes from the passed BIFF12 XF record data. */
+    void                setBiff12Data( sal_uInt32 nFlags );
     /** Sets the protection attributes from the passed BIFF2 XF record data. */
     void                setBiff2Data( sal_uInt8 nNumFmt );
     /** Sets the protection attributes from the passed BIFF3-BIFF8 XF record data. */
@@ -491,7 +491,7 @@ struct BorderLineModel
 
     explicit            BorderLineModel( bool bDxf );
 
-    /** Sets the passed OOBIN or BIFF line style. */
+    /** Sets the passed BIFF line style. */
     void                setBiffStyle( sal_Int32 nLineStyle );
     /** Sets line style and line color from the passed BIFF data. */
     void                setBiffData( sal_uInt8 nLineStyle, sal_uInt16 nLineColor );
@@ -607,8 +607,8 @@ struct PatternFillModel
 
     explicit            PatternFillModel( bool bDxf );
 
-    /** Sets the passed OOBIN or BIFF pattern identifier. */
-    void                setBinPattern( sal_Int32 nPattern );
+    /** Sets the passed BIFF pattern identifier. */
+    void                setBiffPattern( sal_Int32 nPattern );
     /** Sets the pattern and pattern colors from the passed BIFF data. */
     void                setBiffData( sal_uInt16 nPatternColor, sal_uInt16 nFillColor, sal_uInt8 nPattern );
 };
@@ -630,9 +630,9 @@ struct GradientFillModel
 
     explicit            GradientFillModel();
 
-    /** Reads OOBIN gradient settings from a FILL or DXF record. */
+    /** Reads BIFF12 gradient settings from a FILL or DXF record. */
     void                readGradient( RecordInputStream& rStrm );
-    /** Reads OOBIN gradient stop settings from a FILL or DXF record. */
+    /** Reads BIFF12 gradient stop settings from a FILL or DXF record. */
     void                readGradientStop( RecordInputStream& rStrm, bool bDxf );
 };
 
@@ -945,6 +945,21 @@ private:
 
 // ============================================================================
 
+struct AutoFormatModel
+{
+    sal_Int32           mnAutoFormatId;     /// Index of predefined autoformatting.
+    bool                mbApplyNumFmt;      /// True = apply number format from autoformatting.
+    bool                mbApplyFont;        /// True = apply font from autoformatting.
+    bool                mbApplyAlignment;   /// True = apply alignment from autoformatting.
+    bool                mbApplyBorder;      /// True = apply border from autoformatting.
+    bool                mbApplyFill;        /// True = apply fill from autoformatting.
+    bool                mbApplyProtection;  /// True = apply protection from autoformatting.
+
+    explicit            AutoFormatModel();
+};
+
+// ============================================================================
+
 class StylesBuffer : public WorkbookHelper
 {
 public:
@@ -1080,4 +1095,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/stylesfragment.hxx b/oox/inc/oox/xls/stylesfragment.hxx
index b3dc63fe6e31..4ab7ee78ae15 100644
--- a/oox/inc/oox/xls/stylesfragment.hxx
+++ b/oox/inc/oox/xls/stylesfragment.hxx
@@ -36,10 +36,10 @@ namespace xls {
 
 // ============================================================================
 
-class OoxIndexedColorsContext : public OoxWorkbookContextBase
+class IndexedColorsContext : public WorkbookContextBase
 {
 public:
-    explicit            OoxIndexedColorsContext( OoxWorkbookFragmentBase& rFragment );
+    explicit            IndexedColorsContext( WorkbookFragmentBase& rFragment );
 
 protected:
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -48,12 +48,12 @@ protected:
 
 // ============================================================================
 
-class OoxFontContext : public OoxWorkbookContextBase
+class FontContext : public WorkbookContextBase
 {
 public:
     template< typename ParentType >
-    inline explicit     OoxFontContext( ParentType& rParent, const FontRef& rxFont ) :
-                            OoxWorkbookContextBase( rParent ), mxFont( rxFont ) {}
+    inline explicit     FontContext( ParentType& rParent, const FontRef& rxFont ) :
+                            WorkbookContextBase( rParent ), mxFont( rxFont ) {}
 
 protected:
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -64,12 +64,12 @@ private:
 
 // ============================================================================
 
-class OoxBorderContext : public OoxWorkbookContextBase
+class BorderContext : public WorkbookContextBase
 {
 public:
     template< typename ParentType >
-    inline explicit     OoxBorderContext( ParentType& rParent, const BorderRef& rxBorder ) :
-                            OoxWorkbookContextBase( rParent ), mxBorder( rxBorder ) {}
+    inline explicit     BorderContext( ParentType& rParent, const BorderRef& rxBorder ) :
+                            WorkbookContextBase( rParent ), mxBorder( rxBorder ) {}
 
 protected:
     virtual void        onStartElement( const AttributeList& rAttribs );
@@ -81,12 +81,12 @@ private:
 
 // ============================================================================
 
-class OoxFillContext : public OoxWorkbookContextBase
+class FillContext : public WorkbookContextBase
 {
 public:
     template< typename ParentType >
-    inline explicit     OoxFillContext( ParentType& rParent, const FillRef& rxFill ) :
-                            OoxWorkbookContextBase( rParent ), mxFill( rxFill ), mfGradPos( -1.0 ) {}
+    inline explicit     FillContext( ParentType& rParent, const FillRef& rxFill ) :
+                            WorkbookContextBase( rParent ), mxFill( rxFill ), mfGradPos( -1.0 ) {}
 
 protected:
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -98,12 +98,12 @@ private:
 
 // ============================================================================
 
-class OoxXfContext : public OoxWorkbookContextBase
+class XfContext : public WorkbookContextBase
 {
 public:
     template< typename ParentType >
-    inline explicit     OoxXfContext( ParentType& rParent, const XfRef& rxXf, bool bCellXf ) :
-                            OoxWorkbookContextBase( rParent ), mxXf( rxXf ), mbCellXf( bCellXf ) {}
+    inline explicit     XfContext( ParentType& rParent, const XfRef& rxXf, bool bCellXf ) :
+                            WorkbookContextBase( rParent ), mxXf( rxXf ), mbCellXf( bCellXf ) {}
 
 protected:
     virtual void        onStartElement( const AttributeList& rAttribs );
@@ -116,12 +116,12 @@ private:
 
 // ============================================================================
 
-class OoxDxfContext : public OoxWorkbookContextBase
+class DxfContext : public WorkbookContextBase
 {
 public:
     template< typename ParentType >
-    inline explicit     OoxDxfContext( ParentType& rParent, const DxfRef& rxDxf ) :
-                            OoxWorkbookContextBase( rParent ), mxDxf( rxDxf ) {}
+    inline explicit     DxfContext( ParentType& rParent, const DxfRef& rxDxf ) :
+                            WorkbookContextBase( rParent ), mxDxf( rxDxf ) {}
 
 protected:
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -132,21 +132,17 @@ private:
 
 // ============================================================================
 
-class OoxStylesFragment : public OoxWorkbookFragmentBase
+class StylesFragment : public WorkbookFragmentBase
 {
 public:
-    explicit            OoxStylesFragment(
+    explicit            StylesFragment(
                             const WorkbookHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath );
 
 protected:
-    // oox.core.ContextHandler2Helper interface -------------------------------
-
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
     virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
 
-    // oox.core.FragmentHandler2 interface ------------------------------------
-
     virtual const ::oox::core::RecordInfo* getRecordInfos() const;
     virtual void        finalizeImport();
 };
@@ -157,4 +153,3 @@ protected:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/tablebuffer.hxx b/oox/inc/oox/xls/tablebuffer.hxx
index 993b4305d03a..8c127184f15d 100644
--- a/oox/inc/oox/xls/tablebuffer.hxx
+++ b/oox/inc/oox/xls/tablebuffer.hxx
@@ -66,7 +66,7 @@ public:
     /** Creates a database range from this tables. */
     void                finalizeImport();
 
-    /** Returns the table identifier. */
+    /** Returns the unique table identifier. */
     inline sal_Int32    getTableId() const { return maModel.mnId; }
     /** Returns the token index used in API token arrays (com.sun.star.sheet.FormulaToken). */
     inline sal_Int32    getTokenIndex() const { return mnTokenIndex; }
@@ -116,7 +116,7 @@ public:
     TableRef            getTable( const ::rtl::OUString& rDispName ) const;
 
 private:
-    void                insertTable( TableRef xTable );
+    void                insertTable( const TableRef& rxTable );
 
 private:
     typedef RefMap< sal_Int32, Table >          TableIdMap;
@@ -132,4 +132,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/tablefragment.hxx b/oox/inc/oox/xls/tablefragment.hxx
index e30eb1e2f9e8..5b92063ba147 100644
--- a/oox/inc/oox/xls/tablefragment.hxx
+++ b/oox/inc/oox/xls/tablefragment.hxx
@@ -36,21 +36,17 @@ namespace xls {
 
 // ============================================================================
 
-class OoxTableFragment : public OoxWorksheetFragmentBase
+class TableFragment : public WorksheetFragmentBase
 {
 public:
-    explicit            OoxTableFragment(
+    explicit            TableFragment(
                             const WorksheetHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath );
 
 protected:
-    // oox.core.ContextHandler2Helper interface -------------------------------
-
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
     virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
 
-    // oox.core.FragmentHandler2 interface ------------------------------------
-
     virtual const ::oox::core::RecordInfo* getRecordInfos() const;
 
 private:
@@ -63,4 +59,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/themebuffer.hxx b/oox/inc/oox/xls/themebuffer.hxx
index 338837e40427..95d092198b95 100644
--- a/oox/inc/oox/xls/themebuffer.hxx
+++ b/oox/inc/oox/xls/themebuffer.hxx
@@ -61,4 +61,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/unitconverter.hxx b/oox/inc/oox/xls/unitconverter.hxx
index 36a70a7f4067..1ea4180bc6fd 100644
--- a/oox/inc/oox/xls/unitconverter.hxx
+++ b/oox/inc/oox/xls/unitconverter.hxx
@@ -28,8 +28,8 @@
 #ifndef OOX_XLS_UNITCONVERTER_HXX
 #define OOX_XLS_UNITCONVERTER_HXX
 
-#include 
 #include 
+#include 
 #include "oox/xls/workbookhelper.hxx"
 
 namespace com { namespace sun { namespace star {
@@ -121,4 +121,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/viewsettings.hxx b/oox/inc/oox/xls/viewsettings.hxx
index 1f82aedeef91..30adfcbf6a07 100644
--- a/oox/inc/oox/xls/viewsettings.hxx
+++ b/oox/inc/oox/xls/viewsettings.hxx
@@ -228,4 +228,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/webquerybuffer.hxx b/oox/inc/oox/xls/webquerybuffer.hxx
deleted file mode 100644
index 22c91bc15d1f..000000000000
--- a/oox/inc/oox/xls/webquerybuffer.hxx
+++ /dev/null
@@ -1,127 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * 
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef OOX_XLS_WEBQUERYBUFFER_HXX
-#define OOX_XLS_WEBQUERYBUFFER_HXX
-
-#include 
-#include 
-#include 
-#include 
-#include "oox/xls/workbookhelper.hxx"
-
-namespace oox {
-namespace xls {
-
-// ============================================================================
-
-struct QueryTable
-{
-    sal_Int32   mnConnectionId;
-};
-
-// struct WebQuery
-// {
-//     enum WebQueryMode
-//     {
-//         xlWQUnknown,                /// Not specified.
-//         xlWQDocument,               /// Entire document.
-//         xlWQAllTables,              /// All tables.
-//         xlWQSpecTables              /// Specific tables.
-//     };
-//
-//     ::rtl::OUString maURL;                          /// Source document URL.
-//     ::rtl::OUString maTables;                       /// List of source range names.
-//     ::com::sun::star::table::CellRangeAddress maDestRange; /// Destination range.
-//     WebQueryMode meMode;                            /// Current mode of web query.
-//     sal_uInt16 mnRefresh;                           /// Refresh time in minutes.
-// };
-
-struct BaseProperties
-{
-};
-
-/** Stores web query properties from webPr element. */
-struct WebProperties : public BaseProperties
-{
-    ::rtl::OUString     maURL;
-};
-
-/** Stores text data source properties from textPr element. */
-struct TextProperties : public BaseProperties
-{
-    ::rtl::OUString     maSourceFile;
-};
-
-struct Connection
-{
-    static const sal_Int32 CONNECTION_ODBC_SOURCE;
-    static const sal_Int32 CONNECTION_DAO_SOURCE;
-    static const sal_Int32 CONNECTION_FILE_SOURCE;
-    static const sal_Int32 CONNECTION_WEBQUERY;
-    static const sal_Int32 CONNECTION_OLEDB_SOURCE;
-    static const sal_Int32 CONNECTION_TEXT_SOURCE;
-    static const sal_Int32 CONNECTION_ADO_RECORD_SET;
-    static const sal_Int32 CONNECTION_DSP;
-
-    ::rtl::OUString     maName;                     /// Connection name (must be unique).
-    sal_Int32           mnType;
-    ::boost::shared_ptr< BaseProperties > mpProperties;
-};
-
-// ============================================================================
-
-typedef ::std::hash_map< ::rtl::OUString, QueryTable, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > QueryTableHashMap;
-
-class WebQueryBuffer : public WorkbookHelper
-{
-public:
-    explicit            WebQueryBuffer( const WorkbookHelper& rHelper );
-
-    void                importQueryTable( const AttributeList& rAttribs );
-
-    void                importConnection( const AttributeList& rAttribs );
-
-    void                importWebPr( const AttributeList& rAttribs );
-
-    /** Dumps content for debug purposes. */
-    void                dump() const;
-
-private:
-    QueryTableHashMap           maQueryTableMap;
-    ::std::vector< Connection > maConnections;
-
-    sal_Int32                   mnCurConnId;        /// Current connection ID.
-};
-
-// ============================================================================
-
-} // namespace xls
-} // namespace oox
-
-#endif
-
diff --git a/oox/inc/oox/xls/workbookfragment.hxx b/oox/inc/oox/xls/workbookfragment.hxx
index b499704e62cb..8c354dca1840 100644
--- a/oox/inc/oox/xls/workbookfragment.hxx
+++ b/oox/inc/oox/xls/workbookfragment.hxx
@@ -38,23 +38,19 @@ class ExternalLink;
 
 // ============================================================================
 
-class OoxWorkbookFragment : public OoxWorkbookFragmentBase
+class WorkbookFragment : public WorkbookFragmentBase
 {
 public:
-    explicit            OoxWorkbookFragment(
+    explicit            WorkbookFragment(
                             const WorkbookHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath );
 
 protected:
-    // oox.core.ContextHandler2Helper interface -------------------------------
-
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
     virtual void        onCharacters( const ::rtl::OUString& rChars );
 
     virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
 
-    // oox.core.FragmentHandler2 interface ------------------------------------
-
     virtual const ::oox::core::RecordInfo* getRecordInfos() const;
     virtual void        finalizeImport();
 
@@ -100,4 +96,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/workbookhelper.hxx b/oox/inc/oox/xls/workbookhelper.hxx
index 0ff8c0f9d3e5..78a9d674fa96 100644
--- a/oox/inc/oox/xls/workbookhelper.hxx
+++ b/oox/inc/oox/xls/workbookhelper.hxx
@@ -37,24 +37,20 @@ namespace com { namespace sun { namespace star {
     namespace container { class XNameAccess; }
     namespace container { class XNameContainer; }
     namespace lang { class XMultiServiceFactory; }
-    namespace awt { class XDevice; }
     namespace table { struct CellAddress; }
     namespace table { struct CellRangeAddress; }
     namespace table { class XCell; }
     namespace table { class XCellRange; }
-    namespace sheet { class XSpreadsheetDocument; }
-    namespace sheet { class XSpreadsheet; }
-    namespace sheet { class XNamedRanges; }
     namespace sheet { class XNamedRange; }
-    namespace sheet { class XDatabaseRanges; }
-    namespace sheet { class XExternalDocLinks; }
+    namespace sheet { class XSpreadsheet; }
+    namespace sheet { class XSpreadsheetDocument; }
     namespace style { class XStyle; }
 } } }
 
 namespace oox {
     class AttributeList;
-    class SegmentProgressBar;
     class RecordInputStream;
+    class SegmentProgressBar;
 }
 
 namespace oox { namespace core {
@@ -79,8 +75,8 @@ class ExcelBiffFilter;
 /** An enumeration for all supported spreadsheet filter types. */
 enum FilterType
 {
-    FILTER_OOX,         /// MS Excel OOXML (Office Open XML) or OOBIN.
-    FILTER_BIFF,        /// MS Excel BIFF (Binary Interchange File Format).
+    FILTER_OOXML,       /// MS Excel OOXML (Office Open XML) or BIFF12.
+    FILTER_BIFF,        /// MS Excel BIFF2-BIFF8 (Binary Interchange File Format).
     FILTER_UNKNOWN      /// Unknown filter type.
 };
 
@@ -89,31 +85,31 @@ enum FilterType
 /** Functor for case-insensitive string comparison, usable in maps etc. */
 struct IgnoreCaseCompare
 {
-    bool                operator()( const ::rtl::OUString& rName1, const ::rtl::OUString& rName2 ) const;
+    bool operator()( const ::rtl::OUString& rName1, const ::rtl::OUString& rName2 ) const;
 };
 
 // ============================================================================
 
-class WorkbookData;
-class WorkbookSettings;
-class ViewSettings;
-class WorksheetBuffer;
-class ThemeBuffer;
-class StylesBuffer;
-class SharedStringsBuffer;
-class ExternalLinkBuffer;
+class AddressConverter;
+class BiffCodecHelper;
+class ConnectionsBuffer;
 class DefinedNamesBuffer;
-class TableBuffer;
-class ScenarioBuffer;
-class WebQueryBuffer;
+class ExcelChartConverter;
+class ExternalLinkBuffer;
+class FormulaParser;
+class PageSettingsConverter;
 class PivotCacheBuffer;
 class PivotTableBuffer;
-class FormulaParser;
+class ScenarioBuffer;
+class SharedStringsBuffer;
+class StylesBuffer;
+class TableBuffer;
+class ThemeBuffer;
 class UnitConverter;
-class AddressConverter;
-class ExcelChartConverter;
-class PageSettingsConverter;
-class BiffCodecHelper;
+class ViewSettings;
+class WorkbookData;
+class WorkbookSettings;
+class WorksheetBuffer;
 
 /** Helper class to provice access to global workbook data.
 
@@ -163,21 +159,6 @@ public:
     /** Returns a reference to the service factory of the spreadsheet document model. */
     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
                         getDocumentFactory() const;
-    /** Returns the reference device of the document. */
-    ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice >
-                        getReferenceDevice() const;
-    /** Returns the container for defined names from the Calc document. */
-    ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XNamedRanges >
-                        getNamedRanges() const;
-    /** Returns the container for database ranges from the Calc document. */
-    ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDatabaseRanges >
-                        getDatabaseRanges() const;
-    /** Returns the container for external documents from the Calc document. */
-    ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XExternalDocLinks >
-                        getExternalDocLinks() const;
-    /** Returns the container for DDE links from the Calc document. */
-    ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
-                        getDdeLinks() const;
 
     /** Returns a reference to the specified spreadsheet in the document model. */
     ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet >
@@ -237,8 +218,8 @@ public:
     TableBuffer&        getTables() const;
     /** Returns the scenarios collection. */
     ScenarioBuffer&     getScenarios() const;
-    /** Returns the web queries. */
-    WebQueryBuffer&     getWebQueries() const;
+    /** Returns the collection of external data connections. */
+    ConnectionsBuffer&  getConnections() const;
     /** Returns the collection of pivot caches. */
     PivotCacheBuffer&   getPivotCaches() const;
     /** Returns the collection of pivot tables. */
@@ -257,17 +238,17 @@ public:
     /** Returns the page and print settings converter. */
     PageSettingsConverter& getPageSettingsConverter() const;
 
-    // OOX specific (MUST NOT be called in BIFF filter) -----------------------
+    // OOXML/BIFF12 specific (MUST NOT be called in BIFF filter) --------------
 
-    /** Returns the base OOX filter object.
-        Must not be called, if current filter is not the OOX filter. */
+    /** Returns the base OOXML/BIFF12 filter object.
+        Must not be called, if current filter is not the OOXML/BIFF12 filter. */
     ::oox::core::XmlFilterBase& getOoxFilter() const;
 
     /** Imports a fragment using the passed fragment handler, which contains
         the full path to the fragment stream. */
     bool                importOoxFragment( const ::rtl::Reference< ::oox::core::FragmentHandler >& rxHandler );
 
-    // BIFF specific (MUST NOT be called in OOX filter) -----------------------
+    // BIFF2-BIFF8 specific (MUST NOT be called in OOXML/BIFF12 filter) -------
 
     /** Returns the base BIFF filter object. */
     ::oox::core::BinaryFilterBase& getBiffFilter() const;
diff --git a/oox/inc/oox/xls/workbooksettings.hxx b/oox/inc/oox/xls/workbooksettings.hxx
index 8ba322103955..bbdbefac17ff 100644
--- a/oox/inc/oox/xls/workbooksettings.hxx
+++ b/oox/inc/oox/xls/workbooksettings.hxx
@@ -61,8 +61,8 @@ struct WorkbookSettingsModel
 
     explicit            WorkbookSettingsModel();
 
-    /** Sets OOBIN or BIFF object visibility mode. */
-    void                setBinObjectMode( sal_uInt16 nObjMode );
+    /** Sets BIFF object visibility mode. */
+    void                setBiffObjectMode( sal_uInt16 nObjMode );
 };
 
 // ============================================================================
@@ -162,4 +162,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/worksheetbuffer.hxx b/oox/inc/oox/xls/worksheetbuffer.hxx
index 2f9359b38370..d32012c48cff 100644
--- a/oox/inc/oox/xls/worksheetbuffer.hxx
+++ b/oox/inc/oox/xls/worksheetbuffer.hxx
@@ -58,8 +58,8 @@ struct SheetInfoModel
 /** Stores information about all sheets in a spreadsheet document.
 
     Information about sheets includes the sheet name, the visibility state, and
-    for the OOX filter, the relation identifier of the sheet used to obtain the
-    related worksheet fragment.
+    for the OOXML filter, the relation identifier of the sheet used to obtain
+    the related worksheet fragment.
  */
 class WorksheetBuffer : public WorkbookHelper
 {
@@ -74,7 +74,7 @@ public:
 
     /** Imports the attributes of a sheet element. */
     void                importSheet( const AttributeList& rAttribs );
-    /** Imports the SHEET record from the passed OOBIN stream. */
+    /** Imports the SHEET record from the passed BIFF12 stream. */
     void                importSheet( RecordInputStream& rStrm );
     /** Imports the SHEET record from the passed BIFF stream. */
     void                importSheet( BiffInputStream& rStrm );
@@ -84,7 +84,7 @@ public:
 
     /** Returns the number of original sheets contained in the workbook. */
     sal_Int32           getWorksheetCount() const;
-    /** Returns the OOX relation identifier of the specified worksheet. */
+    /** Returns the OOXML relation identifier of the specified worksheet. */
     ::rtl::OUString     getWorksheetRelId( sal_Int32 nWorksheet ) const;
     /** Returns the BIFF record handle of the associated sheet substream. */
     sal_Int64           getBiffRecordHandle( sal_Int32 nWorksheet ) const;
@@ -130,4 +130,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/worksheetfragment.hxx b/oox/inc/oox/xls/worksheetfragment.hxx
index 6b3b5357bb44..4a8fc9f3ef04 100644
--- a/oox/inc/oox/xls/worksheetfragment.hxx
+++ b/oox/inc/oox/xls/worksheetfragment.hxx
@@ -35,14 +35,12 @@ namespace xls {
 
 // ============================================================================
 
-class OoxDataValidationsContext : public OoxWorksheetContextBase
+class DataValidationsContext : public WorksheetContextBase
 {
 public:
-    explicit            OoxDataValidationsContext( OoxWorksheetFragmentBase& rFragment );
+    explicit            DataValidationsContext( WorksheetFragmentBase& rFragment );
 
 protected:
-    // oox.core.ContextHandler2Helper interface -------------------------------
-
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
     virtual void        onCharacters( const ::rtl::OUString& rChars );
     virtual void        onEndElement();
@@ -61,26 +59,22 @@ private:
 
 // ============================================================================
 
-class OoxWorksheetFragment : public OoxWorksheetFragmentBase
+class WorksheetFragment : public WorksheetFragmentBase
 {
 public:
-    explicit            OoxWorksheetFragment(
+    explicit            WorksheetFragment(
                             const WorkbookHelper& rHelper,
                             const ::rtl::OUString& rFragmentPath,
-                            ISegmentProgressBarRef xProgressBar,
+                            const ISegmentProgressBarRef& rxProgressBar,
                             WorksheetType eSheetType,
                             sal_Int16 nSheet );
 
 protected:
-    // oox.core.ContextHandler2Helper interface -------------------------------
-
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
     virtual void        onCharacters( const ::rtl::OUString& rChars );
 
     virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
 
-    // oox.core.FragmentHandler2 interface ------------------------------------
-
     virtual const ::oox::core::RecordInfo* getRecordInfos() const;
     virtual void        initializeImport();
     virtual void        finalizeImport();
@@ -136,14 +130,12 @@ private:
 
 // ============================================================================
 
-class BiffPivotTableContext;
-
 class BiffWorksheetFragment : public BiffWorksheetFragmentBase
 {
 public:
     explicit            BiffWorksheetFragment(
                             const BiffWorkbookFragmentBase& rParent,
-                            ISegmentProgressBarRef xProgressBar,
+                            const ISegmentProgressBarRef& rxProgressBar,
                             WorksheetType eSheetType,
                             sal_Int16 nSheet );
     virtual             ~BiffWorksheetFragment();
@@ -153,40 +145,42 @@ public:
 
 private:
     /** Imports the COLINFO record and sets column properties and formatting. */
-    void                importColInfo();
+    void                importColInfo( BiffInputStream& rStrm );
     /** Imports the BIFF2 COLUMNDEFAULT record and sets column default formatting. */
-    void                importColumnDefault();
+    void                importColumnDefault( BiffInputStream& rStrm );
     /** Imports the BIFF2 COLWIDTH record and sets column width. */
-    void                importColWidth();
+    void                importColWidth( BiffInputStream& rStrm );
     /** Imports the DATAVALIDATION record containing cell ranges with data validation settings. */
-    void                importDataValidation();
+    void                importDataValidation( BiffInputStream& rStrm );
     /** Imports the DATAVALIDATIONS record containing global data validation settings. */
-    void                importDataValidations();
+    void                importDataValidations( BiffInputStream& rStrm );
     /** Imports the DEFCOLWIDTH record and sets default column width. */
-    void                importDefColWidth();
+    void                importDefColWidth( BiffInputStream& rStrm );
     /** Imports the DEFROWHEIGHT record and sets default row height and properties. */
-    void                importDefRowHeight();
+    void                importDefRowHeight( BiffInputStream& rStrm );
     /** Imports the DIMENSION record containing the used area of the sheet. */
-    void                importDimension();
+    void                importDimension( BiffInputStream& rStrm );
     /** Imports the HYPERLINK record and sets a cell hyperlink. */
-    void                importHyperlink();
+    void                importHyperlink( BiffInputStream& rStrm );
     /** Imports the LABELRANGES record and sets the imported label ranges. */
-    void                importLabelRanges();
+    void                importLabelRanges( BiffInputStream& rStrm );
     /** Imports the MEREDCELLS record and merges all cells in the document. */
-    void                importMergedCells();
+    void                importMergedCells( BiffInputStream& rStrm );
     /** Imports the HORPAGEBREAKS or VERPAGEBREAKS record and inserts page breaks. */
-    void                importPageBreaks( bool bRowBreak );
+    void                importPageBreaks( BiffInputStream& rStrm, bool bRowBreak );
     /** Imports a pivot table. */
-    void                importPTDefinition();
+    void                importPTDefinition( BiffInputStream& rStrm );
+    /** Imports the QUERYTABLE and following records and inserts a web query. */
+    void                importQueryTable( BiffInputStream& rStrm );
     /** Imports the SCENARIOS record and the following scenarios. */
-    void                importScenarios();
+    void                importScenarios( BiffInputStream& rStrm );
     /** Imports the SHAREDFEATHEAD record. */
-    void                importSharedFeatHead();
+    void                importSharedFeatHead( BiffInputStream& rStrm );
     /** Imports the STANDARDWIDTH record and sets standard column width. */
-    void                importStandardWidth();
+    void                importStandardWidth( BiffInputStream& rStrm );
 
 private:
-    ::boost::shared_ptr< BiffPivotTableContext > mxPTContext;
+    ::boost::shared_ptr< BiffWorksheetContextBase > mxContext;
 };
 
 // ============================================================================
@@ -195,4 +189,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/worksheethelper.hxx b/oox/inc/oox/xls/worksheethelper.hxx
index 632d7027403f..6994470c34cd 100644
--- a/oox/inc/oox/xls/worksheethelper.hxx
+++ b/oox/inc/oox/xls/worksheethelper.hxx
@@ -37,14 +37,14 @@ namespace com { namespace sun { namespace star {
     namespace awt { struct Point; }
     namespace awt { struct Rectangle; }
     namespace awt { struct Size; }
-    namespace util { struct DateTime; }
     namespace drawing { class XDrawPage; }
-    namespace table { class XTableColumns; }
-    namespace table { class XTableRows; }
+    namespace sheet { class XSheetCellRanges; }
+    namespace sheet { class XSpreadsheet; }
     namespace table { class XCell; }
     namespace table { class XCellRange; }
-    namespace sheet { class XSpreadsheet; }
-    namespace sheet { class XSheetCellRanges; }
+    namespace table { class XTableColumns; }
+    namespace table { class XTableRows; }
+    namespace util { struct DateTime; }
 } } }
 
 namespace oox {
@@ -53,13 +53,14 @@ namespace xls {
 struct BinAddress;
 struct BinRange;
 class BinRangeList;
-class WorksheetSettings;
-class SharedFormulaBuffer;
-class CondFormatBuffer;
 class CommentsBuffer;
+class CondFormatBuffer;
 class PageSettings;
+class QueryTableBuffer;
+class SharedFormulaBuffer;
 class SheetViewSettings;
 class VmlDrawing;
+class WorksheetSettings;
 
 // ============================================================================
 // ============================================================================
@@ -202,12 +203,12 @@ struct ValidationModel
 
     explicit            ValidationModel();
 
-    /** Sets the passed OOBIN or BIFF validation type. */
-    void                setBinType( sal_uInt8 nType );
-    /** Sets the passed OOBIN or BIFF operator. */
-    void                setBinOperator( sal_uInt8 nOperator );
-    /** Sets the passed OOBIN or BIFF error style. */
-    void                setBinErrorStyle( sal_uInt8 nErrorStyle );
+    /** Sets the passed BIFF validation type. */
+    void                setBiffType( sal_uInt8 nType );
+    /** Sets the passed BIFF operator. */
+    void                setBiffOperator( sal_uInt8 nOperator );
+    /** Sets the passed BIFF error style. */
+    void                setBiffErrorStyle( sal_uInt8 nErrorStyle );
 };
 
 // ============================================================================
@@ -314,6 +315,8 @@ public:
     CondFormatBuffer&   getCondFormats() const;
     /** Returns the buffer for all cell comments in this sheet. */
     CommentsBuffer&     getComments() const;
+    /** Returns the buffer for all web query tables in this sheet. */
+    QueryTableBuffer&   getQueryTables() const;
     /** Returns the page/print settings for this sheet. */
     PageSettings&       getPageSettings() const;
     /** Returns the view settings for this sheet. */
@@ -445,7 +448,7 @@ protected:
     /** Constructs from the passed data, creates and owns a new data object. */
     explicit            WorksheetHelperRoot(
                             const WorkbookHelper& rHelper,
-                            ISegmentProgressBarRef xProgressBar,
+                            const ISegmentProgressBarRef& rxProgressBar,
                             WorksheetType eSheetType,
                             sal_Int16 nSheet );
 
@@ -468,4 +471,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/inc/oox/xls/worksheetsettings.hxx b/oox/inc/oox/xls/worksheetsettings.hxx
index 990a463b3545..de58fa3e1355 100644
--- a/oox/inc/oox/xls/worksheetsettings.hxx
+++ b/oox/inc/oox/xls/worksheetsettings.hxx
@@ -28,8 +28,8 @@
 #ifndef OOX_XLS_WORKSHEETSETTINGS_HXX
 #define OOX_XLS_WORKSHEETSETTINGS_HXX
 
-#include "oox/xls/worksheethelper.hxx"
 #include "oox/xls/richstring.hxx"
+#include "oox/xls/worksheethelper.hxx"
 
 namespace oox {
 namespace xls {
@@ -142,4 +142,3 @@ private:
 } // namespace oox
 
 #endif
-
diff --git a/oox/source/dump/biffdumper.cxx b/oox/source/dump/biffdumper.cxx
index 7932ff2e6f4e..d768b08812b7 100644
--- a/oox/source/dump/biffdumper.cxx
+++ b/oox/source/dump/biffdumper.cxx
@@ -537,6 +537,26 @@ OUString BiffObjectBase::dumpString( const String& rName, BiffStringFlags nByteF
     return (getBiff() == BIFF8) ? dumpUniString( rName, nUniFlags ) : dumpByteString( rName, nByteFlags, eDefaultTextEnc );
 }
 
+OUString BiffObjectBase::dumpSegmentedUniString( const String& rName )
+{
+    sal_Int32 nLength = mxBiffStrm->readInt32();
+    OUStringBuffer aBuffer;
+    while( !mxBiffStrm->isEof() && (aBuffer.getLength() < nLength) )
+        aBuffer.append( mxBiffStrm->readUniString() );
+    OUString aString = aBuffer.makeStringAndClear();
+    writeStringItem( rName, aString );
+    return aString;
+}
+
+void BiffObjectBase::dumpSegmentedUniStringArray( const String& rName )
+{
+    writeEmptyItem( rName );
+    IndentGuard aIndGuard( mxOut );
+    mxOut->resetItemIndex();
+    for( sal_uInt16 nIndex = 0, nCount = dumpDec< sal_uInt16 >( "count" ); !mxBiffStrm->isEof() && (nIndex < nCount); ++nIndex )
+        dumpSegmentedUniString( "#entry" );
+}
+
 sal_uInt8 BiffObjectBase::dumpBoolean( const String& rName )
 {
     sal_uInt8 nBool;
@@ -2066,6 +2086,69 @@ void WorkbookStreamObject::implDumpRecordBody()
             dumpBool< sal_uInt32 >( "recommend-compress-pics" );
         break;
 
+        case BIFF_ID_CONNECTION:
+        {
+            dumpFrHeader( true, false );
+            sal_uInt16 nType = dumpDec< sal_uInt16 >( "data-source-type", "CONNECTION-SOURCETYPE" );
+            sal_uInt16 nFlags1 = dumpHex< sal_uInt16 >( "flags", "CONNECTION-FLAGS" );
+            dumpDec< sal_uInt16 >( "param-count" );
+            dumpUnused( 2 );
+            dumpHex< sal_uInt16 >( "querytable-flags", "QUERYTABLESETTINGS-FLAGS" );
+            switch( nType )
+            {
+                case 4:     dumpHex< sal_uInt16 >( "html-flags", "QUERYTABLESETTINGS-HTML-FLAGS" );     break;
+                case 5:     dumpHex< sal_uInt16 >( "oledb-flags", "QUERYTABLESETTINGS-OLEDB-FLAGS" );   break;
+                case 7:     dumpHex< sal_uInt16 >( "ado-flags", "QUERYTABLESETTINGS-ADO-FLAGS" );       break;
+                default:    dumpUnused( 2 );
+            }
+            dumpDec< sal_uInt8 >( "edited-version" );
+            dumpDec< sal_uInt8 >( "refreshed-version" );
+            dumpDec< sal_uInt8 >( "min-refresh-version" );
+            dumpDec< sal_uInt16 >( "refresh-interval", "QUERYTABLESETTINGS-INTERVAL" );
+            dumpDec< sal_uInt16 >( "html-format", "QUERYTABLESETTINGS-HTMLFORMAT" );
+            dumpDec< sal_Int32 >( "reconnect-type", "CONNECTION-RECONNECTTYPE" );
+            dumpDec< sal_uInt8 >( "credentials", "CONNECTION-CREDENTIALS" );
+            dumpUnused( 1 );
+            dumpSegmentedUniString( "source-file" );
+            dumpSegmentedUniString( "source-conn-file" );
+            dumpSegmentedUniString( "name" );
+            dumpSegmentedUniString( "description" );
+            dumpSegmentedUniString( "sso-id" );
+            if( nFlags1 & 0x0004 ) dumpSegmentedUniString( "table-names" );
+            if( nFlags1 & 0x0010 )
+            {
+                break;   // TODO: parameter array structure
+            }
+            bool bEscape = false;
+            switch( nType )
+            {
+                case 1:
+                    dumpSegmentedUniString( "connection-string" );
+                break;
+                case 4:
+                    dumpSegmentedUniStringArray( "urls" );
+                    dumpSegmentedUniStringArray( "post-method" );
+                break;
+                case 5:
+                    bEscape = true;
+                break;
+                case 6:
+                    bEscape = true;
+                break;
+            }
+            if( bEscape )
+                break;
+            dumpSegmentedUniStringArray( "sql-command" );
+            dumpSegmentedUniStringArray( "orig-sql-command" );
+            dumpSegmentedUniStringArray( "webquery-dialog-url" );
+            switch( dumpDec< sal_uInt8 >( "linked-object-type", "CONNECTION-LINKEDOBJECTTYPE" ) )
+            {
+                case 1: dumpSegmentedUniString( "defined-name" );   break;
+                case 2: dumpHex< sal_uInt16 >( "cache-id" );        break;
+            }
+        }
+        break;
+
         case BIFF_ID_CONT:
             if( (eBiff == BIFF8) && (getLastRecId() == BIFF_ID_OBJ) )
                 dumpEmbeddedDff();
@@ -2177,6 +2260,21 @@ void WorkbookStreamObject::implDumpRecordBody()
                 dumpDec< sal_uInt16 >( "#cell-offset" );
         break;
 
+        case BIFF_ID_DBQUERY:
+            if( eBiff == BIFF8 )
+            {
+                if( (getLastRecId() != BIFF_ID_PCITEM_STRING) && (getLastRecId() != BIFF_ID_DBQUERY) )
+                {
+                    dumpHex< sal_uInt16 >( "flags", "DBQUERY-FLAGS" );
+                    dumpDec< sal_uInt16 >( "sql-param-count" );
+                    dumpDec< sal_uInt16 >( "command-count" );
+                    dumpDec< sal_uInt16 >( "post-method-count" );
+                    dumpDec< sal_uInt16 >( "server-sql-count" );
+                    dumpDec< sal_uInt16 >( "odbc-connection-count" );
+                }
+            }
+        break;
+
         case BIFF2_ID_DEFINEDNAME:
         case BIFF3_ID_DEFINEDNAME:
         {
@@ -2715,6 +2813,58 @@ void WorkbookStreamObject::implDumpRecordBody()
             }
         break;
 
+        case BIFF_ID_QUERYTABLE:
+            dumpHex< sal_uInt16 >( "flags", "QUERYTABLE-FLAGS" );
+            dumpDec< sal_uInt16 >( "autoformat-id" );
+            dumpHex< sal_uInt16 >( "autoformat-flags", "QUERYTABLE-AUTOFORMAT-FLAGS" );
+            dumpUnused( 4 );
+            dumpUniString( "defined-name" );
+            dumpUnused( 2 );
+        break;
+
+        case BIFF_ID_QUERYTABLEREFRESH:
+        {
+            dumpFrHeader( true, false );
+            bool bPivot = dumpBool< sal_uInt16 >( "pivot-table" );
+            dumpHex< sal_uInt16 >( "flags", "QUERYTABLEREFRESH-FLAGS" );
+            dumpHex< sal_uInt32 >( bPivot ? "pivottable-flags" : "querytable-flags", bPivot ? "QUERYTABLEREFRESH-PTFLAGS" : "QUERYTABLEREFRESH-QTFLAGS" );
+            dumpDec< sal_uInt8 >( "refreshed-version" );
+            dumpDec< sal_uInt8 >( "min-refresh-version" );
+            dumpUnused( 2 );
+            dumpUniString( "table-name" );
+            dumpUnused( 2 );
+        }
+        break;
+
+        case BIFF_ID_QUERYTABLESETTINGS:
+        {
+            dumpFrHeader( true, false );
+            sal_uInt16 nType = dumpDec< sal_uInt16 >( "data-source-type", "CONNECTION-SOURCETYPE" );
+            dumpHex< sal_uInt16 >( "flags-1", "QUERYTABLESETTINGS-FLAGS" );
+            switch( nType )
+            {
+                case 4:     dumpHex< sal_uInt16 >( "html-flags", "QUERYTABLESETTINGS-HTML-FLAGS" );     break;
+                case 5:     dumpHex< sal_uInt16 >( "oledb-flags", "QUERYTABLESETTINGS-OLEDB-FLAGS" );   break;
+                case 7:     dumpHex< sal_uInt16 >( "ado-flags", "QUERYTABLESETTINGS-ADO-FLAGS" );       break;
+                default:    dumpUnused( 2 );
+            }
+            dumpHex< sal_uInt16 >( "ext-flags", "QUERYTABLESETTINGS-EXT-FLAGS" );
+            dumpDec< sal_uInt8 >( "edited-version" );
+            dumpDec< sal_uInt8 >( "refreshed-version" );
+            dumpDec< sal_uInt8 >( "min-refresh-version" );
+            dumpUnused( 3 );
+            dumpDec< sal_uInt16 >( "oledb-count" );
+            dumpDec< sal_uInt16 >( "future-data-size" );
+            dumpDec< sal_uInt16 >( "refresh-interval", "QUERYTABLESETTINGS-INTERVAL" );
+            dumpDec< sal_uInt16 >( "html-format", "QUERYTABLESETTINGS-HTMLFORMAT" );
+        }
+        break;
+
+        case BIFF_ID_QUERYTABLESTRING:
+            dumpFrHeader( true, false );
+            dumpUniString( "connection-string" );
+        break;
+
         case BIFF_ID_RECALCID:
             dumpFrHeader( true, false );
             dumpDec< sal_uInt32 >( "recalc-engine-id" );
@@ -2896,18 +3046,6 @@ void WorkbookStreamObject::implDumpRecordBody()
             dumpDxfProp();
         break;
 
-        case BIFF_ID_SXEXT:
-            if( eBiff == BIFF8 )
-            {
-                dumpHex< sal_uInt16 >( "flags", "SXEXT-FLAGS" );
-                dumpDec< sal_uInt16 >( "param-string-count" );
-                dumpDec< sal_uInt16 >( "sql-statement-string-count" );
-                dumpDec< sal_uInt16 >( "webquery-postmethod-string-count" );
-                dumpDec< sal_uInt16 >( "server-pagefields-string-count" );
-                dumpDec< sal_uInt16 >( "odbc-connection-string-count" );
-            }
-        break;
-
         case BIFF_ID_TABLESTYLES:
         {
             dumpFrHeader( true, true );
diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini
index 881001cb05c9..8e3e25271cc9 100644
--- a/oox/source/dump/biffdumper.ini
+++ b/oox/source/dump/biffdumper.ini
@@ -351,7 +351,7 @@ multilist=RECORD-NAMES-BIFF5
   0x00C0=TOOLBAREND,MMS,ADDMENU,DELMENU,,PTDATAFIELD,PCDEFINITION,PCDFIELD
   0x00C8=PCITEM_INDEXLIST,PCITEM_DOUBLE,PCITEM_BOOL,PCITEM_ERROR,PCITEM_INTEGER,PCITEM_STRING,PCITEM_DATE,PCITEM_MISSING
   0x00D0=SXTBL,SXTBRGITEM,SXTBPG,VBAPROJECT,,PIVOTCACHE,RSTRING,DBCELL
-  0x00D8=PCDFRANGEPR,PCDFDISCRETEPR,BOOKBOOL,REVERT,SXEXT|PARAMQRY,SCENPROTECT,OLESIZE,UDDESC
+  0x00D8=PCDFRANGEPR,PCDFDISCRETEPR,BOOKBOOL,REVERT,DBORPARAMQUERY,SCENPROTECT,OLESIZE,UDDESC
   0x00E0=XF,INTERFACEHDR,INTERFACEEND,PCDSOURCE,,,,
   0x0206=FORMULA
   0x04BC=SHAREDFMLA
@@ -379,16 +379,17 @@ multilist=RECORD-NAMES-BIFF8
   0x0158=,,,,,,,LABELRANGES
   0x0160=USESELFS,DSF,XL5MODIFY,,,,,
   0x0190=,,,,,,CHTRHEADER,
-  0x01A8=,USERBVIEW,USERSVIEWBEGIN,USERSVIEWEND,,QSI,EXTERNALBOOK,PROT4REV
+  0x01A8=,USERBVIEW,USERSVIEWBEGIN,USERSVIEWEND,,QUERYTABLE,EXTERNALBOOK,PROT4REV
   0x01B0=CFHEADER,CFRULE,DATAVALIDATIONS,,,DCONBINAME,TXO,REFRESHALL
   0x01B8=HYPERLINK,NLRDELNAME,CODENAME,PCDFSQLTYPE,PROT4REVPASS,VBAPROJECTEMPTY,DATAVALIDATION,
   0x01C0=XL9FILE,RECALCID,INTCACHEDDATA,,,,,
   # future records
-  0x0800=SCREENTIP,,,WEBQRYSETTINGS,WEBQRYTABLES,,,
+  0x0800=SCREENTIP,,QUERYTABLEREFRESH,QUERYTABLESETTINGS,QUERYTABLESTRING,,,
   0x0850=CHFRINFO,CHFRWRAPPER,CHFRBLOCKBEGIN,CHFRBLOCKEND,,,CHFRCATEGORYPROPS,CHFRUNITPROPS
   0x0858=CHPIVOTREF,CHPIVOTFLAGS,,,,,,
   0x0860=,,SHEETEXT,BOOKEXT,,,,SHAREDFEATHEAD
   0x0868=,,,CHFRLABELPROPS,,,,
+  0x0870=,,,,,,CONNECTION,
   0x0878=,,CFRULE12,CFRULEEXT,XFCRC,XFEXT,,
   0x0888=,,,PAGELAYOUTVIEW,CHECKCOMPAT,DXF,TABLESTYLES,
   0x0890=,,STYLEEXT,,,,THEME,
@@ -1229,6 +1230,26 @@ combilist=COLINFO-FLAGS
   0x1000=outline-collapsed
 end
 
+# CONNECTION -----------------------------------------------------------------
+
+shortlist=CONNECTION-SOURCETYPE,1,odbc,dao,file,html,ole-db,text,ado,dsp
+
+flagslist=CONNECTION-FLAGS
+  0x0001=save-password
+  0x0002=html-tables
+  0x0004=table-names
+  0x0008=deleted
+  0x0010=stand-alone
+  0x0020=only-use-conn-file
+  0x0040=background
+  0x0080=refresh-on-load
+  0x0100=save-data
+end
+
+shortlist=CONNECTION-RECONNECTTYPE,0,as-required,always,never
+shortlist=CONNECTION-CREDENTIALS,0,integrated,none,stored-sso,prompt
+shortlist=CONNECTION-LINKEDOBJECTTYPE,0,none,query-table,pivot-cache
+
 # DATATABLE ------------------------------------------------------------------
 
 flagslist=DATATABLE-FLAGS-BIFF3
@@ -1273,6 +1294,18 @@ end
 
 shortlist=DATEMODE,0,1899-12-31,1904-01-01
 
+# DBQUERY --------------------------------------------------------------------
+
+combilist=DBQUERY-FLAGS
+  0x0007=uint8,dec,source-type,CONNECTION-SOURCETYPE
+  0x0008=odbc-connection
+  0x0010=sql-query
+  0x0020=server-sql
+  0x0040=html-query
+  0x0080=save-password
+  0x0100=html-tables
+end
+
 # DEFINEDNAME ----------------------------------------------------------------
 
 flagslist=DEFINEDNAME-FLAGS-BIFF2
@@ -1874,6 +1907,101 @@ combilist=PTROWCOLITEMS-FLAGS
   0x1000=multi-data
 end
 
+# QUERYTABLE -----------------------------------------------------------------
+
+combilist=QUERYTABLE-FLAGS
+  0x0001=headers
+  0x0002=row-numbers
+  0x0004=disable-refresh
+  0x0008=background
+  0x0010=first-background
+  0x0020=refresh-on-load
+  0x0040=delete-unused
+  0x0080=fill-formulas
+  0x0100=adjust-column-width
+  0x0200=save-data
+  0x0400=disable-edit
+  0x2000=overwrite-existing
+end
+
+combilist=QUERYTABLE-AUTOFORMAT-FLAGS
+  0x0001=apply-num-fmt
+  0x0002=apply-font
+  0x0004=apply-alignment
+  0x0008=apply-border
+  0x0010=apply-fill
+  0x0020=apply-protection
+end
+
+# QUERYTABLEREFRESH ----------------------------------------------------------
+
+flagslist=QUERYTABLEREFRESH-FLAGS
+  0x0001=enable-refresh
+  0x0002=pivot-cache-invalid
+  0x0004=olap-pivot-table
+end
+
+flagslist=QUERYTABLEREFRESH-PTFLAGS
+  0x00000001=disable-draw-drop
+  0x00000002=hide-totals-annotation
+  0x00000008=include-empty-rows
+  0x00000010=include-empty-columns
+end
+
+flagslist=QUERYTABLEREFRESH-QTFLAGS
+  0x00000001=preserve-formatting
+  0x00000002=adjust-column-width
+  0x00000010=ext-data-list
+  0x00000040=create-table-list
+  0x00000080=create-dummy-list
+end
+
+# QUERYTABLESETTINGS ---------------------------------------------------------
+
+flagslist=QUERYTABLESETTINGS-FLAGS
+  0x0001=keep-alive
+  0x0002=new
+  0x0004=source-data
+  0x0008=web-based-prov
+  0x0010=reinit-list
+  0x0080=xml
+end
+
+flagslist=QUERYTABLESETTINGS-HTML-FLAGS
+  0x0001=parse-pre
+  0x0002=consecutive-delimiters
+  0x0004=first-row
+  0x0008=xl97-created
+  0x0010=text-dates
+  0x0020=xl2000-refreshed
+end
+
+combilist=QUERYTABLESETTINGS-OLEDB-FLAGS
+  0x0007=uint8,dec,command-type,QUERYTABLESETTINGS-OLEDB-COMMANDTYPE
+  0x0008=alt-connection-string
+  0x0010=no-refresh-cube
+  0x0020=olap-has-locale
+  0x0040=server-num-fmt
+  0x0080=server-fill-color
+  0x0100=server-font-color
+  0x0200=server-font-format
+  0x0400=olap-member-l10n
+end
+
+shortlist=QUERYTABLESETTINGS-OLEDB-COMMANDTYPE,0,none,cube,sql,table,default,list
+
+flagslist=QUERYTABLESETTINGS-ADO-FLAGS
+  0x0100=ado-refreshable
+end
+
+flagslist=QUERYTABLESETTINGS-EXT-FLAGS
+  0x0001=text-query
+  0x0002=table-names
+endif
+
+unitconverter=QUERYTABLESETTINGS-INTERVAL,60,sec
+shortlist=QUERYTABLESETTINGS-HTMLFORMAT,1,none,rtf,all
+
 # REFMODE --------------------------------------------------------------------
 
 shortlist=REFMODE,0,R1C1,A1
@@ -1998,20 +2126,6 @@ multilist=STYLEEXT-BUILTIN
   50=20%-accent6,40%-accent6,60%-accent6,explanatory-text
 end
 
-# SXEXT ----------------------------------------------------------------------
-
-combilist=SXEXT-FLAGS
-  0x0007=uint8,dec,source-type,SXEXT-SOURCETYPE
-  0x0008=odbc-connection
-  0x0010=odbc-sql
-  0x0020=server-pagefields
-  0x0040=webquery
-  0x0080=save-password
-  0x0100=tables-html-only
-end
-
-shortlist=SXEXT-SOURCETYPE,1,odbc,dao,,webquery
-
 # THEME ----------------------------------------------------------------------
 
 constlist=THEME-VERSION
diff --git a/oox/source/dump/xlsbdumper.cxx b/oox/source/dump/xlsbdumper.cxx
index 8f249a909000..79135ca1daeb 100644
--- a/oox/source/dump/xlsbdumper.cxx
+++ b/oox/source/dump/xlsbdumper.cxx
@@ -61,15 +61,10 @@ using ::rtl::OUStringBuffer;
 
 namespace {
 
-const sal_uInt8 OOBIN_STRINGFLAG_FONTS          = 0x01;
-const sal_uInt8 OOBIN_STRINGFLAG_PHONETICS      = 0x02;
+const sal_uInt8 BIFF12_STRINGFLAG_FONTS         = 0x01;
+const sal_uInt8 BIFF12_STRINGFLAG_PHONETICS     = 0x02;
 
-const sal_uInt8 OOBIN_TOK_ARRAY_DOUBLE          = 0;
-const sal_uInt8 OOBIN_TOK_ARRAY_STRING          = 1;
-const sal_uInt8 OOBIN_TOK_ARRAY_BOOL            = 2;
-const sal_uInt8 OOBIN_TOK_ARRAY_ERROR           = 4;
-
-const sal_uInt16 OOBIN_OLEOBJECT_LINKED         = 0x0001;
+const sal_uInt16 BIFF12_OLEOBJECT_LINKED        = 0x0001;
 
 } // namespace
 
@@ -207,7 +202,7 @@ OUString RecordObjectBase::dumpString( const String& rName, bool bRich, bool b32
     writeStringItem( rName( "text" ), aString );
 
     // --- formatting ---
-    if( getFlag( nFlags, OOBIN_STRINGFLAG_FONTS ) )
+    if( getFlag( nFlags, BIFF12_STRINGFLAG_FONTS ) )
     {
         IndentGuard aIndGuard( mxOut );
         FontPortionModelList aPortions;
@@ -216,7 +211,7 @@ OUString RecordObjectBase::dumpString( const String& rName, bool bRich, bool b32
     }
 
     // --- phonetic text ---
-    if( getFlag( nFlags, OOBIN_STRINGFLAG_PHONETICS ) )
+    if( getFlag( nFlags, BIFF12_STRINGFLAG_PHONETICS ) )
     {
         IndentGuard aIndGuard( mxOut );
         dumpString( "phonetic-text" );
@@ -492,7 +487,7 @@ void FormulaObject::constructFmlaObj()
 {
     if( RecordObjectBase::implIsValid() )
     {
-        mxFuncProv.reset( new FunctionProvider( FILTER_OOX, BIFF_UNKNOWN, true ) );
+        mxFuncProv.reset( new FunctionProvider( FILTER_OOXML, BIFF_UNKNOWN, true ) );
 
         Config& rCfg = cfg();
         mxClasses   = rCfg.getNameList( "TOKENCLASSES" );
@@ -570,7 +565,7 @@ OUString FormulaObject::writeFuncIdItem( sal_uInt16 nFuncId, const FunctionInfo*
     ItemGuard aItem( mxOut, "func-id" );
     writeHexItem( EMPTY_STRING, nFuncId, "FUNCID" );
     OUStringBuffer aBuffer;
-    const FunctionInfo* pFuncInfo = mxFuncProv->getFuncInfoFromOobFuncId( nFuncId );
+    const FunctionInfo* pFuncInfo = mxFuncProv->getFuncInfoFromBiff12FuncId( nFuncId );
     if( pFuncInfo )
         aBuffer.append( pFuncInfo->maOoxFuncName );
     else
@@ -591,9 +586,9 @@ OUString FormulaObject::writeFuncIdItem( sal_uInt16 nFuncId, const FunctionInfo*
 sal_Int32 FormulaObject::dumpTokenCol( const String& rName, bool& rbRelC, bool& rbRelR )
 {
     sal_uInt16 nCol = dumpHex< sal_uInt16 >( rName, mxRelFlags );
-    rbRelC = getFlag( nCol, OOBIN_TOK_REF_COLREL );
-    rbRelR = getFlag( nCol, OOBIN_TOK_REF_ROWREL );
-    nCol &= OOBIN_TOK_REF_COLMASK;
+    rbRelC = getFlag( nCol, BIFF12_TOK_REF_COLREL );
+    rbRelR = getFlag( nCol, BIFF12_TOK_REF_ROWREL );
+    nCol &= BIFF12_TOK_REF_COLMASK;
     return nCol;
 }
 
@@ -824,17 +819,17 @@ bool FormulaObject::dumpTableToken()
     StringHelper::appendIndex( aColRange, mxOut->getLastItemValue() );
     OUStringBuffer aParams;
     size_t nParams = 0;
-    if( getFlag( nFlags, OOBIN_TOK_TABLE_ALL ) && ++nParams )
+    if( getFlag( nFlags, BIFF12_TOK_TABLE_ALL ) && ++nParams )
         StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#All]" ) );
-    if( getFlag( nFlags, OOBIN_TOK_TABLE_HEADERS ) && ++nParams )
+    if( getFlag( nFlags, BIFF12_TOK_TABLE_HEADERS ) && ++nParams )
         StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#Headers]" ) );
-    if( getFlag( nFlags, OOBIN_TOK_TABLE_DATA ) && ++nParams )
+    if( getFlag( nFlags, BIFF12_TOK_TABLE_DATA ) && ++nParams )
         StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#Data]" ) );
-    if( getFlag( nFlags, OOBIN_TOK_TABLE_TOTALS ) && ++nParams )
+    if( getFlag( nFlags, BIFF12_TOK_TABLE_TOTALS ) && ++nParams )
         StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#Totals]" ) );
-    if( getFlag( nFlags, OOBIN_TOK_TABLE_THISROW ) && ++nParams )
+    if( getFlag( nFlags, BIFF12_TOK_TABLE_THISROW ) && ++nParams )
         StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#This Row]" ) );
-    if( (getFlag( nFlags, OOBIN_TOK_TABLE_COLUMN ) || getFlag( nFlags, OOBIN_TOK_TABLE_COLRANGE )) && ++nParams )
+    if( (getFlag( nFlags, BIFF12_TOK_TABLE_COLUMN ) || getFlag( nFlags, BIFF12_TOK_TABLE_COLRANGE )) && ++nParams )
         StringHelper::appendToken( aParams, aColRange.makeStringAndClear() );
     OUStringBuffer aOp;
     StringHelper::appendIndexedText( aOp, CREATE_OUSTRING( "TABLE" ), nTabId );
@@ -852,13 +847,13 @@ bool FormulaObject::dumpAttrToken()
     sal_uInt8 nType = dumpHex< sal_uInt8 >( "type", mxAttrTypes );
     switch( nType )
     {
-        case OOBIN_TOK_ATTR_VOLATILE:
+        case BIFF_TOK_ATTR_VOLATILE:
             dumpUnused( 2 );
         break;
-        case OOBIN_TOK_ATTR_IF:
+        case BIFF_TOK_ATTR_IF:
             dumpDec< sal_uInt16 >( "skip" );
         break;
-        case OOBIN_TOK_ATTR_CHOOSE:
+        case BIFF_TOK_ATTR_CHOOSE:
         {
             sal_uInt16 nCount = dumpDec< sal_uInt16 >( "choices" );
             mxOut->resetItemIndex();
@@ -867,22 +862,22 @@ bool FormulaObject::dumpAttrToken()
             dumpDec< sal_uInt16 >( "skip-err" );
         }
         break;
-        case OOBIN_TOK_ATTR_SKIP:
+        case BIFF_TOK_ATTR_SKIP:
             dumpDec< sal_uInt16 >( "skip" );
         break;
-        case OOBIN_TOK_ATTR_SUM:
+        case BIFF_TOK_ATTR_SUM:
             dumpUnused( 2 );
             mxStack->pushFuncOp( CREATE_OUSTRING( "SUM" ), OUString( OOX_DUMP_BASECLASS ), 1 );
         break;
-        case OOBIN_TOK_ATTR_ASSIGN:
+        case BIFF_TOK_ATTR_ASSIGN:
             dumpUnused( 2 );
         break;
-        case OOBIN_TOK_ATTR_SPACE:
-        case OOBIN_TOK_ATTR_SPACE | BIFF_TOK_ATTR_VOLATILE:
+        case BIFF_TOK_ATTR_SPACE:
+        case BIFF_TOK_ATTR_SPACE | BIFF_TOK_ATTR_VOLATILE:
             dumpDec< sal_uInt8 >( "char-type", mxSpTypes );
             dumpDec< sal_uInt8 >( "char-count" );
         break;
-        case OOBIN_TOK_ATTR_IFERROR:
+        case BIFF_TOK_ATTR_IFERROR:
             dumpDec< sal_uInt16 >( "skip" );
         break;
         default:
@@ -970,19 +965,19 @@ OUString FormulaObject::dumpaddDataArrayValue()
     OUStringBuffer aValue;
     switch( dumpDec< sal_uInt8 >( "type", "ARRAYVALUE-TYPE" ) )
     {
-        case OOBIN_TOK_ARRAY_DOUBLE:
+        case BIFF_TOK_ARRAY_DOUBLE:
             dumpDec< double >( "value" );
             aValue.append( mxOut->getLastItemValue() );
         break;
-        case OOBIN_TOK_ARRAY_STRING:
+        case BIFF_TOK_ARRAY_STRING:
             aValue.append( dumpString( "value", false, false ) );
             StringHelper::enclose( aValue, OOX_DUMP_STRQUOTE );
         break;
-        case OOBIN_TOK_ARRAY_BOOL:
+        case BIFF_TOK_ARRAY_BOOL:
             dumpBoolean( "value" );
             aValue.append( mxOut->getLastItemValue() );
         break;
-        case OOBIN_TOK_ARRAY_ERROR:
+        case BIFF_TOK_ARRAY_ERROR:
             dumpErrorCode( "value" );
             aValue.append( mxOut->getLastItemValue() );
             dumpUnused( 3 );
@@ -1009,18 +1004,18 @@ void RecordStreamObject::implDumpRecordBody()
 {
     switch( getRecId() )
     {
-        case OOBIN_ID_ARRAY:
+        case BIFF12_ID_ARRAY:
             dumpRange( "array-range" );
             dumpHex< sal_uInt8 >( "flags", "ARRAY-FLAGS" );
             mxFmlaObj->dumpCellFormula();
         break;
 
-        case OOBIN_ID_BINARYINDEXBLOCK:
+        case BIFF12_ID_BINARYINDEXBLOCK:
             dumpRowRange( "row-range" );
             dumpUnknown( 12 );
         break;
 
-        case OOBIN_ID_BINARYINDEXROWS:
+        case BIFF12_ID_BINARYINDEXROWS:
         {
             sal_uInt32 nUsedRows = dumpBin< sal_uInt32 >( "used-rows" );
             dumpDec< sal_Int64 >( "stream-offset" );
@@ -1030,7 +1025,7 @@ void RecordStreamObject::implDumpRecordBody()
         }
         break;
 
-        case OOBIN_ID_BORDER:
+        case BIFF12_ID_BORDER:
             dumpHex< sal_uInt8 >( "flags", "BORDER-FLAGS" );
             dumpDec< sal_uInt16 >( "top-style", "BORDERSTYLES" );
             dumpColor( "top-color" );
@@ -1044,7 +1039,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpColor( "diag-color" );
         break;
 
-        case OOBIN_ID_BRK:
+        case BIFF12_ID_BRK:
             dumpDec< sal_Int32 >( "id" );
             dumpDec< sal_Int32 >( "min" );
             dumpDec< sal_Int32 >( "max" );
@@ -1052,7 +1047,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpDec< sal_Int32 >( "pivot-break", "BOOLEAN" );
         break;
 
-        case OOBIN_ID_CALCPR:
+        case BIFF12_ID_CALCPR:
             dumpDec< sal_Int32 >( "calc-id" );
             dumpDec< sal_Int32 >( "calc-mode", "CALCPR-CALCMODE" );
             dumpDec< sal_Int32 >( "iteration-count" );
@@ -1061,46 +1056,46 @@ void RecordStreamObject::implDumpRecordBody()
             dumpHex< sal_uInt16 >( "flags", "CALCPR-FLAGS" );
         break;
 
-        case OOBIN_ID_CELL_BLANK:
+        case BIFF12_ID_CELL_BLANK:
             dumpCellHeader( true );
         break;
 
-        case OOBIN_ID_CELL_BOOL:
+        case BIFF12_ID_CELL_BOOL:
             dumpCellHeader( true );
             dumpBoolean();
         break;
 
-        case OOBIN_ID_CELL_DOUBLE:
+        case BIFF12_ID_CELL_DOUBLE:
             dumpCellHeader( true );
             dumpDec< double >( "value" );
         break;
 
-        case OOBIN_ID_CELL_ERROR:
+        case BIFF12_ID_CELL_ERROR:
             dumpCellHeader( true );
             dumpErrorCode();
         break;
 
-        case OOBIN_ID_CELL_RK:
+        case BIFF12_ID_CELL_RK:
             dumpCellHeader( true );
             dumpRk( "value" );
         break;
 
-        case OOBIN_ID_CELL_RSTRING:
+        case BIFF12_ID_CELL_RSTRING:
             dumpCellHeader( true );
             dumpString( "value", true );
         break;
 
-        case OOBIN_ID_CELL_SI:
+        case BIFF12_ID_CELL_SI:
             dumpCellHeader( true );
             dumpDec< sal_Int32 >( "string-id" );
         break;
 
-        case OOBIN_ID_CELL_STRING:
+        case BIFF12_ID_CELL_STRING:
             dumpCellHeader( true );
             dumpString( "value" );
         break;
 
-        case OOBIN_ID_CELLSTYLE:
+        case BIFF12_ID_CELLSTYLE:
             dumpDec< sal_Int32 >( "xf-id" );
             dumpHex< sal_uInt16 >( "flags", "CELLSTYLE-FLAGS" );
             dumpDec< sal_uInt8 >( "builtin-id", "CELLSTYLE-BUILTIN" );
@@ -1108,11 +1103,11 @@ void RecordStreamObject::implDumpRecordBody()
             dumpString( "name" );
         break;
 
-        case OOBIN_ID_CFCOLOR:
+        case BIFF12_ID_CFCOLOR:
             dumpColor();
         break;
 
-        case OOBIN_ID_CFRULE:
+        case BIFF12_ID_CFRULE:
         {
             // type/subtype/operator is a mess...
             dumpDec< sal_Int32 >( "type", "CFRULE-TYPE" );
@@ -1156,7 +1151,7 @@ void RecordStreamObject::implDumpRecordBody()
         }
         break;
 
-        case OOBIN_ID_CHARTPAGESETUP:
+        case BIFF12_ID_CHARTPAGESETUP:
             dumpDec< sal_Int32 >( "paper-size", "PAGESETUP-PAPERSIZE" );
             dumpDec< sal_Int32 >( "horizontal-res", "PAGESETUP-DPI" );
             dumpDec< sal_Int32 >( "vertical-res", "PAGESETUP-DPI" );
@@ -1166,75 +1161,96 @@ void RecordStreamObject::implDumpRecordBody()
             dumpString( "printer-settings-rel-id" );
         break;
 
-        case OOBIN_ID_CHARTPROTECTION:
+        case BIFF12_ID_CHARTPROTECTION:
             dumpHex< sal_uInt16 >( "password-hash" );
             // no flags field for the boolean flags?!?
             dumpDec< sal_Int32 >( "content-locked", "BOOLEAN" );
             dumpDec< sal_Int32 >( "objects-locked", "BOOLEAN" );
         break;
 
-        case OOBIN_ID_CHARTSHEETPR:
+        case BIFF12_ID_CHARTSHEETPR:
             dumpHex< sal_uInt16 >( "flags", "CHARTSHEETPR-FLAGS" );
             dumpColor( "tab-color" );
             dumpString( "codename" );
         break;
 
-        case OOBIN_ID_CHARTSHEETVIEW:
+        case BIFF12_ID_CHARTSHEETVIEW:
             dumpHex< sal_uInt16 >( "flags", "CHARTSHEETVIEW-FLAGS" );
             dumpDec< sal_Int32 >( "zoom-scale", "CONV-PERCENT" );
             dumpDec< sal_Int32 >( "workbookview-id" );
         break;
 
-        case OOBIN_ID_COL:
+        case BIFF12_ID_COL:
             dumpColRange();
             dumpDec< sal_Int32 >( "col-width", "CONV-COLWIDTH" );
             dumpDec< sal_Int32 >( "custom-xf-id" );
             dumpHex< sal_uInt16 >( "flags", "COL-FLAGS" );
         break;
 
-        case OOBIN_ID_COLBREAKS:
+        case BIFF12_ID_COLBREAKS:
             dumpDec< sal_Int32 >( "count" );
             dumpDec< sal_Int32 >( "manual-count" );
         break;
 
-        case OOBIN_ID_COLOR:
+        case BIFF12_ID_COLOR:
             dumpColor();
         break;
 
-        case OOBIN_ID_COMMENT:
+        case BIFF12_ID_COMMENT:
             dumpDec< sal_Int32 >( "author-id" );
             dumpRange( "ref" );
             dumpGuid();
         break;
 
-        case OOBIN_ID_COMMENTAUTHOR:
+        case BIFF12_ID_COMMENTAUTHOR:
             dumpString( "author" );
         break;
 
-        case OOBIN_ID_COMMENTTEXT:
+        case BIFF12_ID_COMMENTTEXT:
             dumpString( "text", true );
         break;
 
-        case OOBIN_ID_CONDFORMATTING:
+        case BIFF12_ID_CONDFORMATTING:
             dumpDec< sal_Int32 >( "cfrule-count" );
             dumpDec< sal_Int32 >( "pivot-table", "BOOLEAN" );
             dumpRangeList();
         break;
 
-        case OOBIN_ID_CONTROL:
+        case BIFF12_ID_CONNECTION:
+        {
+            dumpDec< sal_uInt8 >( "refreshed-version" );
+            dumpDec< sal_uInt8 >( "min-refresh-version" );
+            dumpDec< sal_uInt8 >( "save-password", "CONNECTION-SAVEPASSWORD" );
+            dumpUnused( 1 );
+            dumpDec< sal_uInt16 >( "refresh-interval", "CONNECTION-INTERVAL" );
+            dumpHex< sal_uInt16 >( "flags", "CONNECTION-FLAGS" );
+            sal_uInt16 nStrFlags = dumpHex< sal_uInt16 >( "string-flags", "CONNECTION-STRINGFLAGS" );
+            dumpDec< sal_Int32 >( "data-source-type", "CONNECTION-SOURCETYPE" );
+            dumpDec< sal_Int32 >( "reconnect-type", "CONNECTION-RECONNECTTYPE" );
+            dumpDec< sal_Int32 >( "id" );
+            dumpDec< sal_uInt8 >( "credentials", "CONNECTION-CREDENTIALS" );
+            if( nStrFlags & 0x0001 ) dumpString( "source-file" );
+            if( nStrFlags & 0x0002 ) dumpString( "source-conn-file" );
+            if( nStrFlags & 0x0004 ) dumpString( "description" );
+            if( nStrFlags & 0x0008 ) dumpString( "name" );
+            if( nStrFlags & 0x0010 ) dumpString( "sso-id" );
+        }
+        break;
+
+        case BIFF12_ID_CONTROL:
             dumpDec< sal_Int32 >( "shape-id" );
             dumpString( "rel-id" );
             dumpString( "name" );
         break;
 
-        case OOBIN_ID_DATATABLE:
+        case BIFF12_ID_DATATABLE:
             dumpRange( "table-range" );
             dumpAddress( "ref1" );
             dumpAddress( "ref2" );
             dumpHex< sal_uInt8 >( "flags", "DATATABLE-FLAGS" );
         break;
 
-        case OOBIN_ID_DATAVALIDATION:
+        case BIFF12_ID_DATAVALIDATION:
             dumpHex< sal_uInt32 >( "flags", "DATAVALIDATION-FLAGS" );
             dumpRangeList();
             dumpString( "error-title" );
@@ -1245,7 +1261,7 @@ void RecordStreamObject::implDumpRecordBody()
             mxFmlaObj->dumpNameFormula( "formula2" );
         break;
 
-        case OOBIN_ID_DATAVALIDATIONS:
+        case BIFF12_ID_DATAVALIDATIONS:
             dumpHex< sal_uInt16 >( "flags", "DATAVALIDATIONS-FLAGS" );
             dumpDec< sal_Int32 >( "input-x" );
             dumpDec< sal_Int32 >( "input-y" );
@@ -1253,16 +1269,16 @@ void RecordStreamObject::implDumpRecordBody()
             dumpDec< sal_Int32 >( "count" );
         break;
 
-        case OOBIN_ID_DDEITEMVALUES:
+        case BIFF12_ID_DDEITEMVALUES:
             dumpDec< sal_Int32 >( "rows" );
             dumpDec< sal_Int32 >( "columns" );
         break;
 
-        case OOBIN_ID_DDEITEM_STRING:
+        case BIFF12_ID_DDEITEM_STRING:
             dumpString( "value" );
         break;
 
-        case OOBIN_ID_DEFINEDNAME:
+        case BIFF12_ID_DEFINEDNAME:
             dumpHex< sal_uInt32 >( "flags", "DEFINEDNAME-FLAGS" );
             dumpChar( "accelerator", RTL_TEXTENCODING_ISO_8859_1 );
             dumpDec< sal_Int32 >( "sheet-id", "DEFINEDNAME-SHEETID" );
@@ -1275,15 +1291,15 @@ void RecordStreamObject::implDumpRecordBody()
             if( mxStrm->getRemaining() >= 4 ) dumpString( "statusbar-text" );
         break;
 
-        case OOBIN_ID_DIMENSION:
+        case BIFF12_ID_DIMENSION:
             dumpRange( "used-range" );
         break;
 
-        case OOBIN_ID_DRAWING:
+        case BIFF12_ID_DRAWING:
             dumpString( "rel-id" );
         break;
 
-        case OOBIN_ID_DXF:
+        case BIFF12_ID_DXF:
             dumpHex< sal_uInt32 >( "flags", "DXF-FLAGS" );
             for( sal_uInt16 nIndex = 0, nCount = dumpDec< sal_uInt16 >( "subrec-count" ); !mxStrm->isEof() && (nIndex < nCount); ++nIndex )
             {
@@ -1380,27 +1396,27 @@ void RecordStreamObject::implDumpRecordBody()
             }
         break;
 
-        case OOBIN_ID_EXTCELL_BOOL:
+        case BIFF12_ID_EXTCELL_BOOL:
             dumpColIndex();
             dumpBoolean();
         break;
 
-        case OOBIN_ID_EXTCELL_DOUBLE:
+        case BIFF12_ID_EXTCELL_DOUBLE:
             dumpColIndex();
             dumpDec< double >( "value" );
         break;
 
-        case OOBIN_ID_EXTCELL_ERROR:
+        case BIFF12_ID_EXTCELL_ERROR:
             dumpColIndex();
             dumpErrorCode();
         break;
 
-        case OOBIN_ID_EXTCELL_STRING:
+        case BIFF12_ID_EXTCELL_STRING:
             dumpColIndex();
             dumpString( "value" );
         break;
 
-        case OOBIN_ID_EXTERNALBOOK:
+        case BIFF12_ID_EXTERNALBOOK:
             switch( dumpDec< sal_uInt16 >( "type", "EXTERNALBOOK-TYPE" ) )
             {
                 case 0:
@@ -1418,21 +1434,21 @@ void RecordStreamObject::implDumpRecordBody()
             }
         break;
 
-        case OOBIN_ID_EXTERNALNAME:
+        case BIFF12_ID_EXTERNALNAME:
             dumpString( "name" );
         break;
 
-        case OOBIN_ID_EXTERNALNAMEFLAGS:
+        case BIFF12_ID_EXTERNALNAMEFLAGS:
             dumpHex< sal_uInt16 >( "flags", "EXTERNALNAMEFLAGS-FLAGS" );
             dumpDec< sal_Int32 >( "sheet-id" );
             dumpBoolean( "is-dde-ole" );
         break;
 
-        case OOBIN_ID_EXTERNALREF:
+        case BIFF12_ID_EXTERNALREF:
             dumpString( "rel-id" );
         break;
 
-        case OOBIN_ID_EXTERNALSHEETS:
+        case BIFF12_ID_EXTERNALSHEETS:
         {
             sal_Int32 nCount = dumpDec< sal_Int32 >( "ref-count" );
             TableGuard aTabGuard( mxOut, 13, 17, 24 );
@@ -1448,28 +1464,28 @@ void RecordStreamObject::implDumpRecordBody()
         }
         break;
 
-        case OOBIN_ID_EXTROW:
+        case BIFF12_ID_EXTROW:
             dumpRowIndex();
         break;
 
-        case OOBIN_ID_EXTSHEETDATA:
+        case BIFF12_ID_EXTSHEETDATA:
             dumpDec< sal_Int32 >( "sheet-id" );
             dumpHex< sal_uInt8 >( "flags", "EXTSHEETDATA-FLAGS" );
         break;
 
-        case OOBIN_ID_EXTSHEETNAMES:
+        case BIFF12_ID_EXTSHEETNAMES:
             mxOut->resetItemIndex();
             for( sal_Int32 nSheet = 0, nCount = dumpDec< sal_Int32 >( "sheet-count" ); !mxStrm->isEof() && (nSheet < nCount); ++nSheet )
                 dumpString( "#sheet-name" );
         break;
 
-        case OOBIN_ID_FILESHARING:
+        case BIFF12_ID_FILESHARING:
             dumpBool< sal_uInt16 >( "recommend-read-only" );
             dumpHex< sal_uInt16 >( "password-hash" );
             dumpString( "password-creator" );
         break;
 
-        case OOBIN_ID_FILL:
+        case BIFF12_ID_FILL:
             dumpDec< sal_Int32 >( "fill-pattern", "FILLPATTERNS" );
             dumpColor( "fg-color" );
             dumpColor( "bg-color" );
@@ -1484,7 +1500,7 @@ void RecordStreamObject::implDumpRecordBody()
             }
         break;
 
-        case OOBIN_ID_FILEVERSION:
+        case BIFF12_ID_FILEVERSION:
             dumpGuid( "codename" );
             dumpString( "app-name" );
             dumpString( "last-edited" );
@@ -1492,7 +1508,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpString( "build-version" );
         break;
 
-        case OOBIN_ID_FONT:
+        case BIFF12_ID_FONT:
             dumpDec< sal_uInt16 >( "height", "CONV-TWIP-TO-PT" );
             dumpHex< sal_uInt16 >( "flags", "FONT-FLAGS" );
             dumpDec< sal_uInt16 >( "weight", "FONT-WEIGHT" );
@@ -1506,39 +1522,39 @@ void RecordStreamObject::implDumpRecordBody()
             dumpString( "name" );
         break;
 
-        case OOBIN_ID_FORMULA_BOOL:
+        case BIFF12_ID_FORMULA_BOOL:
             dumpCellHeader( true );
             dumpBoolean();
             dumpHex< sal_uInt16 >( "flags", "FORMULA-FLAGS" );
             mxFmlaObj->dumpCellFormula();
         break;
 
-        case OOBIN_ID_FORMULA_DOUBLE:
+        case BIFF12_ID_FORMULA_DOUBLE:
             dumpCellHeader( true );
             dumpDec< double >( "value" );
             dumpHex< sal_uInt16 >( "flags", "FORMULA-FLAGS" );
             mxFmlaObj->dumpCellFormula();
         break;
 
-        case OOBIN_ID_FORMULA_ERROR:
+        case BIFF12_ID_FORMULA_ERROR:
             dumpCellHeader( true );
             dumpErrorCode();
             dumpHex< sal_uInt16 >( "flags", "FORMULA-FLAGS" );
             mxFmlaObj->dumpCellFormula();
         break;
 
-        case OOBIN_ID_FORMULA_STRING:
+        case BIFF12_ID_FORMULA_STRING:
             dumpCellHeader( true );
             dumpString( "value" );
             dumpHex< sal_uInt16 >( "flags", "FORMULA-FLAGS" );
             mxFmlaObj->dumpCellFormula();
         break;
 
-        case OOBIN_ID_FUNCTIONGROUP:
+        case BIFF12_ID_FUNCTIONGROUP:
             dumpString( "name" );
         break;
 
-        case OOBIN_ID_HEADERFOOTER:
+        case BIFF12_ID_HEADERFOOTER:
             dumpHex< sal_uInt16 >( "flags", "HEADERFOOTER-FLAGS" );
             dumpString( "odd-header" );
             dumpString( "odd-footer" );
@@ -1548,7 +1564,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpString( "first-footer" );
         break;
 
-        case OOBIN_ID_HYPERLINK:
+        case BIFF12_ID_HYPERLINK:
             dumpRange();
             dumpString( "rel-id" );
             dumpString( "location" );
@@ -1556,84 +1572,84 @@ void RecordStreamObject::implDumpRecordBody()
             dumpString( "display" );
         break;
 
-        case OOBIN_ID_INPUTCELLS:
+        case BIFF12_ID_INPUTCELLS:
             dumpAddress( "pos" );
             dumpUnused( 8 );
             dumpDec< sal_uInt16 >( "numfmt-id" );
             dumpString( "value" );
         break;
 
-        case OOBIN_ID_LEGACYDRAWING:
+        case BIFF12_ID_LEGACYDRAWING:
             dumpString( "rel-id" );
         break;
 
-        case OOBIN_ID_MERGECELL:
+        case BIFF12_ID_MERGECELL:
             dumpRange();
         break;
 
-        case OOBIN_ID_MULTCELL_BLANK:
+        case BIFF12_ID_MULTCELL_BLANK:
             dumpCellHeader( false );
         break;
 
-        case OOBIN_ID_MULTCELL_BOOL:
+        case BIFF12_ID_MULTCELL_BOOL:
             dumpCellHeader( false );
             dumpBoolean();
         break;
 
-        case OOBIN_ID_MULTCELL_DOUBLE:
+        case BIFF12_ID_MULTCELL_DOUBLE:
             dumpCellHeader( false );
             dumpDec< double >( "value" );
         break;
 
-        case OOBIN_ID_MULTCELL_ERROR:
+        case BIFF12_ID_MULTCELL_ERROR:
             dumpCellHeader( false );
             dumpErrorCode();
         break;
 
-        case OOBIN_ID_MULTCELL_RK:
+        case BIFF12_ID_MULTCELL_RK:
             dumpCellHeader( false );
             dumpRk( "value" );
         break;
 
-        case OOBIN_ID_MULTCELL_RSTRING:
+        case BIFF12_ID_MULTCELL_RSTRING:
             dumpCellHeader( false );
             dumpString( "value", true );
         break;
 
-        case OOBIN_ID_MULTCELL_SI:
+        case BIFF12_ID_MULTCELL_SI:
             dumpCellHeader( false );
             dumpDec< sal_Int32 >( "string-id" );
         break;
 
-        case OOBIN_ID_MULTCELL_STRING:
+        case BIFF12_ID_MULTCELL_STRING:
             dumpCellHeader( false );
             dumpString( "value" );
         break;
 
-        case OOBIN_ID_NUMFMT:
+        case BIFF12_ID_NUMFMT:
             dumpDec< sal_uInt16 >( "numfmt-id" );
             dumpString( "format" );
         break;
 
-        case OOBIN_ID_OLEOBJECT:
+        case BIFF12_ID_OLEOBJECT:
         {
             dumpDec< sal_Int32 >( "aspect", "OLEOBJECT-ASPECT" );
             dumpDec< sal_Int32 >( "update", "OLEOBJECT-UPDATE" );
             dumpDec< sal_Int32 >( "shape-id" );
             sal_uInt16 nFlags = dumpHex< sal_uInt16 >( "flags", "OLEOBJECT-FLAGS" );
             dumpString( "prog-id" );
-            if( getFlag( nFlags, OOBIN_OLEOBJECT_LINKED ) )
+            if( getFlag( nFlags, BIFF12_OLEOBJECT_LINKED ) )
                 mxFmlaObj->dumpNameFormula( "link" );
             else
                 dumpString( "rel-id" );
         }
         break;
 
-        case OOBIN_ID_OLESIZE:
+        case BIFF12_ID_OLESIZE:
             dumpRange( "visible-range" );
         break;
 
-        case OOBIN_ID_PAGEMARGINS:
+        case BIFF12_ID_PAGEMARGINS:
             dumpDec< double >( "left-margin" );
             dumpDec< double >( "right-margin" );
             dumpDec< double >( "top-margin" );
@@ -1642,7 +1658,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpDec< double >( "footer-margin" );
         break;
 
-        case OOBIN_ID_PAGESETUP:
+        case BIFF12_ID_PAGESETUP:
             dumpDec< sal_Int32 >( "paper-size", "PAGESETUP-PAPERSIZE" );
             dumpDec< sal_Int32 >( "scaling", "CONV-PERCENT" );
             dumpDec< sal_Int32 >( "horizontal-res", "PAGESETUP-DPI" );
@@ -1655,7 +1671,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpString( "printer-settings-rel-id" );
         break;
 
-        case OOBIN_ID_PANE:
+        case BIFF12_ID_PANE:
             dumpDec< double >( "x-split-pos" );
             dumpDec< double >( "y-split-pos" );
             dumpAddress( "second-top-left" );
@@ -1663,7 +1679,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpHex< sal_uInt8 >( "flags", "PANE-FLAGS" );
         break;
 
-        case OOBIN_ID_PCDEFINITION:
+        case BIFF12_ID_PCDEFINITION:
         {
             dumpDec< sal_uInt8 >( "refreshed-version" );
             dumpDec< sal_uInt8 >( "min-refresh-version" );
@@ -1678,7 +1694,7 @@ void RecordStreamObject::implDumpRecordBody()
         }
         break;
 
-        case OOBIN_ID_PCDFIELD:
+        case BIFF12_ID_PCDFIELD:
         {
             sal_uInt16 nFlags = dumpHex< sal_uInt16 >( "flags", "PCDFIELD-FLAGS" );
             dumpDec< sal_Int32 >( "numfmt-id" );
@@ -1698,12 +1714,12 @@ void RecordStreamObject::implDumpRecordBody()
         }
         break;
 
-        case OOBIN_ID_PCDFIELDGROUP:
+        case BIFF12_ID_PCDFIELDGROUP:
             dumpDec< sal_Int32 >( "parent-field" );
             dumpDec< sal_Int32 >( "base-field" );
         break;
 
-        case OOBIN_ID_PCDFRANGEPR:
+        case BIFF12_ID_PCDFRANGEPR:
             dumpDec< sal_uInt8 >( "group-by", "PCDFRANGEPR-GROUPBY" );
             dumpHex< sal_uInt8 >( "flags", "PCDFRANGEPR-FLAGS" );
             dumpDec< double >( "start-value" );
@@ -1711,7 +1727,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpDec< double >( "interval" );
         break;
 
-        case OOBIN_ID_PCDFSHAREDITEMS:
+        case BIFF12_ID_PCDFSHAREDITEMS:
         {
             sal_uInt16 nFlags = dumpHex< sal_uInt16 >( "flags", "PCDFSHAREDITEMS-FLAGS" );
             dumpDec< sal_Int32 >( "count" );
@@ -1720,7 +1736,7 @@ void RecordStreamObject::implDumpRecordBody()
         }
         break;
 
-        case OOBIN_ID_PCDSHEETSOURCE:
+        case BIFF12_ID_PCDSHEETSOURCE:
         {
             sal_uInt8 nIsDefName = dumpBoolean( "is-def-name" );
             dumpBoolean( "is-builtin-def-name" );
@@ -1731,12 +1747,12 @@ void RecordStreamObject::implDumpRecordBody()
         }
         break;
 
-        case OOBIN_ID_PCDSOURCE:
+        case BIFF12_ID_PCDSOURCE:
             dumpDec< sal_Int32 >( "source-type", "PCDSOURCE-TYPE" );
             dumpDec< sal_Int32 >( "connection-id" );
         break;
 
-        case OOBIN_ID_PCITEM_ARRAY:
+        case BIFF12_ID_PCITEM_ARRAY:
         {
             sal_uInt16 nType = dumpDec< sal_uInt16 >( "type", "PCITEM_ARRAY-TYPE" );
             sal_Int32 nCount = dumpDec< sal_Int32 >( "count" );
@@ -1755,97 +1771,97 @@ void RecordStreamObject::implDumpRecordBody()
         }
         break;
 
-        case OOBIN_ID_PCITEM_BOOL:
+        case BIFF12_ID_PCITEM_BOOL:
             dumpBoolean( "value" );
         break;
 
-        case OOBIN_ID_PCITEM_DATE:
+        case BIFF12_ID_PCITEM_DATE:
             dumpPivotDateTime( "value" );
         break;
 
-        case OOBIN_ID_PCITEM_DOUBLE:
+        case BIFF12_ID_PCITEM_DOUBLE:
             dumpDec< double >( "value" );
             // TODO: server formatting
         break;
 
-        case OOBIN_ID_PCITEM_ERROR:
+        case BIFF12_ID_PCITEM_ERROR:
             dumpErrorCode( "value" );
             // TODO: server formatting
         break;
 
-        case OOBIN_ID_PCITEM_INDEX:
+        case BIFF12_ID_PCITEM_INDEX:
             dumpDec< sal_Int32 >( "index" );
         break;
 
-        case OOBIN_ID_PCITEM_MISSING:
+        case BIFF12_ID_PCITEM_MISSING:
             // TODO: server formatting
         break;
 
 
-        case OOBIN_ID_PCITEM_STRING:
+        case BIFF12_ID_PCITEM_STRING:
             dumpString( "value" );
             // TODO: server formatting
         break;
 
-        case OOBIN_ID_PCITEMA_BOOL:
+        case BIFF12_ID_PCITEMA_BOOL:
             dumpBoolean( "value" );
             // TODO: additional info
         break;
 
-        case OOBIN_ID_PCITEMA_DATE:
+        case BIFF12_ID_PCITEMA_DATE:
             dumpPivotDateTime( "value" );
             // TODO: additional info
         break;
 
-        case OOBIN_ID_PCITEMA_DOUBLE:
+        case BIFF12_ID_PCITEMA_DOUBLE:
             dumpDec< double >( "value" );
             // TODO: additional info
         break;
 
-        case OOBIN_ID_PCITEMA_ERROR:
+        case BIFF12_ID_PCITEMA_ERROR:
             dumpErrorCode( "value" );
             // TODO: additional info
         break;
 
-        case OOBIN_ID_PCITEMA_MISSING:
+        case BIFF12_ID_PCITEMA_MISSING:
             // TODO: additional info
         break;
 
-        case OOBIN_ID_PCITEMA_STRING:
+        case BIFF12_ID_PCITEMA_STRING:
             dumpString( "value" );
             // TODO: additional info
         break;
 
-        case OOBIN_ID_PHONETICPR:
+        case BIFF12_ID_PHONETICPR:
             dumpDec< sal_uInt16 >( "font-id", "FONTNAMES" );
             dumpDec< sal_Int32 >( "type", "PHONETICPR-TYPE" );
             dumpDec< sal_Int32 >( "alignment", "PHONETICPR-ALIGNMENT" );
         break;
 
-        case OOBIN_ID_PICTURE:
+        case BIFF12_ID_PICTURE:
             dumpString( "rel-id" );
         break;
 
-        case OOBIN_ID_PIVOTAREA:
+        case BIFF12_ID_PIVOTAREA:
             dumpDec< sal_Int32 >( "field" );
             dumpDec< sal_uInt8 >( "type", "PIVOTAREA-TYPE" );
             dumpHex< sal_uInt8 >( "flags-1", "PIVOTAREA-FLAGS1" );
             dumpHex< sal_uInt16 >( "flags-2", "PIVOTAREA-FLAGS2" );
         break;
 
-        case OOBIN_ID_PIVOTCACHE:
+        case BIFF12_ID_PIVOTCACHE:
             dumpDec< sal_Int32 >( "cache-id" );
             dumpString( "rel-id" );
         break;
 
-        case OOBIN_ID_PTCOLFIELDS:
+        case BIFF12_ID_PTCOLFIELDS:
             dumpDec< sal_Int32 >( "count" );
             mxOut->resetItemIndex();
             while( mxStrm->getRemaining() >= 4 )
                 dumpDec< sal_Int32 >( "#field", "PT-FIELDINDEX" );
         break;
 
-        case OOBIN_ID_PTDATAFIELD:
+        case BIFF12_ID_PTDATAFIELD:
             dumpDec< sal_Int32 >( "field" );
             dumpDec< sal_Int32 >( "subtotal", "PTDATAFIELD-SUBTOTAL" );
             dumpDec< sal_Int32 >( "show-data-as", "PTDATAFIELD-SHOWDATAAS" );
@@ -1856,7 +1872,7 @@ void RecordStreamObject::implDumpRecordBody()
                 dumpString( "name" );
         break;
 
-        case OOBIN_ID_PTDEFINITION:
+        case BIFF12_ID_PTDEFINITION:
         {
             dumpDec< sal_uInt8 >( "created-version" );
             dumpHex< sal_uInt8 >( "flags-1", "PTDEFINITION-FLAGS1" );
@@ -1886,7 +1902,7 @@ void RecordStreamObject::implDumpRecordBody()
         }
         break;
 
-        case OOBIN_ID_PTFIELD:
+        case BIFF12_ID_PTFIELD:
             dumpHex< sal_uInt32 >( "flags-1", "PTFIELD-FLAGS1" );
             dumpDec< sal_Int32 >( "num-fmt" );
             dumpHex< sal_uInt32 >( "flags-2", "PTFIELD-FLAGS2" );
@@ -1894,7 +1910,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpDec< sal_Int32 >( "autoshow-datafield-idx" );
         break;
 
-        case OOBIN_ID_PTFILTER:
+        case BIFF12_ID_PTFILTER:
         {
             dumpDec< sal_Int32 >( "field" );
             dumpDec< sal_Int32 >( "member-prop-field" );
@@ -1911,7 +1927,7 @@ void RecordStreamObject::implDumpRecordBody()
         }
         break;
 
-        case OOBIN_ID_PTFITEM:
+        case BIFF12_ID_PTFITEM:
         {
             dumpDec< sal_uInt8 >( "type", "PTFITEM-TYPE" );
             sal_uInt16 nFlags = dumpHex< sal_uInt16 >( "flags", "PTFITEM-FLAGS" );
@@ -1920,7 +1936,7 @@ void RecordStreamObject::implDumpRecordBody()
         }
         break;
 
-        case OOBIN_ID_PTLOCATION:
+        case BIFF12_ID_PTLOCATION:
             dumpRange( "location" );
             dumpDec< sal_Int32 >( "first-header-row" );
             dumpDec< sal_Int32 >( "first-data-row" );
@@ -1929,7 +1945,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpDec< sal_Int32 >( "page-col-count" );
         break;
 
-        case OOBIN_ID_PTPAGEFIELD:
+        case BIFF12_ID_PTPAGEFIELD:
         {
             dumpDec< sal_Int32 >( "field" );
             dumpDec< sal_Int32 >( "cache-item", "PTPAGEFIELD-ITEM" );
@@ -1940,21 +1956,28 @@ void RecordStreamObject::implDumpRecordBody()
         }
         break;
 
-        case OOBIN_ID_PTREFERENCE:
+        case BIFF12_ID_PTREFERENCE:
             dumpDec< sal_Int32 >( "field", "PT-FIELDINDEX" );
             dumpDec< sal_Int32 >( "item-count" );
             dumpHex< sal_uInt16 >( "flags-1", "PTREFERENCE-FLAGS1" );
             dumpHex< sal_uInt8 >( "flags-2", "PTREFERENCE-FLAGS2" );
         break;
 
-        case OOBIN_ID_PTROWFIELDS:
+        case BIFF12_ID_PTROWFIELDS:
             dumpDec< sal_Int32 >( "count" );
             mxOut->resetItemIndex();
             while( mxStrm->getRemaining() >= 4 )
                 dumpDec< sal_Int32 >( "#field", "PT-FIELDINDEX" );
         break;
 
-        case OOBIN_ID_ROW:
+        case BIFF12_ID_QUERYTABLE:
+            dumpHex< sal_uInt32 >( "flags", "QUERYTABLE-FLAGS" );
+            dumpDec< sal_uInt16 >( "autoformat-id" );
+            dumpDec< sal_Int32 >( "connection-id" );
+            dumpString( "defined-name" );
+        break;
+
+        case BIFF12_ID_ROW:
             dumpRowIndex();
             dumpDec< sal_Int32 >( "custom-xf-id" );
             dumpDec< sal_uInt16 >( "height", "CONV-TWIP-TO-PT" );
@@ -1965,12 +1988,12 @@ void RecordStreamObject::implDumpRecordBody()
                 dumpRowRange( "#row-spans" );
         break;
 
-        case OOBIN_ID_ROWBREAKS:
+        case BIFF12_ID_ROWBREAKS:
             dumpDec< sal_Int32 >( "count" );
             dumpDec< sal_Int32 >( "manual-count" );
         break;
 
-        case OOBIN_ID_SCENARIO:
+        case BIFF12_ID_SCENARIO:
             dumpDec< sal_uInt16 >( "cell-count" );
             // two longs instead of flag field
             dumpDec< sal_Int32 >( "locked", "BOOLEAN" );
@@ -1980,32 +2003,32 @@ void RecordStreamObject::implDumpRecordBody()
             dumpString( "user" );
         break;
 
-        case OOBIN_ID_SCENARIOS:
+        case BIFF12_ID_SCENARIOS:
             dumpDec< sal_uInt16 >( "selected" );
             dumpDec< sal_uInt16 >( "shown" );
             dumpRangeList( "result-cells" );
         break;
 
-        case OOBIN_ID_SELECTION:
+        case BIFF12_ID_SELECTION:
             dumpDec< sal_Int32 >( "pane", "PANE-ID" );
             dumpAddress( "active-cell" );
             dumpDec< sal_Int32 >( "active-cell-id" );
             dumpRangeList( "selection" );
         break;
 
-        case OOBIN_ID_SHAREDFMLA:
+        case BIFF12_ID_SHAREDFMLA:
             dumpRange( "formula-range" );
             mxFmlaObj->dumpCellFormula();
         break;
 
-        case OOBIN_ID_SHEET:
+        case BIFF12_ID_SHEET:
             dumpDec< sal_Int32 >( "sheet-state", "SHEET-STATE" );
             dumpDec< sal_Int32 >( "sheet-id" );
             dumpString( "rel-id" );
             dumpString( "sheet-name" );
         break;
 
-        case OOBIN_ID_SHEETFORMATPR:
+        case BIFF12_ID_SHEETFORMATPR:
             dumpDec< sal_Int32 >( "default-col-width", "CONV-COLWIDTH" );
             dumpDec< sal_uInt16 >( "base-col-width" );
             dumpDec< sal_uInt16 >( "default-row-height", "CONV-TWIP-TO-PT" );
@@ -2014,7 +2037,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpDec< sal_uInt8 >( "max-col-outline" );
         break;
 
-        case OOBIN_ID_SHEETPR:
+        case BIFF12_ID_SHEETPR:
             dumpHex< sal_uInt16 >( "flags1", "SHEETPR-FLAGS1" );
             dumpHex< sal_uInt8 >( "flags2", "SHEETPR-FLAGS2" );
             dumpColor( "tab-color" );
@@ -2022,7 +2045,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpString( "codename" );
         break;
 
-        case OOBIN_ID_SHEETPROTECTION:
+        case BIFF12_ID_SHEETPROTECTION:
             dumpHex< sal_uInt16 >( "password-hash" );
             // no flags field for all these boolean flags?!?
             dumpDec< sal_Int32 >( "sheet-locked", "BOOLEAN" );
@@ -2043,7 +2066,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpDec< sal_Int32 >( "select-unlocked-cells-locked", "BOOLEAN" );
         break;
 
-        case OOBIN_ID_SHEETVIEW:
+        case BIFF12_ID_SHEETVIEW:
             dumpHex< sal_uInt16 >( "flags", "SHEETVIEW-FLAGS" );
             dumpDec< sal_Int32 >( "view-type", "SHEETVIEW-TYPE" );
             dumpAddress( "top-left" );
@@ -2055,16 +2078,16 @@ void RecordStreamObject::implDumpRecordBody()
             dumpDec< sal_Int32 >( "workbookview-id" );
         break;
 
-        case OOBIN_ID_SI:
+        case BIFF12_ID_SI:
             dumpString( "string", true );
         break;
 
-        case OOBIN_ID_SST:
+        case BIFF12_ID_SST:
             dumpDec< sal_Int32 >( "string-cell-count" );
             dumpDec< sal_Int32 >( "sst-size" );
         break;
 
-        case OOBIN_ID_TABLE:
+        case BIFF12_ID_TABLE:
             dumpRange();
             dumpDec< sal_Int32 >( "type", "TABLE-TYPE" );
             dumpDec< sal_Int32 >( "id" );
@@ -2086,41 +2109,51 @@ void RecordStreamObject::implDumpRecordBody()
             dumpString( "totalsrow-cell-style" );
         break;
 
-        case OOBIN_ID_TABLEPART:
+        case BIFF12_ID_TABLEPART:
             dumpString( "rel-id" );
         break;
 
-        case OOBIN_ID_TABLESTYLEINFO:
+        case BIFF12_ID_TABLESTYLEINFO:
             dumpHex< sal_uInt16 >( "flags", "TABLESTYLEINFO-FLAGS" );
             dumpString( "style-name" );
         break;
 
-        case OOBIN_ID_TOP10FILTER:
+        case BIFF12_ID_TOP10FILTER:
             dumpHex< sal_uInt8 >( "flags", "TOP10FILTER-FLAGS" );
             dumpDec< double >( "value" );
             dumpDec< double >( "cell-value" );
         break;
 
-        case OOBIN_ID_VOLTYPEMAIN:
+        case BIFF12_ID_VOLTYPEMAIN:
             dumpString( "first" );
         break;
 
-        case OOBIN_ID_VOLTYPESTP:
+        case BIFF12_ID_VOLTYPESTP:
             dumpString( "topic-value" );
         break;
 
-        case OOBIN_ID_VOLTYPETR:
+        case BIFF12_ID_VOLTYPETR:
             dumpAddress( "ref" );
             dumpDec< sal_Int32 >( "sheet-id" );
         break;
 
-        case OOBIN_ID_WORKBOOKPR:
+        case BIFF12_ID_WEBPR:
+        {
+            dumpHex< sal_uInt32 >( "flags", "WEBPR-FLAGS" );
+            sal_uInt8 nStrFlags = dumpHex< sal_uInt8 >( "string-flags", "WEBPR-STRINGFLAGS" );
+            if( nStrFlags & 0x04 ) dumpString( "url" );
+            if( nStrFlags & 0x01 ) dumpString( "post-method" );
+            if( nStrFlags & 0x02 ) dumpString( "edit-page" );
+        }
+        break;
+
+        case BIFF12_ID_WORKBOOKPR:
             dumpHex< sal_uInt32 >( "flags", "WORKBBOKPR-FLAGS" );
             dumpDec< sal_Int32 >( "default-theme-version" );
             dumpString( "codename" );
         break;
 
-        case OOBIN_ID_WORKBOOKVIEW:
+        case BIFF12_ID_WORKBOOKVIEW:
             dumpDec< sal_Int32 >( "x-window" );
             dumpDec< sal_Int32 >( "y-window" );
             dumpDec< sal_Int32 >( "win-width" );
@@ -2131,7 +2164,7 @@ void RecordStreamObject::implDumpRecordBody()
             dumpHex< sal_uInt8 >( "flags", "WORKBOOKVIEW-FLAGS" );
         break;
 
-        case OOBIN_ID_XF:
+        case BIFF12_ID_XF:
             dumpDec< sal_uInt16 >( "parent-xf-id" );
             dumpDec< sal_uInt16 >( "numfmt-id" );
             dumpDec< sal_uInt16 >( "font-id", "FONTNAMES" );
@@ -2222,6 +2255,7 @@ void RootStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, cons
             rStrgPath.equalsAscii( "xl/macrosheets" ) ||
             rStrgPath.equalsAscii( "xl/pivotCache" ) ||
             rStrgPath.equalsAscii( "xl/pivotTables" ) ||
+            rStrgPath.equalsAscii( "xl/queryTables" ) ||
             rStrgPath.equalsAscii( "xl/tables" ) ||
             rStrgPath.equalsAscii( "xl/worksheets" ) )
         {
diff --git a/oox/source/dump/xlsbdumper.ini b/oox/source/dump/xlsbdumper.ini
index b53870f09a15..0624eebb3ffc 100644
--- a/oox/source/dump/xlsbdumper.ini
+++ b/oox/source/dump/xlsbdumper.ini
@@ -179,13 +179,15 @@ multilist=RECORD-NAMES
   0x00B0=MERGECELL,MERGECELLS,MERGECELLS_END,PCDEFINITION,PCDEFINITION_END,PCDFIELDS,PCDFIELDS_END,PCDFIELD
   0x00B8=PCDFIELD_END,PCDSOURCE,PCDSOURCE_END,PCDSHEETSOURCE,PCDSHEETSOURCE_END,PCDFSHAREDITEMS,PCDFSHAREDITEMS_END,PCITEM_ARRAY
   0x00C0=PCITEM_ARRAY_END,PCRECORDS,PCRECORDS_END,,,,,
+  0x00C8=,CONNECTION,CONNECTION_END,,,,,
 
   0x00D8=,,,PCDFIELDGROUP,PCDFIELDGROUP_END,PCDFGROUPITEMS,PCDFGROUPITEMS_END,PCDFRANGEPR
   0x00E0=PCDFRANGEPR_END,PCDFDISCRETEPR,PCDFDISCRETEPR_END,,,,,
 
   0x00F0=,,,,,,,PIVOTAREA
   0x00F8=PIVOTAREA_END,PTREFERENCES,PTREFERENCES_END,PTREFERENCE,PTREFERENCE_END,,,
-
+  0x0100=,,,,,WEBPR,WEBPR_END,WEBPRTABLES
+  0x0108=WEBPRTABLES_END,,,,,,,
   0x0110=,,,,,BINARYINDEX_END,STYLESHEET,STYLESHEET_END
   0x0118=PTDEFINITION,PTFITEM_END,PTFITEM,PTFITEMS,PTFITEMS_END,PTFIELD,PTFIELD_END,PTFIELDS
   0x0120=PTFIELDS_END,PTPAGEFIELD,PTPAGEFIELD_END,PTPAGEFIELDS,PTPAGEFIELDS_END,PTDATAFIELD,PTDATAFIELD_END,PTDATAFIELDS
@@ -203,8 +205,10 @@ multilist=RECORD-NAMES
   0x0188=ROWBREAKS,ROWBREAKS_END,COLBREAKS,COLBREAKS_END,BRK,CUSTOMWORKBOOKVIEW,,
 
   0x01A0=,,,,,,CUSTOMSHEETVIEWS,CUSTOMSHEETVIEW
-  0x01A8=CUSTOMSHEETVIEW_END,CUSTOMSHEETVIEWS_END,ARRAY,SHAREDFMLA,DATATABLE,,,
+  0x01A8=CUSTOMSHEETVIEW_END,CUSTOMSHEETVIEWS_END,ARRAY,SHAREDFMLA,DATATABLE,CONNECTIONS,CONNECTIONS_END,
 
+  0x01B8=,,,,,,,QUERYTABLE
+  0x01C0=QUERYTABLE_END,QUERYTABLEREFRESH,QUERYTABLEREFRESH_END,,,,,
   0x01C8=,,,AUTOSORTSCOPE,AUTOSORTSCOPE_END,CONDFORMATTING,CONDFORMATTING_END,CFRULE
   0x01D0=CFRULE_END,ICONSET,ICONSET_END,DATABAR,DATABAR_END,COLORSCALE,COLORSCALE_END,CFVO
   0x01D8=,COLORS,COLORS_END,RGBCOLOR,PAGEMARGINS,PRINTOPTIONS,PAGESETUP,HEADERFOOTER
@@ -243,6 +247,7 @@ constlist=SIMPLE-RECORDS
   0x00DD=int32,dec,count
   0x00E1=int32,dec,count
   0x00F9=int32,dec,count
+  0x0107=int32,dec,count
   0x011B=int32,dec,count
   0x011F=int32,dec,count
   0x0123=int32,dec,count
@@ -374,6 +379,32 @@ combilist=COL-FLAGS
   0x1000=outline-collapsed
 end
 
+# CONNECTION -----------------------------------------------------------------
+
+shortlist=CONNECTION-SAVEPASSWORD,1,on,off
+unitconverter=CONNECTION-INTERVAL,60,sec
+shortlist=CONNECTION-SOURCETYPE,1,odbc,dao,file,html,ole-db,text,ado,dsp
+shortlist=CONNECTION-RECONNECTTYPE,1,as-required,always,never
+shortlist=CONNECTION-CREDENTIALS,0,integrated,none,stored-sso,prompt
+
+flagslist=CONNECTION-FLAGS
+  0x0001=keep-alive
+  0x0002=new
+  0x0004=deleted
+  0x0008=only-use-conn-file
+  0x0010=background
+  0x0020=refresh-on-load
+  0x0040=save-data
+end
+
+flagslist=CONNECTION-STRINGFLAGS
+  0x0001=has-source-file
+  0x0002=has-source-conn-file
+  0x0004=has-description
+  0x0008=has-name
+  0x0010=has-sso-id
+end
+
 # DATATABLE ------------------------------------------------------------------
 
 flagslist=DATATABLE-FLAGS
@@ -741,7 +772,7 @@ flagslist=PTDEFINITION-FLAGS3
   0x00004000=col-grand-totals
   0x00008000=field-print-titles
   0x00020000=item-print-titles
-  0x00040000=merge-labels
+  0x00040000=merge-item
   0x00080000=has-data-caption
   0x00100000=has-grand-total-caption
   0x00200000=has-page-field-style
@@ -751,8 +782,8 @@ flagslist=PTDEFINITION-FLAGS3
   0x02000000=apply-font
   0x04000000=apply-alignment
   0x08000000=apply-border
-  0x10000000=apply-pattern
-  0x20000000=protected
+  0x10000000=apply-fill
+  0x20000000=apply-protection
   0x40000000=has-tag
 end
 
@@ -905,6 +936,32 @@ flagslist=PTREFERENCE-FLAGS2
   0x01=selected
 end
 
+# QUERYTABLE -----------------------------------------------------------------
+
+combilist=QUERYTABLE-FLAGS
+  0x00000001=headers
+  0x00000002=row-numbers
+  0x00000004=disable-refresh
+  0x00000008=background
+  0x00000010=first-background
+  0x00000020=refresh-on-load
+  0x000000C0=uint8,dec,grow-shrink,QUERYTABLE-GROWSHRINK
+  0x00000100=fill-formulas
+  0x00000200=save-data
+  0x00000400=disable-edit
+  0x00000800=preserve-formatting
+  0x00001000=adjust-column-width
+  0x00002000=intermediate
+  0x00004000=apply-num-fmt
+  0x00008000=apply-font
+  0x00010000=apply-alignment
+  0x00020000=apply-border
+  0x00040000=apply-fill
+  0x00080000=apply-protection
+end
+
+shortlist=QUERYTABLE-GROWSHRINK,0,insert-clear,insert-delete,overwrite-clear
+
 # ROW ------------------------------------------------------------------------
 
 combilist=ROW-FLAGS1
@@ -1012,6 +1069,29 @@ end
 
 shortlist=VOLTYPE-TYPE,0,realtime-data,olap-functions
 
+# WEBPR ----------------------------------------------------------------------
+
+combilist=WEBPR-FLAGS
+  0x000000FF=uint8,dec,html-format,WEBPR-HTMLFORMAT
+  0x00000100=xml
+  0x00000200=source-data
+  0x00000400=parse-pre
+  0x00000800=consecutive-delimiters
+  0x00001000=first-row
+  0x00002000=xl97-created
+  0x00004000=text-dates
+  0x00008000=xl2000-refreshed
+  0x00010000=html-tables
+end
+
+shortlist=WEBPR-HTMLFORMAT,0,none,rtf,all
+
+flagslist=WEBPR-STRINGFLAGS
+  0x01=has-post-method
+  0x02=has-edit-page
+  0x04=has-url
+end
+
 # WORKBBOKPR -----------------------------------------------------------------
 
 combilist=WORKBBOKPR-FLAGS
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 72453ed512e5..369c5e5218db 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -10,6 +10,7 @@ AdjustmentValues
 Align
 AnchorPosition
 ApplyFormDesignMode
+AreaLinks
 ArrangeOrder
 Aspect
 AttachedAxisIndex
@@ -145,6 +146,8 @@ FillGradient
 FillGradientName
 FillStyle
 FillTransparence
+Filter
+FilterOptions
 FirstLineOffset
 FirstPageNumber
 FocusOnClick
@@ -333,6 +336,7 @@ RefY
 Reference
 ReferenceDevice
 ReferenceSheet
+RefreshPeriod
 RegularExpressions
 RelId
 RelativeHorizontalTabbarWidth
@@ -442,6 +446,7 @@ Transparency
 TriState
 Type
 URL
+Url
 UseRegularExpressions
 UseRings
 UseSelectedPage
diff --git a/oox/source/xls/addressconverter.cxx b/oox/source/xls/addressconverter.cxx
index 5a379000fe9e..0f9828b8e0f4 100644
--- a/oox/source/xls/addressconverter.cxx
+++ b/oox/source/xls/addressconverter.cxx
@@ -26,37 +26,38 @@
  ************************************************************************/
 
 #include "oox/xls/addressconverter.hxx"
-#include 
-#include 
-#include 
+
 #include 
 #include 
 #include 
-#include "oox/helper/recordinputstream.hxx"
+#include 
+#include 
+#include 
 #include "oox/core/filterbase.hxx"
+#include "oox/helper/recordinputstream.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/biffoutputstream.hxx"
 
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OStringBuffer;
 using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
-using ::rtl::OStringBuffer;
 using ::rtl::OUStringToOString;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::XCellRangeAddressable;
-
-namespace oox {
-namespace xls {
 
 // ============================================================================
 
 namespace {
 
-//! TODO: this limit may be changed
+//! TODO: this limit may change, is there a way to obtain it via API?
 const sal_Int16 API_MAXTAB          = 255;
 
 const sal_Int32 OOX_MAXCOL          = static_cast< sal_Int32 >( (1 << 14) - 1 );
@@ -242,7 +243,7 @@ AddressConverter::AddressConverter( const WorkbookHelper& rHelper ) :
     maDConChars.set( 0xFFFF, '\x01', 0xFFFF, '\x02', 0xFFFF );
     switch( getFilterType() )
     {
-        case FILTER_OOX:
+        case FILTER_OOXML:
             initializeMaxPos( OOX_MAXTAB, OOX_MAXCOL, OOX_MAXROW );
         break;
         case FILTER_BIFF: switch( getBiff() )
@@ -781,4 +782,3 @@ void AddressConverter::initializeMaxPos(
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/autofiltercontext.cxx b/oox/source/xls/autofiltercontext.cxx
index 279b62de2ccf..87514d7804c5 100644
--- a/oox/source/xls/autofiltercontext.cxx
+++ b/oox/source/xls/autofiltercontext.cxx
@@ -26,21 +26,22 @@
  ************************************************************************/
 
 #include "oox/xls/autofiltercontext.hxx"
-#include 
+
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include "properties.hxx"
+#include 
+#include 
+#include "oox/core/filterbase.hxx"
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/propertyset.hxx"
-#include "oox/core/filterbase.hxx"
 #include "oox/xls/addressconverter.hxx"
+#include "properties.hxx"
 
 #define DEBUG_OOX_AUTOFILTER 0
 
@@ -117,8 +118,8 @@ FilterFieldItem::FilterFieldItem(Type eType) :
 
 // ============================================================================
 
-OoxAutoFilterContext::OoxAutoFilterContext( OoxWorksheetFragmentBase& rFragment ) :
-    OoxWorksheetContextBase( rFragment ),
+AutoFilterContext::AutoFilterContext( WorksheetFragmentBase& rFragment ) :
+    WorksheetContextBase( rFragment ),
     mbValidAddress( false ),
     mbUseRegex( false ),
     mbShowBlank( false ),
@@ -126,9 +127,7 @@ OoxAutoFilterContext::OoxAutoFilterContext( OoxWorksheetFragmentBase& rFragment
 {
 }
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxAutoFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
+ContextHandlerRef AutoFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
 {
     switch( getCurrentElement() )
     {
@@ -166,7 +165,7 @@ ContextHandlerRef OoxAutoFilterContext::onCreateContext( sal_Int32 nElement, con
     return 0;
 }
 
-void OoxAutoFilterContext::onStartElement( const AttributeList& rAttribs )
+void AutoFilterContext::onStartElement( const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -204,7 +203,7 @@ void OoxAutoFilterContext::onStartElement( const AttributeList& rAttribs )
     }
 }
 
-void OoxAutoFilterContext::onEndElement()
+void AutoFilterContext::onEndElement()
 {
     switch( getCurrentElement() )
     {
@@ -352,14 +351,14 @@ static void lclPrintFilterField( const FilterFieldItem& aItem )
 }
 #endif
 
-void OoxAutoFilterContext::initialize()
+void AutoFilterContext::initialize()
 {
     maFields.clear();
     maFilterNames.clear();
     mbValidAddress = mbShowBlank = mbUseRegex = mbConnectionAnd = false;
 }
 
-void OoxAutoFilterContext::setAutoFilter()
+void AutoFilterContext::setAutoFilter()
 {
     using namespace ::com::sun::star::sheet;
 
@@ -373,12 +372,11 @@ void OoxAutoFilterContext::setAutoFilter()
     // Create a new database range, add filters to it and refresh the database
     // for that to take effect.
 
-    Reference< XDatabaseRanges > xDBRanges = getDatabaseRanges();
+    PropertySet aDocProps( getDocument() );
+    Reference< XDatabaseRanges > xDBRanges( aDocProps.getAnyProperty( PROP_DatabaseRanges ), UNO_QUERY );
+    OSL_ENSURE( xDBRanges.is(), "AutoFilterContext::setAutoFilter: DBRange empty" );
     if ( !xDBRanges.is() )
-    {
-        OSL_ENSURE( false, "OoxAutoFilterContext::setAutoFilter: DBRange empty" );
         return;
-    }
 
     Reference< XNameAccess > xNA( xDBRanges, UNO_QUERY_THROW );
     if ( !xNA->hasByName( sDataAreaName ) )
@@ -403,7 +401,7 @@ void OoxAutoFilterContext::setAutoFilter()
     }
     else
     {
-        OSL_ENSURE(false, "OoxAutoFilterContext::setAutoFilter: descriptor is empty");
+        OSL_ENSURE(false, "AutoFilterContext::setAutoFilter: descriptor is empty");
         return;
     }
 
@@ -412,7 +410,7 @@ void OoxAutoFilterContext::setAutoFilter()
     Reference< XExtendedSheetFilterDescriptor > xExtDescriptor( xDescriptor, UNO_QUERY );
     if ( !xExtDescriptor.is() )
     {
-        OSL_ENSURE(false, "OoxAutoFilterContext::setAutoFilter: extended descriptor is empty");
+        OSL_ENSURE(false, "AutoFilterContext::setAutoFilter: extended descriptor is empty");
         return;
     }
 
@@ -457,7 +455,7 @@ void OoxAutoFilterContext::setAutoFilter()
     xDB->refresh();
 }
 
-void OoxAutoFilterContext::maybeShowBlank()
+void AutoFilterContext::maybeShowBlank()
 {
     using namespace ::com::sun::star::sheet;
 
@@ -481,7 +479,7 @@ void OoxAutoFilterContext::maybeShowBlank()
     maFields.push_back(aItem);
 }
 
-void OoxAutoFilterContext::setFilterNames()
+void AutoFilterContext::setFilterNames()
 {
     using namespace ::com::sun::star::sheet;
 
@@ -536,7 +534,7 @@ void OoxAutoFilterContext::setFilterNames()
 #endif
 }
 
-void OoxAutoFilterContext::importAutoFilter( const AttributeList& rAttribs )
+void AutoFilterContext::importAutoFilter( const AttributeList& rAttribs )
 {
     initialize();
 
@@ -544,13 +542,13 @@ void OoxAutoFilterContext::importAutoFilter( const AttributeList& rAttribs )
         maAutoFilterRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex(), true, true );
 }
 
-void OoxAutoFilterContext::importFilterColumn( const AttributeList& rAttribs )
+void AutoFilterContext::importFilterColumn( const AttributeList& rAttribs )
 {
     // hiddenButton and showButton attributes are not used for now.
     mnCurColID = rAttribs.getInteger( XML_colId, -1 );
 }
 
-void OoxAutoFilterContext::importTop10( const AttributeList& rAttribs )
+void AutoFilterContext::importTop10( const AttributeList& rAttribs )
 {
     using namespace ::com::sun::star::sheet;
 
@@ -584,7 +582,7 @@ void OoxAutoFilterContext::importTop10( const AttributeList& rAttribs )
     maFields.push_back(aItem);
 }
 
-void OoxAutoFilterContext::importCustomFilters( const AttributeList& rAttribs )
+void AutoFilterContext::importCustomFilters( const AttributeList& rAttribs )
 {
     // OR is default when the 'and' attribute is absent.
     mbConnectionAnd = rAttribs.getBool( XML_and, false );
@@ -683,7 +681,7 @@ static ::com::sun::star::sheet::FilterOperator lclTranslateFilterOp( sal_Int32 n
     return FilterOperator_EQUAL;
 }
 
-void OoxAutoFilterContext::importCustomFilter( const AttributeList& rAttribs )
+void AutoFilterContext::importCustomFilter( const AttributeList& rAttribs )
 {
     using namespace ::com::sun::star::sheet;
 
@@ -741,11 +739,11 @@ void OoxAutoFilterContext::importCustomFilter( const AttributeList& rAttribs )
         }
         break;
         default:
-            OSL_ENSURE( false, "OoxAutoFilterContext::importCustomFilter: unhandled case" );
+            OSL_ENSURE( false, "AutoFilterContext::importCustomFilter: unhandled case" );
     }
 }
 
-void OoxAutoFilterContext::importFilters( const AttributeList& rAttribs )
+void AutoFilterContext::importFilters( const AttributeList& rAttribs )
 {
     // blank (boolean) and calendarType attributes can be present, but not used for now.
 
@@ -753,7 +751,7 @@ void OoxAutoFilterContext::importFilters( const AttributeList& rAttribs )
     maFilterNames.clear();
 }
 
-void OoxAutoFilterContext::importFilter( const AttributeList& rAttribs )
+void AutoFilterContext::importFilter( const AttributeList& rAttribs )
 {
     if (mnCurColID == -1)
         return;
@@ -763,7 +761,7 @@ void OoxAutoFilterContext::importFilter( const AttributeList& rAttribs )
         maFilterNames.push_back(value);
 }
 
-void OoxAutoFilterContext::importDynamicFilter( const AttributeList& /*rAttribs*/ )
+void AutoFilterContext::importDynamicFilter( const AttributeList& /*rAttribs*/ )
 {
     // not implemented yet - Calc doesn't support this.
 }
@@ -772,4 +770,3 @@ void OoxAutoFilterContext::importDynamicFilter( const AttributeList& /*rAttribs*
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/biffcodec.cxx b/oox/source/xls/biffcodec.cxx
index 2021c21cb08c..774760b7a9c5 100644
--- a/oox/source/xls/biffcodec.cxx
+++ b/oox/source/xls/biffcodec.cxx
@@ -26,18 +26,21 @@
  ************************************************************************/
 
 #include "oox/xls/biffcodec.hxx"
+
 #include 
 #include 
 #include "oox/core/filterbase.hxx"
 #include "oox/xls/biffinputstream.hxx"
 
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using ::oox::core::FilterBase;
 using ::rtl::OString;
 using ::rtl::OUString;
 using ::rtl::OStringToOUString;
-using ::oox::core::FilterBase;
-
-namespace oox {
-namespace xls {
 
 // ============================================================================
 
@@ -331,4 +334,3 @@ void BiffCodecHelper::cloneDecoder( BiffInputStream& rStrm )
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/biffdetector.cxx b/oox/source/xls/biffdetector.cxx
index e5ef5416c9b3..038d7d732425 100644
--- a/oox/source/xls/biffdetector.cxx
+++ b/oox/source/xls/biffdetector.cxx
@@ -26,6 +26,7 @@
  ************************************************************************/
 
 #include "oox/xls/biffdetector.hxx"
+
 #include 
 #include 
 #include 
@@ -228,4 +229,3 @@ OUString SAL_CALL BiffDetector::detect( Sequence< PropertyValue >& rDescriptor )
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/biffhelper.cxx b/oox/source/xls/biffhelper.cxx
index afd7e04e6a08..5989777456e0 100644
--- a/oox/source/xls/biffhelper.cxx
+++ b/oox/source/xls/biffhelper.cxx
@@ -26,20 +26,23 @@
  ************************************************************************/
 
 #include "oox/xls/biffhelper.hxx"
+
 #include 
 #include 
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/biffoutputstream.hxx"
 #include "oox/xls/worksheethelper.hxx"
 
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
 namespace {
 
 const sal_Int32 BIFF_RK_100FLAG             = 0x00000001;
@@ -262,6 +265,24 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm,
     return static_cast< sal_uInt16 >( (nCodePage == 0) ? 1252 : nCodePage );
 }
 
+/*static*/ bool BiffHelper::isBofRecord( BiffInputStream& rStrm )
+{
+    return
+        (rStrm.getRecId() == BIFF2_ID_BOF) ||
+        (rStrm.getRecId() == BIFF3_ID_BOF) ||
+        (rStrm.getRecId() == BIFF4_ID_BOF) ||
+        (rStrm.getRecId() == BIFF5_ID_BOF);
+}
+
+/*static*/ bool BiffHelper::skipRecordBlock( BiffInputStream& rStrm, sal_uInt16 nEndRecId )
+{
+    sal_uInt16 nStartRecId = rStrm.getRecId();
+    while( rStrm.startNextRecord() && (rStrm.getRecId() != nEndRecId) )
+        if( rStrm.getRecId() == nStartRecId )
+            skipRecordBlock( rStrm, nEndRecId );
+    return !rStrm.isEof() && (rStrm.getRecId() == nEndRecId);
+}
+
 /*static*/ void BiffHelper::importImgData( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, BiffType eBiff )
 {
     sal_uInt16 nFormat, nEnv;
@@ -284,4 +305,3 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm,
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/biffinputstream.cxx b/oox/source/xls/biffinputstream.cxx
index fec36d4fa54d..6dfa8f755c25 100644
--- a/oox/source/xls/biffinputstream.cxx
+++ b/oox/source/xls/biffinputstream.cxx
@@ -26,17 +26,20 @@
  ************************************************************************/
 
 #include "oox/xls/biffinputstream.hxx"
+
 #include 
 #include 
 
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
 using ::rtl::OString;
 using ::rtl::OStringToOUString;
 using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
 
-namespace oox {
-namespace xls {
-
 // ============================================================================
 
 namespace prv {
@@ -628,4 +631,3 @@ BiffInputStreamPosGuard::~BiffInputStreamPosGuard()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/biffoutputstream.cxx b/oox/source/xls/biffoutputstream.cxx
index 5ec8834c5336..ba59f50bea4d 100644
--- a/oox/source/xls/biffoutputstream.cxx
+++ b/oox/source/xls/biffoutputstream.cxx
@@ -205,4 +205,3 @@ sal_uInt16 BiffOutputStream::prepareRawBlock( sal_Int32 nTotalSize )
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/chartsheetfragment.cxx b/oox/source/xls/chartsheetfragment.cxx
index 432b50b075f2..5a8a3774c9c5 100644
--- a/oox/source/xls/chartsheetfragment.cxx
+++ b/oox/source/xls/chartsheetfragment.cxx
@@ -26,6 +26,7 @@
  ************************************************************************/
 
 #include "oox/xls/chartsheetfragment.hxx"
+
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/recordinputstream.hxx"
 #include "oox/xls/biffinputstream.hxx"
@@ -34,24 +35,24 @@
 #include "oox/xls/workbooksettings.hxx"
 #include "oox/xls/worksheetsettings.hxx"
 
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
-OoxChartsheetFragment::OoxChartsheetFragment( const WorkbookHelper& rHelper,
-        const OUString& rFragmentPath, ISegmentProgressBarRef xProgressBar, sal_Int16 nSheet ) :
-    OoxWorksheetFragmentBase( rHelper, rFragmentPath, xProgressBar, SHEETTYPE_CHARTSHEET, nSheet )
+using ::oox::core::ContextHandlerRef;
+using ::oox::core::RecordInfo;
+using ::rtl::OUString;
+
+// ============================================================================
+
+ChartsheetFragment::ChartsheetFragment( const WorkbookHelper& rHelper,
+        const OUString& rFragmentPath, const ISegmentProgressBarRef& rxProgressBar, sal_Int16 nSheet ) :
+    WorksheetFragmentBase( rHelper, rFragmentPath, rxProgressBar, SHEETTYPE_CHARTSHEET, nSheet )
 {
 }
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxChartsheetFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ChartsheetFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -93,7 +94,7 @@ ContextHandlerRef OoxChartsheetFragment::onCreateContext( sal_Int32 nElement, co
     return 0;
 }
 
-void OoxChartsheetFragment::onCharacters( const OUString& rChars )
+void ChartsheetFragment::onCharacters( const OUString& rChars )
 {
     switch( getCurrentElement() )
     {
@@ -108,60 +109,58 @@ void OoxChartsheetFragment::onCharacters( const OUString& rChars )
     }
 }
 
-ContextHandlerRef OoxChartsheetFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ChartsheetFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
         case XML_ROOT_CONTEXT:
-            if( nRecId == OOBIN_ID_WORKSHEET ) return this;
+            if( nRecId == BIFF12_ID_WORKSHEET ) return this;
         break;
 
-        case OOBIN_ID_WORKSHEET:
+        case BIFF12_ID_WORKSHEET:
             switch( nRecId )
             {
-                case OOBIN_ID_CHARTSHEETVIEWS:  return this;
-
-                case OOBIN_ID_CHARTSHEETPR:     getWorksheetSettings().importChartSheetPr( rStrm );                 break;
-                case OOBIN_ID_CHARTPROTECTION:  getWorksheetSettings().importChartProtection( rStrm );              break;
-                case OOBIN_ID_PAGEMARGINS:      getPageSettings().importPageMargins( rStrm );                       break;
-                case OOBIN_ID_CHARTPAGESETUP:   getPageSettings().importChartPageSetup( getRelations(), rStrm );    break;
-                case OOBIN_ID_HEADERFOOTER:     getPageSettings().importHeaderFooter( rStrm );                      break;
-                case OOBIN_ID_PICTURE:          getPageSettings().importPicture( getRelations(), rStrm );           break;
-                case OOBIN_ID_DRAWING:          importDrawing( rStrm );                                             break;
+                case BIFF12_ID_CHARTSHEETVIEWS:  return this;
+
+                case BIFF12_ID_CHARTSHEETPR:    getWorksheetSettings().importChartSheetPr( rStrm );                 break;
+                case BIFF12_ID_CHARTPROTECTION: getWorksheetSettings().importChartProtection( rStrm );              break;
+                case BIFF12_ID_PAGEMARGINS:     getPageSettings().importPageMargins( rStrm );                       break;
+                case BIFF12_ID_CHARTPAGESETUP:  getPageSettings().importChartPageSetup( getRelations(), rStrm );    break;
+                case BIFF12_ID_HEADERFOOTER:    getPageSettings().importHeaderFooter( rStrm );                      break;
+                case BIFF12_ID_PICTURE:         getPageSettings().importPicture( getRelations(), rStrm );           break;
+                case BIFF12_ID_DRAWING:         importDrawing( rStrm );                                             break;
             }
         break;
 
-        case OOBIN_ID_CHARTSHEETVIEWS:
-            if( nRecId == OOBIN_ID_CHARTSHEETVIEW ) getSheetViewSettings().importChartSheetView( rStrm );
+        case BIFF12_ID_CHARTSHEETVIEWS:
+            if( nRecId == BIFF12_ID_CHARTSHEETVIEW ) getSheetViewSettings().importChartSheetView( rStrm );
         break;
     }
     return 0;
 }
 
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxChartsheetFragment::getRecordInfos() const
+const RecordInfo* ChartsheetFragment::getRecordInfos() const
 {
     static const RecordInfo spRecInfos[] =
     {
-        { OOBIN_ID_CHARTSHEETVIEW,      OOBIN_ID_CHARTSHEETVIEW + 1     },
-        { OOBIN_ID_CHARTSHEETVIEWS,     OOBIN_ID_CHARTSHEETVIEWS + 1    },
-        { OOBIN_ID_CUSTOMCHARTVIEW,     OOBIN_ID_CUSTOMCHARTVIEW + 1    },
-        { OOBIN_ID_CUSTOMCHARTVIEWS,    OOBIN_ID_CUSTOMCHARTVIEWS + 1   },
-        { OOBIN_ID_HEADERFOOTER,        OOBIN_ID_HEADERFOOTER + 1       },
-        { OOBIN_ID_WORKSHEET,           OOBIN_ID_WORKSHEET + 1          },
+        { BIFF12_ID_CHARTSHEETVIEW,     BIFF12_ID_CHARTSHEETVIEW + 1    },
+        { BIFF12_ID_CHARTSHEETVIEWS,    BIFF12_ID_CHARTSHEETVIEWS + 1   },
+        { BIFF12_ID_CUSTOMCHARTVIEW,    BIFF12_ID_CUSTOMCHARTVIEW + 1   },
+        { BIFF12_ID_CUSTOMCHARTVIEWS,   BIFF12_ID_CUSTOMCHARTVIEWS + 1  },
+        { BIFF12_ID_HEADERFOOTER,       BIFF12_ID_HEADERFOOTER + 1      },
+        { BIFF12_ID_WORKSHEET,          BIFF12_ID_WORKSHEET + 1         },
         { -1,                           -1                              }
     };
     return spRecInfos;
 }
 
-void OoxChartsheetFragment::initializeImport()
+void ChartsheetFragment::initializeImport()
 {
     // initial processing in base class WorksheetHelper
     initializeWorksheetImport();
 }
 
-void OoxChartsheetFragment::finalizeImport()
+void ChartsheetFragment::finalizeImport()
 {
     // final processing in base class WorksheetHelper
     finalizeWorksheetImport();
@@ -169,12 +168,12 @@ void OoxChartsheetFragment::finalizeImport()
 
 // private --------------------------------------------------------------------
 
-void OoxChartsheetFragment::importDrawing( const AttributeList& rAttribs )
+void ChartsheetFragment::importDrawing( const AttributeList& rAttribs )
 {
     setDrawingPath( getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ) );
 }
 
-void OoxChartsheetFragment::importDrawing( RecordInputStream& rStrm )
+void ChartsheetFragment::importDrawing( RecordInputStream& rStrm )
 {
     setDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) );
 }
@@ -182,8 +181,8 @@ void OoxChartsheetFragment::importDrawing( RecordInputStream& rStrm )
 // ============================================================================
 
 BiffChartsheetFragment::BiffChartsheetFragment( const BiffWorkbookFragmentBase& rParent,
-        ISegmentProgressBarRef xProgressBar, sal_Int16 nSheet ) :
-    BiffWorksheetFragmentBase( rParent, xProgressBar, SHEETTYPE_CHARTSHEET, nSheet )
+        const ISegmentProgressBarRef& rxProgressBar, sal_Int16 nSheet ) :
+    BiffWorksheetFragmentBase( rParent, rxProgressBar, SHEETTYPE_CHARTSHEET, nSheet )
 {
 }
 
@@ -197,81 +196,82 @@ bool BiffChartsheetFragment::importFragment()
     PageSettings& rPageSett           = getPageSettings();
 
     // process all record in this sheet fragment
-    while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
+    BiffInputStream& rStrm = getInputStream();
+    while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
     {
-        if( isBofRecord() )
+        if( BiffHelper::isBofRecord( rStrm ) )
         {
             // skip unknown embedded fragments (BOF/EOF blocks)
             skipFragment();
         }
         else
         {
-            sal_uInt16 nRecId = mrStrm.getRecId();
+            sal_uInt16 nRecId = rStrm.getRecId();
             switch( nRecId )
             {
                 // records in all BIFF versions
-                case BIFF_ID_BOTTOMMARGIN:  rPageSett.importBottomMargin( mrStrm );     break;
-                case BIFF_ID_CHBEGIN:       skipRecordBlock( BIFF_ID_CHEND );           break;
-                case BIFF_ID_FOOTER:        rPageSett.importFooter( mrStrm );           break;
-                case BIFF_ID_HEADER:        rPageSett.importHeader( mrStrm );           break;
-                case BIFF_ID_LEFTMARGIN:    rPageSett.importLeftMargin( mrStrm );       break;
-                case BIFF_ID_PASSWORD:      rWorksheetSett.importPassword( mrStrm );    break;
-                case BIFF_ID_PROTECT:       rWorksheetSett.importProtect( mrStrm );     break;
-                case BIFF_ID_RIGHTMARGIN:   rPageSett.importRightMargin( mrStrm );      break;
-                case BIFF_ID_TOPMARGIN:     rPageSett.importTopMargin( mrStrm );        break;
+                case BIFF_ID_BOTTOMMARGIN:  rPageSett.importBottomMargin( rStrm );                  break;
+                case BIFF_ID_CHBEGIN:       BiffHelper::skipRecordBlock( rStrm, BIFF_ID_CHEND );    break;
+                case BIFF_ID_FOOTER:        rPageSett.importFooter( rStrm );                        break;
+                case BIFF_ID_HEADER:        rPageSett.importHeader( rStrm );                        break;
+                case BIFF_ID_LEFTMARGIN:    rPageSett.importLeftMargin( rStrm );                    break;
+                case BIFF_ID_PASSWORD:      rWorksheetSett.importPassword( rStrm );                 break;
+                case BIFF_ID_PROTECT:       rWorksheetSett.importProtect( rStrm );                  break;
+                case BIFF_ID_RIGHTMARGIN:   rPageSett.importRightMargin( rStrm );                   break;
+                case BIFF_ID_TOPMARGIN:     rPageSett.importTopMargin( rStrm );                     break;
 
                 // BIFF specific records
                 default: switch( getBiff() )
                 {
                     case BIFF2: switch( nRecId )
                     {
-                        case BIFF2_ID_WINDOW2:      rSheetViewSett.importWindow2( mrStrm );  break;
+                        case BIFF2_ID_WINDOW2:      rSheetViewSett.importWindow2( rStrm );          break;
                     }
                     break;
 
                     case BIFF3: switch( nRecId )
                     {
-                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( mrStrm );            break;
-                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm );   break;
-                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( mrStrm );            break;
-                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( mrStrm );         break;
+                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( rStrm );             break;
+                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm );    break;
+                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( rStrm );             break;
+                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( rStrm );          break;
 
                     }
                     break;
 
                     case BIFF4: switch( nRecId )
                     {
-                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( mrStrm );            break;
-                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm );   break;
-                        case BIFF_ID_PAGESETUP:     rPageSett.importPageSetup( mrStrm );            break;
-                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( mrStrm );            break;
-                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( mrStrm );         break;
+                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( rStrm );             break;
+                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm );    break;
+                        case BIFF_ID_PAGESETUP:     rPageSett.importPageSetup( rStrm );             break;
+                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( rStrm );             break;
+                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( rStrm );          break;
                     }
                     break;
 
                     case BIFF5: switch( nRecId )
                     {
-                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( mrStrm );            break;
-                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm );   break;
-                        case BIFF_ID_PAGESETUP:     rPageSett.importPageSetup( mrStrm );            break;
-                        case BIFF_ID_SCENPROTECT:   rWorksheetSett.importScenProtect( mrStrm );     break;
-                        case BIFF_ID_SCL:           rSheetViewSett.importScl( mrStrm );             break;
-                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( mrStrm );            break;
-                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( mrStrm );         break;
+                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( rStrm );             break;
+                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm );    break;
+                        case BIFF_ID_PAGESETUP:     rPageSett.importPageSetup( rStrm );             break;
+                        case BIFF_ID_SCENPROTECT:   rWorksheetSett.importScenProtect( rStrm );      break;
+                        case BIFF_ID_SCL:           rSheetViewSett.importScl( rStrm );              break;
+                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( rStrm );             break;
+                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( rStrm );          break;
                     }
                     break;
 
                     case BIFF8: switch( nRecId )
                     {
-                        case BIFF_ID_CODENAME:      rWorksheetSett.importCodeName( mrStrm );        break;
-                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( mrStrm );            break;
-                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm );   break;
-                        case BIFF_ID_PICTURE:       rPageSett.importPicture( mrStrm );              break;
-                        case BIFF_ID_PAGESETUP:     rPageSett.importPageSetup( mrStrm );            break;
-                        case BIFF_ID_SCL:           rSheetViewSett.importScl( mrStrm );             break;
-                        case BIFF_ID_SHEETEXT:      rWorksheetSett.importSheetExt( mrStrm );        break;
-                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( mrStrm );            break;
-                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( mrStrm );         break;
+                        case BIFF_ID_CODENAME:      rWorksheetSett.importCodeName( rStrm );         break;
+                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( rStrm );             break;
+                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm );    break;
+                        case BIFF_ID_PICTURE:       rPageSett.importPicture( rStrm );               break;
+                        case BIFF_ID_PAGESETUP:     rPageSett.importPageSetup( rStrm );             break;
+                        case BIFF_ID_SCL:           rSheetViewSett.importScl( rStrm );              break;
+                        case BIFF_ID_SHEETEXT:      rWorksheetSett.importSheetExt( rStrm );         break;
+                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( rStrm );             break;
+                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( rStrm );          break;
                     }
                     break;
 
@@ -283,11 +283,10 @@ bool BiffChartsheetFragment::importFragment()
 
     // final processing in base class WorksheetHelper
     finalizeWorksheetImport();
-    return mrStrm.getRecId() == BIFF_ID_EOF;
+    return rStrm.getRecId() == BIFF_ID_EOF;
 }
 
 // ============================================================================
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/commentsbuffer.cxx b/oox/source/xls/commentsbuffer.cxx
index ecc5d4dff390..264656eb7063 100644
--- a/oox/source/xls/commentsbuffer.cxx
+++ b/oox/source/xls/commentsbuffer.cxx
@@ -26,6 +26,7 @@
  ************************************************************************/
 
 #include "oox/xls/commentsbuffer.hxx"
+
 #include 
 #include 
 #include 
@@ -36,24 +37,20 @@
 #include "oox/xls/addressconverter.hxx"
 #include "oox/xls/drawingfragment.hxx"
 
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::drawing::XShape;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::XSheetAnnotation;
-using ::com::sun::star::sheet::XSheetAnnotationAnchor;
-using ::com::sun::star::sheet::XSheetAnnotationShapeSupplier;
-using ::com::sun::star::sheet::XSheetAnnotations;
-using ::com::sun::star::sheet::XSheetAnnotationsSupplier;
-
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
 CommentModel::CommentModel() :
     mnAuthorId( -1 )
 {
@@ -89,7 +86,7 @@ RichStringRef Comment::createText()
 
 void Comment::finalizeImport()
 {
-    // OOBIN format stores cell range instead of cell address, use first cell of this range
+    // BIFF12 stores cell range instead of cell address, use first cell of this range
     OSL_ENSURE( (maModel.maRange.StartColumn == maModel.maRange.EndColumn) &&
         (maModel.maRange.StartRow == maModel.maRange.EndRow),
         "Comment::finalizeImport - comment anchor should be a single cell" );
@@ -153,4 +150,3 @@ void CommentsBuffer::finalizeImport()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/commentsfragment.cxx b/oox/source/xls/commentsfragment.cxx
index 44ae98ca7b43..7df1269be8e0 100644
--- a/oox/source/xls/commentsfragment.cxx
+++ b/oox/source/xls/commentsfragment.cxx
@@ -26,25 +26,26 @@
  ************************************************************************/
 
 #include "oox/xls/commentsfragment.hxx"
-#include "oox/xls/richstringcontext.hxx"
 
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
+#include "oox/xls/richstringcontext.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
-OoxCommentsFragment::OoxCommentsFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
-    OoxWorksheetFragmentBase( rHelper, rFragmentPath )
+using ::oox::core::ContextHandlerRef;
+using ::oox::core::RecordInfo;
+using ::rtl::OUString;
+
+// ============================================================================
+
+CommentsFragment::CommentsFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+    WorksheetFragmentBase( rHelper, rFragmentPath )
 {
 }
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxCommentsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef CommentsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -63,79 +64,77 @@ ContextHandlerRef OoxCommentsFragment::onCreateContext( sal_Int32 nElement, cons
         break;
         case XLS_TOKEN( comment ):
             if( (nElement == XLS_TOKEN( text )) && mxComment.get() )
-                return new OoxRichStringContext( *this, mxComment->createText() );
+                return new RichStringContext( *this, mxComment->createText() );
         break;
     }
     return 0;
 }
 
-void OoxCommentsFragment::onCharacters( const OUString& rChars )
+void CommentsFragment::onCharacters( const OUString& rChars )
 {
     if( isCurrentElement( XLS_TOKEN( author ) ) )
         getComments().appendAuthor( rChars );
 }
 
-void OoxCommentsFragment::onEndElement()
+void CommentsFragment::onEndElement()
 {
     if( isCurrentElement( XLS_TOKEN( comment ) ) )
         mxComment.reset();
 }
 
-ContextHandlerRef OoxCommentsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef CommentsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
         case XML_ROOT_CONTEXT:
-            if( nRecId == OOBIN_ID_COMMENTS ) return this;
+            if( nRecId == BIFF12_ID_COMMENTS ) return this;
         break;
-        case OOBIN_ID_COMMENTS:
-            if( nRecId == OOBIN_ID_COMMENTAUTHORS ) return this;
-            if( nRecId == OOBIN_ID_COMMENTLIST ) return this;
+        case BIFF12_ID_COMMENTS:
+            if( nRecId == BIFF12_ID_COMMENTAUTHORS ) return this;
+            if( nRecId == BIFF12_ID_COMMENTLIST ) return this;
         break;
-        case OOBIN_ID_COMMENTAUTHORS:
-            if( nRecId == OOBIN_ID_COMMENTAUTHOR ) getComments().appendAuthor( rStrm.readString() );
+        case BIFF12_ID_COMMENTAUTHORS:
+            if( nRecId == BIFF12_ID_COMMENTAUTHOR ) getComments().appendAuthor( rStrm.readString() );
         break;
-        case OOBIN_ID_COMMENTLIST:
-            if( nRecId == OOBIN_ID_COMMENT ) { importComment( rStrm ); return this; }
+        case BIFF12_ID_COMMENTLIST:
+            if( nRecId == BIFF12_ID_COMMENT ) { importComment( rStrm ); return this; }
         break;
-        case OOBIN_ID_COMMENT:
-            if( (nRecId == OOBIN_ID_COMMENTTEXT) && mxComment.get() )
+        case BIFF12_ID_COMMENT:
+            if( (nRecId == BIFF12_ID_COMMENTTEXT) && mxComment.get() )
                 mxComment->createText()->importString( rStrm, true );
         break;
     }
     return 0;
 }
 
-void OoxCommentsFragment::onEndRecord()
+void CommentsFragment::onEndRecord()
 {
-    if( isCurrentElement( OOBIN_ID_COMMENT ) )
+    if( isCurrentElement( BIFF12_ID_COMMENT ) )
         mxComment.reset();
 }
 
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxCommentsFragment::getRecordInfos() const
+const RecordInfo* CommentsFragment::getRecordInfos() const
 {
     static const RecordInfo spRecInfos[] =
     {
-        { OOBIN_ID_COMMENT,         OOBIN_ID_COMMENT + 1        },
-        { OOBIN_ID_COMMENTAUTHORS,  OOBIN_ID_COMMENTAUTHORS + 1 },
-        { OOBIN_ID_COMMENTLIST,     OOBIN_ID_COMMENTLIST + 1    },
-        { OOBIN_ID_COMMENTS,        OOBIN_ID_COMMENTS + 1       },
-        { -1,                       -1                          }
+        { BIFF12_ID_COMMENT,        BIFF12_ID_COMMENT + 1           },
+        { BIFF12_ID_COMMENTAUTHORS, BIFF12_ID_COMMENTAUTHORS + 1    },
+        { BIFF12_ID_COMMENTLIST,    BIFF12_ID_COMMENTLIST + 1       },
+        { BIFF12_ID_COMMENTS,       BIFF12_ID_COMMENTS + 1          },
+        { -1,                       -1                              }
     };
     return spRecInfos;
 }
 
 // private --------------------------------------------------------------------
 
-void OoxCommentsFragment::importComment( const AttributeList& rAttribs )
+void CommentsFragment::importComment( const AttributeList& rAttribs )
 {
     mxComment = getComments().createComment();
     mxComment->importComment( rAttribs );
 }
 
-void OoxCommentsFragment::importComment( RecordInputStream& rStrm )
+void CommentsFragment::importComment( RecordInputStream& rStrm )
 {
     mxComment = getComments().createComment();
     mxComment->importComment( rStrm );
@@ -145,4 +144,3 @@ void OoxCommentsFragment::importComment( RecordInputStream& rStrm )
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/condformatbuffer.cxx b/oox/source/xls/condformatbuffer.cxx
index 317476f25635..e79684012d92 100644
--- a/oox/source/xls/condformatbuffer.cxx
+++ b/oox/source/xls/condformatbuffer.cxx
@@ -26,109 +26,99 @@
  ************************************************************************/
 
 #include "oox/xls/condformatbuffer.hxx"
-#include 
+
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include "properties.hxx"
+#include 
+#include 
+#include 
+#include 
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/helper/recordinputstream.hxx"
 #include "oox/xls/addressconverter.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/stylesbuffer.hxx"
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::style::XStyleFamiliesSupplier;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::ConditionOperator;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::sheet::XSheetCellRanges;
-using ::com::sun::star::sheet::XSheetConditionalEntries;
-using ::com::sun::star::sheet::XSpreadsheetDocument;
-using ::com::sun::star::sheet::XSpreadsheets;
-using ::com::sun::star::sheet::XSpreadsheet;
-using ::com::sun::star::style::XStyle;
+#include "properties.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
 namespace {
 
-const sal_Int32 OOBIN_CFRULE_TYPE_CELLIS        = 1;
-const sal_Int32 OOBIN_CFRULE_TYPE_EXPRESSION    = 2;
-const sal_Int32 OOBIN_CFRULE_TYPE_COLORSCALE    = 3;
-const sal_Int32 OOBIN_CFRULE_TYPE_DATABAR       = 4;
-const sal_Int32 OOBIN_CFRULE_TYPE_TOPTEN        = 5;
-const sal_Int32 OOBIN_CFRULE_TYPE_ICONSET       = 6;
-
-const sal_Int32 OOBIN_CFRULE_SUB_CELLIS         = 0;
-const sal_Int32 OOBIN_CFRULE_SUB_EXPRESSION     = 1;
-const sal_Int32 OOBIN_CFRULE_SUB_COLORSCALE     = 2;
-const sal_Int32 OOBIN_CFRULE_SUB_DATABAR        = 3;
-const sal_Int32 OOBIN_CFRULE_SUB_ICONSET        = 4;
-const sal_Int32 OOBIN_CFRULE_SUB_TOPTEN         = 5;
-const sal_Int32 OOBIN_CFRULE_SUB_UNIQUE         = 7;
-const sal_Int32 OOBIN_CFRULE_SUB_TEXT           = 8;
-const sal_Int32 OOBIN_CFRULE_SUB_BLANK          = 9;
-const sal_Int32 OOBIN_CFRULE_SUB_NOTBLANK       = 10;
-const sal_Int32 OOBIN_CFRULE_SUB_ERROR          = 11;
-const sal_Int32 OOBIN_CFRULE_SUB_NOTERROR       = 12;
-const sal_Int32 OOBIN_CFRULE_SUB_TODAY          = 15;
-const sal_Int32 OOBIN_CFRULE_SUB_TOMORROW       = 16;
-const sal_Int32 OOBIN_CFRULE_SUB_YESTERDAY      = 17;
-const sal_Int32 OOBIN_CFRULE_SUB_LAST7DAYS      = 18;
-const sal_Int32 OOBIN_CFRULE_SUB_LASTMONTH      = 19;
-const sal_Int32 OOBIN_CFRULE_SUB_NEXTMONTH      = 20;
-const sal_Int32 OOBIN_CFRULE_SUB_THISWEEK       = 21;
-const sal_Int32 OOBIN_CFRULE_SUB_NEXTWEEK       = 22;
-const sal_Int32 OOBIN_CFRULE_SUB_LASTWEEK       = 23;
-const sal_Int32 OOBIN_CFRULE_SUB_THISMONTH      = 24;
-const sal_Int32 OOBIN_CFRULE_SUB_ABOVEAVERAGE   = 25;
-const sal_Int32 OOBIN_CFRULE_SUB_BELOWAVERAGE   = 26;
-const sal_Int32 OOBIN_CFRULE_SUB_DUPLICATE      = 27;
-const sal_Int32 OOBIN_CFRULE_SUB_EQABOVEAVERAGE = 29;
-const sal_Int32 OOBIN_CFRULE_SUB_EQBELOWAVERAGE = 30;
-
-const sal_Int32 OOBIN_CFRULE_TIMEOP_TODAY       = 0;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_YESTERDAY   = 1;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_LAST7DAYS   = 2;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_THISWEEK    = 3;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_LASTWEEK    = 4;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_LASTMONTH   = 5;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_TOMORROW    = 6;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_NEXTWEEK    = 7;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_NEXTMONTH   = 8;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_THISMONTH   = 9;
-
-const sal_uInt16 OOBIN_CFRULE_STOPIFTRUE        = 0x0002;
-const sal_uInt16 OOBIN_CFRULE_ABOVEAVERAGE      = 0x0004;
-const sal_uInt16 OOBIN_CFRULE_BOTTOM            = 0x0008;
-const sal_uInt16 OOBIN_CFRULE_PERCENT           = 0x0010;
+const sal_Int32 BIFF12_CFRULE_TYPE_CELLIS           = 1;
+const sal_Int32 BIFF12_CFRULE_TYPE_EXPRESSION       = 2;
+const sal_Int32 BIFF12_CFRULE_TYPE_COLORSCALE       = 3;
+const sal_Int32 BIFF12_CFRULE_TYPE_DATABAR          = 4;
+const sal_Int32 BIFF12_CFRULE_TYPE_TOPTEN           = 5;
+const sal_Int32 BIFF12_CFRULE_TYPE_ICONSET          = 6;
+
+const sal_Int32 BIFF12_CFRULE_SUB_CELLIS            = 0;
+const sal_Int32 BIFF12_CFRULE_SUB_EXPRESSION        = 1;
+const sal_Int32 BIFF12_CFRULE_SUB_COLORSCALE        = 2;
+const sal_Int32 BIFF12_CFRULE_SUB_DATABAR           = 3;
+const sal_Int32 BIFF12_CFRULE_SUB_ICONSET           = 4;
+const sal_Int32 BIFF12_CFRULE_SUB_TOPTEN            = 5;
+const sal_Int32 BIFF12_CFRULE_SUB_UNIQUE            = 7;
+const sal_Int32 BIFF12_CFRULE_SUB_TEXT              = 8;
+const sal_Int32 BIFF12_CFRULE_SUB_BLANK             = 9;
+const sal_Int32 BIFF12_CFRULE_SUB_NOTBLANK          = 10;
+const sal_Int32 BIFF12_CFRULE_SUB_ERROR             = 11;
+const sal_Int32 BIFF12_CFRULE_SUB_NOTERROR          = 12;
+const sal_Int32 BIFF12_CFRULE_SUB_TODAY             = 15;
+const sal_Int32 BIFF12_CFRULE_SUB_TOMORROW          = 16;
+const sal_Int32 BIFF12_CFRULE_SUB_YESTERDAY         = 17;
+const sal_Int32 BIFF12_CFRULE_SUB_LAST7DAYS         = 18;
+const sal_Int32 BIFF12_CFRULE_SUB_LASTMONTH         = 19;
+const sal_Int32 BIFF12_CFRULE_SUB_NEXTMONTH         = 20;
+const sal_Int32 BIFF12_CFRULE_SUB_THISWEEK          = 21;
+const sal_Int32 BIFF12_CFRULE_SUB_NEXTWEEK          = 22;
+const sal_Int32 BIFF12_CFRULE_SUB_LASTWEEK          = 23;
+const sal_Int32 BIFF12_CFRULE_SUB_THISMONTH         = 24;
+const sal_Int32 BIFF12_CFRULE_SUB_ABOVEAVERAGE      = 25;
+const sal_Int32 BIFF12_CFRULE_SUB_BELOWAVERAGE      = 26;
+const sal_Int32 BIFF12_CFRULE_SUB_DUPLICATE         = 27;
+const sal_Int32 BIFF12_CFRULE_SUB_EQABOVEAVERAGE    = 29;
+const sal_Int32 BIFF12_CFRULE_SUB_EQBELOWAVERAGE    = 30;
+
+const sal_Int32 BIFF12_CFRULE_TIMEOP_TODAY          = 0;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_YESTERDAY      = 1;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_LAST7DAYS      = 2;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_THISWEEK       = 3;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_LASTWEEK       = 4;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_LASTMONTH      = 5;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_TOMORROW       = 6;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_NEXTWEEK       = 7;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_NEXTMONTH      = 8;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_THISMONTH      = 9;
+
+const sal_uInt16 BIFF12_CFRULE_STOPIFTRUE           = 0x0002;
+const sal_uInt16 BIFF12_CFRULE_ABOVEAVERAGE         = 0x0004;
+const sal_uInt16 BIFF12_CFRULE_BOTTOM               = 0x0008;
+const sal_uInt16 BIFF12_CFRULE_PERCENT              = 0x0010;
 
 // ----------------------------------------------------------------------------
 
@@ -160,7 +150,7 @@ CondFormatRuleModel::CondFormatRuleModel() :
 {
 }
 
-void CondFormatRuleModel::setBinOperator( sal_Int32 nOperator )
+void CondFormatRuleModel::setBiffOperator( sal_Int32 nOperator )
 {
     static const sal_Int32 spnOperators[] = {
         XML_TOKEN_INVALID, XML_between, XML_notBetween, XML_equal, XML_notEqual,
@@ -168,7 +158,7 @@ void CondFormatRuleModel::setBinOperator( sal_Int32 nOperator )
     mnOperator = STATIC_ARRAY_SELECT( spnOperators, nOperator, XML_TOKEN_INVALID );
 }
 
-void CondFormatRuleModel::setOobTextType( sal_Int32 nOperator )
+void CondFormatRuleModel::setBiff12TextType( sal_Int32 nOperator )
 {
     // note: type XML_notContainsText vs. operator XML_notContains
     static const sal_Int32 spnTypes[] = { XML_containsText, XML_notContainsText, XML_beginsWith, XML_endsWith };
@@ -251,129 +241,129 @@ void CondFormatRule::importCfRule( RecordInputStream& rStrm )
     }
 
     // flags
-    maModel.mbStopIfTrue   = getFlag( nFlags, OOBIN_CFRULE_STOPIFTRUE );
-    maModel.mbBottom       = getFlag( nFlags, OOBIN_CFRULE_BOTTOM );
-    maModel.mbPercent      = getFlag( nFlags, OOBIN_CFRULE_PERCENT );
-    maModel.mbAboveAverage = getFlag( nFlags, OOBIN_CFRULE_ABOVEAVERAGE );
+    maModel.mbStopIfTrue   = getFlag( nFlags, BIFF12_CFRULE_STOPIFTRUE );
+    maModel.mbBottom       = getFlag( nFlags, BIFF12_CFRULE_BOTTOM );
+    maModel.mbPercent      = getFlag( nFlags, BIFF12_CFRULE_PERCENT );
+    maModel.mbAboveAverage = getFlag( nFlags, BIFF12_CFRULE_ABOVEAVERAGE );
     // no flag for equalAverage, must be determined from subtype below...
 
     // Convert the type/operator settings. This is a real mess...
     switch( nType )
     {
-        case OOBIN_CFRULE_TYPE_CELLIS:
-            OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_CELLIS, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+        case BIFF12_CFRULE_TYPE_CELLIS:
+            OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_CELLIS, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
             maModel.mnType = XML_cellIs;
-            maModel.setBinOperator( nOperator );
+            maModel.setBiffOperator( nOperator );
             OSL_ENSURE( maModel.mnOperator != XML_TOKEN_INVALID, "CondFormatRule::importCfRule - unknown operator" );
         break;
-        case OOBIN_CFRULE_TYPE_EXPRESSION:
+        case BIFF12_CFRULE_TYPE_EXPRESSION:
             // here we have to look at the subtype to find the real type...
             switch( nSubType )
             {
-                case OOBIN_CFRULE_SUB_EXPRESSION:
+                case BIFF12_CFRULE_SUB_EXPRESSION:
                     OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
                     maModel.mnType = XML_expression;
                 break;
-                case OOBIN_CFRULE_SUB_UNIQUE:
+                case BIFF12_CFRULE_SUB_UNIQUE:
                     OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
                     maModel.mnType = XML_uniqueValues;
                 break;
-                case OOBIN_CFRULE_SUB_TEXT:
-                    maModel.setOobTextType( nOperator );
+                case BIFF12_CFRULE_SUB_TEXT:
+                    maModel.setBiff12TextType( nOperator );
                     OSL_ENSURE( maModel.mnType != XML_TOKEN_INVALID, "CondFormatRule::importCfRule - unexpected operator value" );
                 break;
-                case OOBIN_CFRULE_SUB_BLANK:
+                case BIFF12_CFRULE_SUB_BLANK:
                     OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
                     maModel.mnType = XML_containsBlanks;
                 break;
-                case OOBIN_CFRULE_SUB_NOTBLANK:
+                case BIFF12_CFRULE_SUB_NOTBLANK:
                     OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
                     maModel.mnType = XML_notContainsBlanks;
                 break;
-                case OOBIN_CFRULE_SUB_ERROR:
+                case BIFF12_CFRULE_SUB_ERROR:
                     OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
                     maModel.mnType = XML_containsErrors;
                 break;
-                case OOBIN_CFRULE_SUB_NOTERROR:
+                case BIFF12_CFRULE_SUB_NOTERROR:
                     OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
                     maModel.mnType = XML_notContainsErrors;
                 break;
-                case OOBIN_CFRULE_SUB_TODAY:
-                    OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_TODAY, "CondFormatRule::importCfRule - unexpected time operator value" );
+                case BIFF12_CFRULE_SUB_TODAY:
+                    OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_TODAY, "CondFormatRule::importCfRule - unexpected time operator value" );
                     maModel.mnType = XML_timePeriod;
                     maModel.mnTimePeriod = XML_today;
                 break;
-                case OOBIN_CFRULE_SUB_TOMORROW:
-                    OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_TOMORROW, "CondFormatRule::importCfRule - unexpected time operator value" );
+                case BIFF12_CFRULE_SUB_TOMORROW:
+                    OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_TOMORROW, "CondFormatRule::importCfRule - unexpected time operator value" );
                     maModel.mnType = XML_timePeriod;
                     maModel.mnTimePeriod = XML_tomorrow;
                 break;
-                case OOBIN_CFRULE_SUB_YESTERDAY:
-                    OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_YESTERDAY, "CondFormatRule::importCfRule - unexpected time operator value" );
+                case BIFF12_CFRULE_SUB_YESTERDAY:
+                    OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_YESTERDAY, "CondFormatRule::importCfRule - unexpected time operator value" );
                     maModel.mnType = XML_timePeriod;
                     maModel.mnTimePeriod = XML_yesterday;
                 break;
-                case OOBIN_CFRULE_SUB_LAST7DAYS:
-                    OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_LAST7DAYS, "CondFormatRule::importCfRule - unexpected time operator value" );
+                case BIFF12_CFRULE_SUB_LAST7DAYS:
+                    OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_LAST7DAYS, "CondFormatRule::importCfRule - unexpected time operator value" );
                     maModel.mnType = XML_timePeriod;
                     maModel.mnTimePeriod = XML_last7Days;
                 break;
-                case OOBIN_CFRULE_SUB_LASTMONTH:
-                    OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_LASTMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
+                case BIFF12_CFRULE_SUB_LASTMONTH:
+                    OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_LASTMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
                     maModel.mnType = XML_timePeriod;
                     maModel.mnTimePeriod = XML_lastMonth;
                 break;
-                case OOBIN_CFRULE_SUB_NEXTMONTH:
-                    OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_NEXTMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
+                case BIFF12_CFRULE_SUB_NEXTMONTH:
+                    OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_NEXTMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
                     maModel.mnType = XML_timePeriod;
                     maModel.mnTimePeriod = XML_nextMonth;
                 break;
-                case OOBIN_CFRULE_SUB_THISWEEK:
-                    OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_THISWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
+                case BIFF12_CFRULE_SUB_THISWEEK:
+                    OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_THISWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
                     maModel.mnType = XML_timePeriod;
                     maModel.mnTimePeriod = XML_thisWeek;
                 break;
-                case OOBIN_CFRULE_SUB_NEXTWEEK:
-                    OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_NEXTWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
+                case BIFF12_CFRULE_SUB_NEXTWEEK:
+                    OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_NEXTWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
                     maModel.mnType = XML_timePeriod;
                     maModel.mnTimePeriod = XML_nextWeek;
                 break;
-                case OOBIN_CFRULE_SUB_LASTWEEK:
-                    OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_LASTWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
+                case BIFF12_CFRULE_SUB_LASTWEEK:
+                    OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_LASTWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
                     maModel.mnType = XML_timePeriod;
                     maModel.mnTimePeriod = XML_lastWeek;
                 break;
-                case OOBIN_CFRULE_SUB_THISMONTH:
-                    OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_THISMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
+                case BIFF12_CFRULE_SUB_THISMONTH:
+                    OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_THISMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
                     maModel.mnType = XML_timePeriod;
                     maModel.mnTimePeriod = XML_thisMonth;
                 break;
-                case OOBIN_CFRULE_SUB_ABOVEAVERAGE:
+                case BIFF12_CFRULE_SUB_ABOVEAVERAGE:
                     OSL_ENSURE( maModel.mbAboveAverage, "CondFormatRule::importCfRule - wrong above-average flag" );
                     maModel.mnType = XML_aboveAverage;
                     maModel.mnStdDev = nOperator;     // operator field used for standard deviation
                     maModel.mbAboveAverage = true;
                     maModel.mbEqualAverage = false;   // does not exist as real flag...
                 break;
-                case OOBIN_CFRULE_SUB_BELOWAVERAGE:
+                case BIFF12_CFRULE_SUB_BELOWAVERAGE:
                     OSL_ENSURE( !maModel.mbAboveAverage, "CondFormatRule::importCfRule - wrong above-average flag" );
                     maModel.mnType = XML_aboveAverage;
                     maModel.mnStdDev = nOperator;     // operator field used for standard deviation
                     maModel.mbAboveAverage = false;
                     maModel.mbEqualAverage = false;   // does not exist as real flag...
                 break;
-                case OOBIN_CFRULE_SUB_DUPLICATE:
+                case BIFF12_CFRULE_SUB_DUPLICATE:
                     OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
                     maModel.mnType = XML_duplicateValues;
                 break;
-                case OOBIN_CFRULE_SUB_EQABOVEAVERAGE:
+                case BIFF12_CFRULE_SUB_EQABOVEAVERAGE:
                     OSL_ENSURE( maModel.mbAboveAverage, "CondFormatRule::importCfRule - wrong above-average flag" );
                     maModel.mnType = XML_aboveAverage;
                     maModel.mnStdDev = nOperator;     // operator field used for standard deviation
                     maModel.mbAboveAverage = true;
                     maModel.mbEqualAverage = true;    // does not exist as real flag...
                 break;
-                case OOBIN_CFRULE_SUB_EQBELOWAVERAGE:
+                case BIFF12_CFRULE_SUB_EQBELOWAVERAGE:
                     OSL_ENSURE( !maModel.mbAboveAverage, "CondFormatRule::importCfRule - wrong above-average flag" );
                     maModel.mnType = XML_aboveAverage;
                     maModel.mnStdDev = nOperator;     // operator field used for standard deviation
@@ -382,23 +372,23 @@ void CondFormatRule::importCfRule( RecordInputStream& rStrm )
                 break;
             }
         break;
-        case OOBIN_CFRULE_TYPE_COLORSCALE:
-            OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_COLORSCALE, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+        case BIFF12_CFRULE_TYPE_COLORSCALE:
+            OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_COLORSCALE, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
             OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
             maModel.mnType = XML_colorScale;
         break;
-        case OOBIN_CFRULE_TYPE_DATABAR:
-            OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_DATABAR, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+        case BIFF12_CFRULE_TYPE_DATABAR:
+            OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_DATABAR, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
             OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
             maModel.mnType = XML_dataBar;
         break;
-        case OOBIN_CFRULE_TYPE_TOPTEN:
-            OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_TOPTEN, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+        case BIFF12_CFRULE_TYPE_TOPTEN:
+            OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_TOPTEN, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
             maModel.mnType = XML_top10;
             maModel.mnRank = nOperator;   // operator field used for rank value
         break;
-        case OOBIN_CFRULE_TYPE_ICONSET:
-            OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_ICONSET, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+        case BIFF12_CFRULE_TYPE_ICONSET:
+            OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_ICONSET, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
             OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
             maModel.mnType = XML_iconSet;
         break;
@@ -418,7 +408,7 @@ void CondFormatRule::importCfRule( BiffInputStream& rStrm, sal_Int32 nPriority )
     static const sal_Int32 spnTypeIds[] = { XML_TOKEN_INVALID, XML_cellIs, XML_expression };
     maModel.mnType = STATIC_ARRAY_SELECT( spnTypeIds, nType, XML_TOKEN_INVALID );
 
-    maModel.setBinOperator( nOperator );
+    maModel.setBiffOperator( nOperator );
     maModel.mnPriority = nPriority;
     maModel.mbStopIfTrue = true;
 
@@ -694,18 +684,17 @@ void CondFormat::importCfHeader( BiffInputStream& rStrm )
 
 void CondFormat::finalizeImport()
 {
-    Reference< XSheetCellRanges > xRanges = getCellRangeList( maModel.maRanges );
-    if( xRanges.is() )
+    try
     {
+        Reference< XSheetCellRanges > xRanges( getCellRangeList( maModel.maRanges ), UNO_SET_THROW );
         PropertySet aPropSet( xRanges );
-        Reference< XSheetConditionalEntries > xEntries;
-        aPropSet.getProperty( xEntries, PROP_ConditionalFormat );
-        if( xEntries.is() )
-        {
-            // maRules is sorted by rule priority
-            maRules.forEachMem( &CondFormatRule::finalizeImport, ::boost::cref( xEntries ) );
-            aPropSet.setProperty( PROP_ConditionalFormat, xEntries );
-        }
+        Reference< XSheetConditionalEntries > xEntries( aPropSet.getAnyProperty( PROP_ConditionalFormat ), UNO_QUERY_THROW );
+        // maRules is sorted by rule priority
+        maRules.forEachMem( &CondFormatRule::finalizeImport, ::boost::cref( xEntries ) );
+        aPropSet.setProperty( PROP_ConditionalFormat, xEntries );
+    }
+    catch( Exception& )
+    {
     }
 }
 
@@ -784,4 +773,3 @@ CondFormatRef CondFormatBuffer::createCondFormat()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/condformatcontext.cxx b/oox/source/xls/condformatcontext.cxx
index a879dcb2e86d..23f32262cb07 100644
--- a/oox/source/xls/condformatcontext.cxx
+++ b/oox/source/xls/condformatcontext.cxx
@@ -27,22 +27,22 @@
 
 #include "oox/xls/condformatcontext.hxx"
 
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
-OoxCondFormatContext::OoxCondFormatContext( OoxWorksheetFragmentBase& rFragment ) :
-    OoxWorksheetContextBase( rFragment )
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
+CondFormatContext::CondFormatContext( WorksheetFragmentBase& rFragment ) :
+    WorksheetContextBase( rFragment )
 {
 }
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxCondFormatContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
+ContextHandlerRef CondFormatContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
 {
     switch( getCurrentElement() )
     {
@@ -54,7 +54,7 @@ ContextHandlerRef OoxCondFormatContext::onCreateContext( sal_Int32 nElement, con
     return 0;
 }
 
-void OoxCondFormatContext::onStartElement( const AttributeList& rAttribs )
+void CondFormatContext::onStartElement( const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -67,30 +67,30 @@ void OoxCondFormatContext::onStartElement( const AttributeList& rAttribs )
     }
 }
 
-void OoxCondFormatContext::onCharacters( const OUString& rChars )
+void CondFormatContext::onCharacters( const OUString& rChars )
 {
     if( isCurrentElement( XLS_TOKEN( formula ) ) && mxCondFmt.get() && mxRule.get() )
         mxRule->appendFormula( rChars );
 }
 
-ContextHandlerRef OoxCondFormatContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& )
+ContextHandlerRef CondFormatContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& )
 {
     switch( getCurrentElement() )
     {
-        case OOBIN_ID_CONDFORMATTING:
-            return (nRecId == OOBIN_ID_CFRULE) ? this : 0;
+        case BIFF12_ID_CONDFORMATTING:
+            return (nRecId == BIFF12_ID_CFRULE) ? this : 0;
     }
     return 0;
 }
 
-void OoxCondFormatContext::onStartRecord( RecordInputStream& rStrm )
+void CondFormatContext::onStartRecord( RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
-        case OOBIN_ID_CONDFORMATTING:
+        case BIFF12_ID_CONDFORMATTING:
             mxCondFmt = getCondFormats().importCondFormatting( rStrm );
         break;
-        case OOBIN_ID_CFRULE:
+        case BIFF12_ID_CFRULE:
             if( mxCondFmt.get() ) mxCondFmt->importCfRule( rStrm );
         break;
     }
@@ -100,4 +100,3 @@ void OoxCondFormatContext::onStartRecord( RecordInputStream& rStrm )
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/connectionsbuffer.cxx b/oox/source/xls/connectionsbuffer.cxx
new file mode 100755
index 000000000000..8a1d2c718948
--- /dev/null
+++ b/oox/source/xls/connectionsbuffer.cxx
@@ -0,0 +1,491 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * 
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "oox/xls/connectionsbuffer.hxx"
+
+#include "oox/core/namespaces.hxx"
+#include "oox/helper/attributelist.hxx"
+#include "oox/helper/recordinputstream.hxx"
+#include "oox/xls/biffinputstream.hxx"
+#include "tokens.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
+namespace {
+
+const sal_Int32 BIFF12_RECONNECT_AS_REQUIRED            = 1;
+const sal_Int32 BIFF12_RECONNECT_ALWAYS                 = 2;
+const sal_Int32 BIFF12_RECONNECT_NEVER                  = 3;
+
+const sal_uInt16 BIFF12_CONNECTION_KEEPALIVE            = 0x0001;
+const sal_uInt16 BIFF12_CONNECTION_NEW                  = 0x0002;
+const sal_uInt16 BIFF12_CONNECTION_DELETED              = 0x0004;
+const sal_uInt16 BIFF12_CONNECTION_ONLYUSECONNFILE      = 0x0008;
+const sal_uInt16 BIFF12_CONNECTION_BACKGROUND           = 0x0010;
+const sal_uInt16 BIFF12_CONNECTION_REFRESHONLOAD        = 0x0020;
+const sal_uInt16 BIFF12_CONNECTION_SAVEDATA             = 0x0040;
+
+const sal_uInt16 BIFF12_CONNECTION_HAS_SOURCEFILE       = 0x0001;
+const sal_uInt16 BIFF12_CONNECTION_HAS_SOURCECONNFILE   = 0x0002;
+const sal_uInt16 BIFF12_CONNECTION_HAS_DESCRIPTION      = 0x0004;
+const sal_uInt16 BIFF12_CONNECTION_HAS_NAME             = 0x0008;
+const sal_uInt16 BIFF12_CONNECTION_HAS_SSOID            = 0x0010;
+
+const sal_uInt32 BIFF12_WEBPR_XML                       = 0x00000100;
+const sal_uInt32 BIFF12_WEBPR_SOURCEDATA                = 0x00000200;
+const sal_uInt32 BIFF12_WEBPR_PARSEPRE                  = 0x00000400;
+const sal_uInt32 BIFF12_WEBPR_CONSECUTIVE               = 0x00000800;
+const sal_uInt32 BIFF12_WEBPR_FIRSTROW                  = 0x00001000;
+const sal_uInt32 BIFF12_WEBPR_XL97CREATED               = 0x00002000;
+const sal_uInt32 BIFF12_WEBPR_TEXTDATES                 = 0x00004000;
+const sal_uInt32 BIFF12_WEBPR_XL2000REFRESHED           = 0x00008000;
+const sal_uInt32 BIFF12_WEBPR_HTMLTABLES                = 0x00010000;
+
+const sal_uInt8 BIFF12_WEBPR_HAS_POSTMETHOD             = 0x01;
+const sal_uInt8 BIFF12_WEBPR_HAS_EDITPAGE               = 0x02;
+const sal_uInt8 BIFF12_WEBPR_HAS_URL                    = 0x04;
+
+const sal_uInt16 BIFF_DBQUERY_ODBC                      = 0x0008;
+const sal_uInt16 BIFF_DBQUERY_SQLQUERY                  = 0x0010;
+const sal_uInt16 BIFF_DBQUERY_SERVERBASEDSQL            = 0x0020;
+const sal_uInt16 BIFF_DBQUERY_HTML                      = 0x0040;
+const sal_uInt16 BIFF_DBQUERY_SAVEPASSWORD              = 0x0080;
+const sal_uInt16 BIFF_DBQUERY_HTMLTABLES                = 0x0100;
+
+const sal_uInt16 BIFF_QTSETTINGS_KEEPALIVE              = 0x0001;
+const sal_uInt16 BIFF_QTSETTINGS_NEW                    = 0x0002;
+const sal_uInt16 BIFF_QTSETTINGS_SOURCEDATA             = 0x0004;
+const sal_uInt16 BIFF_QTSETTINGS_WEBBASEDPROV           = 0x0008;
+const sal_uInt16 BIFF_QTSETTINGS_REINITLIST             = 0x0010;
+const sal_uInt16 BIFF_QTSETTINGS_XML                    = 0x0080;
+
+const sal_uInt16 BIFF_QTSETTINGS_PARSEPRE               = 0x0001;
+const sal_uInt16 BIFF_QTSETTINGS_CONSECUTIVE            = 0x0002;
+const sal_uInt16 BIFF_QTSETTINGS_FIRSTROW               = 0x0004;
+const sal_uInt16 BIFF_QTSETTINGS_XL97CREATED            = 0x0008;
+const sal_uInt16 BIFF_QTSETTINGS_TEXTDATES              = 0x0010;
+const sal_uInt16 BIFF_QTSETTINGS_XL2000REFRESHED        = 0x0020;
+
+const sal_uInt16 BIFF_QTSETTINGS_TEXTQUERY              = 0x0001;
+const sal_uInt16 BIFF_QTSETTINGS_TABLENAMES             = 0x0002;
+
+// ----------------------------------------------------------------------------
+
+OUString lclReadQueryString( BiffInputStream& rStrm, sal_uInt16 nCount )
+{
+    bool bValidRec = true;
+    OUStringBuffer aBuffer;
+    for( sal_uInt16 nIndex = 0; bValidRec && (nIndex < nCount); ++nIndex )
+    {
+        bValidRec = (rStrm.getNextRecId() == BIFF_ID_PCITEM_STRING) && rStrm.startNextRecord();
+        if( bValidRec )
+            aBuffer.append( rStrm.readUniString() );
+    }
+    OSL_ENSURE( bValidRec, "lclReadQueryString - missing PCITEM_STRING records" );
+    return aBuffer.makeStringAndClear();
+}
+
+void lclParseTables( WebPrModel::TablesVector& rTables, const OUString& rTableNames )
+{
+    rTables.clear();
+    OUString aTableNames = rTableNames.trim();
+    while( aTableNames.getLength() > 0 )
+    {
+        sal_Int32 nSep = -1;
+        // table names are enclosed in double quotes
+        if( aTableNames[ 0 ] == '"' )
+        {
+            // search closing quote character
+            sal_Int32 nEndQuote = aTableNames.indexOf( '"', 1 );
+            OSL_ENSURE( nEndQuote >= 1, "lclParseTables - invalid syntax" );
+            if( nEndQuote < 0 )
+                nEndQuote = aTableNames.getLength();
+            else
+                nSep = aTableNames.indexOf( ',', nEndQuote + 1 );
+            // extract text between quote characters
+            OUString aTableName = aTableNames.copy( 1, nEndQuote - 1 ).trim();
+            if( aTableName.getLength() > 0 )
+                rTables.push_back( Any( aTableName ) );
+            else
+                rTables.push_back( Any() );
+        }
+        else
+        {
+            nSep = aTableNames.indexOf( ',' );
+            if( nSep < 0 )
+                nSep = aTableNames.getLength();
+            OUString aTableIndex = aTableNames.copy( 0, nSep ).trim();
+            if( (aTableIndex.getLength() > 0) && (aTableIndex[ 0 ] >= '1') && (aTableIndex[ 0 ] <= '9') )
+                rTables.push_back( Any( aTableIndex.toInt32() ) );
+            else
+                rTables.push_back( Any() );
+        }
+
+        // remove processed item from aTableNames
+        if( (nSep < 0) || (nSep >= aTableNames.getLength()) )
+            aTableNames = OUString();
+        else
+            aTableNames = aTableNames.copy( nSep + 1 ).trim();
+    }
+}
+
+} // namespace
+
+// ============================================================================
+
+WebPrModel::WebPrModel() :
+    mnHtmlFormat( XML_none ),
+    mbXml( false ),
+    mbSourceData( false ),
+    mbParsePre( false ),
+    mbConsecutive( false ),
+    mbFirstRow( false ),
+    mbXl97Created( false ),
+    mbTextDates( false ),
+    mbXl2000Refreshed( false ),
+    mbHtmlTables( false )
+{
+}
+
+// ----------------------------------------------------------------------------
+
+ConnectionModel::ConnectionModel() :
+    mnId( -1 ),
+    mnType( BIFF12_CONNECTION_UNKNOWN ),
+    mnReconnectMethod( BIFF12_RECONNECT_AS_REQUIRED ),
+    mnInterval( 0 ),
+    mbKeepAlive( false ),
+    mbNew( false ),
+    mbDeleted( false ),
+    mbOnlyUseConnFile( false ),
+    mbBackground( false ),
+    mbRefreshOnLoad( false ),
+    mbSaveData( false )
+{
+}
+
+WebPrModel& ConnectionModel::createWebPr()
+{
+    OSL_ENSURE( !mxWebPr.get(), "ConnectionModel::createWebPr - multiple call" );
+    mxWebPr.reset( new WebPrModel );
+    return *mxWebPr;
+}
+
+// ----------------------------------------------------------------------------
+
+Connection::Connection( const WorkbookHelper& rHelper, sal_Int32 nConnId ) :
+    WorkbookHelper( rHelper )
+{
+    maModel.mnId = nConnId;
+}
+
+void Connection::importConnection( const AttributeList& rAttribs )
+{
+    maModel.maName            = rAttribs.getXString( XML_name, OUString() );
+    maModel.maDescription     = rAttribs.getXString( XML_description, OUString() );
+    maModel.maSourceFile      = rAttribs.getXString( XML_sourceFile, OUString() );
+    maModel.maSourceConnFile  = rAttribs.getXString( XML_odcFile, OUString() );
+    maModel.maSsoId           = rAttribs.getXString( XML_singleSignOnId, OUString() );
+    maModel.mnId              = rAttribs.getInteger( XML_id, -1 );
+    // type and reconnectionMethod are using the BIFF12 constants instead of XML tokens
+    maModel.mnType            = rAttribs.getInteger( XML_type, BIFF12_CONNECTION_UNKNOWN );
+    maModel.mnReconnectMethod = rAttribs.getInteger( XML_reconnectionMethod, BIFF12_RECONNECT_AS_REQUIRED );
+    maModel.mnInterval        = rAttribs.getInteger( XML_interval, 0 );
+    maModel.mbKeepAlive       = rAttribs.getBool( XML_keepAlive, false );
+    maModel.mbNew             = rAttribs.getBool( XML_new, false );
+    maModel.mbDeleted         = rAttribs.getBool( XML_deleted, false );
+    maModel.mbOnlyUseConnFile = rAttribs.getBool( XML_onlyUseConnectionFile, false );
+    maModel.mbBackground      = rAttribs.getBool( XML_background, false );
+    maModel.mbRefreshOnLoad   = rAttribs.getBool( XML_refreshOnLoad, false );
+}
+
+void Connection::importWebPr( const AttributeList& rAttribs )
+{
+    WebPrModel& rWebPr = maModel.createWebPr();
+
+    rWebPr.maUrl             = rAttribs.getXString( XML_url, OUString() );
+    rWebPr.maPostMethod      = rAttribs.getXString( XML_post, OUString() );
+    rWebPr.maEditPage        = rAttribs.getXString( XML_editPage, OUString() );
+    rWebPr.mnHtmlFormat      = rAttribs.getToken( XML_htmlFormat, XML_none );
+    rWebPr.mbXml             = rAttribs.getBool( XML_xml, false );
+    rWebPr.mbSourceData      = rAttribs.getBool( XML_sourceData, false );
+    rWebPr.mbParsePre        = rAttribs.getBool( XML_parsePre, false );
+    rWebPr.mbConsecutive     = rAttribs.getBool( XML_consecutive, false );
+    rWebPr.mbFirstRow        = rAttribs.getBool( XML_firstRow, false );
+    rWebPr.mbXl97Created     = rAttribs.getBool( XML_xl97, false );
+    rWebPr.mbTextDates       = rAttribs.getBool( XML_textDates, false );
+    rWebPr.mbXl2000Refreshed = rAttribs.getBool( XML_xl2000, false );
+    rWebPr.mbHtmlTables      = rAttribs.getBool( XML_htmlTables, false );
+}
+
+void Connection::importTables( const AttributeList& /*rAttribs*/ )
+{
+    if( maModel.mxWebPr.get() )
+    {
+        OSL_ENSURE( maModel.mxWebPr->maTables.empty(), "Connection::importTables - multiple calls" );
+        maModel.mxWebPr->maTables.clear();
+    }
+}
+
+void Connection::importTable( const AttributeList& rAttribs, sal_Int32 nElement )
+{
+    if( maModel.mxWebPr.get() )
+    {
+        Any aTableAny;
+        switch( nElement )
+        {
+            case XLS_TOKEN( m ):                                                            break;
+            case XLS_TOKEN( s ):    aTableAny <<= rAttribs.getXString( XML_v, OUString() ); break;
+            case XLS_TOKEN( x ):    aTableAny <<= rAttribs.getInteger( XML_v, -1 );         break;
+            default:
+                OSL_ENSURE( false, "Connection::importTable - unexpected element" );
+                return;
+        }
+        maModel.mxWebPr->maTables.push_back( aTableAny );
+    }
+}
+
+void Connection::importConnection( RecordInputStream& rStrm )
+{
+    rStrm.skip( 4 );
+    sal_uInt16 nFlags, nStrFlags;
+    maModel.mnInterval = rStrm.readuInt16();
+    rStrm >> nFlags >> nStrFlags >> maModel.mnType >> maModel.mnReconnectMethod >> maModel.mnId;
+    rStrm.skip( 1 );    // credentials
+
+    if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_SOURCEFILE ) )
+        rStrm >> maModel.maSourceFile;
+    if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_SOURCECONNFILE ) )
+        rStrm >> maModel.maSourceConnFile;
+    if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_DESCRIPTION ) )
+        rStrm >> maModel.maDescription;
+    if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_NAME ) )
+        rStrm >> maModel.maName;
+    if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_SSOID ) )
+        rStrm >> maModel.maSsoId;
+
+    maModel.mbKeepAlive       = getFlag( nFlags, BIFF12_CONNECTION_KEEPALIVE );
+    maModel.mbNew             = getFlag( nFlags, BIFF12_CONNECTION_NEW );
+    maModel.mbDeleted         = getFlag( nFlags, BIFF12_CONNECTION_DELETED );
+    maModel.mbOnlyUseConnFile = getFlag( nFlags, BIFF12_CONNECTION_ONLYUSECONNFILE );
+    maModel.mbBackground      = getFlag( nFlags, BIFF12_CONNECTION_BACKGROUND );
+    maModel.mbRefreshOnLoad   = getFlag( nFlags, BIFF12_CONNECTION_REFRESHONLOAD );
+    maModel.mbSaveData        = getFlag( nFlags, BIFF12_CONNECTION_SAVEDATA );
+}
+
+void Connection::importWebPr( RecordInputStream& rStrm )
+{
+    WebPrModel& rWebPr = maModel.createWebPr();
+
+    sal_uInt32 nFlags;
+    sal_uInt8 nStrFlags;
+    rStrm >> nFlags >> nStrFlags;
+
+    if( getFlag( nStrFlags, BIFF12_WEBPR_HAS_URL ) )
+        rStrm >> rWebPr.maUrl;
+    if( getFlag( nStrFlags, BIFF12_WEBPR_HAS_POSTMETHOD ) )
+        rStrm >> rWebPr.maPostMethod;
+    if( getFlag( nStrFlags, BIFF12_WEBPR_HAS_EDITPAGE ) )
+        rStrm >> rWebPr.maEditPage;
+
+    static const sal_Int32 spnHmlFormats[] = { XML_none, XML_rtf, XML_all };
+    rWebPr.mnHtmlFormat = STATIC_ARRAY_SELECT( spnHmlFormats, extractValue< sal_uInt8 >( nFlags, 0, 8 ), XML_none );
+
+    rWebPr.mbXml             = getFlag( nFlags, BIFF12_WEBPR_XML );
+    rWebPr.mbSourceData      = getFlag( nFlags, BIFF12_WEBPR_SOURCEDATA );
+    rWebPr.mbParsePre        = getFlag( nFlags, BIFF12_WEBPR_PARSEPRE );
+    rWebPr.mbConsecutive     = getFlag( nFlags, BIFF12_WEBPR_CONSECUTIVE );
+    rWebPr.mbFirstRow        = getFlag( nFlags, BIFF12_WEBPR_FIRSTROW );
+    rWebPr.mbXl97Created     = getFlag( nFlags, BIFF12_WEBPR_XL97CREATED );
+    rWebPr.mbTextDates       = getFlag( nFlags, BIFF12_WEBPR_TEXTDATES );
+    rWebPr.mbXl2000Refreshed = getFlag( nFlags, BIFF12_WEBPR_XL2000REFRESHED );
+    rWebPr.mbHtmlTables      = getFlag( nFlags, BIFF12_WEBPR_HTMLTABLES );
+}
+
+void Connection::importWebPrTables( RecordInputStream& /*rStrm*/ )
+{
+    if( maModel.mxWebPr.get() )
+    {
+        OSL_ENSURE( maModel.mxWebPr->maTables.empty(), "Connection::importWebPrTables - multiple calls" );
+        maModel.mxWebPr->maTables.clear();
+    }
+}
+
+void Connection::importWebPrTable( RecordInputStream& rStrm, sal_Int32 nRecId )
+{
+    if( maModel.mxWebPr.get() )
+    {
+        Any aTableAny;
+        switch( nRecId )
+        {
+            case BIFF12_ID_PCITEM_MISSING:                                      break;
+            case BIFF12_ID_PCITEM_STRING:   aTableAny <<= rStrm.readString();   break;
+            case BIFF12_ID_PCITEM_INDEX:    aTableAny <<= rStrm.readInt32();    break;
+            default:
+                OSL_ENSURE( false, "Connection::importWebPrTable - unexpected record" );
+                return;
+        }
+        maModel.mxWebPr->maTables.push_back( aTableAny );
+    }
+}
+
+void Connection::importDbQuery( BiffInputStream& rStrm )
+{
+    sal_uInt16 nFlags, nSqlParamCount, nCommandCount, nPostMethodCount, nServerSqlCount, nOdbcConnCount;
+    rStrm >> nFlags >> nSqlParamCount >> nCommandCount >> nPostMethodCount >> nServerSqlCount >> nOdbcConnCount;
+
+    // same type constants in all BIFF versions
+    maModel.mnType = extractValue< sal_Int32 >( nFlags, 0, 3 );
+
+    OSL_ENSURE( getFlag( nFlags, BIFF_DBQUERY_ODBC ) == (maModel.mnType == BIFF12_CONNECTION_ODBC), "Connection::importDbQuery - wrong ODBC flag" );
+    OSL_ENSURE( getFlag( nFlags, BIFF_DBQUERY_SQLQUERY ) != (maModel.mnType == BIFF12_CONNECTION_HTML), "Connection::importDbQuery - wrong SQL query flag" );
+    OSL_ENSURE( getFlag( nFlags, BIFF_DBQUERY_HTML ) == (maModel.mnType == BIFF12_CONNECTION_HTML), "Connection::importDbQuery - wrong HTML flag" );
+
+    if( (maModel.mnType == BIFF12_CONNECTION_HTML) && getFlag( nFlags, BIFF_DBQUERY_HTML ) )
+    {
+        WebPrModel& rWebPr = maModel.createWebPr();
+        rWebPr.mbHtmlTables = getFlag( nFlags, BIFF_DBQUERY_HTMLTABLES );
+
+        // read HTML query URL and post method
+        rWebPr.maUrl = lclReadQueryString( rStrm, nCommandCount );
+        rWebPr.maPostMethod = lclReadQueryString( rStrm, nPostMethodCount );
+    }
+}
+
+void Connection::importQueryTableSettings( BiffInputStream& rStrm )
+{
+    rStrm.skip( 4 );
+    // source data type, again
+    sal_uInt16 nType = rStrm.readuInt16();
+    OSL_ENSURE( nType == maModel.mnType, "Connection::importQueryTableSettings - source data type mismatch" );
+    if( nType == maModel.mnType )
+    {
+        sal_uInt16 nFlags1, nFlags2, nFlags3, nHtmlFormat;
+        rStrm >> nFlags1 >> nFlags2 >> nFlags3;
+        rStrm.skip( 10 );
+        maModel.mnInterval = rStrm.readuInt16();
+        rStrm >> nHtmlFormat;
+
+        // first flags field: generic connection flags
+        maModel.mbKeepAlive = getFlag( nFlags1, BIFF_QTSETTINGS_KEEPALIVE );
+        maModel.mbNew       = getFlag( nFlags1, BIFF_QTSETTINGS_NEW );
+
+        // meaning of second flags field is dependent on source data type
+        if( (maModel.mnType == BIFF12_CONNECTION_HTML) && maModel.mxWebPr.get() )
+        {
+            WebPrModel& rWebPr = *maModel.mxWebPr;
+
+            // HTML format is one-based in BIFF8 (but zero-based in BIFF12)
+            static const sal_Int32 spnHmlFormats[] = { XML_none, XML_none, XML_rtf, XML_all };
+            rWebPr.mnHtmlFormat = STATIC_ARRAY_SELECT( spnHmlFormats, nHtmlFormat, XML_none );
+
+            rWebPr.mbXml             = getFlag( nFlags1, BIFF_QTSETTINGS_XML );
+            rWebPr.mbSourceData      = getFlag( nFlags1, BIFF_QTSETTINGS_SOURCEDATA );
+            rWebPr.mbParsePre        = getFlag( nFlags2, BIFF_QTSETTINGS_PARSEPRE );
+            rWebPr.mbConsecutive     = getFlag( nFlags2, BIFF_QTSETTINGS_CONSECUTIVE );
+            rWebPr.mbFirstRow        = getFlag( nFlags2, BIFF_QTSETTINGS_FIRSTROW );
+            rWebPr.mbXl97Created     = getFlag( nFlags2, BIFF_QTSETTINGS_XL97CREATED );
+            rWebPr.mbTextDates       = getFlag( nFlags2, BIFF_QTSETTINGS_TEXTDATES );
+            rWebPr.mbXl2000Refreshed = getFlag( nFlags2, BIFF_QTSETTINGS_XL2000REFRESHED );
+
+            // list of HTML table names or indexes
+            if( getFlag( nFlags3, BIFF_QTSETTINGS_TABLENAMES ) )
+            {
+                // a QUERYTABLESTRING record containing the table names must follow
+                bool bHasQTString = (rStrm.getNextRecId() == BIFF_ID_QUERYTABLESTRING) && rStrm.startNextRecord();
+                OSL_ENSURE( bHasQTString, "Connection::importQueryTableSettings - missing QUERYTABLESTRING record" );
+                if( bHasQTString )
+                {
+                    rStrm.skip( 4 );
+                    lclParseTables( rWebPr.maTables, rStrm.readUniString() );
+                }
+            }
+        }
+    }
+}
+
+// ============================================================================
+
+ConnectionsBuffer::ConnectionsBuffer( const WorkbookHelper& rHelper ) :
+    WorkbookHelper( rHelper ),
+    mnUnusedId( 1 )
+{
+}
+
+ConnectionRef ConnectionsBuffer::importConnection( const AttributeList& rAttribs )
+{
+    ConnectionRef xConnection( new Connection( *this ) );
+    xConnection->importConnection( rAttribs );
+    insertConnection( xConnection );
+    return xConnection;
+}
+
+ConnectionRef ConnectionsBuffer::importConnection( RecordInputStream& rStrm )
+{
+    ConnectionRef xConnection( new Connection( *this ) );
+    xConnection->importConnection( rStrm );
+    insertConnection( xConnection );
+    return xConnection;
+}
+
+ConnectionRef ConnectionsBuffer::createConnection()
+{
+    ConnectionRef xConnection( new Connection( *this, mnUnusedId ) );
+    insertConnection( xConnection );
+    return xConnection;
+}
+
+ConnectionRef ConnectionsBuffer::getConnection( sal_Int32 nConnId ) const
+{
+    return maConnections.get( nConnId );
+}
+
+void ConnectionsBuffer::insertConnection( const ConnectionRef& rxConnection )
+{
+    sal_Int32 nConnId = rxConnection->getConnectionId();
+    if( nConnId > 0 )
+    {
+        OSL_ENSURE( !maConnections.has( nConnId ), "ConnectionsBuffer::insertConnection - multiple connection identifier" );
+        maConnections[ nConnId ] = rxConnection;
+        mnUnusedId = ::std::max< sal_Int32 >( mnUnusedId, nConnId + 1 );
+    }
+}
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
diff --git a/oox/source/xls/connectionsfragment.cxx b/oox/source/xls/connectionsfragment.cxx
index f19204306d1b..ee4aaa3a059e 100644
--- a/oox/source/xls/connectionsfragment.cxx
+++ b/oox/source/xls/connectionsfragment.cxx
@@ -26,88 +26,145 @@
  ************************************************************************/
 
 #include "oox/xls/connectionsfragment.hxx"
+
 #include "oox/helper/attributelist.hxx"
-#include "oox/xls/webquerybuffer.hxx"
+#include "oox/xls/biffhelper.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
 
 using ::rtl::OUString;
 using ::oox::core::ContextHandlerRef;
+using ::oox::core::RecordInfo;
 
-namespace oox {
-namespace xls {
+// ============================================================================
 
-OoxConnectionsFragment::OoxConnectionsFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
-    OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+ConnectionContext::ConnectionContext( WorkbookFragmentBase& rParent, const ConnectionRef& rxConnection ) :
+    WorkbookContextBase( rParent ),
+    mxConnection( rxConnection )
 {
+    OSL_ENSURE( mxConnection.get(), "ConnectionContext::ConnectionContext - missing connection" );
 }
 
-ContextHandlerRef OoxConnectionsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ConnectionContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
-        case XML_ROOT_CONTEXT:
-            if( nElement == XLS_TOKEN( connections ) ) return this;
-        break;
-
-        case XLS_TOKEN( connections ):
-            switch( nElement )
-            {
-                case XLS_TOKEN( connection ):   importConnection( rAttribs );   return this;
-            }
-        break;
-
         case XLS_TOKEN( connection ):
-            switch( nElement )
+            if( nElement == XLS_TOKEN( webPr ) )
             {
-                case XLS_TOKEN( webPr ):        importWebPr( rAttribs );        return this;
+                mxConnection->importWebPr( rAttribs );
+                return this;
             }
         break;
 
         case XLS_TOKEN( webPr ):
-            switch( nElement )
+            if( nElement == XLS_TOKEN( tables ) )
             {
-                case XLS_TOKEN( tables ):       importTables( rAttribs );       return this;
+                mxConnection->importTables( rAttribs );
+                return this;
             }
         break;
 
         case XLS_TOKEN( tables ):
-            switch( nElement )
-            {
-                case XLS_TOKEN( s ):            importS( rAttribs );            break;
-                case XLS_TOKEN( x ):            importX( rAttribs );            break;
-            }
+            mxConnection->importTable( rAttribs, nElement );
         break;
     }
     return 0;
 }
 
-void OoxConnectionsFragment::importConnection( const AttributeList& rAttribs )
+ContextHandlerRef ConnectionContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
-    if ( rAttribs.getInteger( XML_type, 0 ) == Connection::CONNECTION_WEBQUERY )
+    switch( getCurrentElement() )
     {
-        getWebQueries().importConnection( rAttribs );
+        case BIFF12_ID_CONNECTION:
+            if( nRecId == BIFF12_ID_WEBPR )
+            {
+                mxConnection->importWebPr( rStrm );
+                return this;
+            }
+        break;
+
+        case BIFF12_ID_WEBPR:
+            if( nRecId == BIFF12_ID_WEBPRTABLES )
+            {
+                mxConnection->importWebPrTables( rStrm );
+                return this;
+            }
+        break;
+
+        case BIFF12_ID_WEBPRTABLES:
+            mxConnection->importWebPrTable( rStrm, nRecId );
+        break;
     }
+    return 0;
 }
 
-void OoxConnectionsFragment::importWebPr( const AttributeList& rAttribs )
+// ============================================================================
+
+ConnectionsFragment::ConnectionsFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
+    WorkbookFragmentBase( rHelper, rFragmentPath )
 {
-    getWebQueries().importWebPr( rAttribs );
 }
 
-void OoxConnectionsFragment::importTables( const AttributeList& /*rAttribs*/ )
+ContextHandlerRef ConnectionsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
-//     sal_Int32 nCount = rAttribs.getInteger( XML_count, 0 );
+    switch( getCurrentElement() )
+    {
+        case XML_ROOT_CONTEXT:
+            if( nElement == XLS_TOKEN( connections ) )
+                return this;
+        break;
+
+        case XLS_TOKEN( connections ):
+            if( nElement == XLS_TOKEN( connection ) )
+            {
+                ConnectionRef xConnection = getConnections().importConnection( rAttribs );
+                if( xConnection.get() )
+                    return new ConnectionContext( *this, xConnection );
+            }
+        break;
+    }
+    return 0;
 }
 
-void OoxConnectionsFragment::importS( const AttributeList& /*rAttribs*/ )
+ContextHandlerRef ConnectionsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
-//     OUString aName = rAttribs.getString( XML_v );
+    switch( getCurrentElement() )
+    {
+        case XML_ROOT_CONTEXT:
+            if( nRecId == BIFF12_ID_CONNECTIONS )
+                return this;
+        break;
+
+        case BIFF12_ID_CONNECTIONS:
+            if( nRecId == BIFF12_ID_CONNECTION )
+            {
+                ConnectionRef xConnection = getConnections().importConnection( rStrm );
+                if( xConnection.get() )
+                    return new ConnectionContext( *this, xConnection );
+            }
+        break;
+    }
+    return 0;
 }
 
-void OoxConnectionsFragment::importX( const AttributeList& /*rAttribs*/ )
+const RecordInfo* ConnectionsFragment::getRecordInfos() const
 {
-//     sal_Int32 nSharedId = rAttribs.getInteger( XML_v, 0 );
+    static const RecordInfo spRecInfos[] =
+    {
+        { BIFF12_ID_CONNECTIONS,    BIFF12_ID_CONNECTIONS + 1   },
+        { BIFF12_ID_CONNECTION,     BIFF12_ID_CONNECTION + 1    },
+        { BIFF12_ID_WEBPR,          BIFF12_ID_WEBPR + 1         },
+        { BIFF12_ID_WEBPRTABLES,    BIFF12_ID_WEBPRTABLES + 1   },
+        { -1,                       -1                          }
+    };
+    return spRecInfos;
 }
 
+// ============================================================================
+
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/defnamesbuffer.cxx b/oox/source/xls/defnamesbuffer.cxx
index a02375e2b869..6ff80e0efe64 100644
--- a/oox/source/xls/defnamesbuffer.cxx
+++ b/oox/source/xls/defnamesbuffer.cxx
@@ -26,7 +26,7 @@
  ************************************************************************/
 
 #include "oox/xls/defnamesbuffer.hxx"
-#include 
+
 #include 
 #include 
 #include 
@@ -34,7 +34,7 @@
 #include 
 #include 
 #include 
-#include "properties.hxx"
+#include 
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/xls/addressconverter.hxx"
@@ -42,35 +42,32 @@
 #include "oox/xls/externallinkbuffer.hxx"
 #include "oox/xls/formulaparser.hxx"
 #include "oox/xls/worksheetbuffer.hxx"
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::ComplexReference;
-using ::com::sun::star::sheet::ExternalReference;
-using ::com::sun::star::sheet::SingleReference;
-using ::com::sun::star::sheet::XFormulaTokens;
-using ::com::sun::star::sheet::XPrintAreas;
+#include "properties.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
 namespace {
 
-const sal_uInt32 OOBIN_DEFNAME_HIDDEN       = 0x00000001;
-const sal_uInt32 OOBIN_DEFNAME_FUNC         = 0x00000002;
-const sal_uInt32 OOBIN_DEFNAME_VBNAME       = 0x00000004;
-const sal_uInt32 OOBIN_DEFNAME_MACRO        = 0x00000008;
-const sal_uInt32 OOBIN_DEFNAME_CALCEXP      = 0x00000010;
-const sal_uInt32 OOBIN_DEFNAME_BUILTIN      = 0x00000020;
-const sal_uInt32 OOBIN_DEFNAME_PUBLISHED    = 0x00008000;
-const sal_uInt32 OOBIN_DEFNAME_WBPARAM      = 0x00010000;
+const sal_uInt32 BIFF12_DEFNAME_HIDDEN      = 0x00000001;
+const sal_uInt32 BIFF12_DEFNAME_FUNC        = 0x00000002;
+const sal_uInt32 BIFF12_DEFNAME_VBNAME      = 0x00000004;
+const sal_uInt32 BIFF12_DEFNAME_MACRO       = 0x00000008;
+const sal_uInt32 BIFF12_DEFNAME_CALCEXP     = 0x00000010;
+const sal_uInt32 BIFF12_DEFNAME_BUILTIN     = 0x00000020;
+const sal_uInt32 BIFF12_DEFNAME_PUBLISHED   = 0x00008000;
+const sal_uInt32 BIFF12_DEFNAME_WBPARAM     = 0x00010000;
 
 const sal_uInt16 BIFF_DEFNAME_HIDDEN        = 0x0001;
 const sal_uInt16 BIFF_DEFNAME_FUNC          = 0x0002;
@@ -91,20 +88,20 @@ const sal_Char* const spcOoxPrefix = "_xlnm.";
 
 const sal_Char* const sppcBaseNames[] =
 {
-    "Consolidate_Area", /* OOX */
+    "Consolidate_Area", /* OOXML */
     "Auto_Open",
     "Auto_Close",
-    "Extract",          /* OOX */
-    "Database",         /* OOX */
-    "Criteria",         /* OOX */
-    "Print_Area",       /* OOX */
-    "Print_Titles",     /* OOX */
+    "Extract",          /* OOXML */
+    "Database",         /* OOXML */
+    "Criteria",         /* OOXML */
+    "Print_Area",       /* OOXML */
+    "Print_Titles",     /* OOXML */
     "Recorder",
     "Data_Form",
     "Auto_Activate",
     "Auto_Deactivate",
-    "Sheet_Title",      /* OOX */
-    "_FilterDatabase"   /* OOX */
+    "Sheet_Title",      /* OOXML */
+    "_FilterDatabase"   /* OOXML */
 };
 
 /** Localized names for _xlnm._FilterDatabase as used in BIFF5. */
@@ -144,15 +141,15 @@ sal_Unicode lclGetBuiltinIdFromOox( const OUString& rOoxName )
                 return cBuiltinId;
         }
     }
-    return OOX_DEFNAME_UNKNOWN;
+    return BIFF_DEFNAME_UNKNOWN;
 }
 
-sal_Unicode lclGetBuiltinIdFromOob( const OUString& rOobName )
+sal_Unicode lclGetBuiltinIdFromBiff( const OUString& rName )
 {
     for( sal_Unicode cBuiltinId = 0; cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ); ++cBuiltinId )
-        if( rOobName.equalsIgnoreAsciiCaseAscii( sppcBaseNames[ cBuiltinId ] ) )
+        if( rName.equalsIgnoreAsciiCaseAscii( sppcBaseNames[ cBuiltinId ] ) )
             return cBuiltinId;
-    return OOX_DEFNAME_UNKNOWN;
+    return BIFF_DEFNAME_UNKNOWN;
 }
 
 bool lclIsFilterDatabaseName( const OUString& rName )
@@ -288,7 +285,7 @@ void DefinedNameBase::importOoxFormula( FormulaContext& rContext, sal_Int16 nBas
         getFormulaParser().convertErrorToFormula( rContext, BIFF_ERR_NAME );
 }
 
-void DefinedNameBase::importOobFormula( FormulaContext& rContext, sal_Int16 nBaseSheet, RecordInputStream& rStrm )
+void DefinedNameBase::importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, RecordInputStream& rStrm )
 {
     rContext.setBaseAddress( CellAddress( nBaseSheet, 0, 0 ) );
     getFormulaParser().importFormula( rContext, rStrm );
@@ -314,7 +311,7 @@ void DefinedNameBase::extractReference( const ApiTokenSequence& rTokens )
 DefinedName::DefinedName( const WorkbookHelper& rHelper ) :
     DefinedNameBase( rHelper ),
     mnTokenIndex( -1 ),
-    mcBuiltinId( OOX_DEFNAME_UNKNOWN ),
+    mcBuiltinId( BIFF_DEFNAME_UNKNOWN ),
     mnFmlaSize( 0 )
 {
 }
@@ -347,14 +344,14 @@ void DefinedName::importDefinedName( RecordInputStream& rStrm )
 
     // macro function/command, hidden flag
     maModel.mnFuncGroupId = extractValue< sal_Int32 >( nFlags, 6, 9 );
-    maModel.mbMacro       = getFlag( nFlags, OOBIN_DEFNAME_MACRO );
-    maModel.mbFunction    = getFlag( nFlags, OOBIN_DEFNAME_FUNC );
-    maModel.mbVBName      = getFlag( nFlags, OOBIN_DEFNAME_VBNAME );
-    maModel.mbHidden      = getFlag( nFlags, OOBIN_DEFNAME_HIDDEN );
+    maModel.mbMacro       = getFlag( nFlags, BIFF12_DEFNAME_MACRO );
+    maModel.mbFunction    = getFlag( nFlags, BIFF12_DEFNAME_FUNC );
+    maModel.mbVBName      = getFlag( nFlags, BIFF12_DEFNAME_VBNAME );
+    maModel.mbHidden      = getFlag( nFlags, BIFF12_DEFNAME_HIDDEN );
 
     // get builtin name index from name
-    if( getFlag( nFlags, OOBIN_DEFNAME_BUILTIN ) )
-        mcBuiltinId = lclGetBuiltinIdFromOob( maModel.maName );
+    if( getFlag( nFlags, BIFF12_DEFNAME_BUILTIN ) )
+        mcBuiltinId = lclGetBuiltinIdFromBiff( maModel.maName );
     // unhide built-in names (_xlnm._FilterDatabase is always hidden)
     if( isBuiltinName() )
         maModel.mbHidden = false;
@@ -430,7 +427,7 @@ void DefinedName::importDefinedName( BiffInputStream& rStrm, sal_Int16 nCalcShee
         built-in flag, and even worse, localized. */
     else if( (eBiff == BIFF5) && lclIsFilterDatabaseName( maModel.maName ) )
     {
-        mcBuiltinId = OOX_DEFNAME_FILTERDATABASE;
+        mcBuiltinId = BIFF_DEFNAME_FILTERDATABASE;
     }
 
     // unhide built-in names (_xlnm._FilterDatabase is always hidden)
@@ -512,9 +509,9 @@ void DefinedName::createNameObject()
     using namespace ::com::sun::star::sheet::NamedRangeFlag;
     if( !isGlobalName() ) switch( mcBuiltinId )
     {
-        case OOX_DEFNAME_CRITERIA:      nNameFlags = FILTER_CRITERIA;               break;
-        case OOX_DEFNAME_PRINTAREA:     nNameFlags = PRINT_AREA;                    break;
-        case OOX_DEFNAME_PRINTTITLES:   nNameFlags = COLUMN_HEADER | ROW_HEADER;    break;
+        case BIFF_DEFNAME_CRITERIA:     nNameFlags = FILTER_CRITERIA;               break;
+        case BIFF_DEFNAME_PRINTAREA:    nNameFlags = PRINT_AREA;                    break;
+        case BIFF_DEFNAME_PRINTTITLES:  nNameFlags = COLUMN_HEADER | ROW_HEADER;    break;
     }
 
     // create the name and insert it into the document, maCalcName will be changed to the resulting name
@@ -532,7 +529,7 @@ void DefinedName::convertFormula()
         // convert and set formula of the defined name
         switch( getFilterType() )
         {
-            case FILTER_OOX:
+            case FILTER_OOXML:
             {
                 SimpleFormulaContext aContext( xTokens, true, false );
                 implImportOoxFormula( aContext );
@@ -550,7 +547,7 @@ void DefinedName::convertFormula()
         // set builtin names (print ranges, repeated titles, filter ranges)
         if( !isGlobalName() ) switch( mcBuiltinId )
         {
-            case OOX_DEFNAME_PRINTAREA:
+            case BIFF_DEFNAME_PRINTAREA:
             {
                 Reference< XPrintAreas > xPrintAreas( getSheetFromDoc( mnCalcSheet ), UNO_QUERY );
                 ApiCellRangeList aPrintRanges;
@@ -559,7 +556,7 @@ void DefinedName::convertFormula()
                     xPrintAreas->setPrintAreas( ContainerHelper::vectorToSequence( aPrintRanges ) );
             }
             break;
-            case OOX_DEFNAME_PRINTTITLES:
+            case BIFF_DEFNAME_PRINTTITLES:
             {
                 Reference< XPrintAreas > xPrintAreas( getSheetFromDoc( mnCalcSheet ), UNO_QUERY );
                 ApiCellRangeList aTitleRanges;
@@ -606,7 +603,7 @@ void DefinedName::implImportOoxFormula( FormulaContext& rContext )
     if( mxFormula.get() )
     {
         RecordInputStream aStrm( *mxFormula );
-        importOobFormula( rContext, mnCalcSheet, aStrm );
+        importBiff12Formula( rContext, mnCalcSheet, aStrm );
     }
     else
         importOoxFormula( rContext, mnCalcSheet );
@@ -709,4 +706,3 @@ DefinedNameRef DefinedNamesBuffer::createDefinedName()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx
index 9f565868a77a..b9e3e3637bd7 100644
--- a/oox/source/xls/drawingfragment.cxx
+++ b/oox/source/xls/drawingfragment.cxx
@@ -458,14 +458,14 @@ void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >&
 
 // ============================================================================
 
-OoxGroupShapeContext::OoxGroupShapeContext( ContextHandler& rParent,
+GroupShapeContext::GroupShapeContext( ContextHandler& rParent,
         const WorksheetHelper& rHelper, const ShapePtr& rxShape ) :
     ShapeGroupContext( rParent, ShapePtr(), rxShape ),
     WorksheetHelper( rHelper )
 {
 }
 
-/*static*/ ContextHandlerRef OoxGroupShapeContext::createShapeContext( ContextHandler& rParent,
+/*static*/ ContextHandlerRef GroupShapeContext::createShapeContext( ContextHandler& rParent,
         const WorksheetHelper& rHelper, sal_Int32 nElement, const AttributeList& rAttribs, ShapePtr* pxShape )
 {
     switch( nElement )
@@ -498,13 +498,13 @@ OoxGroupShapeContext::OoxGroupShapeContext( ContextHandler& rParent,
         {
             ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GroupShape" ) );
             if( pxShape ) *pxShape = xShape;
-            return new OoxGroupShapeContext( rParent, rHelper, xShape );
+            return new GroupShapeContext( rParent, rHelper, xShape );
         }
     }
     return 0;
 }
 
-Reference< XFastContextHandler > SAL_CALL OoxGroupShapeContext::createFastChildContext(
+Reference< XFastContextHandler > SAL_CALL GroupShapeContext::createFastChildContext(
         sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) throw (SAXException, RuntimeException)
 {
     ContextHandlerRef xContext = createShapeContext( *this, *this, nElement, AttributeList( rxAttribs ) );
@@ -513,19 +513,17 @@ Reference< XFastContextHandler > SAL_CALL OoxGroupShapeContext::createFastChildC
 
 // ============================================================================
 
-OoxDrawingFragment::OoxDrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
-    OoxWorksheetFragmentBase( rHelper, rFragmentPath ),
+DrawingFragment::DrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+    WorksheetFragmentBase( rHelper, rFragmentPath ),
     mxDrawPage( rHelper.getDrawPage(), UNO_QUERY )
 {
-    OSL_ENSURE( mxDrawPage.is(), "OoxDrawingFragment::OoxDrawingFragment - missing drawing page" );
+    OSL_ENSURE( mxDrawPage.is(), "DrawingFragment::DrawingFragment - missing drawing page" );
     maApiSheetSize = getDrawPageSize();
     maEmuSheetSize.Width = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Width, UNIT_EMU ) );
     maEmuSheetSize.Height = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Height, UNIT_EMU ) );
 }
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxDrawingFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef DrawingFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -558,7 +556,7 @@ ContextHandlerRef OoxDrawingFragment::onCreateContext( sal_Int32 nElement, const
                 case XDR_TOKEN( ext ):          if( mxAnchor.get() ) mxAnchor->importExt( rAttribs );           break;
                 case XDR_TOKEN( clientData ):   if( mxAnchor.get() ) mxAnchor->importClientData( rAttribs );    break;
 
-                default:                        return OoxGroupShapeContext::createShapeContext( *this, *this, nElement, rAttribs, &mxShape );
+                default:                        return GroupShapeContext::createShapeContext( *this, *this, nElement, rAttribs, &mxShape );
             }
         }
         break;
@@ -577,7 +575,7 @@ ContextHandlerRef OoxDrawingFragment::onCreateContext( sal_Int32 nElement, const
     return 0;
 }
 
-void OoxDrawingFragment::onCharacters( const OUString& rChars )
+void DrawingFragment::onCharacters( const OUString& rChars )
 {
     switch( getCurrentElement() )
     {
@@ -590,7 +588,7 @@ void OoxDrawingFragment::onCharacters( const OUString& rChars )
     }
 }
 
-void OoxDrawingFragment::onEndElement()
+void DrawingFragment::onEndElement()
 {
     switch( getCurrentElement() )
     {
@@ -1077,13 +1075,13 @@ void VmlDrawing::convertControlBackground( AxMorphDataModelBase& rAxModel, const
 
 // ============================================================================
 
-OoxVmlDrawingFragment::OoxVmlDrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+VmlDrawingFragment::VmlDrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
     ::oox::vml::DrawingFragment( rHelper.getOoxFilter(), rFragmentPath, rHelper.getVmlDrawing() ),
     WorksheetHelper( rHelper )
 {
 }
 
-void OoxVmlDrawingFragment::finalizeImport()
+void VmlDrawingFragment::finalizeImport()
 {
     ::oox::vml::DrawingFragment::finalizeImport();
     getVmlDrawing().convertAndInsert();
diff --git a/oox/source/xls/excelchartconverter.cxx b/oox/source/xls/excelchartconverter.cxx
index bde3dd65d723..af0a445223ad 100644
--- a/oox/source/xls/excelchartconverter.cxx
+++ b/oox/source/xls/excelchartconverter.cxx
@@ -26,30 +26,29 @@
  ************************************************************************/
 
 #include "oox/xls/excelchartconverter.hxx"
+
 #include 
 #include 
 #include 
 #include "oox/drawingml/chart/datasourcemodel.hxx"
 #include "oox/xls/formulaparser.hxx"
 
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::chart2::XChartDocument;
-using ::com::sun::star::chart2::data::XDataProvider;
-using ::com::sun::star::chart2::data::XDataReceiver;
-using ::com::sun::star::chart2::data::XDataSequence;
-using ::oox::drawingml::chart::DataSequenceModel;
-
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::oox::drawingml::chart::DataSequenceModel;
+using ::rtl::OUString;
+
+// ============================================================================
+
 ExcelChartConverter::ExcelChartConverter( const WorkbookHelper& rHelper ) :
     WorkbookHelper( rHelper )
 {
@@ -122,4 +121,3 @@ Reference< XDataSequence > ExcelChartConverter::createDataSequence(
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/excelfilter.cxx b/oox/source/xls/excelfilter.cxx
index e136c537c731..030b9cf203c1 100644
--- a/oox/source/xls/excelfilter.cxx
+++ b/oox/source/xls/excelfilter.cxx
@@ -126,7 +126,7 @@ bool ExcelFilter::importDocument() throw()
         return false;
 
     WorkbookHelperRoot aHelper( *this );
-    return aHelper.isValid() && importFragment( new OoxWorkbookFragment( aHelper, aWorkbookPath ) );
+    return aHelper.isValid() && importFragment( new WorkbookFragment( aHelper, aWorkbookPath ) );
 }
 
 bool ExcelFilter::exportDocument() throw()
diff --git a/oox/source/xls/excelhandlers.cxx b/oox/source/xls/excelhandlers.cxx
index aaf551424483..1ffad94d52f1 100644
--- a/oox/source/xls/excelhandlers.cxx
+++ b/oox/source/xls/excelhandlers.cxx
@@ -26,20 +26,23 @@
  ************************************************************************/
 
 #include "oox/xls/excelhandlers.hxx"
+
 #include "oox/core/filterbase.hxx"
 #include "oox/xls/biffinputstream.hxx"
 
-using ::rtl::OUString;
-using ::oox::core::FilterBase;
-using ::oox::core::FragmentHandler2;
-
 namespace oox {
 namespace xls {
 
+// ============================================================================
+
+using ::oox::core::FilterBase;
+using ::oox::core::FragmentHandler2;
+using ::rtl::OUString;
+
 // ============================================================================
 // ============================================================================
 
-OoxWorkbookFragmentBase::OoxWorkbookFragmentBase(
+WorkbookFragmentBase::WorkbookFragmentBase(
         const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
     FragmentHandler2( rHelper.getOoxFilter(), rFragmentPath ),
     WorkbookHelper( rHelper )
@@ -48,14 +51,14 @@ OoxWorkbookFragmentBase::OoxWorkbookFragmentBase(
 
 // ============================================================================
 
-OoxWorksheetFragmentBase::OoxWorksheetFragmentBase( const WorkbookHelper& rHelper,
-        const OUString& rFragmentPath, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+WorksheetFragmentBase::WorksheetFragmentBase( const WorkbookHelper& rHelper,
+        const OUString& rFragmentPath, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
     FragmentHandler2( rHelper.getOoxFilter(), rFragmentPath ),
-    WorksheetHelperRoot( rHelper, xProgressBar, eSheetType, nSheet )
+    WorksheetHelperRoot( rHelper, rxProgressBar, eSheetType, nSheet )
 {
 }
 
-OoxWorksheetFragmentBase::OoxWorksheetFragmentBase(
+WorksheetFragmentBase::WorksheetFragmentBase(
         const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
     FragmentHandler2( rHelper.getOoxFilter(), rFragmentPath ),
     WorksheetHelperRoot( rHelper )
@@ -65,108 +68,52 @@ OoxWorksheetFragmentBase::OoxWorksheetFragmentBase(
 // ============================================================================
 // ============================================================================
 
-namespace {
-
-const sal_uInt16 BIFF_BOF_GLOBALS           = 0x0005;   /// BIFF5-BIFF8 workbook globals.
-const sal_uInt16 BIFF_BOF_MODULE            = 0x0006;   /// BIFF5-BIFF8 Visual Basic module.
-const sal_uInt16 BIFF_BOF_SHEET             = 0x0010;   /// BIFF2-BIFF8 worksheet/dialog sheet.
-const sal_uInt16 BIFF_BOF_CHART             = 0x0020;   /// BIFF2-BIFF8 chart sheet.
-const sal_uInt16 BIFF_BOF_MACRO             = 0x0040;   /// BIFF4-BIFF8 macro sheet.
-const sal_uInt16 BIFF_BOF_WORKSPACE         = 0x0100;   /// BIFF3-BIFF8 workspace.
-
-} // namespace
-
-// ============================================================================
-
-BiffHandlerBase::~BiffHandlerBase()
-{
-}
-
-bool BiffHandlerBase::skipRecordBlock( sal_uInt16 nEndRecId )
-{
-    sal_uInt16 nStartRecId = mrStrm.getRecId();
-    while( mrStrm.startNextRecord() && (mrStrm.getRecId() != nEndRecId) )
-        if( mrStrm.getRecId() == nStartRecId )
-            skipRecordBlock( nEndRecId );
-    return !mrStrm.isEof() && (mrStrm.getRecId() == nEndRecId);
-}
-
-bool BiffHandlerBase::isBofRecord() const
-{
-    return
-        (mrStrm.getRecId() == BIFF2_ID_BOF) ||
-        (mrStrm.getRecId() == BIFF3_ID_BOF) ||
-        (mrStrm.getRecId() == BIFF4_ID_BOF) ||
-        (mrStrm.getRecId() == BIFF5_ID_BOF);
-}
-
-// ============================================================================
-
-BiffContextHandler::BiffContextHandler( const BiffHandlerBase& rParent ) :
-    BiffHandlerBase( rParent )
+BiffContextHandler::~BiffContextHandler()
 {
 }
 
-// ============================================================================
-
-namespace prv {
-
-BiffFragmentStreamOwner::BiffFragmentStreamOwner( const FilterBase& rFilter, const OUString& rStrmName )
-{
-    // do not automatically close the root stream (indicated by empty stream name)
-    mxXInStrm.reset( new BinaryXInputStream( rFilter.openInputStream( rStrmName ), rStrmName.getLength() > 0 ) );
-    mxBiffStrm.reset( new BiffInputStream( *mxXInStrm ) );
-}
+// ----------------------------------------------------------------------------
 
-BiffFragmentStreamOwner::~BiffFragmentStreamOwner()
+BiffWorkbookContextBase::BiffWorkbookContextBase( const WorkbookHelper& rHelper ) :
+    WorkbookHelper( rHelper )
 {
 }
 
-} // namespace prv
-
 // ----------------------------------------------------------------------------
 
-BiffFragmentHandler::BiffFragmentHandler( const FilterBase& rFilter, const OUString& rStrmName ) :
-    prv::BiffFragmentStreamOwner( rFilter, rStrmName ),
-    BiffHandlerBase( *mxBiffStrm )
+BiffWorksheetContextBase::BiffWorksheetContextBase( const WorkbookHelper& rHelper,
+        const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+    WorksheetHelperRoot( rHelper, rxProgressBar, eSheetType, nSheet )
 {
 }
 
-BiffFragmentHandler::BiffFragmentHandler( const BiffFragmentHandler& rHandler ) :
-    prv::BiffFragmentStreamOwner( rHandler ),
-    BiffHandlerBase( rHandler )
+BiffWorksheetContextBase::BiffWorksheetContextBase( const WorksheetHelper& rHelper ) :
+    WorksheetHelperRoot( rHelper )
 {
 }
 
-BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff )
-{
-    return mrStrm.startNextRecord() ? implStartFragment( eBiff ) : BIFF_FRAGMENT_UNKNOWN;
-}
+// ============================================================================
 
-BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff, sal_Int64 nRecHandle )
-{
-    return mrStrm.startRecordByHandle( nRecHandle ) ? implStartFragment( eBiff ) : BIFF_FRAGMENT_UNKNOWN;
-}
+namespace {
 
-bool BiffFragmentHandler::skipFragment()
-{
-    while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
-        if( isBofRecord() )
-            skipFragment();
-    return !mrStrm.isEof() && (mrStrm.getRecId() == BIFF_ID_EOF);
-}
+const sal_uInt16 BIFF_BOF_GLOBALS           = 0x0005;   /// BIFF5-BIFF8 workbook globals.
+const sal_uInt16 BIFF_BOF_MODULE            = 0x0006;   /// BIFF5-BIFF8 Visual Basic module.
+const sal_uInt16 BIFF_BOF_SHEET             = 0x0010;   /// BIFF2-BIFF8 worksheet/dialog sheet.
+const sal_uInt16 BIFF_BOF_CHART             = 0x0020;   /// BIFF2-BIFF8 chart sheet.
+const sal_uInt16 BIFF_BOF_MACRO             = 0x0040;   /// BIFF4-BIFF8 macro sheet.
+const sal_uInt16 BIFF_BOF_WORKSPACE         = 0x0100;   /// BIFF3-BIFF8 workspace.
 
-BiffFragmentType BiffFragmentHandler::implStartFragment( BiffType eBiff )
+BiffFragmentType lclStartFragment( BiffInputStream& rStrm, BiffType eBiff )
 {
     BiffFragmentType eFragment = BIFF_FRAGMENT_UNKNOWN;
     /*  #i23425# Don't rely on BOF record ID to read BOF contents, but on
         the detected BIFF version. */
-    if( isBofRecord() )
+    if( BiffHelper::isBofRecord( rStrm ) )
     {
         // BOF is always written unencrypted
-        mrStrm.enableDecoder( false );
-        mrStrm.skip( 2 );
-        sal_uInt16 nType = mrStrm.readuInt16();
+        rStrm.enableDecoder( false );
+        rStrm.skip( 2 );
+        sal_uInt16 nType = rStrm.readuInt16();
 
         // decide which fragment types are valid for current BIFF version
         switch( eBiff )
@@ -219,30 +166,64 @@ BiffFragmentType BiffFragmentHandler::implStartFragment( BiffType eBiff )
     return eFragment;
 }
 
-// ============================================================================
+} // namespace
+
+// ----------------------------------------------------------------------------
+
+BiffFragmentHandler::BiffFragmentHandler( const FilterBase& rFilter, const OUString& rStrmName )
+{
+    // do not automatically close the root stream (indicated by empty stream name)
+    bool bRootStrm = rStrmName.getLength() == 0;
+    mxXInStrm.reset( new BinaryXInputStream( rFilter.openInputStream( rStrmName ), !bRootStrm ) );
+    mxBiffStrm.reset( new BiffInputStream( *mxXInStrm ) );
+}
+
+BiffFragmentHandler::~BiffFragmentHandler()
+{
+}
+
+BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff )
+{
+    return mxBiffStrm->startNextRecord() ? lclStartFragment( *mxBiffStrm, eBiff ) : BIFF_FRAGMENT_UNKNOWN;
+}
+
+BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff, sal_Int64 nRecHandle )
+{
+    return mxBiffStrm->startRecordByHandle( nRecHandle ) ? lclStartFragment( *mxBiffStrm, eBiff ) : BIFF_FRAGMENT_UNKNOWN;
+}
+
+bool BiffFragmentHandler::skipFragment()
+{
+    while( mxBiffStrm->startNextRecord() && (mxBiffStrm->getRecId() != BIFF_ID_EOF) )
+        if( BiffHelper::isBofRecord( *mxBiffStrm ) )
+            skipFragment();
+    return !mxBiffStrm->isEof() && (mxBiffStrm->getRecId() == BIFF_ID_EOF);
+}
+
+// ----------------------------------------------------------------------------
 
 BiffWorkbookFragmentBase::BiffWorkbookFragmentBase( const WorkbookHelper& rHelper, const OUString& rStrmName, bool bCloneDecoder ) :
     BiffFragmentHandler( rHelper.getBaseFilter(), rStrmName ),
     WorkbookHelper( rHelper )
 {
     if( bCloneDecoder )
-        getCodecHelper().cloneDecoder( mrStrm );
+        getCodecHelper().cloneDecoder( getInputStream() );
 }
 
-// ============================================================================
+// ----------------------------------------------------------------------------
 
 BiffWorksheetFragmentBase::BiffWorksheetFragmentBase( const BiffWorkbookFragmentBase& rParent,
-        ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+        const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
     BiffFragmentHandler( rParent ),
-    WorksheetHelperRoot( rParent, xProgressBar, eSheetType, nSheet )
+    WorksheetHelperRoot( rParent, rxProgressBar, eSheetType, nSheet )
 {
 }
 
-// ============================================================================
+// ----------------------------------------------------------------------------
 
-BiffSkipWorksheetFragment::BiffSkipWorksheetFragment(
-        const BiffWorkbookFragmentBase& rParent, ISegmentProgressBarRef xProgressBar, sal_Int16 nSheet ) :
-    BiffWorksheetFragmentBase( rParent, xProgressBar, SHEETTYPE_EMPTYSHEET, nSheet )
+BiffSkipWorksheetFragment::BiffSkipWorksheetFragment( const BiffWorkbookFragmentBase& rParent,
+        const ISegmentProgressBarRef& rxProgressBar, sal_Int16 nSheet ) :
+    BiffWorksheetFragmentBase( rParent, rxProgressBar, SHEETTYPE_EMPTYSHEET, nSheet )
 {
 }
 
@@ -256,4 +237,3 @@ bool BiffSkipWorksheetFragment::importFragment()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/externallinkbuffer.cxx b/oox/source/xls/externallinkbuffer.cxx
index 648555474218..73264f338850 100644
--- a/oox/source/xls/externallinkbuffer.cxx
+++ b/oox/source/xls/externallinkbuffer.cxx
@@ -39,13 +39,14 @@
 #include 
 #include 
 #include 
-#include "oox/helper/attributelist.hxx"
 #include "oox/core/filterbase.hxx"
+#include "oox/helper/attributelist.hxx"
 #include "oox/xls/addressconverter.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/excelhandlers.hxx"
 #include "oox/xls/formulaparser.hxx"
 #include "oox/xls/worksheetbuffer.hxx"
+#include "properties.hxx"
 
 namespace oox {
 namespace xls {
@@ -67,15 +68,15 @@ using ::rtl::OUString;
 
 namespace {
 
-const sal_uInt16 OOBIN_EXTERNALBOOK_BOOK    = 0;
-const sal_uInt16 OOBIN_EXTERNALBOOK_DDE     = 1;
-const sal_uInt16 OOBIN_EXTERNALBOOK_OLE     = 2;
+const sal_uInt16 BIFF12_EXTERNALBOOK_BOOK   = 0;
+const sal_uInt16 BIFF12_EXTERNALBOOK_DDE    = 1;
+const sal_uInt16 BIFF12_EXTERNALBOOK_OLE    = 2;
 
-const sal_uInt16 OOBIN_EXTNAME_AUTOMATIC    = 0x0002;
-const sal_uInt16 OOBIN_EXTNAME_PREFERPIC    = 0x0004;
-const sal_uInt16 OOBIN_EXTNAME_STDDOCNAME   = 0x0008;
-const sal_uInt16 OOBIN_EXTNAME_OLEOBJECT    = 0x0010;
-const sal_uInt16 OOBIN_EXTNAME_ICONIFIED    = 0x0020;
+const sal_uInt16 BIFF12_EXTNAME_AUTOMATIC   = 0x0002;
+const sal_uInt16 BIFF12_EXTNAME_PREFERPIC   = 0x0004;
+const sal_uInt16 BIFF12_EXTNAME_STDDOCNAME  = 0x0008;
+const sal_uInt16 BIFF12_EXTNAME_OLEOBJECT   = 0x0010;
+const sal_uInt16 BIFF12_EXTNAME_ICONIFIED   = 0x0020;
 
 const sal_uInt16 BIFF_EXTNAME_BUILTIN       = 0x0001;
 const sal_uInt16 BIFF_EXTNAME_AUTOMATIC     = 0x0002;
@@ -152,14 +153,14 @@ void ExternalName::importExternalNameFlags( RecordInputStream& rStrm )
     sal_uInt16 nFlags;
     sal_Int32 nSheetId;
     rStrm >> nFlags >> nSheetId;
-    // index into sheet list of EXTSHEETNAMES (one-based in OOBIN)
+    // index into sheet list of EXTSHEETNAMES (one-based in BIFF12)
     maModel.mnSheet = nSheetId - 1;
-    // no flag for built-in names, as in OOX...
-    maExtNameModel.mbNotify     = getFlag( nFlags, OOBIN_EXTNAME_AUTOMATIC );
-    maExtNameModel.mbPreferPic  = getFlag( nFlags, OOBIN_EXTNAME_PREFERPIC );
-    maExtNameModel.mbStdDocName = getFlag( nFlags, OOBIN_EXTNAME_STDDOCNAME );
-    maExtNameModel.mbOleObj     = getFlag( nFlags, OOBIN_EXTNAME_OLEOBJECT );
-    maExtNameModel.mbIconified  = getFlag( nFlags, OOBIN_EXTNAME_ICONIFIED );
+    // no flag for built-in names, as in OOXML...
+    maExtNameModel.mbNotify     = getFlag( nFlags, BIFF12_EXTNAME_AUTOMATIC );
+    maExtNameModel.mbPreferPic  = getFlag( nFlags, BIFF12_EXTNAME_PREFERPIC );
+    maExtNameModel.mbStdDocName = getFlag( nFlags, BIFF12_EXTNAME_STDDOCNAME );
+    maExtNameModel.mbOleObj     = getFlag( nFlags, BIFF12_EXTNAME_OLEOBJECT );
+    maExtNameModel.mbIconified  = getFlag( nFlags, BIFF12_EXTNAME_ICONIFIED );
     OSL_ENSURE( (mrParentLink.getLinkType() == LINKTYPE_OLE) == maExtNameModel.mbOleObj,
         "ExternalName::importExternalNameFlags - wrong OLE flag in external name" );
 }
@@ -313,8 +314,8 @@ sal_Int32 ExternalName::getSheetCacheIndex() const
     sal_Int32 nCacheIdx = -1;
     switch( getFilterType() )
     {
-        case FILTER_OOX:
-            // OOXML/OOBIN: zero-based index into sheet list, -1 means global name
+        case FILTER_OOXML:
+            // OOXML/BIFF12: zero-based index into sheet list, -1 means global name
             if( maModel.mnSheet >= 0 )
                 nCacheIdx = mrParentLink.getSheetIndex( maModel.mnSheet );
         break;
@@ -364,14 +365,15 @@ bool ExternalName::getDdeLinkData( OUString& orDdeServer, OUString& orDdeTopic,
         // try to create a DDE link and to set the imported link results
         if( !mbDdeLinkCreated ) try
         {
-            Reference< XDDELinks > xDdeLinks( getDdeLinks(), UNO_QUERY_THROW );
+            PropertySet aDocProps( getDocument() );
+            Reference< XDDELinks > xDdeLinks( aDocProps.getAnyProperty( PROP_DDELinks ), UNO_QUERY_THROW );
             mxDdeLink = xDdeLinks->addDDELink( mrParentLink.getClassName(), mrParentLink.getTargetUrl(), maModel.maName, ::com::sun::star::sheet::DDELinkMode_DEFAULT );
+            mbDdeLinkCreated = true;    // ignore if setting results fails
             if( !maResults.empty() )
             {
                 Reference< XDDELinkResults > xResults( mxDdeLink, UNO_QUERY_THROW );
                 xResults->setResults( ContainerHelper::matrixToSequenceSequence( maResults ) );
             }
-            mbDdeLinkCreated = true;
         }
         catch( Exception& )
         {
@@ -566,17 +568,17 @@ void ExternalLink::importExternalBook( const Relations& rRelations, RecordInputS
 {
     switch( rStrm.readuInt16() )
     {
-        case OOBIN_EXTERNALBOOK_BOOK:
+        case BIFF12_EXTERNALBOOK_BOOK:
             parseExternalReference( rRelations, rStrm.readString() );
         break;
-        case OOBIN_EXTERNALBOOK_DDE:
+        case BIFF12_EXTERNALBOOK_DDE:
         {
             OUString aDdeService, aDdeTopic;
             rStrm >> aDdeService >> aDdeTopic;
             setDdeOleTargetUrl( aDdeService, aDdeTopic, LINKTYPE_DDE );
         }
         break;
-        case OOBIN_EXTERNALBOOK_OLE:
+        case BIFF12_EXTERNALBOOK_OLE:
         {
             OUString aTargetUrl = rRelations.getExternalTargetFromRelId( rStrm.readString() );
             OUString aProgId = rStrm.readString();
@@ -715,7 +717,7 @@ FunctionLibraryType ExternalLink::getFuncLibraryType() const
 sal_Int16 ExternalLink::getCalcSheetIndex( sal_Int32 nTabId ) const
 {
     OSL_ENSURE( meLinkType == LINKTYPE_INTERNAL, "ExternalLink::getCalcSheetIndex - invalid link type" );
-    OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOX) || (getBiff() == BIFF8),
+    OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOXML) || (getBiff() == BIFF8),
         "ExternalLink::getCalcSheetIndex - invalid sheet index" );
     return ContainerHelper::getVectorElement< sal_Int16 >( maCalcSheets, nTabId, -1 );
 }
@@ -729,7 +731,7 @@ sal_Int32 ExternalLink::getDocumentLinkIndex() const
 sal_Int32 ExternalLink::getSheetCacheIndex( sal_Int32 nTabId ) const
 {
     OSL_ENSURE( meLinkType == LINKTYPE_EXTERNAL, "ExternalLink::getSheetCacheIndex - invalid link type" );
-    OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOX) || (getBiff() == BIFF8),
+    OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOXML) || (getBiff() == BIFF8),
         "ExternalLink::getSheetCacheIndex - invalid sheet index" );
     return ContainerHelper::getVectorElement< sal_Int32 >( maSheetCaches, nTabId, -1 );
 }
@@ -767,8 +769,8 @@ void ExternalLink::getSheetRange( LinkSheetRange& orSheetRange, sal_Int32 nTabId
             sal_Int32 nDocLinkIdx = getDocumentLinkIndex();
             switch( getFilterType() )
             {
-                case FILTER_OOX:
-                    // OOBIN: passed indexes point into sheet list of EXTSHEETLIST
+                case FILTER_OOXML:
+                    // BIFF12: passed indexes point into sheet list of EXTSHEETLIST
                     orSheetRange.setExternalRange( nDocLinkIdx, getSheetCacheIndex( nTabId1 ), getSheetCacheIndex( nTabId2 ) );
                 break;
                 case FILTER_BIFF:
@@ -830,11 +832,14 @@ void ExternalLink::setExternalTargetUrl( const OUString& rTargetUrl, const OUStr
     OSL_ENSURE( meLinkType != LINKTYPE_UNKNOWN, "ExternalLink::setExternalTargetUrl - empty target URL or unknown target type" );
 
     // create the external document link API object that will contain the sheet caches
-    if( meLinkType == LINKTYPE_EXTERNAL )
+    if( meLinkType == LINKTYPE_EXTERNAL ) try
+    {
+        PropertySet aDocProps( getDocument() );
+        Reference< XExternalDocLinks > xDocLinks( aDocProps.getAnyProperty( PROP_ExternalDocLinks ), UNO_QUERY_THROW );
+        mxDocLink = xDocLinks->addDocLink( maTargetUrl );
+    }
+    catch( Exception& )
     {
-        Reference< XExternalDocLinks > xDocLinks = getExternalDocLinks();
-        if( xDocLinks.is() )
-            mxDocLink = xDocLinks->addDocLink( maTargetUrl );
     }
 }
 
@@ -922,7 +927,7 @@ RefSheetsModel::RefSheetsModel() :
 {
 }
 
-void RefSheetsModel::readOobData( RecordInputStream& rStrm )
+void RefSheetsModel::readBiff12Data( RecordInputStream& rStrm )
 {
     rStrm >> mnExtRefId >> mnTabId1 >> mnTabId2;
 }
@@ -992,7 +997,7 @@ void ExternalLinkBuffer::importExternalSheets( RecordInputStream& rStrm )
     for( size_t nRefId = 0; !rStrm.isEof() && (nRefId < nMaxCount); ++nRefId )
     {
         RefSheetsModel aRefSheets;
-        aRefSheets.readOobData( rStrm );
+        aRefSheets.readBiff12Data( rStrm );
         maRefSheets.push_back( aRefSheets );
     }
 }
@@ -1032,15 +1037,15 @@ void ExternalLinkBuffer::importExternSheet8( BiffInputStream& rStrm )
         insert the entries of the second record before the entries of the first
         record. */
     maRefSheets.insert( maRefSheets.begin(), nRefCount, RefSheetsModel() );
-    for( RefSheetsModelVec::iterator aIt = maRefSheets.begin(); !rStrm.isEof() && (nRefCount > 0); --nRefCount )
+    for( RefSheetsModelVec::iterator aIt = maRefSheets.begin(), aEnd = aIt + nRefCount; !rStrm.isEof() && (aIt != aEnd); ++aIt )
         aIt->readBiff8Data( rStrm );
 }
 
 Sequence< ExternalLinkInfo > ExternalLinkBuffer::getLinkInfos() const
 {
     ::std::vector< ExternalLinkInfo > aLinkInfos;
-    // should not be used for OOBIN documents
-    OSL_ENSURE( (getFilterType() == FILTER_OOX) && !mbUseRefSheets, "ExternalLinkBuffer::getLinkInfos - unexpected file format" );
+    // should not be used for BIFF12 documents
+    OSL_ENSURE( (getFilterType() == FILTER_OOXML) && !mbUseRefSheets, "ExternalLinkBuffer::getLinkInfos - unexpected file format" );
     // add entry for implicit index 0 (self reference to this document)
     aLinkInfos.push_back( mxSelfRef->getLinkInfo() );
     for( ExternalLinkVec::const_iterator aIt = maExtLinks.begin(), aEnd = maExtLinks.end(); aIt != aEnd; ++aIt )
@@ -1053,11 +1058,11 @@ ExternalLinkRef ExternalLinkBuffer::getExternalLink( sal_Int32 nRefId, bool bUse
     ExternalLinkRef xExtLink;
     switch( getFilterType() )
     {
-        case FILTER_OOX:
+        case FILTER_OOXML:
             // OOXML: 0 = this document, otherwise one-based index into link list
             if( !bUseRefSheets || !mbUseRefSheets )
                 xExtLink = (nRefId == 0) ? mxSelfRef : maLinks.get( nRefId - 1 );
-            // OOBIN: zero-based index into ref-sheets list
+            // BIFF12: zero-based index into ref-sheets list
             else if( const RefSheetsModel* pRefSheets = getRefSheets( nRefId ) )
                 xExtLink = maLinks.get( pRefSheets->mnExtRefId );
         break;
@@ -1108,7 +1113,7 @@ LinkSheetRange ExternalLinkBuffer::getSheetRange( sal_Int32 nRefId, sal_Int16 nT
 
 LinkSheetRange ExternalLinkBuffer::getSheetRange( sal_Int32 nRefId ) const
 {
-    OSL_ENSURE( ((getFilterType() == FILTER_OOX) && mbUseRefSheets) || (getBiff() == BIFF8), "ExternalLinkBuffer::getSheetRange - wrong BIFF version" );
+    OSL_ENSURE( ((getFilterType() == FILTER_OOXML) && mbUseRefSheets) || (getBiff() == BIFF8), "ExternalLinkBuffer::getSheetRange - wrong BIFF version" );
     LinkSheetRange aSheetRange;
     if( const ExternalLink* pExtLink = getExternalLink( nRefId ).get() )
         if( const RefSheetsModel* pRefSheets = getRefSheets( nRefId ) )
diff --git a/oox/source/xls/externallinkfragment.cxx b/oox/source/xls/externallinkfragment.cxx
index b9b2029f5824..d519e27e1506 100644
--- a/oox/source/xls/externallinkfragment.cxx
+++ b/oox/source/xls/externallinkfragment.cxx
@@ -26,6 +26,7 @@
  ************************************************************************/
 
 #include "oox/xls/externallinkfragment.hxx"
+
 #include 
 #include "oox/helper/attributelist.hxx"
 #include "oox/xls/biffinputstream.hxx"
@@ -33,32 +34,32 @@
 #include "oox/xls/sheetdatacontext.hxx"
 #include "oox/xls/unitconverter.hxx"
 
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::XExternalSheetCache;
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
 using ::oox::core::ContextHandlerRef;
 using ::oox::core::RecordInfo;
 using ::oox::core::Relation;
-
-namespace oox {
-namespace xls {
+using ::rtl::OUString;
 
+// ============================================================================
 // ============================================================================
 
-OoxExternalSheetDataContext::OoxExternalSheetDataContext(
-        OoxWorkbookFragmentBase& rFragment, const Reference< XExternalSheetCache >& rxSheetCache ) :
-    OoxWorkbookContextBase( rFragment ),
+ExternalSheetDataContext::ExternalSheetDataContext(
+        WorkbookFragmentBase& rFragment, const Reference< XExternalSheetCache >& rxSheetCache ) :
+    WorkbookContextBase( rFragment ),
     mxSheetCache( rxSheetCache )
 {
-    OSL_ENSURE( mxSheetCache.is(), "OoxExternalSheetDataContext::OoxExternalSheetDataContext - missing sheet cache" );
+    OSL_ENSURE( mxSheetCache.is(), "ExternalSheetDataContext::ExternalSheetDataContext - missing sheet cache" );
 }
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxExternalSheetDataContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ExternalSheetDataContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -75,7 +76,7 @@ ContextHandlerRef OoxExternalSheetDataContext::onCreateContext( sal_Int32 nEleme
     return 0;
 }
 
-void OoxExternalSheetDataContext::onCharacters( const OUString& rChars )
+void ExternalSheetDataContext::onCharacters( const OUString& rChars )
 {
     if( isCurrentElement( XLS_TOKEN( v ) ) )
     {
@@ -96,21 +97,21 @@ void OoxExternalSheetDataContext::onCharacters( const OUString& rChars )
     }
 }
 
-ContextHandlerRef OoxExternalSheetDataContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ExternalSheetDataContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
-        case OOBIN_ID_EXTSHEETDATA:
-            if( nRecId == OOBIN_ID_EXTROW ) { maCurrPos.Row = rStrm.readInt32(); return this; }
+        case BIFF12_ID_EXTSHEETDATA:
+            if( nRecId == BIFF12_ID_EXTROW ) { maCurrPos.Row = rStrm.readInt32(); return this; }
         break;
-        case OOBIN_ID_EXTROW:
+        case BIFF12_ID_EXTROW:
             switch( nRecId )
             {
-                case OOBIN_ID_EXTCELL_BLANK:    importExtCellBlank( rStrm );    break;
-                case OOBIN_ID_EXTCELL_BOOL:     importExtCellBool( rStrm );     break;
-                case OOBIN_ID_EXTCELL_DOUBLE:   importExtCellDouble( rStrm );   break;
-                case OOBIN_ID_EXTCELL_ERROR:    importExtCellError( rStrm );    break;
-                case OOBIN_ID_EXTCELL_STRING:   importExtCellString( rStrm );   break;
+                case BIFF12_ID_EXTCELL_BLANK:   importExtCellBlank( rStrm );    break;
+                case BIFF12_ID_EXTCELL_BOOL:    importExtCellBool( rStrm );     break;
+                case BIFF12_ID_EXTCELL_DOUBLE:  importExtCellDouble( rStrm );   break;
+                case BIFF12_ID_EXTCELL_ERROR:   importExtCellError( rStrm );    break;
+                case BIFF12_ID_EXTCELL_STRING:  importExtCellString( rStrm );   break;
             }
         break;
     }
@@ -119,7 +120,7 @@ ContextHandlerRef OoxExternalSheetDataContext::onCreateRecordContext( sal_Int32
 
 // private --------------------------------------------------------------------
 
-void OoxExternalSheetDataContext::importCell( const AttributeList& rAttribs )
+void ExternalSheetDataContext::importCell( const AttributeList& rAttribs )
 {
     if( getAddressConverter().convertToCellAddress( maCurrPos, rAttribs.getString( XML_r, OUString() ), 0, false ) )
         mnCurrType = rAttribs.getToken( XML_t, XML_n );
@@ -127,38 +128,38 @@ void OoxExternalSheetDataContext::importCell( const AttributeList& rAttribs )
         mnCurrType = XML_TOKEN_INVALID;
 }
 
-void OoxExternalSheetDataContext::importExtCellBlank( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellBlank( RecordInputStream& rStrm )
 {
     maCurrPos.Column = rStrm.readInt32();
     setCellValue( Any( OUString() ) );
 }
 
-void OoxExternalSheetDataContext::importExtCellBool( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellBool( RecordInputStream& rStrm )
 {
     maCurrPos.Column = rStrm.readInt32();
     double fValue = (rStrm.readuInt8() == 0) ? 0.0 : 1.0;
     setCellValue( Any( fValue ) );
 }
 
-void OoxExternalSheetDataContext::importExtCellDouble( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellDouble( RecordInputStream& rStrm )
 {
     maCurrPos.Column = rStrm.readInt32();
     setCellValue( Any( rStrm.readDouble() ) );
 }
 
-void OoxExternalSheetDataContext::importExtCellError( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellError( RecordInputStream& rStrm )
 {
     maCurrPos.Column = rStrm.readInt32();
     setCellValue( Any( BiffHelper::calcDoubleFromError( rStrm.readuInt8() ) ) );
 }
 
-void OoxExternalSheetDataContext::importExtCellString( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellString( RecordInputStream& rStrm )
 {
     maCurrPos.Column = rStrm.readInt32();
     setCellValue( Any( rStrm.readString() ) );
 }
 
-void OoxExternalSheetDataContext::setCellValue( const Any& rValue )
+void ExternalSheetDataContext::setCellValue( const Any& rValue )
 {
     if( mxSheetCache.is() && getAddressConverter().checkCellAddress( maCurrPos, false ) ) try
     {
@@ -171,17 +172,15 @@ void OoxExternalSheetDataContext::setCellValue( const Any& rValue )
 
 // ============================================================================
 
-OoxExternalLinkFragment::OoxExternalLinkFragment( const WorkbookHelper& rHelper,
+ExternalLinkFragment::ExternalLinkFragment( const WorkbookHelper& rHelper,
         const OUString& rFragmentPath, ExternalLink& rExtLink ) :
-    OoxWorkbookFragmentBase( rHelper, rFragmentPath ),
+    WorkbookFragmentBase( rHelper, rFragmentPath ),
     mrExtLink( rExtLink ),
     mnResultType( XML_TOKEN_INVALID )
 {
 }
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxExternalLinkFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ExternalLinkFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -256,13 +255,13 @@ ContextHandlerRef OoxExternalLinkFragment::onCreateContext( sal_Int32 nElement,
     return 0;
 }
 
-void OoxExternalLinkFragment::onCharacters( const OUString& rChars )
+void ExternalLinkFragment::onCharacters( const OUString& rChars )
 {
     if( isCurrentElement( XLS_TOKEN( val ) ) )
         maResultValue = rChars;
 }
 
-void OoxExternalLinkFragment::onEndElement()
+void ExternalLinkFragment::onEndElement()
 {
     if( isCurrentElement( XLS_TOKEN( value ) ) && mxExtName.get() ) switch( mnResultType )
     {
@@ -283,180 +282,161 @@ void OoxExternalLinkFragment::onEndElement()
     }
 }
 
-ContextHandlerRef OoxExternalLinkFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ExternalLinkFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
         case XML_ROOT_CONTEXT:
-            if( nRecId == OOBIN_ID_EXTERNALBOOK )
+            if( nRecId == BIFF12_ID_EXTERNALBOOK )
             {
                 mrExtLink.importExternalBook( getRelations(), rStrm );
                 return this;
             }
         break;
 
-        case OOBIN_ID_EXTERNALBOOK:
+        case BIFF12_ID_EXTERNALBOOK:
             switch( nRecId )
             {
-                case OOBIN_ID_EXTSHEETDATA:
+                case BIFF12_ID_EXTSHEETDATA:
                     if( mrExtLink.getLinkType() == LINKTYPE_EXTERNAL )
                         return createSheetDataContext( rStrm.readInt32() );
                 break;
 
-                case OOBIN_ID_EXTSHEETNAMES:        mrExtLink.importExtSheetNames( rStrm );                             break;
-                case OOBIN_ID_EXTERNALNAME:         mxExtName = mrExtLink.importExternalName( rStrm );                  return this;
+                case BIFF12_ID_EXTSHEETNAMES:       mrExtLink.importExtSheetNames( rStrm );                             break;
+                case BIFF12_ID_EXTERNALNAME:        mxExtName = mrExtLink.importExternalName( rStrm );                  return this;
             }
         break;
 
-        case OOBIN_ID_EXTERNALNAME:
+        case BIFF12_ID_EXTERNALNAME:
             switch( nRecId )
             {
-                case OOBIN_ID_EXTERNALNAMEFLAGS:    if( mxExtName.get() ) mxExtName->importExternalNameFlags( rStrm );  break;
-                case OOBIN_ID_DDEITEMVALUES:        if( mxExtName.get() ) mxExtName->importDdeItemValues( rStrm );      return this;
+                case BIFF12_ID_EXTERNALNAMEFLAGS:   if( mxExtName.get() ) mxExtName->importExternalNameFlags( rStrm );  break;
+                case BIFF12_ID_DDEITEMVALUES:       if( mxExtName.get() ) mxExtName->importDdeItemValues( rStrm );      return this;
             }
         break;
 
-        case OOBIN_ID_DDEITEMVALUES:
+        case BIFF12_ID_DDEITEMVALUES:
             switch( nRecId )
             {
-                case OOBIN_ID_DDEITEM_BOOL:         if( mxExtName.get() ) mxExtName->importDdeItemBool( rStrm );        break;
-                case OOBIN_ID_DDEITEM_DOUBLE:       if( mxExtName.get() ) mxExtName->importDdeItemDouble( rStrm );      break;
-                case OOBIN_ID_DDEITEM_ERROR:        if( mxExtName.get() ) mxExtName->importDdeItemError( rStrm );       break;
-                case OOBIN_ID_DDEITEM_STRING:       if( mxExtName.get() ) mxExtName->importDdeItemString( rStrm );      break;
+                case BIFF12_ID_DDEITEM_BOOL:        if( mxExtName.get() ) mxExtName->importDdeItemBool( rStrm );        break;
+                case BIFF12_ID_DDEITEM_DOUBLE:      if( mxExtName.get() ) mxExtName->importDdeItemDouble( rStrm );      break;
+                case BIFF12_ID_DDEITEM_ERROR:       if( mxExtName.get() ) mxExtName->importDdeItemError( rStrm );       break;
+                case BIFF12_ID_DDEITEM_STRING:      if( mxExtName.get() ) mxExtName->importDdeItemString( rStrm );      break;
             }
         break;
     }
     return 0;
 }
 
-ContextHandlerRef OoxExternalLinkFragment::createSheetDataContext( sal_Int32 nSheetId )
+ContextHandlerRef ExternalLinkFragment::createSheetDataContext( sal_Int32 nSheetId )
 {
-    return new OoxExternalSheetDataContext( *this, mrExtLink.getSheetCache( nSheetId ) );
+    return new ExternalSheetDataContext( *this, mrExtLink.getSheetCache( nSheetId ) );
 }
 
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxExternalLinkFragment::getRecordInfos() const
+const RecordInfo* ExternalLinkFragment::getRecordInfos() const
 {
     static const RecordInfo spRecInfos[] =
     {
-        { OOBIN_ID_DDEITEMVALUES,   OOBIN_ID_DDEITEMVALUES + 1  },
-        { OOBIN_ID_EXTERNALBOOK,    OOBIN_ID_EXTERNALBOOK + 228 },
-        { OOBIN_ID_EXTERNALNAME,    OOBIN_ID_EXTERNALNAME + 10  },
-        { OOBIN_ID_EXTROW,          -1                          },
-        { OOBIN_ID_EXTSHEETDATA,    OOBIN_ID_EXTSHEETDATA + 1   },
-        { -1,                       -1                          }
+        { BIFF12_ID_DDEITEMVALUES,  BIFF12_ID_DDEITEMVALUES + 1     },
+        { BIFF12_ID_EXTERNALBOOK,   BIFF12_ID_EXTERNALBOOK + 228    },
+        { BIFF12_ID_EXTERNALNAME,   BIFF12_ID_EXTERNALNAME + 10     },
+        { BIFF12_ID_EXTROW,         -1                              },
+        { BIFF12_ID_EXTSHEETDATA,   BIFF12_ID_EXTSHEETDATA + 1      },
+        { -1,                       -1                              }
     };
     return spRecInfos;
 }
 
+// ============================================================================
 // ============================================================================
 
-BiffExternalLinkFragment::BiffExternalLinkFragment( const BiffWorkbookFragmentBase& rParent, bool bImportDefNames ) :
-    BiffWorkbookFragmentBase( rParent ),
+BiffExternalSheetDataContext::BiffExternalSheetDataContext( const WorkbookHelper& rHelper, bool bImportDefNames ) :
+    BiffWorkbookContextBase( rHelper ),
     mbImportDefNames( bImportDefNames )
 {
 }
 
-BiffExternalLinkFragment::~BiffExternalLinkFragment()
+BiffExternalSheetDataContext::~BiffExternalSheetDataContext()
 {
 }
 
-bool BiffExternalLinkFragment::importFragment()
-{
-    // process all record in this sheet fragment
-    while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
-    {
-        if( isBofRecord() )
-            skipFragment();  // skip unknown embedded fragments
-        else
-            importRecord();
-    }
-    return !mrStrm.isEof() && (mrStrm.getRecId() == BIFF_ID_EOF);
-}
-
-void BiffExternalLinkFragment::importRecord()
+void BiffExternalSheetDataContext::importRecord( BiffInputStream& rStrm )
 {
-    sal_uInt16 nRecId = mrStrm.getRecId();
+    sal_uInt16 nRecId = rStrm.getRecId();
     switch( getBiff() )
     {
         case BIFF2: switch( nRecId )
         {
-            case BIFF2_ID_EXTERNALNAME: importExternalName();   break;
-            case BIFF_ID_EXTERNSHEET:   importExternSheet();    break;
-            case BIFF2_ID_DEFINEDNAME:  importDefinedName();    break;
+            case BIFF2_ID_EXTERNALNAME: importExternalName( rStrm );    break;
+            case BIFF_ID_EXTERNSHEET:   importExternSheet( rStrm );     break;
+            case BIFF2_ID_DEFINEDNAME:  importDefinedName( rStrm );     break;
         }
         break;
         case BIFF3: switch( nRecId )
         {
-            case BIFF_ID_CRN:           importCrn();            break;
-            case BIFF3_ID_EXTERNALNAME: importExternalName();   break;
-            case BIFF_ID_EXTERNSHEET:   importExternSheet();    break;
-            case BIFF3_ID_DEFINEDNAME:  importDefinedName();    break;
-            case BIFF_ID_XCT:           importXct();            break;
+            case BIFF_ID_CRN:           importCrn( rStrm );             break;
+            case BIFF3_ID_EXTERNALNAME: importExternalName( rStrm );    break;
+            case BIFF_ID_EXTERNSHEET:   importExternSheet( rStrm );     break;
+            case BIFF3_ID_DEFINEDNAME:  importDefinedName( rStrm );     break;
+            case BIFF_ID_XCT:           importXct( rStrm );             break;
         }
         break;
         case BIFF4: switch( nRecId )
         {
-            case BIFF_ID_CRN:           importCrn();            break;
-            case BIFF3_ID_EXTERNALNAME: importExternalName();   break;
-            case BIFF_ID_EXTERNSHEET:   importExternSheet();    break;
-            case BIFF3_ID_DEFINEDNAME:  importDefinedName();    break;
-            case BIFF_ID_XCT:           importXct();            break;
+            case BIFF_ID_CRN:           importCrn( rStrm );             break;
+            case BIFF3_ID_EXTERNALNAME: importExternalName( rStrm );    break;
+            case BIFF_ID_EXTERNSHEET:   importExternSheet( rStrm );     break;
+            case BIFF3_ID_DEFINEDNAME:  importDefinedName( rStrm );     break;
+            case BIFF_ID_XCT:           importXct( rStrm );             break;
         }
         break;
         case BIFF5: switch( nRecId )
         {
-            case BIFF_ID_CRN:           importCrn();            break;
-            case BIFF5_ID_EXTERNALNAME: importExternalName();   break;
-            case BIFF_ID_EXTERNSHEET:   importExternSheet();    break;
-            case BIFF5_ID_DEFINEDNAME:  importDefinedName();    break;
-            case BIFF_ID_XCT:           importXct();            break;
+            case BIFF_ID_CRN:           importCrn( rStrm );             break;
+            case BIFF5_ID_EXTERNALNAME: importExternalName( rStrm );    break;
+            case BIFF_ID_EXTERNSHEET:   importExternSheet( rStrm );     break;
+            case BIFF5_ID_DEFINEDNAME:  importDefinedName( rStrm );     break;
+            case BIFF_ID_XCT:           importXct( rStrm );             break;
         }
         break;
         case BIFF8: switch( nRecId )
         {
-            case BIFF_ID_CRN:           importCrn();            break;
-            case BIFF_ID_EXTERNALBOOK:  importExternalBook();   break;
-            case BIFF5_ID_EXTERNALNAME: importExternalName();   break;
-            case BIFF_ID_EXTERNSHEET:   importExternSheet();    break;
-            case BIFF5_ID_DEFINEDNAME:  importDefinedName();    break;
-            case BIFF_ID_XCT:           importXct();            break;
+            case BIFF_ID_CRN:           importCrn( rStrm );             break;
+            case BIFF_ID_EXTERNALBOOK:  importExternalBook( rStrm );    break;
+            case BIFF5_ID_EXTERNALNAME: importExternalName( rStrm );    break;
+            case BIFF_ID_EXTERNSHEET:   importExternSheet( rStrm );     break;
+            case BIFF5_ID_DEFINEDNAME:  importDefinedName( rStrm );     break;
+            case BIFF_ID_XCT:           importXct( rStrm );             break;
         }
         break;
         case BIFF_UNKNOWN: break;
     }
 }
 
-void BiffExternalLinkFragment::finalizeImport()
-{
-    getDefinedNames().finalizeImport();
-}
-
 // private --------------------------------------------------------------------
 
-void BiffExternalLinkFragment::importExternSheet()
+void BiffExternalSheetDataContext::importExternSheet( BiffInputStream& rStrm )
 {
     mxSheetCache.clear();
     if( getBiff() == BIFF8 )
-        getExternalLinks().importExternSheet8( mrStrm );
+        getExternalLinks().importExternSheet8( rStrm );
     else
-        mxExtLink = getExternalLinks().importExternSheet( mrStrm );
+        mxExtLink = getExternalLinks().importExternSheet( rStrm );
 }
 
-void BiffExternalLinkFragment::importExternalBook()
+void BiffExternalSheetDataContext::importExternalBook( BiffInputStream& rStrm )
 {
     mxSheetCache.clear();
-    mxExtLink = getExternalLinks().importExternalBook( mrStrm );
+    mxExtLink = getExternalLinks().importExternalBook( rStrm );
 }
 
-void BiffExternalLinkFragment::importExternalName()
+void BiffExternalSheetDataContext::importExternalName( BiffInputStream& rStrm )
 {
     if( mxExtLink.get() )
-        mxExtLink->importExternalName( mrStrm );
+        mxExtLink->importExternalName( rStrm );
 }
 
-void BiffExternalLinkFragment::importXct()
+void BiffExternalSheetDataContext::importXct( BiffInputStream& rStrm )
 {
     mxSheetCache.clear();
     if( mxExtLink.get() && (mxExtLink->getLinkType() == LINKTYPE_EXTERNAL) )
@@ -471,64 +451,65 @@ void BiffExternalLinkFragment::importXct()
                 mxSheetCache = mxExtLink->getSheetCache( 0 );
             break;
             case BIFF8:
-                mrStrm.skip( 2 );
-                mxSheetCache = mxExtLink->getSheetCache( mrStrm.readInt16() );
+                rStrm.skip( 2 );
+                mxSheetCache = mxExtLink->getSheetCache( rStrm.readInt16() );
+            break;
+            case BIFF_UNKNOWN:
             break;
-            case BIFF_UNKNOWN: break;
         }
     }
 }
 
-void BiffExternalLinkFragment::importCrn()
+void BiffExternalSheetDataContext::importCrn( BiffInputStream& rStrm )
 {
     if( !mxSheetCache.is() ) return;
 
     sal_uInt8 nCol2, nCol1;
     sal_uInt16 nRow;
-    mrStrm >> nCol2 >> nCol1 >> nRow;
+    rStrm >> nCol2 >> nCol1 >> nRow;
     bool bLoop = true;
-    for( BinAddress aBinAddr( nCol1, nRow ); bLoop && !mrStrm.isEof() && (aBinAddr.mnCol <= nCol2); ++aBinAddr.mnCol )
+    for( BinAddress aBinAddr( nCol1, nRow ); bLoop && !rStrm.isEof() && (aBinAddr.mnCol <= nCol2); ++aBinAddr.mnCol )
     {
-        switch( mrStrm.readuInt8() )
+        switch( rStrm.readuInt8() )
         {
             case BIFF_DATATYPE_EMPTY:
-                mrStrm.skip( 8 );
+                rStrm.skip( 8 );
                 setCellValue( aBinAddr, Any( OUString() ) );
             break;
             case BIFF_DATATYPE_DOUBLE:
-                setCellValue( aBinAddr, Any( mrStrm.readDouble() ) );
+                setCellValue( aBinAddr, Any( rStrm.readDouble() ) );
             break;
             case BIFF_DATATYPE_STRING:
             {
-                OUString aText = (getBiff() == BIFF8) ? mrStrm.readUniString() : mrStrm.readByteStringUC( false, getTextEncoding() );
+                OUString aText = (getBiff() == BIFF8) ? rStrm.readUniString() : rStrm.readByteStringUC( false, getTextEncoding() );
                 setCellValue( aBinAddr, Any( aText ) );
             }
             break;
             case BIFF_DATATYPE_BOOL:
             {
-                double fValue = (mrStrm.readuInt8() == 0) ? 0.0 : 1.0;
+                double fValue = (rStrm.readuInt8() == 0) ? 0.0 : 1.0;
                 setCellValue( aBinAddr, Any( fValue ) );
-                mrStrm.skip( 7 );
+                rStrm.skip( 7 );
             }
             break;
             case BIFF_DATATYPE_ERROR:
-                setCellValue( aBinAddr, Any( BiffHelper::calcDoubleFromError( mrStrm.readuInt8() ) ) );
-                mrStrm.skip( 7 );
+                setCellValue( aBinAddr, Any( BiffHelper::calcDoubleFromError( rStrm.readuInt8() ) ) );
+                rStrm.skip( 7 );
             break;
             default:
-                OSL_ENSURE( false, "BiffExternalLinkFragment::importCrn - unknown data type" );
+                OSL_ENSURE( false, "BiffExternalSheetDataContext::importCrn - unknown data type" );
                 bLoop = false;
         }
     }
 }
 
-void BiffExternalLinkFragment::importDefinedName()
+void BiffExternalSheetDataContext::importDefinedName( BiffInputStream& rStrm )
 {
     if( mbImportDefNames )
-        getDefinedNames().importDefinedName( mrStrm );
+        getDefinedNames().importDefinedName( rStrm );
 }
 
-void BiffExternalLinkFragment::setCellValue( const BinAddress& rBinAddr, const Any& rValue )
+void BiffExternalSheetDataContext::setCellValue( const BinAddress& rBinAddr, const Any& rValue )
 {
     CellAddress aCellPos;
     if( mxSheetCache.is() && getAddressConverter().convertToCellAddress( aCellPos, rBinAddr, 0, false ) ) try
@@ -542,6 +523,28 @@ void BiffExternalLinkFragment::setCellValue( const BinAddress& rBinAddr, const A
 
 // ============================================================================
 
+BiffExternalLinkFragment::BiffExternalLinkFragment( const BiffWorkbookFragmentBase& rParent ) :
+    BiffWorkbookFragmentBase( rParent )
+{
+}
+
+bool BiffExternalLinkFragment::importFragment()
+{
+    // process all record in this sheet fragment
+    BiffExternalSheetDataContext aSheetContext( *this, false );
+    BiffInputStream& rStrm = getInputStream();
+    while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
+    {
+        if( BiffHelper::isBofRecord( rStrm ) )
+            skipFragment();  // skip unknown embedded fragments
+        else
+            aSheetContext.importRecord( rStrm );
+    }
+    return !rStrm.isEof() && (rStrm.getRecId() == BIFF_ID_EOF);
+}
+
+// ============================================================================
+// ============================================================================
+
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx
index ea353bb48558..da7dc78e954a 100644
--- a/oox/source/xls/formulabase.cxx
+++ b/oox/source/xls/formulabase.cxx
@@ -26,9 +26,8 @@
  ************************************************************************/
 
 #include "oox/xls/formulabase.hxx"
+
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -41,37 +40,29 @@
 #include 
 #include 
 #include 
-#include "properties.hxx"
-#include "oox/helper/recordinputstream.hxx"
+#include 
+#include 
 #include "oox/core/filterbase.hxx"
+#include "oox/helper/recordinputstream.hxx"
 #include "oox/xls/biffinputstream.hxx"
+#include "properties.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
 
 using ::rtl::OString;
 using ::rtl::OStringBuffer;
+using ::rtl::OStringToOUString;
 using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
-using ::rtl::OStringToOUString;
 using ::rtl::OUStringToOString;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::sheet::SingleReference;
-using ::com::sun::star::sheet::ComplexReference;
-using ::com::sun::star::sheet::FormulaToken;
-using ::com::sun::star::sheet::FormulaOpCodeMapEntry;
-using ::com::sun::star::sheet::XSpreadsheetDocument;
-using ::com::sun::star::sheet::XFormulaOpCodeMapper;
-using ::com::sun::star::sheet::XFormulaTokens;
-
-namespace oox {
-namespace xls {
 
 // reference helpers ==========================================================
 
@@ -83,16 +74,16 @@ BinSingleRef2d::BinSingleRef2d() :
 {
 }
 
-void BinSingleRef2d::setOobData( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset )
+void BinSingleRef2d::setBiff12Data( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset )
 {
-    mnCol = nCol & OOBIN_TOK_REF_COLMASK;
-    mnRow = nRow & OOBIN_TOK_REF_ROWMASK;
-    mbColRel = getFlag( nCol, OOBIN_TOK_REF_COLREL );
-    mbRowRel = getFlag( nCol, OOBIN_TOK_REF_ROWREL );
-    if( bRelativeAsOffset && mbColRel && (mnCol > (OOBIN_TOK_REF_COLMASK >> 1)) )
-        mnCol -= (OOBIN_TOK_REF_COLMASK + 1);
-    if( bRelativeAsOffset && mbRowRel && (mnRow > (OOBIN_TOK_REF_ROWMASK >> 1)) )
-        mnRow -= (OOBIN_TOK_REF_ROWMASK + 1);
+    mnCol = nCol & BIFF12_TOK_REF_COLMASK;
+    mnRow = nRow & BIFF12_TOK_REF_ROWMASK;
+    mbColRel = getFlag( nCol, BIFF12_TOK_REF_COLREL );
+    mbRowRel = getFlag( nCol, BIFF12_TOK_REF_ROWREL );
+    if( bRelativeAsOffset && mbColRel && (mnCol > (BIFF12_TOK_REF_COLMASK >> 1)) )
+        mnCol -= (BIFF12_TOK_REF_COLMASK + 1);
+    if( bRelativeAsOffset && mbRowRel && (mnRow > (BIFF12_TOK_REF_ROWMASK >> 1)) )
+        mnRow -= (BIFF12_TOK_REF_ROWMASK + 1);
 }
 
 void BinSingleRef2d::setBiff2Data( sal_uInt8 nCol, sal_uInt16 nRow, bool bRelativeAsOffset )
@@ -119,12 +110,12 @@ void BinSingleRef2d::setBiff8Data( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelat
         mnRow -= 0x10000;
 }
 
-void BinSingleRef2d::readOobData( RecordInputStream& rStrm, bool bRelativeAsOffset )
+void BinSingleRef2d::readBiff12Data( RecordInputStream& rStrm, bool bRelativeAsOffset )
 {
     sal_Int32 nRow;
     sal_uInt16 nCol;
     rStrm >> nRow >> nCol;
-    setOobData( nCol, nRow, bRelativeAsOffset );
+    setBiff12Data( nCol, nRow, bRelativeAsOffset );
 }
 
 void BinSingleRef2d::readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset )
@@ -144,13 +135,13 @@ void BinSingleRef2d::readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffs
 
 // ----------------------------------------------------------------------------
 
-void BinComplexRef2d::readOobData( RecordInputStream& rStrm, bool bRelativeAsOffset )
+void BinComplexRef2d::readBiff12Data( RecordInputStream& rStrm, bool bRelativeAsOffset )
 {
     sal_Int32 nRow1, nRow2;
     sal_uInt16 nCol1, nCol2;
     rStrm >> nRow1 >> nRow2 >> nCol1 >> nCol2;
-    maRef1.setOobData( nCol1, nRow1, bRelativeAsOffset );
-    maRef2.setOobData( nCol2, nRow2, bRelativeAsOffset );
+    maRef1.setBiff12Data( nCol1, nRow1, bRelativeAsOffset );
+    maRef2.setBiff12Data( nCol2, nRow2, bRelativeAsOffset );
 }
 
 void BinComplexRef2d::readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset )
@@ -246,8 +237,8 @@ struct FunctionData
 {
     const sal_Char*     mpcOdfFuncName;     /// ODF function name.
     const sal_Char*     mpcOoxFuncName;     /// OOXML function name.
-    sal_uInt16          mnOobFuncId;        /// OOBIN function identifier.
-    sal_uInt16          mnBiffFuncId;       /// BIFF function identifier.
+    sal_uInt16          mnBiff12FuncId;     /// BIFF12 function identifier.
+    sal_uInt16          mnBiffFuncId;       /// BIFF2-BIFF8 function identifier.
     sal_uInt8           mnMinParamCount;    /// Minimum number of parameters.
     sal_uInt8           mnMaxParamCount;    /// Maximum number of parameters.
     sal_uInt8           mnRetClass;         /// BIFF token class of the return value.
@@ -264,7 +255,7 @@ inline bool FunctionData::isSupported( bool bImportFilter ) const
     return !getFlag( mnFlags, bImportFilter ? FUNCFLAG_EXPORTONLY : FUNCFLAG_IMPORTONLY );
 }
 
-const sal_uInt16 NOID = SAL_MAX_UINT16;     /// No BIFF/OOBIN function identifier available.
+const sal_uInt16 NOID = SAL_MAX_UINT16;     /// No BIFF function identifier available.
 const sal_uInt8 MX    = SAL_MAX_UINT8;      /// Maximum parameter count.
 
 // abbreviations for function return token class
@@ -678,8 +669,8 @@ static const FunctionData saFuncTableBiff5[] =
     { "COUNTBLANK",             "COUNTBLANK",           347,    347,    1,  1,  V, { RO }, 0 },
     { "ISPMT",                  "ISPMT",                350,    350,    4,  4,  V, { VR }, 0 },
     { 0,                        "DATEDIF",              351,    351,    3,  3,  V, { VR }, FUNCFLAG_IMPORTONLY },   // not supported in Calc
-    { 0,                        "DATESTRING",           352,    352,    1,  1,  V, { VR }, FUNCFLAG_IMPORTONLY },   // not supported in Calc, missing in OOX spec
-    { 0,                        "NUMBERSTRING",         353,    353,    2,  2,  V, { VR }, FUNCFLAG_IMPORTONLY },   // not supported in Calc, missing in OOX spec
+    { 0,                        "DATESTRING",           352,    352,    1,  1,  V, { VR }, FUNCFLAG_IMPORTONLY },   // not supported in Calc, missing in OOXML spec
+    { 0,                        "NUMBERSTRING",         353,    353,    2,  2,  V, { VR }, FUNCFLAG_IMPORTONLY },   // not supported in Calc, missing in OOXML spec
     { "ROMAN",                  "ROMAN",                354,    354,    1,  2,  V, { VR }, 0 },
 
     // *** EuroTool add-in ***
@@ -722,7 +713,7 @@ static const FunctionData saFuncTableBiff8[] =
     { 0,                        "RTD",                  379,    379,    3,  3,  A, { VR, VR, RO }, 0 }
 };
 
-/** Functions new in OOX. */
+/** Functions new in OOXML. */
 static const FunctionData saFuncTableOox[] =
 {
     { 0,                        "CUBEVALUE",            380,    NOID,   1,  MX, V, { VR, RX }, 0 },
@@ -845,8 +836,8 @@ struct FunctionProviderImpl
     FunctionInfoVector  maFuncs;            /// All function infos in one list.
     FuncNameMap         maOdfFuncs;         /// Maps ODF function names to function data.
     FuncNameMap         maOoxFuncs;         /// Maps OOXML function names to function data.
-    FuncIdMap           maOobFuncs;         /// Maps OOBIN function indexes to function data.
-    FuncIdMap           maBiffFuncs;        /// Maps BIFF function indexes to function data.
+    FuncIdMap           maBiff12Funcs;      /// Maps BIFF12 function indexes to function data.
+    FuncIdMap           maBiffFuncs;        /// Maps BIFF2-BIFF8 function indexes to function data.
     FuncNameMap         maMacroFuncs;       /// Maps macro function names to function data.
 
     explicit            FunctionProviderImpl( FilterType eFilter, BiffType eBiff, bool bImportFilter );
@@ -869,9 +860,9 @@ FunctionProviderImpl::FunctionProviderImpl( FilterType eFilter, BiffType eBiff,
     sal_uInt8 nMaxParam = 0;
     switch( eFilter )
     {
-        case FILTER_OOX:
+        case FILTER_OOXML:
             nMaxParam = OOX_MAX_PARAMCOUNT;
-            eBiff = BIFF8;  // insert all BIFF function tables, then the OOX table
+            eBiff = BIFF8;  // insert all BIFF function tables, then the OOXML table
         break;
         case FILTER_BIFF:
             nMaxParam = BIFF_MAX_PARAMCOUNT;
@@ -895,7 +886,7 @@ FunctionProviderImpl::FunctionProviderImpl( FilterType eFilter, BiffType eBiff,
         initFuncs( saFuncTableBiff5, STATIC_ARRAY_END( saFuncTableBiff5 ), nMaxParam, bImportFilter );
     if( eBiff >= BIFF8 )
         initFuncs( saFuncTableBiff8, STATIC_ARRAY_END( saFuncTableBiff8 ), nMaxParam, bImportFilter );
-    if( eFilter == FILTER_OOX )
+    if( eFilter == FILTER_OOXML )
         initFuncs( saFuncTableOox, STATIC_ARRAY_END( saFuncTableOox ), nMaxParam, bImportFilter );
     initFuncs( saFuncTableOdf, STATIC_ARRAY_END( saFuncTableOdf ), nMaxParam, bImportFilter );
 }
@@ -928,7 +919,7 @@ void FunctionProviderImpl::initFunc( const FunctionData& rFuncData, sal_uInt8 nM
     }
 
     xFuncInfo->mnApiOpCode = -1;
-    xFuncInfo->mnOobFuncId = rFuncData.mnOobFuncId;
+    xFuncInfo->mnBiff12FuncId = rFuncData.mnBiff12FuncId;
     xFuncInfo->mnBiffFuncId = rFuncData.mnBiffFuncId;
     xFuncInfo->mnMinParamCount = rFuncData.mnMinParamCount;
     xFuncInfo->mnMaxParamCount = (rFuncData.mnMaxParamCount == MX) ? nMaxParam : rFuncData.mnMaxParamCount;
@@ -941,7 +932,7 @@ void FunctionProviderImpl::initFunc( const FunctionData& rFuncData, sal_uInt8 nM
     xFuncInfo->mbMacroFunc = bMacroCmd || getFlag( rFuncData.mnFlags, FUNCFLAG_MACROFUNC );
     xFuncInfo->mbVarParam = bMacroCmd || (rFuncData.mnMinParamCount != rFuncData.mnMaxParamCount) || getFlag( rFuncData.mnFlags, FUNCFLAG_ALWAYSVAR );
 
-    setFlag( xFuncInfo->mnOobFuncId, BIFF_TOK_FUNCVAR_CMD, bMacroCmd );
+    setFlag( xFuncInfo->mnBiff12FuncId, BIFF_TOK_FUNCVAR_CMD, bMacroCmd );
     setFlag( xFuncInfo->mnBiffFuncId, BIFF_TOK_FUNCVAR_CMD, bMacroCmd );
 
     // insert the function info into the member maps
@@ -950,8 +941,8 @@ void FunctionProviderImpl::initFunc( const FunctionData& rFuncData, sal_uInt8 nM
         maOdfFuncs[ xFuncInfo->maOdfFuncName ] = xFuncInfo;
     if( xFuncInfo->maOoxFuncName.getLength() > 0 )
         maOoxFuncs[ xFuncInfo->maOoxFuncName ] = xFuncInfo;
-    if( xFuncInfo->mnOobFuncId != NOID )
-        maOobFuncs[ xFuncInfo->mnOobFuncId ] = xFuncInfo;
+    if( xFuncInfo->mnBiff12FuncId != NOID )
+        maBiff12Funcs[ xFuncInfo->mnBiff12FuncId ] = xFuncInfo;
     if( xFuncInfo->mnBiffFuncId != NOID )
         maBiffFuncs[ xFuncInfo->mnBiffFuncId ] = xFuncInfo;
     if( xFuncInfo->maBiffMacroName.getLength() > 0 )
@@ -986,9 +977,9 @@ const FunctionInfo* FunctionProvider::getFuncInfoFromOoxFuncName( const OUString
     return mxFuncImpl->maOoxFuncs.get( rFuncName ).get();
 }
 
-const FunctionInfo* FunctionProvider::getFuncInfoFromOobFuncId( sal_uInt16 nFuncId ) const
+const FunctionInfo* FunctionProvider::getFuncInfoFromBiff12FuncId( sal_uInt16 nFuncId ) const
 {
-    return mxFuncImpl->maOobFuncs.get( nFuncId ).get();
+    return mxFuncImpl->maBiff12Funcs.get( nFuncId ).get();
 }
 
 const FunctionInfo* FunctionProvider::getFuncInfoFromBiffFuncId( sal_uInt16 nFuncId ) const
@@ -1252,7 +1243,7 @@ bool OpCodeProviderImpl::initFuncOpCode( FunctionInfo& orFuncInfo, const ApiToke
                     append( '"' ).getStr() );
             }
 
-            // add to parser map, if OOX function name exists
+            // add to parser map, if OOXML function name exists
             if( bIsValid && (orFuncInfo.maOoxFuncName.getLength() > 0) )
             {
                 // create the parser map entry
@@ -1747,4 +1738,3 @@ void FormulaProcessorBase::convertStringToStringList(
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/formulaparser.cxx b/oox/source/xls/formulaparser.cxx
index e3a8282e1a15..89b88915d162 100644
--- a/oox/source/xls/formulaparser.cxx
+++ b/oox/source/xls/formulaparser.cxx
@@ -26,42 +26,37 @@
  ************************************************************************/
 
 #include "oox/xls/formulaparser.hxx"
+
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include "properties.hxx"
-#include "oox/helper/recordinputstream.hxx"
 #include "oox/core/filterbase.hxx"
+#include "oox/helper/recordinputstream.hxx"
 #include "oox/xls/addressconverter.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/defnamesbuffer.hxx"
 #include "oox/xls/externallinkbuffer.hxx"
 #include "oox/xls/tablebuffer.hxx"
 #include "oox/xls/worksheethelper.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::ComplexReference;
-using ::com::sun::star::sheet::ExternalReference;
-using ::com::sun::star::sheet::SingleReference;
-using ::com::sun::star::sheet::XFormulaParser;
-using namespace ::com::sun::star::sheet::ReferenceFlags;
+#include "properties.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::sheet::ReferenceFlags;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
 namespace {
 
 sal_uInt16 lclReadFmlaSize( BiffInputStream& rStrm, BiffType eBiff, const sal_uInt16* pnFmlaSize )
@@ -249,7 +244,7 @@ const ApiToken* FormulaFinalizer::processParameters(
                 if( !aParamInfoIt.isExcelOnlyParam() )
                 {
                     // replace empty second and third parameter in IF function with zeros
-                    if( (pRealFuncInfo->mnOobFuncId == OOBIN_FUNC_IF) && ((nParam == 1) || (nParam == 2)) && bIsEmpty )
+                    if( (pRealFuncInfo->mnBiff12FuncId == BIFF_FUNC_IF) && ((nParam == 1) || (nParam == 2)) && bIsEmpty )
                     {
                         maTokens.append< double >( OPCODE_PUSH, 0.0 );
                         bIsEmpty = false;
@@ -368,10 +363,10 @@ const ApiToken* FormulaFinalizer::findParameters( ParameterPosVector& rParams,
 void FormulaFinalizer::appendCalcOnlyParameter( const FunctionInfo& rFuncInfo, size_t nParam )
 {
     (void)nParam;   // prevent 'unused' warning
-    switch( rFuncInfo.mnOobFuncId )
+    switch( rFuncInfo.mnBiff12FuncId )
     {
-        case OOBIN_FUNC_FLOOR:
-        case OOBIN_FUNC_CEILING:
+        case BIFF_FUNC_FLOOR:
+        case BIFF_FUNC_CEILING:
             OSL_ENSURE( nParam == 2, "FormulaFinalizer::appendCalcOnlyParameter - unexpected parameter index" );
             maTokens.append< double >( OPCODE_PUSH, 1.0 );
             maTokens.append( OPCODE_SEP );
@@ -381,9 +376,9 @@ void FormulaFinalizer::appendCalcOnlyParameter( const FunctionInfo& rFuncInfo, s
 
 void FormulaFinalizer::appendRequiredParameters( const FunctionInfo& rFuncInfo, size_t nParamCount )
 {
-    switch( rFuncInfo.mnOobFuncId )
+    switch( rFuncInfo.mnBiff12FuncId )
     {
-        case OOBIN_FUNC_WEEKNUM:
+        case BIFF_FUNC_WEEKNUM:
             if( nParamCount == 1 )
             {
                 maTokens.append< double >( OPCODE_PUSH, 1.0 );
@@ -422,12 +417,12 @@ public:
                             FormulaContext& rContext,
                             const OUString& rFormulaString );
 
-    /** Imports and converts a OOBIN token array from the passed stream. */
-    virtual void        importOobFormula(
+    /** Imports and converts a BIFF12 token array from the passed stream. */
+    virtual void        importBiff12Formula(
                             FormulaContext& rContext,
                             RecordInputStream& rStrm );
 
-    /** Imports and converts a BIFF token array from the passed stream. */
+    /** Imports and converts a BIFF2-BIFF8 token array from the passed stream. */
     virtual void        importBiffFormula(
                             FormulaContext& rContext,
                             BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize );
@@ -589,9 +584,9 @@ void FormulaParserImpl::importOoxFormula( FormulaContext&, const OUString& )
     OSL_ENSURE( false, "FormulaParserImpl::importOoxFormula - not implemented" );
 }
 
-void FormulaParserImpl::importOobFormula( FormulaContext&, RecordInputStream& )
+void FormulaParserImpl::importBiff12Formula( FormulaContext&, RecordInputStream& )
 {
-    OSL_ENSURE( false, "FormulaParserImpl::importOobFormula - not implemented" );
+    OSL_ENSURE( false, "FormulaParserImpl::importBiff12Formula - not implemented" );
 }
 
 void FormulaParserImpl::importBiffFormula( FormulaContext&, BiffInputStream&, const sal_uInt16* )
@@ -903,7 +898,7 @@ bool FormulaParserImpl::pushValueOperand( const Type& rValue, sal_Int32 nOpCode
 
 bool FormulaParserImpl::pushBoolOperand( bool bValue )
 {
-    if( const FunctionInfo* pFuncInfo = getFuncInfoFromOobFuncId( bValue ? OOBIN_FUNC_TRUE : OOBIN_FUNC_FALSE ) )
+    if( const FunctionInfo* pFuncInfo = getFuncInfoFromBiff12FuncId( bValue ? BIFF_FUNC_TRUE : BIFF_FUNC_FALSE ) )
         return pushFunctionOperator( pFuncInfo->mnApiOpCode, 0 );
     return pushValueOperand< double >( bValue ? 1.0 : 0.0 );
 }
@@ -1234,7 +1229,7 @@ OUString FormulaParserImpl::resolveDefinedName( sal_Int32 nTokenIndex ) const
     return OUString();
 }
 
-// OOX parser implementation ==================================================
+// OOXML/BIFF12 parser implementation =========================================
 
 class OoxFormulaParserImpl : public FormulaParserImpl
 {
@@ -1245,7 +1240,7 @@ public:
                             FormulaContext& rContext,
                             const OUString& rFormulaString );
 
-    virtual void        importOobFormula(
+    virtual void        importBiff12Formula(
                             FormulaContext& rContext,
                             RecordInputStream& rStrm );
 
@@ -1275,10 +1270,10 @@ private:
 
     // convert BIN token and push API operand or operator ---------------------
 
-    bool                pushOobName( sal_Int32 nNameId );
-    bool                pushOobExtName( sal_Int32 nRefId, sal_Int32 nNameId );
-    bool                pushOobFunction( sal_uInt16 nFuncId );
-    bool                pushOobFunction( sal_uInt16 nFuncId, sal_uInt8 nParamCount );
+    bool                pushBiff12Name( sal_Int32 nNameId );
+    bool                pushBiff12ExtName( sal_Int32 nRefId, sal_Int32 nNameId );
+    bool                pushBiff12Function( sal_uInt16 nFuncId );
+    bool                pushBiff12Function( sal_uInt16 nFuncId, sal_uInt8 nParamCount );
 
 private:
     ApiParserWrapper    maApiParser;        /// Wrapper for the API formula parser object.
@@ -1307,7 +1302,7 @@ void OoxFormulaParserImpl::importOoxFormula( FormulaContext& rContext, const OUS
     finalizeImport( maApiParser.parseFormula( rFormulaString, rContext.getBaseAddress() ) );
 }
 
-void OoxFormulaParserImpl::importOobFormula( FormulaContext& rContext, RecordInputStream& rStrm )
+void OoxFormulaParserImpl::importBiff12Formula( FormulaContext& rContext, RecordInputStream& rStrm )
 {
     initializeImport( rContext );
 
@@ -1414,26 +1409,26 @@ bool OoxFormulaParserImpl::importAttrToken( RecordInputStream& rStrm )
     bool bOk = true;
     sal_uInt8 nType;
     rStrm >> nType;
-    // equal flags in BIFF and OOBIN
+    // equal flags in all BIFFs
     switch( nType )
     {
         case 0:     // sometimes, tAttrSkip tokens miss the type flag
-        case OOBIN_TOK_ATTR_VOLATILE:
-        case OOBIN_TOK_ATTR_IF:
-        case OOBIN_TOK_ATTR_SKIP:
-        case OOBIN_TOK_ATTR_ASSIGN:
-        case OOBIN_TOK_ATTR_IFERROR:
+        case BIFF_TOK_ATTR_VOLATILE:
+        case BIFF_TOK_ATTR_IF:
+        case BIFF_TOK_ATTR_SKIP:
+        case BIFF_TOK_ATTR_ASSIGN:
+        case BIFF_TOK_ATTR_IFERROR:
             rStrm.skip( 2 );
         break;
-        case OOBIN_TOK_ATTR_CHOOSE:
+        case BIFF_TOK_ATTR_CHOOSE:
             rStrm.skip( 2 * rStrm.readuInt16() + 2 );
         break;
-        case OOBIN_TOK_ATTR_SUM:
+        case BIFF_TOK_ATTR_SUM:
             rStrm.skip( 2 );
-            bOk = pushOobFunction( OOBIN_FUNC_SUM, 1 );
+            bOk = pushBiff12Function( BIFF_FUNC_SUM, 1 );
         break;
-        case OOBIN_TOK_ATTR_SPACE:
-        case OOBIN_TOK_ATTR_SPACE_VOLATILE:
+        case BIFF_TOK_ATTR_SPACE:
+        case BIFF_TOK_ATTR_SPACE_VOLATILE:
             bOk = importSpaceToken( rStrm );
         break;
         default:
@@ -1491,8 +1486,8 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
         bool bFixedStartRow = true;
         bool bFixedHeight = false;
 
-        bool bSingleCol = getFlag( nFlags, OOBIN_TOK_TABLE_COLUMN );
-        bool bColRange = getFlag( nFlags, OOBIN_TOK_TABLE_COLRANGE );
+        bool bSingleCol = getFlag( nFlags, BIFF12_TOK_TABLE_COLUMN );
+        bool bColRange = getFlag( nFlags, BIFF12_TOK_TABLE_COLRANGE );
         bool bValidRef = !bSingleCol || !bColRange;
         OSL_ENSURE( bValidRef, "OoxFormulaParserImpl::importTableToken - illegal combination of single column and column range" );
         if( bValidRef )
@@ -1507,11 +1502,11 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
 
         if( bValidRef )
         {
-            bool bAllRows    = getFlag( nFlags, OOBIN_TOK_TABLE_ALL );
-            bool bHeaderRows = getFlag( nFlags, OOBIN_TOK_TABLE_HEADERS );
-            bool bDataRows   = getFlag( nFlags, OOBIN_TOK_TABLE_DATA );
-            bool bTotalsRows = getFlag( nFlags, OOBIN_TOK_TABLE_TOTALS );
-            bool bThisRow    = getFlag( nFlags, OOBIN_TOK_TABLE_THISROW );
+            bool bAllRows    = getFlag( nFlags, BIFF12_TOK_TABLE_ALL );
+            bool bHeaderRows = getFlag( nFlags, BIFF12_TOK_TABLE_HEADERS );
+            bool bDataRows   = getFlag( nFlags, BIFF12_TOK_TABLE_DATA );
+            bool bTotalsRows = getFlag( nFlags, BIFF12_TOK_TABLE_TOTALS );
+            bool bThisRow    = getFlag( nFlags, BIFF12_TOK_TABLE_THISROW );
 
             sal_Int32 nStartDataRow = xTable->getHeaderRows();
             sal_Int32 nEndDataRow = nEndRow - xTable->getTotalsRows();
@@ -1567,8 +1562,8 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
             if( (nStartCol == 0) && (nEndCol + 1 == nWidth) && (nStartRow == 0) && (nEndRow + 1 == nHeight) )
                 return pushValueOperand( nTokenIndex, OPCODE_DBAREA );
             // create an OFFSET function call to refer to a subrange of the table
-            const FunctionInfo* pRowsInfo = getFuncInfoFromOobFuncId( OOBIN_FUNC_ROWS );
-            const FunctionInfo* pColumnsInfo = getFuncInfoFromOobFuncId( OOBIN_FUNC_COLUMNS );
+            const FunctionInfo* pRowsInfo = getFuncInfoFromBiff12FuncId( BIFF_FUNC_ROWS );
+            const FunctionInfo* pColumnsInfo = getFuncInfoFromBiff12FuncId( BIFF_FUNC_COLUMNS );
             return
                 pRowsInfo && pColumnsInfo &&
                 pushValueOperandToken( nTokenIndex, OPCODE_DBAREA ) &&
@@ -1590,7 +1585,7 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
                     (pushValueOperandToken( nTokenIndex, OPCODE_DBAREA ) &&
                      pushFunctionOperatorToken( *pColumnsInfo, 1 )) :
                     pushValueOperandToken< double >( nEndCol - nStartCol + 1 )) &&
-                pushOobFunction( OOBIN_FUNC_OFFSET, 5 );
+                pushBiff12Function( BIFF_FUNC_OFFSET, 5 );
         }
     }
     return pushBiffErrorOperand( BIFF_ERR_REF );
@@ -1622,16 +1617,16 @@ bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm )
                 appendRawToken( OPCODE_ARRAY_COLSEP );
             switch( rStrm.readuInt8() )
             {
-                case OOBIN_TOK_ARRAY_DOUBLE:
+                case BIFF_TOK_ARRAY_DOUBLE:
                     appendRawToken( OPCODE_PUSH ) <<= rStrm.readDouble();
                 break;
-                case OOBIN_TOK_ARRAY_STRING:
+                case BIFF_TOK_ARRAY_STRING:
                     appendRawToken( OPCODE_PUSH ) <<= rStrm.readString( false );
                 break;
-                case OOBIN_TOK_ARRAY_BOOL:
+                case BIFF_TOK_ARRAY_BOOL:
                     appendRawToken( OPCODE_PUSH ) <<= static_cast< double >( (rStrm.readuInt8() == BIFF_TOK_BOOL_FALSE) ? 0.0 : 1.0 );
                 break;
-                case OOBIN_TOK_ARRAY_ERROR:
+                case BIFF_TOK_ARRAY_ERROR:
                     appendRawToken( OPCODE_PUSH ) <<= BiffHelper::calcDoubleFromError( rStrm.readuInt8() );
                     rStrm.skip( 3 );
                 break;
@@ -1652,14 +1647,14 @@ bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm )
 bool OoxFormulaParserImpl::importRefToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
 {
     BinSingleRef2d aRef;
-    aRef.readOobData( rStrm, bRelativeAsOffset );
+    aRef.readBiff12Data( rStrm, bRelativeAsOffset );
     return pushReferenceOperand( aRef, bDeleted, bRelativeAsOffset );
 }
 
 bool OoxFormulaParserImpl::importAreaToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
 {
     BinComplexRef2d aRef;
-    aRef.readOobData( rStrm, bRelativeAsOffset );
+    aRef.readBiff12Data( rStrm, bRelativeAsOffset );
     return pushReferenceOperand( aRef, bDeleted, bRelativeAsOffset );
 }
 
@@ -1667,7 +1662,7 @@ bool OoxFormulaParserImpl::importRef3dToken( RecordInputStream& rStrm, bool bDel
 {
     LinkSheetRange aSheetRange = readSheetRange( rStrm );
     BinSingleRef2d aRef;
-    aRef.readOobData( rStrm, bRelativeAsOffset );
+    aRef.readBiff12Data( rStrm, bRelativeAsOffset );
     return pushReferenceOperand( aSheetRange, aRef, bDeleted, bRelativeAsOffset );
 }
 
@@ -1675,7 +1670,7 @@ bool OoxFormulaParserImpl::importArea3dToken( RecordInputStream& rStrm, bool bDe
 {
     LinkSheetRange aSheetRange = readSheetRange( rStrm );
     BinComplexRef2d aRef;
-    aRef.readOobData( rStrm, bRelativeAsOffset );
+    aRef.readBiff12Data( rStrm, bRelativeAsOffset );
     return pushReferenceOperand( aSheetRange, aRef, bDeleted, bRelativeAsOffset );
 }
 
@@ -1695,21 +1690,21 @@ bool OoxFormulaParserImpl::importMemFuncToken( RecordInputStream& rStrm )
 
 bool OoxFormulaParserImpl::importNameToken( RecordInputStream& rStrm )
 {
-    return pushOobName( rStrm.readInt32() );
+    return pushBiff12Name( rStrm.readInt32() );
 }
 
 bool OoxFormulaParserImpl::importNameXToken( RecordInputStream& rStrm )
 {
     sal_Int32 nRefId = rStrm.readInt16();
     sal_Int32 nNameId = rStrm.readInt32();
-    return pushOobExtName( nRefId, nNameId );
+    return pushBiff12ExtName( nRefId, nNameId );
 }
 
 bool OoxFormulaParserImpl::importFuncToken( RecordInputStream& rStrm )
 {
     sal_uInt16 nFuncId;
     rStrm >> nFuncId;
-    return pushOobFunction( nFuncId );
+    return pushBiff12Function( nFuncId );
 }
 
 bool OoxFormulaParserImpl::importFuncVarToken( RecordInputStream& rStrm )
@@ -1717,7 +1712,7 @@ bool OoxFormulaParserImpl::importFuncVarToken( RecordInputStream& rStrm )
     sal_uInt8 nParamCount;
     sal_uInt16 nFuncId;
     rStrm >> nParamCount >> nFuncId;
-    return pushOobFunction( nFuncId, nParamCount );
+    return pushBiff12Function( nFuncId, nParamCount );
 }
 
 bool OoxFormulaParserImpl::importExpToken( RecordInputStream& rStrm )
@@ -1753,38 +1748,38 @@ void OoxFormulaParserImpl::skipMemAreaAddData( RecordInputStream& rStrm )
 
 // convert BIN token and push API operand or operator -------------------------
 
-bool OoxFormulaParserImpl::pushOobName( sal_Int32 nNameId )
+bool OoxFormulaParserImpl::pushBiff12Name( sal_Int32 nNameId )
 {
-    // one-based in OOBIN formulas
+    // one-based in BIFF12 formulas
     return pushDefinedNameOperand( getDefinedNames().getByIndex( nNameId - 1 ) );
 }
 
-bool OoxFormulaParserImpl::pushOobExtName( sal_Int32 nRefId, sal_Int32 nNameId )
+bool OoxFormulaParserImpl::pushBiff12ExtName( sal_Int32 nRefId, sal_Int32 nNameId )
 {
     if( const ExternalLink* pExtLink = getExternalLinks().getExternalLink( nRefId ).get() )
     {
         if( pExtLink->getLinkType() == LINKTYPE_SELF )
-            return pushOobName( nNameId );
-        // external name indexes are one-based in OOBIN
+            return pushBiff12Name( nNameId );
+        // external name indexes are one-based in BIFF12
         ExternalNameRef xExtName = pExtLink->getNameByIndex( nNameId - 1 );
         return pushExternalNameOperand( xExtName, *pExtLink );
     }
     return pushBiffErrorOperand( BIFF_ERR_NAME );
 }
 
-bool OoxFormulaParserImpl::pushOobFunction( sal_uInt16 nFuncId )
+bool OoxFormulaParserImpl::pushBiff12Function( sal_uInt16 nFuncId )
 {
-    if( const FunctionInfo* pFuncInfo = getFuncInfoFromOobFuncId( nFuncId ) )
+    if( const FunctionInfo* pFuncInfo = getFuncInfoFromBiff12FuncId( nFuncId ) )
         if( pFuncInfo->mnMinParamCount == pFuncInfo->mnMaxParamCount )
             return pushFunctionOperator( *pFuncInfo, pFuncInfo->mnMinParamCount );
     return pushFunctionOperator( OPCODE_NONAME, 0 );
 }
 
-bool OoxFormulaParserImpl::pushOobFunction( sal_uInt16 nFuncId, sal_uInt8 nParamCount )
+bool OoxFormulaParserImpl::pushBiff12Function( sal_uInt16 nFuncId, sal_uInt8 nParamCount )
 {
     if( getFlag( nFuncId, BIFF_TOK_FUNCVAR_CMD ) )
         nParamCount &= BIFF_TOK_FUNCVAR_COUNTMASK;
-    if( const FunctionInfo* pFuncInfo = getFuncInfoFromOobFuncId( nFuncId ) )
+    if( const FunctionInfo* pFuncInfo = getFuncInfoFromBiff12FuncId( nFuncId ) )
         return pushFunctionOperator( *pFuncInfo, nParamCount );
     return pushFunctionOperator( OPCODE_NONAME, nParamCount );
 }
@@ -2762,7 +2757,7 @@ FormulaParser::FormulaParser( const WorkbookHelper& rHelper ) :
 {
     switch( getFilterType() )
     {
-        case FILTER_OOX:    mxImpl.reset( new OoxFormulaParserImpl( *this ) );  break;
+        case FILTER_OOXML:  mxImpl.reset( new OoxFormulaParserImpl( *this ) );  break;
         case FILTER_BIFF:   mxImpl.reset( new BiffFormulaParserImpl( *this ) ); break;
         case FILTER_UNKNOWN: break;
     }
@@ -2779,7 +2774,7 @@ void FormulaParser::importFormula( FormulaContext& rContext, const OUString& rFo
 
 void FormulaParser::importFormula( FormulaContext& rContext, RecordInputStream& rStrm ) const
 {
-    mxImpl->importOobFormula( rContext, rStrm );
+    mxImpl->importBiff12Formula( rContext, rStrm );
 }
 
 void FormulaParser::importFormula( FormulaContext& rContext, BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize ) const
@@ -2814,7 +2809,7 @@ void FormulaParser::convertNameToFormula( FormulaContext& rContext, sal_Int32 nT
 void FormulaParser::convertNumberToHyperlink( FormulaContext& rContext, const OUString& rUrl, double fValue ) const
 {
     OSL_ENSURE( rUrl.getLength() > 0, "FormulaParser::convertNumberToHyperlink - missing URL" );
-    if( const FunctionInfo* pFuncInfo = getFuncInfoFromOobFuncId( OOBIN_FUNC_HYPERLINK ) )
+    if( const FunctionInfo* pFuncInfo = getFuncInfoFromBiff12FuncId( BIFF_FUNC_HYPERLINK ) )
     {
         ApiTokenSequence aTokens( 6 );
         aTokens[ 0 ].OpCode = pFuncInfo->mnApiOpCode;
diff --git a/oox/source/xls/makefile.mk b/oox/source/xls/makefile.mk
index b5ede953bbfe..b6d69dc5cf8c 100644
--- a/oox/source/xls/makefile.mk
+++ b/oox/source/xls/makefile.mk
@@ -53,6 +53,7 @@ SLOFILES =										\
         $(SLO)$/commentsfragment.obj			\
         $(SLO)$/condformatbuffer.obj			\
         $(SLO)$/condformatcontext.obj			\
+        $(SLO)$/connectionsbuffer.obj			\
         $(SLO)$/connectionsfragment.obj			\
         $(SLO)$/defnamesbuffer.obj				\
         $(SLO)$/drawingfragment.obj				\
@@ -71,6 +72,7 @@ SLOFILES =										\
         $(SLO)$/pivotcachefragment.obj			\
         $(SLO)$/pivottablebuffer.obj			\
         $(SLO)$/pivottablefragment.obj			\
+        $(SLO)$/querytablebuffer.obj			\
         $(SLO)$/querytablefragment.obj			\
         $(SLO)$/richstring.obj					\
         $(SLO)$/richstringcontext.obj			\
@@ -87,7 +89,6 @@ SLOFILES =										\
         $(SLO)$/themebuffer.obj					\
         $(SLO)$/unitconverter.obj				\
         $(SLO)$/viewsettings.obj				\
-        $(SLO)$/webquerybuffer.obj				\
         $(SLO)$/workbookfragment.obj			\
         $(SLO)$/workbookhelper.obj				\
         $(SLO)$/workbooksettings.obj			\
diff --git a/oox/source/xls/numberformatsbuffer.cxx b/oox/source/xls/numberformatsbuffer.cxx
index 4dfb00abeb59..36b51c03cfe8 100644
--- a/oox/source/xls/numberformatsbuffer.cxx
+++ b/oox/source/xls/numberformatsbuffer.cxx
@@ -26,43 +26,39 @@
  ************************************************************************/
 
 #include "oox/xls/numberformatsbuffer.hxx"
+
 #include 
+#include 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
+#include 
+#include 
 #include 
+#include 
+#include 
 #include 
-#include "properties.hxx"
+#include "oox/core/filterbase.hxx"
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/propertymap.hxx"
 #include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
 #include "oox/xls/biffinputstream.hxx"
+#include "properties.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
 
 using ::rtl::OString;
 using ::rtl::OStringBuffer;
+using ::rtl::OStringToOUString;
 using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
-using ::rtl::OStringToOUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::lang::Locale;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::util::XNumberFormatsSupplier;
-using ::com::sun::star::util::XNumberFormats;
-using ::com::sun::star::util::XNumberFormatTypes;
-
-namespace oox {
-namespace xls {
 
 // ============================================================================
 
@@ -2120,4 +2116,3 @@ void NumberFormatsBuffer::insertBuiltinFormats()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/ooxformulaparser.cxx b/oox/source/xls/ooxformulaparser.cxx
index ec2668aef0f2..e88218957f7e 100644
--- a/oox/source/xls/ooxformulaparser.cxx
+++ b/oox/source/xls/ooxformulaparser.cxx
@@ -26,27 +26,24 @@
  ************************************************************************/
 
 #include "oox/xls/ooxformulaparser.hxx"
+
 #include 
 #include "oox/xls/formulaparser.hxx"
 
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::XComponentContext;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::FormulaToken;
-
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
 class OOXMLFormulaParserImpl : private FormulaFinalizer
 {
 public:
@@ -64,7 +61,7 @@ private:
 // ----------------------------------------------------------------------------
 
 OOXMLFormulaParserImpl::OOXMLFormulaParserImpl( const Reference< XMultiServiceFactory >& rxFactory ) :
-    FormulaFinalizer( OpCodeProvider( rxFactory, FILTER_OOX, BIFF_UNKNOWN, true ) ),
+    FormulaFinalizer( OpCodeProvider( rxFactory, FILTER_OOXML, BIFF_UNKNOWN, true ) ),
     maApiParser( rxFactory, *this )
 {
 }
@@ -127,7 +124,7 @@ private:
 // ----------------------------------------------------------------------------
 
 OOXMLFormulaPrinterImpl::OOXMLFormulaPrinterImpl( const Reference< XMultiServiceFactory >& rxFactory ) :
-    OpCodeProvider( rxFactory, FILTER_OOX, BIFF_UNKNOWN, false ),
+    OpCodeProvider( rxFactory, FILTER_OOXML, BIFF_UNKNOWN, false ),
     maApiParser( rxFactory, *this )
 {
 }
@@ -222,4 +219,3 @@ OUString SAL_CALL OOXMLFormulaParser::printFormula(
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/pagesettings.cxx b/oox/source/xls/pagesettings.cxx
index 0a5ce05a37df..7509552ffc09 100644
--- a/oox/source/xls/pagesettings.cxx
+++ b/oox/source/xls/pagesettings.cxx
@@ -26,10 +26,9 @@
  ************************************************************************/
 
 #include "oox/xls/pagesettings.hxx"
-#include 
+
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -38,39 +37,38 @@
 #include 
 #include 
 #include 
-#include "properties.hxx"
+#include 
+#include 
+#include "oox/core/xmlfilterbase.hxx"
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/graphichelper.hxx"
 #include "oox/helper/propertymap.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/helper/recordinputstream.hxx"
-#include "oox/core/xmlfilterbase.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/excelhandlers.hxx"
 #include "oox/xls/stylesbuffer.hxx"
 #include "oox/xls/unitconverter.hxx"
+#include "properties.hxx"
 
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::Relations;
 using ::rtl::OString;
 using ::rtl::OStringBuffer;
 using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::sheet::XHeaderFooterContent;
-using ::com::sun::star::style::XStyle;
-using ::com::sun::star::text::XText;
-using ::com::sun::star::text::XTextCursor;
-using ::com::sun::star::text::XTextContent;
-using ::com::sun::star::text::XTextRange;
-using ::oox::core::Relations;
-
-namespace oox {
-namespace xls {
 
 // ============================================================================
 
@@ -80,32 +78,32 @@ const double OOX_MARGIN_DEFAULT_LR                  = 0.748;    /// Left/right d
 const double OOX_MARGIN_DEFAULT_TB                  = 0.984;    /// Top/bottom default margin in inches.
 const double OOX_MARGIN_DEFAULT_HF                  = 0.512;    /// Header/footer default margin in inches.
 
-const sal_uInt16 OOBIN_PRINTOPT_HORCENTER           = 0x0001;
-const sal_uInt16 OOBIN_PRINTOPT_VERCENTER           = 0x0002;
-const sal_uInt16 OOBIN_PRINTOPT_PRINTHEADING        = 0x0004;
-const sal_uInt16 OOBIN_PRINTOPT_PRINTGRID           = 0x0008;
-
-const sal_uInt16 OOBIN_HEADERFOOTER_DIFFEVEN        = 0x0001;
-const sal_uInt16 OOBIN_HEADERFOOTER_DIFFFIRST       = 0x0002;
-const sal_uInt16 OOBIN_HEADERFOOTER_SCALEDOC        = 0x0004;
-const sal_uInt16 OOBIN_HEADERFOOTER_ALIGNMARGIN     = 0x0008;
-
-const sal_uInt16 OOBIN_PAGESETUP_INROWS             = 0x0001;
-const sal_uInt16 OOBIN_PAGESETUP_LANDSCAPE          = 0x0002;
-const sal_uInt16 OOBIN_PAGESETUP_INVALID            = 0x0004;
-const sal_uInt16 OOBIN_PAGESETUP_BLACKWHITE         = 0x0008;
-const sal_uInt16 OOBIN_PAGESETUP_DRAFTQUALITY       = 0x0010;
-const sal_uInt16 OOBIN_PAGESETUP_PRINTNOTES         = 0x0020;
-const sal_uInt16 OOBIN_PAGESETUP_DEFAULTORIENT      = 0x0040;
-const sal_uInt16 OOBIN_PAGESETUP_USEFIRSTPAGE       = 0x0080;
-const sal_uInt16 OOBIN_PAGESETUP_NOTES_END          = 0x0100;   // different to BIFF flag
-
-const sal_uInt16 OOBIN_CHARTPAGESETUP_LANDSCAPE     = 0x0001;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_INVALID       = 0x0002;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_BLACKWHITE    = 0x0004;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_DEFAULTORIENT = 0x0008;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_USEFIRSTPAGE  = 0x0010;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_DRAFTQUALITY  = 0x0020;
+const sal_uInt16 BIFF12_PRINTOPT_HORCENTER          = 0x0001;
+const sal_uInt16 BIFF12_PRINTOPT_VERCENTER          = 0x0002;
+const sal_uInt16 BIFF12_PRINTOPT_PRINTHEADING       = 0x0004;
+const sal_uInt16 BIFF12_PRINTOPT_PRINTGRID          = 0x0008;
+
+const sal_uInt16 BIFF12_HEADERFOOTER_DIFFEVEN       = 0x0001;
+const sal_uInt16 BIFF12_HEADERFOOTER_DIFFFIRST      = 0x0002;
+const sal_uInt16 BIFF12_HEADERFOOTER_SCALEDOC       = 0x0004;
+const sal_uInt16 BIFF12_HEADERFOOTER_ALIGNMARGIN    = 0x0008;
+
+const sal_uInt16 BIFF12_PAGESETUP_INROWS            = 0x0001;
+const sal_uInt16 BIFF12_PAGESETUP_LANDSCAPE         = 0x0002;
+const sal_uInt16 BIFF12_PAGESETUP_INVALID           = 0x0004;
+const sal_uInt16 BIFF12_PAGESETUP_BLACKWHITE        = 0x0008;
+const sal_uInt16 BIFF12_PAGESETUP_DRAFTQUALITY      = 0x0010;
+const sal_uInt16 BIFF12_PAGESETUP_PRINTNOTES        = 0x0020;
+const sal_uInt16 BIFF12_PAGESETUP_DEFAULTORIENT     = 0x0040;
+const sal_uInt16 BIFF12_PAGESETUP_USEFIRSTPAGE      = 0x0080;
+const sal_uInt16 BIFF12_PAGESETUP_NOTES_END         = 0x0100;   // different to BIFF flag
+
+const sal_uInt16 BIFF12_CHARTPAGESETUP_LANDSCAPE    = 0x0001;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_INVALID      = 0x0002;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_BLACKWHITE   = 0x0004;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_DEFAULTORIENT= 0x0008;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_USEFIRSTPAGE = 0x0010;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_DRAFTQUALITY = 0x0020;
 
 const sal_uInt16 BIFF_PAGESETUP_INROWS              = 0x0001;
 const sal_uInt16 BIFF_PAGESETUP_PORTRAIT            = 0x0002;
@@ -154,7 +152,7 @@ PageSettingsModel::PageSettingsModel() :
 {
 }
 
-void PageSettingsModel::setBinPrintErrors( sal_uInt8 nPrintErrors )
+void PageSettingsModel::setBiffPrintErrors( sal_uInt8 nPrintErrors )
 {
     static const sal_Int32 spnErrorIds[] = { XML_displayed, XML_none, XML_dash, XML_NA };
     mnPrintErrors = STATIC_ARRAY_SELECT( spnErrorIds, nPrintErrors, XML_none );
@@ -256,10 +254,10 @@ void PageSettings::importPrintOptions( RecordInputStream& rStrm )
 {
     sal_uInt16 nFlags;
     rStrm >> nFlags;
-    maModel.mbHorCenter     = getFlag( nFlags, OOBIN_PRINTOPT_HORCENTER );
-    maModel.mbVerCenter     = getFlag( nFlags, OOBIN_PRINTOPT_VERCENTER );
-    maModel.mbPrintGrid     = getFlag( nFlags, OOBIN_PRINTOPT_PRINTGRID );
-    maModel.mbPrintHeadings = getFlag( nFlags, OOBIN_PRINTOPT_PRINTHEADING );
+    maModel.mbHorCenter     = getFlag( nFlags, BIFF12_PRINTOPT_HORCENTER );
+    maModel.mbVerCenter     = getFlag( nFlags, BIFF12_PRINTOPT_VERCENTER );
+    maModel.mbPrintGrid     = getFlag( nFlags, BIFF12_PRINTOPT_PRINTGRID );
+    maModel.mbPrintHeadings = getFlag( nFlags, BIFF12_PRINTOPT_PRINTHEADING );
 }
 
 void PageSettings::importPageSetup( const Relations& rRelations, RecordInputStream& rStrm )
@@ -271,15 +269,15 @@ void PageSettings::importPageSetup( const Relations& rRelations, RecordInputStre
             >> maModel.mnCopies >> maModel.mnFirstPage
             >> maModel.mnFitToWidth >> maModel.mnFitToHeight
             >> nFlags >> aRelId;
-    maModel.setBinPrintErrors( extractValue< sal_uInt8 >( nFlags, 9, 2 ) );
+    maModel.setBiffPrintErrors( extractValue< sal_uInt8 >( nFlags, 9, 2 ) );
     maModel.maBinSettPath   = rRelations.getFragmentPathFromRelId( aRelId );
-    maModel.mnOrientation   = getFlagValue( nFlags, OOBIN_PAGESETUP_DEFAULTORIENT, XML_default, getFlagValue( nFlags, OOBIN_PAGESETUP_LANDSCAPE, XML_landscape, XML_portrait ) );
-    maModel.mnPageOrder     = getFlagValue( nFlags, OOBIN_PAGESETUP_INROWS, XML_overThenDown, XML_downThenOver );
-    maModel.mnCellComments  = getFlagValue( nFlags, OOBIN_PAGESETUP_PRINTNOTES, getFlagValue( nFlags, OOBIN_PAGESETUP_NOTES_END, XML_atEnd, XML_asDisplayed ), XML_none );
-    maModel.mbValidSettings = !getFlag( nFlags, OOBIN_PAGESETUP_INVALID );
-    maModel.mbUseFirstPage  = getFlag( nFlags, OOBIN_PAGESETUP_USEFIRSTPAGE );
-    maModel.mbBlackWhite    = getFlag( nFlags, OOBIN_PAGESETUP_BLACKWHITE );
-    maModel.mbDraftQuality  = getFlag( nFlags, OOBIN_PAGESETUP_DRAFTQUALITY );
+    maModel.mnOrientation   = getFlagValue( nFlags, BIFF12_PAGESETUP_DEFAULTORIENT, XML_default, getFlagValue( nFlags, BIFF12_PAGESETUP_LANDSCAPE, XML_landscape, XML_portrait ) );
+    maModel.mnPageOrder     = getFlagValue( nFlags, BIFF12_PAGESETUP_INROWS, XML_overThenDown, XML_downThenOver );
+    maModel.mnCellComments  = getFlagValue( nFlags, BIFF12_PAGESETUP_PRINTNOTES, getFlagValue( nFlags, BIFF12_PAGESETUP_NOTES_END, XML_atEnd, XML_asDisplayed ), XML_none );
+    maModel.mbValidSettings = !getFlag( nFlags, BIFF12_PAGESETUP_INVALID );
+    maModel.mbUseFirstPage  = getFlag( nFlags, BIFF12_PAGESETUP_USEFIRSTPAGE );
+    maModel.mbBlackWhite    = getFlag( nFlags, BIFF12_PAGESETUP_BLACKWHITE );
+    maModel.mbDraftQuality  = getFlag( nFlags, BIFF12_PAGESETUP_DRAFTQUALITY );
 }
 
 void PageSettings::importChartPageSetup( const Relations& rRelations, RecordInputStream& rStrm )
@@ -290,11 +288,11 @@ void PageSettings::importChartPageSetup( const Relations& rRelations, RecordInpu
             >> maModel.mnCopies >> nFirstPage >> nFlags >> aRelId;
     maModel.maBinSettPath   = rRelations.getFragmentPathFromRelId( aRelId );
     maModel.mnFirstPage     = nFirstPage; // 16-bit in CHARTPAGESETUP
-    maModel.mnOrientation   = getFlagValue( nFlags, OOBIN_CHARTPAGESETUP_DEFAULTORIENT, XML_default, getFlagValue( nFlags, OOBIN_CHARTPAGESETUP_LANDSCAPE, XML_landscape, XML_portrait ) );
-    maModel.mbValidSettings = !getFlag( nFlags, OOBIN_CHARTPAGESETUP_INVALID );
-    maModel.mbUseFirstPage  = getFlag( nFlags, OOBIN_CHARTPAGESETUP_USEFIRSTPAGE );
-    maModel.mbBlackWhite    = getFlag( nFlags, OOBIN_CHARTPAGESETUP_BLACKWHITE );
-    maModel.mbDraftQuality  = getFlag( nFlags, OOBIN_CHARTPAGESETUP_DRAFTQUALITY );
+    maModel.mnOrientation   = getFlagValue( nFlags, BIFF12_CHARTPAGESETUP_DEFAULTORIENT, XML_default, getFlagValue( nFlags, BIFF12_CHARTPAGESETUP_LANDSCAPE, XML_landscape, XML_portrait ) );
+    maModel.mbValidSettings = !getFlag( nFlags, BIFF12_CHARTPAGESETUP_INVALID );
+    maModel.mbUseFirstPage  = getFlag( nFlags, BIFF12_CHARTPAGESETUP_USEFIRSTPAGE );
+    maModel.mbBlackWhite    = getFlag( nFlags, BIFF12_CHARTPAGESETUP_BLACKWHITE );
+    maModel.mbDraftQuality  = getFlag( nFlags, BIFF12_CHARTPAGESETUP_DRAFTQUALITY );
 }
 
 void PageSettings::importHeaderFooter( RecordInputStream& rStrm )
@@ -304,8 +302,8 @@ void PageSettings::importHeaderFooter( RecordInputStream& rStrm )
             >> maModel.maOddHeader   >> maModel.maOddFooter
             >> maModel.maEvenHeader  >> maModel.maEvenFooter
             >> maModel.maFirstHeader >> maModel.maFirstFooter;
-    maModel.mbUseEvenHF  = getFlag( nFlags, OOBIN_HEADERFOOTER_DIFFEVEN );
-    maModel.mbUseFirstHF = getFlag( nFlags, OOBIN_HEADERFOOTER_DIFFFIRST );
+    maModel.mbUseEvenHF  = getFlag( nFlags, BIFF12_HEADERFOOTER_DIFFEVEN );
+    maModel.mbUseFirstHF = getFlag( nFlags, BIFF12_HEADERFOOTER_DIFFFIRST );
 }
 
 void PageSettings::importPicture( const Relations& rRelations, RecordInputStream& rStrm )
@@ -364,7 +362,7 @@ void PageSettings::importPageSetup( BiffInputStream& rStrm )
 
         if( getBiff() == BIFF8 )
         {
-            maModel.setBinPrintErrors( extractValue< sal_uInt8 >( nFlags, 10, 2 ) );
+            maModel.setBiffPrintErrors( extractValue< sal_uInt8 >( nFlags, 10, 2 ) );
             maModel.mnCellComments = getFlagValue( nFlags, BIFF_PAGESETUP_PRINTNOTES, getFlagValue( nFlags, BIFF_PAGESETUP_NOTES_END, XML_atEnd, XML_asDisplayed ), XML_none );
         }
     }
@@ -680,8 +678,8 @@ double HeaderFooterParser::parse( const Reference< XHeaderFooterContent >& rxCon
                         appendField( xContent );
                     }
                     break;
-                    case 'Z':   // file path (without file name), BIFF8 and OOX only
-                        if( (getFilterType() == FILTER_OOX) || ((getFilterType() == FILTER_BIFF) && (getBiff() == BIFF8)) )
+                    case 'Z':   // file path (without file name), OOXML, BIFF12, and BIFF8 only
+                        if( (getFilterType() == FILTER_OOXML) || ((getFilterType() == FILTER_BIFF) && (getBiff() == BIFF8)) )
                         {
                             Reference< XTextContent > xContent = createField( maFileNameService );
                             PropertySet aPropSet( xContent );
@@ -749,7 +747,7 @@ double HeaderFooterParser::parse( const Reference< XHeaderFooterContent >& rxCon
                     break;
 
                     case 'K':   // text color (not in BIFF)
-                        if( (getFilterType() == FILTER_OOX) && (pcChar + 6 < pcEnd) )
+                        if( (getFilterType() == FILTER_OOXML) && (pcChar + 6 < pcEnd) )
                         {
                             setAttributes();
                             // eat the following 6 characters
@@ -1237,8 +1235,8 @@ sal_Int32 PageSettingsConverter::writeHeaderFooter(
     sal_Int32 nHeight = 0;
     if( rContent.getLength() > 0 )
     {
-        Reference< XHeaderFooterContent > xHFContent;
-        if( rPropSet.getProperty( xHFContent, nPropId ) && xHFContent.is() )
+        Reference< XHeaderFooterContent > xHFContent( rPropSet.getAnyProperty( nPropId ), UNO_QUERY );
+        if( xHFContent.is() )
         {
             double fTotalHeight = mxHFParser->parse( xHFContent, rContent );
             rPropSet.setProperty( nPropId, xHFContent );
@@ -1252,4 +1250,3 @@ sal_Int32 PageSettingsConverter::writeHeaderFooter(
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/pivotcachebuffer.cxx b/oox/source/xls/pivotcachebuffer.cxx
index d76ab81d07c4..e0c3cec9c193 100644
--- a/oox/source/xls/pivotcachebuffer.cxx
+++ b/oox/source/xls/pivotcachebuffer.cxx
@@ -26,20 +26,20 @@
  ************************************************************************/
 
 #include "oox/xls/pivotcachebuffer.hxx"
+
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include "properties.hxx"
+#include 
+#include 
+#include "oox/core/filterbase.hxx"
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/defnamesbuffer.hxx"
 #include "oox/xls/excelhandlers.hxx"
@@ -47,76 +47,73 @@
 #include "oox/xls/tablebuffer.hxx"
 #include "oox/xls/unitconverter.hxx"
 #include "oox/xls/worksheetbuffer.hxx"
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::DataPilotFieldGroupInfo;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::sheet::XDataPilotField;
-using ::com::sun::star::sheet::XDataPilotFieldGrouping;
-using ::oox::core::Relations;
+#include "properties.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::oox::core::Relations;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
 namespace {
 
-const sal_uInt16 OOBIN_PCDFIELD_SERVERFIELD         = 0x0001;
-const sal_uInt16 OOBIN_PCDFIELD_NOUNIQUEITEMS       = 0x0002;
-const sal_uInt16 OOBIN_PCDFIELD_DATABASEFIELD       = 0x0004;
-const sal_uInt16 OOBIN_PCDFIELD_HASCAPTION          = 0x0008;
-const sal_uInt16 OOBIN_PCDFIELD_MEMBERPROPFIELD     = 0x0010;
-const sal_uInt16 OOBIN_PCDFIELD_HASFORMULA          = 0x0100;
-const sal_uInt16 OOBIN_PCDFIELD_HASPROPERTYNAME     = 0x0200;
-
-const sal_uInt16 OOBIN_PCDFSITEMS_HASSEMIMIXED      = 0x0001;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASNONDATE        = 0x0002;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASDATE           = 0x0004;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASSTRING         = 0x0008;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASBLANK          = 0x0010;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASMIXED          = 0x0020;
-const sal_uInt16 OOBIN_PCDFSITEMS_ISNUMERIC         = 0x0040;
-const sal_uInt16 OOBIN_PCDFSITEMS_ISINTEGER         = 0x0080;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASMINMAX         = 0x0100;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASLONGTEXT       = 0x0200;
-
-const sal_uInt16 OOBIN_PCITEM_ARRAY_DOUBLE          = 0x0001;
-const sal_uInt16 OOBIN_PCITEM_ARRAY_STRING          = 0x0002;
-const sal_uInt16 OOBIN_PCITEM_ARRAY_ERROR           = 0x0010;
-const sal_uInt16 OOBIN_PCITEM_ARRAY_DATE            = 0x0020;
-
-const sal_uInt8 OOBIN_PCDFRANGEPR_AUTOSTART         = 0x01;
-const sal_uInt8 OOBIN_PCDFRANGEPR_AUTOEND           = 0x02;
-const sal_uInt8 OOBIN_PCDFRANGEPR_DATEGROUP         = 0x04;
-
-const sal_uInt8 OOBIN_PCDEFINITION_SAVEDATA         = 0x01;
-const sal_uInt8 OOBIN_PCDEFINITION_INVALID          = 0x02;
-const sal_uInt8 OOBIN_PCDEFINITION_REFRESHONLOAD    = 0x04;
-const sal_uInt8 OOBIN_PCDEFINITION_OPTIMIZEMEMORY   = 0x08;
-const sal_uInt8 OOBIN_PCDEFINITION_ENABLEREFRESH    = 0x10;
-const sal_uInt8 OOBIN_PCDEFINITION_BACKGROUNDQUERY  = 0x20;
-const sal_uInt8 OOBIN_PCDEFINITION_UPGRADEONREFR    = 0x40;
-const sal_uInt8 OOBIN_PCDEFINITION_TUPELCACHE       = 0x80;
-
-const sal_uInt8 OOBIN_PCDEFINITION_HASUSERNAME      = 0x01;
-const sal_uInt8 OOBIN_PCDEFINITION_HASRELID         = 0x02;
-const sal_uInt8 OOBIN_PCDEFINITION_SUPPORTSUBQUERY  = 0x04;
-const sal_uInt8 OOBIN_PCDEFINITION_SUPPORTDRILL     = 0x08;
-
-const sal_uInt8 OOBIN_PCDWBSOURCE_HASRELID          = 0x01;
-const sal_uInt8 OOBIN_PCDWBSOURCE_HASSHEET          = 0x02;
+const sal_uInt16 BIFF12_PCDFIELD_SERVERFIELD        = 0x0001;
+const sal_uInt16 BIFF12_PCDFIELD_NOUNIQUEITEMS      = 0x0002;
+const sal_uInt16 BIFF12_PCDFIELD_DATABASEFIELD      = 0x0004;
+const sal_uInt16 BIFF12_PCDFIELD_HASCAPTION         = 0x0008;
+const sal_uInt16 BIFF12_PCDFIELD_MEMBERPROPFIELD    = 0x0010;
+const sal_uInt16 BIFF12_PCDFIELD_HASFORMULA         = 0x0100;
+const sal_uInt16 BIFF12_PCDFIELD_HASPROPERTYNAME    = 0x0200;
+
+const sal_uInt16 BIFF12_PCDFSITEMS_HASSEMIMIXED     = 0x0001;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASNONDATE       = 0x0002;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASDATE          = 0x0004;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASSTRING        = 0x0008;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASBLANK         = 0x0010;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASMIXED         = 0x0020;
+const sal_uInt16 BIFF12_PCDFSITEMS_ISNUMERIC        = 0x0040;
+const sal_uInt16 BIFF12_PCDFSITEMS_ISINTEGER        = 0x0080;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASMINMAX        = 0x0100;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASLONGTEXT      = 0x0200;
+
+const sal_uInt16 BIFF12_PCITEM_ARRAY_DOUBLE         = 0x0001;
+const sal_uInt16 BIFF12_PCITEM_ARRAY_STRING         = 0x0002;
+const sal_uInt16 BIFF12_PCITEM_ARRAY_ERROR          = 0x0010;
+const sal_uInt16 BIFF12_PCITEM_ARRAY_DATE           = 0x0020;
+
+const sal_uInt8 BIFF12_PCDFRANGEPR_AUTOSTART        = 0x01;
+const sal_uInt8 BIFF12_PCDFRANGEPR_AUTOEND          = 0x02;
+const sal_uInt8 BIFF12_PCDFRANGEPR_DATEGROUP        = 0x04;
+
+const sal_uInt8 BIFF12_PCDEFINITION_SAVEDATA        = 0x01;
+const sal_uInt8 BIFF12_PCDEFINITION_INVALID         = 0x02;
+const sal_uInt8 BIFF12_PCDEFINITION_REFRESHONLOAD   = 0x04;
+const sal_uInt8 BIFF12_PCDEFINITION_OPTIMIZEMEMORY  = 0x08;
+const sal_uInt8 BIFF12_PCDEFINITION_ENABLEREFRESH   = 0x10;
+const sal_uInt8 BIFF12_PCDEFINITION_BACKGROUNDQUERY = 0x20;
+const sal_uInt8 BIFF12_PCDEFINITION_UPGRADEONREFR   = 0x40;
+const sal_uInt8 BIFF12_PCDEFINITION_TUPELCACHE      = 0x80;
+
+const sal_uInt8 BIFF12_PCDEFINITION_HASUSERNAME     = 0x01;
+const sal_uInt8 BIFF12_PCDEFINITION_HASRELID        = 0x02;
+const sal_uInt8 BIFF12_PCDEFINITION_SUPPORTSUBQUERY = 0x04;
+const sal_uInt8 BIFF12_PCDEFINITION_SUPPORTDRILL    = 0x08;
+
+const sal_uInt8 BIFF12_PCDWBSOURCE_HASRELID         = 0x01;
+const sal_uInt8 BIFF12_PCDWBSOURCE_HASSHEET         = 0x02;
+
+// ----------------------------------------------------------------------------
 
 const sal_uInt16 BIFF_PCDSOURCE_WORKSHEET           = 0x0001;
 const sal_uInt16 BIFF_PCDSOURCE_EXTERNAL            = 0x0002;
@@ -344,7 +341,7 @@ void PivotCacheItemList::importItem( sal_Int32 nElement, const AttributeList& rA
 
 void PivotCacheItemList::importItem( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
-    if( nRecId == OOBIN_ID_PCITEM_ARRAY )
+    if( nRecId == BIFF12_ID_PCITEM_ARRAY )
     {
         importArray( rStrm );
         return;
@@ -353,18 +350,18 @@ void PivotCacheItemList::importItem( sal_Int32 nRecId, RecordInputStream& rStrm
     PivotCacheItem& rItem = createItem();
     switch( nRecId )
     {
-        case OOBIN_ID_PCITEM_MISSING:
-        case OOBIN_ID_PCITEMA_MISSING:                              break;
-        case OOBIN_ID_PCITEM_STRING:
-        case OOBIN_ID_PCITEMA_STRING:   rItem.readString( rStrm );  break;
-        case OOBIN_ID_PCITEM_DOUBLE:
-        case OOBIN_ID_PCITEMA_DOUBLE:   rItem.readDouble( rStrm );  break;
-        case OOBIN_ID_PCITEM_DATE:
-        case OOBIN_ID_PCITEMA_DATE:     rItem.readDate( rStrm );    break;
-        case OOBIN_ID_PCITEM_BOOL:
-        case OOBIN_ID_PCITEMA_BOOL:     rItem.readBool( rStrm );    break;
-        case OOBIN_ID_PCITEM_ERROR:
-        case OOBIN_ID_PCITEMA_ERROR:    rItem.readError( rStrm );   break;
+        case BIFF12_ID_PCITEM_MISSING:
+        case BIFF12_ID_PCITEMA_MISSING:                             break;
+        case BIFF12_ID_PCITEM_STRING:
+        case BIFF12_ID_PCITEMA_STRING:  rItem.readString( rStrm );  break;
+        case BIFF12_ID_PCITEM_DOUBLE:
+        case BIFF12_ID_PCITEMA_DOUBLE:  rItem.readDouble( rStrm );  break;
+        case BIFF12_ID_PCITEM_DATE:
+        case BIFF12_ID_PCITEMA_DATE:    rItem.readDate( rStrm );    break;
+        case BIFF12_ID_PCITEM_BOOL:
+        case BIFF12_ID_PCITEMA_BOOL:    rItem.readBool( rStrm );    break;
+        case BIFF12_ID_PCITEM_ERROR:
+        case BIFF12_ID_PCITEMA_ERROR:   rItem.readError( rStrm );   break;
         default:    OSL_ENSURE( false, "PivotCacheItemList::importItem - unknown record type" );
     }
 }
@@ -419,10 +416,10 @@ void PivotCacheItemList::importArray( RecordInputStream& rStrm )
     {
         switch( nType )
         {
-            case OOBIN_PCITEM_ARRAY_DOUBLE: createItem().readDouble( rStrm );   break;
-            case OOBIN_PCITEM_ARRAY_STRING: createItem().readString( rStrm );   break;
-            case OOBIN_PCITEM_ARRAY_ERROR:  createItem().readError( rStrm );    break;
-            case OOBIN_PCITEM_ARRAY_DATE:   createItem().readDate( rStrm );     break;
+            case BIFF12_PCITEM_ARRAY_DOUBLE: createItem().readDouble( rStrm );   break;
+            case BIFF12_PCITEM_ARRAY_STRING: createItem().readString( rStrm );   break;
+            case BIFF12_PCITEM_ARRAY_ERROR:  createItem().readError( rStrm );    break;
+            case BIFF12_PCITEM_ARRAY_DATE:   createItem().readDate( rStrm );     break;
             default:
                 OSL_ENSURE( false, "PivotCacheItemList::importArray - unknown data type" );
                 nIdx = nCount;
@@ -477,7 +474,7 @@ PCFieldGroupModel::PCFieldGroupModel() :
 {
 }
 
-void PCFieldGroupModel::setBinGroupBy( sal_uInt8 nGroupBy )
+void PCFieldGroupModel::setBiffGroupBy( sal_uInt8 nGroupBy )
 {
     static const sal_Int32 spnGroupBy[] = { XML_range,
         XML_seconds, XML_minutes, XML_hours, XML_days, XML_months, XML_quarters, XML_years };
@@ -568,34 +565,34 @@ void PivotCacheField::importPCDField( RecordInputStream& rStrm )
     rStrm >> nFlags >> maFieldModel.mnNumFmtId;
     maFieldModel.mnSqlType = rStrm.readInt16();
     rStrm >> maFieldModel.mnHierarchy >> maFieldModel.mnLevel >> maFieldModel.mnMappingCount >> maFieldModel.maName;
-    if( getFlag( nFlags, OOBIN_PCDFIELD_HASCAPTION ) )
+    if( getFlag( nFlags, BIFF12_PCDFIELD_HASCAPTION ) )
         rStrm >> maFieldModel.maCaption;
-    if( getFlag( nFlags, OOBIN_PCDFIELD_HASFORMULA ) )
+    if( getFlag( nFlags, BIFF12_PCDFIELD_HASFORMULA ) )
         rStrm.skip( ::std::max< sal_Int32 >( rStrm.readInt32(), 0 ) );
     if( maFieldModel.mnMappingCount > 0 )
         rStrm.skip( ::std::max< sal_Int32 >( rStrm.readInt32(), 0 ) );
-    if( getFlag( nFlags, OOBIN_PCDFIELD_HASPROPERTYNAME ) )
+    if( getFlag( nFlags, BIFF12_PCDFIELD_HASPROPERTYNAME ) )
         rStrm >> maFieldModel.maPropertyName;
 
-    maFieldModel.mbDatabaseField   = getFlag( nFlags, OOBIN_PCDFIELD_DATABASEFIELD );
-    maFieldModel.mbServerField     = getFlag( nFlags, OOBIN_PCDFIELD_SERVERFIELD );
-    maFieldModel.mbUniqueList      = !getFlag( nFlags, OOBIN_PCDFIELD_NOUNIQUEITEMS );
-    maFieldModel.mbMemberPropField = getFlag( nFlags, OOBIN_PCDFIELD_MEMBERPROPFIELD );
+    maFieldModel.mbDatabaseField   = getFlag( nFlags, BIFF12_PCDFIELD_DATABASEFIELD );
+    maFieldModel.mbServerField     = getFlag( nFlags, BIFF12_PCDFIELD_SERVERFIELD );
+    maFieldModel.mbUniqueList      = !getFlag( nFlags, BIFF12_PCDFIELD_NOUNIQUEITEMS );
+    maFieldModel.mbMemberPropField = getFlag( nFlags, BIFF12_PCDFIELD_MEMBERPROPFIELD );
 }
 
 void PivotCacheField::importPCDFSharedItems( RecordInputStream& rStrm )
 {
     sal_uInt16 nFlags;
     rStrm >> nFlags;
-    maSharedItemsModel.mbHasSemiMixed = getFlag( nFlags, OOBIN_PCDFSITEMS_HASSEMIMIXED );
-    maSharedItemsModel.mbHasNonDate   = getFlag( nFlags, OOBIN_PCDFSITEMS_HASNONDATE );
-    maSharedItemsModel.mbHasDate      = getFlag( nFlags, OOBIN_PCDFSITEMS_HASDATE );
-    maSharedItemsModel.mbHasString    = getFlag( nFlags, OOBIN_PCDFSITEMS_HASSTRING );
-    maSharedItemsModel.mbHasBlank     = getFlag( nFlags, OOBIN_PCDFSITEMS_HASBLANK );
-    maSharedItemsModel.mbHasMixed     = getFlag( nFlags, OOBIN_PCDFSITEMS_HASMIXED );
-    maSharedItemsModel.mbIsNumeric    = getFlag( nFlags, OOBIN_PCDFSITEMS_ISNUMERIC );
-    maSharedItemsModel.mbIsInteger    = getFlag( nFlags, OOBIN_PCDFSITEMS_ISINTEGER );
-    maSharedItemsModel.mbHasLongText  = getFlag( nFlags, OOBIN_PCDFSITEMS_HASLONGTEXT );
+    maSharedItemsModel.mbHasSemiMixed = getFlag( nFlags, BIFF12_PCDFSITEMS_HASSEMIMIXED );
+    maSharedItemsModel.mbHasNonDate   = getFlag( nFlags, BIFF12_PCDFSITEMS_HASNONDATE );
+    maSharedItemsModel.mbHasDate      = getFlag( nFlags, BIFF12_PCDFSITEMS_HASDATE );
+    maSharedItemsModel.mbHasString    = getFlag( nFlags, BIFF12_PCDFSITEMS_HASSTRING );
+    maSharedItemsModel.mbHasBlank     = getFlag( nFlags, BIFF12_PCDFSITEMS_HASBLANK );
+    maSharedItemsModel.mbHasMixed     = getFlag( nFlags, BIFF12_PCDFSITEMS_HASMIXED );
+    maSharedItemsModel.mbIsNumeric    = getFlag( nFlags, BIFF12_PCDFSITEMS_ISNUMERIC );
+    maSharedItemsModel.mbIsInteger    = getFlag( nFlags, BIFF12_PCDFSITEMS_ISINTEGER );
+    maSharedItemsModel.mbHasLongText  = getFlag( nFlags, BIFF12_PCDFSITEMS_HASLONGTEXT );
 }
 
 void PivotCacheField::importPCDFSharedItem( sal_Int32 nRecId, RecordInputStream& rStrm )
@@ -613,11 +610,11 @@ void PivotCacheField::importPCDFRangePr( RecordInputStream& rStrm )
     sal_uInt8 nGroupBy, nFlags;
     rStrm >> nGroupBy >> nFlags >> maFieldGroupModel.mfStartValue >> maFieldGroupModel.mfEndValue >> maFieldGroupModel.mfInterval;
 
-    maFieldGroupModel.setBinGroupBy( nGroupBy );
+    maFieldGroupModel.setBiffGroupBy( nGroupBy );
     maFieldGroupModel.mbRangeGroup   = true;
-    maFieldGroupModel.mbDateGroup    = getFlag( nFlags, OOBIN_PCDFRANGEPR_DATEGROUP );
-    maFieldGroupModel.mbAutoStart    = getFlag( nFlags, OOBIN_PCDFRANGEPR_AUTOSTART );
-    maFieldGroupModel.mbAutoEnd      = getFlag( nFlags, OOBIN_PCDFRANGEPR_AUTOEND );
+    maFieldGroupModel.mbDateGroup    = getFlag( nFlags, BIFF12_PCDFRANGEPR_DATEGROUP );
+    maFieldGroupModel.mbAutoStart    = getFlag( nFlags, BIFF12_PCDFRANGEPR_AUTOSTART );
+    maFieldGroupModel.mbAutoEnd      = getFlag( nFlags, BIFF12_PCDFRANGEPR_AUTOEND );
 
     OSL_ENSURE( maFieldGroupModel.mbDateGroup == (maFieldGroupModel.mnGroupBy != XML_range), "PivotCacheField::importPCDFRangePr - wrong date flag" );
     if( maFieldGroupModel.mbDateGroup )
@@ -629,8 +626,8 @@ void PivotCacheField::importPCDFRangePr( RecordInputStream& rStrm )
 
 void PivotCacheField::importPCDFDiscretePrItem( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
-    OSL_ENSURE( nRecId == OOBIN_ID_PCITEM_INDEX, "PivotCacheField::importPCDFDiscretePrItem - unexpected record" );
-    if( nRecId == OOBIN_ID_PCITEM_INDEX )
+    OSL_ENSURE( nRecId == BIFF12_ID_PCITEM_INDEX, "PivotCacheField::importPCDFDiscretePrItem - unexpected record" );
+    if( nRecId == BIFF12_ID_PCITEM_INDEX )
         maDiscreteItems.push_back( rStrm.readInt32() );
 }
 
@@ -696,7 +693,7 @@ void PivotCacheField::importPCDFRangePr( BiffInputStream& rStrm )
 {
     sal_uInt16 nFlags;
     rStrm >> nFlags;
-    maFieldGroupModel.setBinGroupBy( extractValue< sal_uInt8 >( nFlags, 2, 3 ) );
+    maFieldGroupModel.setBiffGroupBy( extractValue< sal_uInt8 >( nFlags, 2, 3 ) );
     maFieldGroupModel.mbRangeGroup = true;
     maFieldGroupModel.mbDateGroup  = maFieldGroupModel.mnGroupBy != XML_range;
     maFieldGroupModel.mbAutoStart  = getFlag( nFlags, BIFF_PCDFRANGEPR_AUTOSTART );
@@ -1093,21 +1090,21 @@ void PivotCache::importPCDefinition( RecordInputStream& rStrm )
     sal_uInt8 nFlags1, nFlags2;
     rStrm.skip( 3 );    // create/refresh version id's
     rStrm >> nFlags1 >> maDefModel.mnMissItemsLimit >> maDefModel.mfRefreshedDate >> nFlags2 >> maDefModel.mnRecords;
-    if( getFlag( nFlags2, OOBIN_PCDEFINITION_HASUSERNAME ) )
+    if( getFlag( nFlags2, BIFF12_PCDEFINITION_HASUSERNAME ) )
         rStrm >> maDefModel.maRefreshedBy;
-    if( getFlag( nFlags2, OOBIN_PCDEFINITION_HASRELID ) )
+    if( getFlag( nFlags2, BIFF12_PCDEFINITION_HASRELID ) )
         rStrm >> maDefModel.maRelId;
 
-    maDefModel.mbInvalid          = getFlag( nFlags1, OOBIN_PCDEFINITION_INVALID );
-    maDefModel.mbSaveData         = getFlag( nFlags1, OOBIN_PCDEFINITION_SAVEDATA );
-    maDefModel.mbRefreshOnLoad    = getFlag( nFlags1, OOBIN_PCDEFINITION_REFRESHONLOAD );
-    maDefModel.mbOptimizeMemory   = getFlag( nFlags1, OOBIN_PCDEFINITION_OPTIMIZEMEMORY );
-    maDefModel.mbEnableRefresh    = getFlag( nFlags1, OOBIN_PCDEFINITION_ENABLEREFRESH );
-    maDefModel.mbBackgroundQuery  = getFlag( nFlags1, OOBIN_PCDEFINITION_BACKGROUNDQUERY );
-    maDefModel.mbUpgradeOnRefresh = getFlag( nFlags1, OOBIN_PCDEFINITION_UPGRADEONREFR );
-    maDefModel.mbTupleCache       = getFlag( nFlags1, OOBIN_PCDEFINITION_TUPELCACHE );
-    maDefModel.mbSupportSubquery  = getFlag( nFlags2, OOBIN_PCDEFINITION_SUPPORTSUBQUERY );
-    maDefModel.mbSupportDrill     = getFlag( nFlags2, OOBIN_PCDEFINITION_SUPPORTDRILL );
+    maDefModel.mbInvalid          = getFlag( nFlags1, BIFF12_PCDEFINITION_INVALID );
+    maDefModel.mbSaveData         = getFlag( nFlags1, BIFF12_PCDEFINITION_SAVEDATA );
+    maDefModel.mbRefreshOnLoad    = getFlag( nFlags1, BIFF12_PCDEFINITION_REFRESHONLOAD );
+    maDefModel.mbOptimizeMemory   = getFlag( nFlags1, BIFF12_PCDEFINITION_OPTIMIZEMEMORY );
+    maDefModel.mbEnableRefresh    = getFlag( nFlags1, BIFF12_PCDEFINITION_ENABLEREFRESH );
+    maDefModel.mbBackgroundQuery  = getFlag( nFlags1, BIFF12_PCDEFINITION_BACKGROUNDQUERY );
+    maDefModel.mbUpgradeOnRefresh = getFlag( nFlags1, BIFF12_PCDEFINITION_UPGRADEONREFR );
+    maDefModel.mbTupleCache       = getFlag( nFlags1, BIFF12_PCDEFINITION_TUPELCACHE );
+    maDefModel.mbSupportSubquery  = getFlag( nFlags2, BIFF12_PCDEFINITION_SUPPORTSUBQUERY );
+    maDefModel.mbSupportDrill     = getFlag( nFlags2, BIFF12_PCDEFINITION_SUPPORTDRILL );
 }
 
 void PivotCache::importPCDSource( RecordInputStream& rStrm )
@@ -1122,9 +1119,9 @@ void PivotCache::importPCDSheetSource( RecordInputStream& rStrm, const Relations
 {
     sal_uInt8 nIsDefName, nIsBuiltinName, nFlags;
     rStrm >> nIsDefName >> nIsBuiltinName >> nFlags;
-    if( getFlag( nFlags, OOBIN_PCDWBSOURCE_HASSHEET ) )
+    if( getFlag( nFlags, BIFF12_PCDWBSOURCE_HASSHEET ) )
         rStrm >> maSheetSrcModel.maSheet;
-    if( getFlag( nFlags, OOBIN_PCDWBSOURCE_HASRELID ) )
+    if( getFlag( nFlags, BIFF12_PCDWBSOURCE_HASRELID ) )
         rStrm >> maSheetSrcModel.maRelId;
 
     // read cell range or defined name
@@ -1411,7 +1408,7 @@ void PivotCache::finalizeExternalSheetSource()
 {
     /*  If pivot cache is based on external sheet data, try to restore sheet
         data from cache records. No support for external defined names or tables,
-        sheet name and path to cache records fragment (OOX only) are required. */
+        sheet name and path to cache records fragment (OOXML only) are required. */
     bool bHasRelation = (getFilterType() == FILTER_BIFF) || (maDefModel.maRelId.getLength() > 0);
     if( bHasRelation && (maSheetSrcModel.maDefName.getLength() == 0) && (maSheetSrcModel.maSheet.getLength() > 0) )
         prepareSourceDataSheet();
@@ -1471,6 +1468,29 @@ PivotCache* PivotCacheBuffer::importPivotCacheFragment( sal_Int32 nCacheId )
 {
     switch( getFilterType() )
     {
+        /*  OOXML/BIFF12 filter: On first call for the cache ID, the pivot
+            cache object is created and inserted into maCaches. Then, the cache
+            definition fragment is read and the cache is returned. On
+            subsequent calls, the created cache will be found in maCaches and
+            returned immediately. */
+        case FILTER_OOXML:
+        {
+            // try to find an imported pivot cache
+            if( PivotCache* pCache = maCaches.get( nCacheId ).get() )
+                return pCache;
+
+            // check if a fragment path exists for the passed cache identifier
+            FragmentPathMap::iterator aIt = maFragmentPaths.find( nCacheId );
+            if( aIt == maFragmentPaths.end() )
+                return 0;
+
+            /*  Import the cache fragment. This may create a dummy data sheet
+                for external sheet sources. */
+            PivotCache& rCache = createPivotCache( nCacheId );
+            importOoxFragment( new PivotCacheDefinitionFragment( *this, aIt->second, rCache ) );
+            return &rCache;
+        }
+
         /*  BIFF filter: Pivot table provides 0-based index into list of pivot
             cache source links (PIVOTCACHE/PCDSOURCE/... record blocks in
             workbook stream). First, this index has to be resolved to the cache
@@ -1504,29 +1524,6 @@ PivotCache* PivotCacheBuffer::importPivotCacheFragment( sal_Int32 nCacheId )
             return pCache;
         }
 
-        /*  OOX/OOBIN filter: On first call for the cache ID, the pivot cache
-            object is created and inserted into maCaches. Then, the cache
-            definition fragment is read and the cache is returned. On
-            subsequent calls, the created cache will be found in maCaches and
-            returned immediately. */
-        case FILTER_OOX:
-        {
-            // try to find an imported pivot cache
-            if( PivotCache* pCache = maCaches.get( nCacheId ).get() )
-                return pCache;
-
-            // check if a fragment path exists for the passed cache identifier
-            FragmentPathMap::iterator aIt = maFragmentPaths.find( nCacheId );
-            if( aIt == maFragmentPaths.end() )
-                return 0;
-
-            /*  Import the cache fragment. This may create a dummy data sheet
-                for external sheet sources. */
-            PivotCache& rCache = createPivotCache( nCacheId );
-            importOoxFragment( new OoxPivotCacheDefinitionFragment( *this, aIt->second, rCache ) );
-            return &rCache;
-        }
-
         case FILTER_UNKNOWN:
             OSL_ENSURE( false, "PivotCacheBuffer::importPivotCacheFragment - unknown filter type" );
     }
@@ -1545,4 +1542,3 @@ PivotCache& PivotCacheBuffer::createPivotCache( sal_Int32 nCacheId )
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/pivotcachefragment.cxx b/oox/source/xls/pivotcachefragment.cxx
index 440fcd1e0903..3d69928f7ee8 100644
--- a/oox/source/xls/pivotcachefragment.cxx
+++ b/oox/source/xls/pivotcachefragment.cxx
@@ -26,29 +26,33 @@
  ************************************************************************/
 
 #include "oox/xls/pivotcachefragment.hxx"
+
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/recordinputstream.hxx"
 #include "oox/xls/addressconverter.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/pivotcachebuffer.hxx"
 
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
-OoxPivotCacheFieldContext::OoxPivotCacheFieldContext( OoxWorkbookFragmentBase& rFragment, PivotCacheField& rCacheField ) :
-    OoxWorkbookContextBase( rFragment ),
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::ContextHandlerRef;
+using ::oox::core::RecordInfo;
+using ::rtl::OUString;
+
+// ============================================================================
+
+PivotCacheFieldContext::PivotCacheFieldContext( WorkbookFragmentBase& rFragment, PivotCacheField& rCacheField ) :
+    WorkbookContextBase( rFragment ),
     mrCacheField( rCacheField )
 {
 }
 
-ContextHandlerRef OoxPivotCacheFieldContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotCacheFieldContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -73,41 +77,41 @@ ContextHandlerRef OoxPivotCacheFieldContext::onCreateContext( sal_Int32 nElement
     return 0;
 }
 
-void OoxPivotCacheFieldContext::onStartElement( const AttributeList& rAttribs )
+void PivotCacheFieldContext::onStartElement( const AttributeList& rAttribs )
 {
     if( isRootElement() )
         mrCacheField.importCacheField( rAttribs );
 }
 
-ContextHandlerRef OoxPivotCacheFieldContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotCacheFieldContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
-        case OOBIN_ID_PCDFIELD:
+        case BIFF12_ID_PCDFIELD:
             switch( nRecId )
             {
-                case OOBIN_ID_PCDFSHAREDITEMS:  mrCacheField.importPCDFSharedItems( rStrm );  return this;
-                case OOBIN_ID_PCDFIELDGROUP:    mrCacheField.importPCDFieldGroup( rStrm );    return this;
+                case BIFF12_ID_PCDFSHAREDITEMS: mrCacheField.importPCDFSharedItems( rStrm );  return this;
+                case BIFF12_ID_PCDFIELDGROUP:   mrCacheField.importPCDFieldGroup( rStrm );    return this;
             }
         break;
 
-        case OOBIN_ID_PCDFIELDGROUP:
+        case BIFF12_ID_PCDFIELDGROUP:
             switch( nRecId )
             {
-                case OOBIN_ID_PCDFRANGEPR:      mrCacheField.importPCDFRangePr( rStrm );    break;
-                case OOBIN_ID_PCDFDISCRETEPR:   return this;
-                case OOBIN_ID_PCDFGROUPITEMS:   return this;
+                case BIFF12_ID_PCDFRANGEPR:     mrCacheField.importPCDFRangePr( rStrm );    break;
+                case BIFF12_ID_PCDFDISCRETEPR:  return this;
+                case BIFF12_ID_PCDFGROUPITEMS:  return this;
             }
         break;
 
-        case OOBIN_ID_PCDFSHAREDITEMS:  mrCacheField.importPCDFSharedItem( nRecId, rStrm );     break;
-        case OOBIN_ID_PCDFDISCRETEPR:   mrCacheField.importPCDFDiscretePrItem( nRecId, rStrm ); break;
-        case OOBIN_ID_PCDFGROUPITEMS:   mrCacheField.importPCDFGroupItem( nRecId, rStrm );      break;
+        case BIFF12_ID_PCDFSHAREDITEMS: mrCacheField.importPCDFSharedItem( nRecId, rStrm );     break;
+        case BIFF12_ID_PCDFDISCRETEPR:  mrCacheField.importPCDFDiscretePrItem( nRecId, rStrm ); break;
+        case BIFF12_ID_PCDFGROUPITEMS:  mrCacheField.importPCDFGroupItem( nRecId, rStrm );      break;
     }
     return 0;
 }
 
-void OoxPivotCacheFieldContext::onStartRecord( RecordInputStream& rStrm )
+void PivotCacheFieldContext::onStartRecord( RecordInputStream& rStrm )
 {
     if( isRootElement() )
         mrCacheField.importPCDField( rStrm );
@@ -115,14 +119,14 @@ void OoxPivotCacheFieldContext::onStartRecord( RecordInputStream& rStrm )
 
 // ============================================================================
 
-OoxPivotCacheDefinitionFragment::OoxPivotCacheDefinitionFragment(
+PivotCacheDefinitionFragment::PivotCacheDefinitionFragment(
         const WorkbookHelper& rHelper, const OUString& rFragmentPath, PivotCache& rPivotCache ) :
-    OoxWorkbookFragmentBase( rHelper, rFragmentPath ),
+    WorkbookFragmentBase( rHelper, rFragmentPath ),
     mrPivotCache( rPivotCache )
 {
 }
 
-ContextHandlerRef OoxPivotCacheDefinitionFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotCacheDefinitionFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -143,60 +147,60 @@ ContextHandlerRef OoxPivotCacheDefinitionFragment::onCreateContext( sal_Int32 nE
         break;
 
         case XLS_TOKEN( cacheFields ):
-            if( nElement == XLS_TOKEN( cacheField ) ) return new OoxPivotCacheFieldContext( *this, mrPivotCache.createCacheField() );
+            if( nElement == XLS_TOKEN( cacheField ) ) return new PivotCacheFieldContext( *this, mrPivotCache.createCacheField() );
         break;
     }
     return 0;
 }
 
-ContextHandlerRef OoxPivotCacheDefinitionFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotCacheDefinitionFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
         case XML_ROOT_CONTEXT:
-            if( nRecId == OOBIN_ID_PCDEFINITION ) { mrPivotCache.importPCDefinition( rStrm ); return this; }
+            if( nRecId == BIFF12_ID_PCDEFINITION ) { mrPivotCache.importPCDefinition( rStrm ); return this; }
         break;
 
-        case OOBIN_ID_PCDEFINITION:
+        case BIFF12_ID_PCDEFINITION:
             switch( nRecId )
             {
-                case OOBIN_ID_PCDSOURCE: mrPivotCache.importPCDSource( rStrm ); return this;
-                case OOBIN_ID_PCDFIELDS: return this;
+                case BIFF12_ID_PCDSOURCE: mrPivotCache.importPCDSource( rStrm ); return this;
+                case BIFF12_ID_PCDFIELDS: return this;
             }
         break;
 
-        case OOBIN_ID_PCDSOURCE:
-            if( nRecId == OOBIN_ID_PCDSHEETSOURCE ) mrPivotCache.importPCDSheetSource( rStrm, getRelations() );
+        case BIFF12_ID_PCDSOURCE:
+            if( nRecId == BIFF12_ID_PCDSHEETSOURCE ) mrPivotCache.importPCDSheetSource( rStrm, getRelations() );
         break;
 
-        case OOBIN_ID_PCDFIELDS:
-            if( nRecId == OOBIN_ID_PCDFIELD ) return new OoxPivotCacheFieldContext( *this, mrPivotCache.createCacheField() );
+        case BIFF12_ID_PCDFIELDS:
+            if( nRecId == BIFF12_ID_PCDFIELD ) return new PivotCacheFieldContext( *this, mrPivotCache.createCacheField() );
         break;
     }
     return 0;
 }
 
-const RecordInfo* OoxPivotCacheDefinitionFragment::getRecordInfos() const
+const RecordInfo* PivotCacheDefinitionFragment::getRecordInfos() const
 {
     static const RecordInfo spRecInfos[] =
     {
-        { OOBIN_ID_PCDEFINITION,    OOBIN_ID_PCDEFINITION + 1       },
-        { OOBIN_ID_PCDFDISCRETEPR,  OOBIN_ID_PCDFDISCRETEPR + 1     },
-        { OOBIN_ID_PCDFGROUPITEMS,  OOBIN_ID_PCDFGROUPITEMS + 1     },
-        { OOBIN_ID_PCDFIELD,        OOBIN_ID_PCDFIELD + 1           },
-        { OOBIN_ID_PCDFIELDGROUP,   OOBIN_ID_PCDFIELDGROUP + 1      },
-        { OOBIN_ID_PCDFIELDS,       OOBIN_ID_PCDFIELDS + 1          },
-        { OOBIN_ID_PCDFRANGEPR,     OOBIN_ID_PCDFRANGEPR + 1        },
-        { OOBIN_ID_PCDFSHAREDITEMS, OOBIN_ID_PCDFSHAREDITEMS + 1    },
-        { OOBIN_ID_PCITEM_ARRAY,    OOBIN_ID_PCITEM_ARRAY + 1       },
-        { OOBIN_ID_PCDSHEETSOURCE,  OOBIN_ID_PCDSHEETSOURCE + 1     },
-        { OOBIN_ID_PCDSOURCE,       OOBIN_ID_PCDSOURCE + 1          },
-        { -1,                       -1                              }
+        { BIFF12_ID_PCDEFINITION,       BIFF12_ID_PCDEFINITION + 1      },
+        { BIFF12_ID_PCDFDISCRETEPR,     BIFF12_ID_PCDFDISCRETEPR + 1    },
+        { BIFF12_ID_PCDFGROUPITEMS,     BIFF12_ID_PCDFGROUPITEMS + 1    },
+        { BIFF12_ID_PCDFIELD,           BIFF12_ID_PCDFIELD + 1          },
+        { BIFF12_ID_PCDFIELDGROUP,      BIFF12_ID_PCDFIELDGROUP + 1     },
+        { BIFF12_ID_PCDFIELDS,          BIFF12_ID_PCDFIELDS + 1         },
+        { BIFF12_ID_PCDFRANGEPR,        BIFF12_ID_PCDFRANGEPR + 1       },
+        { BIFF12_ID_PCDFSHAREDITEMS,    BIFF12_ID_PCDFSHAREDITEMS + 1   },
+        { BIFF12_ID_PCITEM_ARRAY,       BIFF12_ID_PCITEM_ARRAY + 1      },
+        { BIFF12_ID_PCDSHEETSOURCE,     BIFF12_ID_PCDSHEETSOURCE + 1    },
+        { BIFF12_ID_PCDSOURCE,          BIFF12_ID_PCDSOURCE + 1         },
+        { -1,                           -1                              }
     };
     return spRecInfos;
 }
 
-void OoxPivotCacheDefinitionFragment::finalizeImport()
+void PivotCacheDefinitionFragment::finalizeImport()
 {
     // finalize the cache (check source range etc.)
     mrPivotCache.finalizeImport();
@@ -206,15 +210,15 @@ void OoxPivotCacheDefinitionFragment::finalizeImport()
     {
         OUString aRecFragmentPath = getRelations().getFragmentPathFromRelId( mrPivotCache.getRecordsRelId() );
         if( aRecFragmentPath.getLength() > 0 )
-            importOoxFragment( new OoxPivotCacheRecordsFragment( *this, aRecFragmentPath, mrPivotCache ) );
+            importOoxFragment( new PivotCacheRecordsFragment( *this, aRecFragmentPath, mrPivotCache ) );
     }
 }
 
 // ============================================================================
 
-OoxPivotCacheRecordsFragment::OoxPivotCacheRecordsFragment( const WorkbookHelper& rHelper,
+PivotCacheRecordsFragment::PivotCacheRecordsFragment( const WorkbookHelper& rHelper,
         const OUString& rFragmentPath, const PivotCache& rPivotCache ) :
-    OoxWorksheetFragmentBase( rHelper, rFragmentPath, ISegmentProgressBarRef(), SHEETTYPE_WORKSHEET, rPivotCache.getSourceRange().Sheet ),
+    WorksheetFragmentBase( rHelper, rFragmentPath, ISegmentProgressBarRef(), SHEETTYPE_WORKSHEET, rPivotCache.getSourceRange().Sheet ),
     mrPivotCache( rPivotCache ),
     mnCol( 0 ),
     mnRow( 0 ),
@@ -224,7 +228,7 @@ OoxPivotCacheRecordsFragment::OoxPivotCacheRecordsFragment( const WorkbookHelper
     rPivotCache.writeSourceHeaderCells( *this );
 }
 
-ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotCacheRecordsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -248,7 +252,7 @@ ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateContext( sal_Int32 nElem
                 case XLS_TOKEN( b ):    aItem.readBool( rAttribs );                         break;
                 case XLS_TOKEN( e ):    aItem.readError( rAttribs, getUnitConverter() );    break;
                 case XLS_TOKEN( x ):    aItem.readIndex( rAttribs );                        break;
-                default:    OSL_ENSURE( false, "OoxPivotCacheRecordsFragment::onCreateContext - unexpected element" );
+                default:    OSL_ENSURE( false, "PivotCacheRecordsFragment::onCreateContext - unexpected element" );
             }
             mrPivotCache.writeSourceDataCell( *this, mnCol, mnRow, aItem );
             ++mnCol;
@@ -258,19 +262,19 @@ ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateContext( sal_Int32 nElem
     return 0;
 }
 
-ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotCacheRecordsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
         case XML_ROOT_CONTEXT:
-            if( nRecId == OOBIN_ID_PCRECORDS ) return this;
+            if( nRecId == BIFF12_ID_PCRECORDS ) return this;
         break;
 
-        case OOBIN_ID_PCRECORDS:
+        case BIFF12_ID_PCRECORDS:
             switch( nRecId )
             {
-                case OOBIN_ID_PCRECORD:     importPCRecord( rStrm );                break;
-                case OOBIN_ID_PCRECORDDT:   startCacheRecord();                     break;
+                case BIFF12_ID_PCRECORD:    importPCRecord( rStrm );                break;
+                case BIFF12_ID_PCRECORDDT:  startCacheRecord();                     break;
                 default:                    importPCRecordItem( nRecId, rStrm );    break;
             }
         break;
@@ -278,11 +282,11 @@ ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateRecordContext( sal_Int32
     return 0;
 }
 
-const RecordInfo* OoxPivotCacheRecordsFragment::getRecordInfos() const
+const RecordInfo* PivotCacheRecordsFragment::getRecordInfos() const
 {
     static const RecordInfo spRecInfos[] =
     {
-        { OOBIN_ID_PCRECORDS,   OOBIN_ID_PCRECORDS + 1  },
+        { BIFF12_ID_PCRECORDS,  BIFF12_ID_PCRECORDS + 1 },
         { -1,                   -1                      }
     };
     return spRecInfos;
@@ -290,35 +294,35 @@ const RecordInfo* OoxPivotCacheRecordsFragment::getRecordInfos() const
 
 // private --------------------------------------------------------------------
 
-void OoxPivotCacheRecordsFragment::startCacheRecord()
+void PivotCacheRecordsFragment::startCacheRecord()
 {
     mnCol = 0;
     ++mnRow;
     mbInRecord = true;
 }
 
-void OoxPivotCacheRecordsFragment::importPCRecord( RecordInputStream& rStrm )
+void PivotCacheRecordsFragment::importPCRecord( RecordInputStream& rStrm )
 {
     startCacheRecord();
     mrPivotCache.importPCRecord( rStrm, *this, mnRow );
     mbInRecord = false;
 }
 
-void OoxPivotCacheRecordsFragment::importPCRecordItem( sal_Int32 nRecId, RecordInputStream& rStrm )
+void PivotCacheRecordsFragment::importPCRecordItem( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     if( mbInRecord )
     {
         PivotCacheItem aItem;
         switch( nRecId )
         {
-            case OOBIN_ID_PCITEM_MISSING:                               break;
-            case OOBIN_ID_PCITEM_STRING:    aItem.readString( rStrm );  break;
-            case OOBIN_ID_PCITEM_DOUBLE:    aItem.readDouble( rStrm );  break;
-            case OOBIN_ID_PCITEM_DATE:      aItem.readDate( rStrm );    break;
-            case OOBIN_ID_PCITEM_BOOL:      aItem.readBool( rStrm );    break;
-            case OOBIN_ID_PCITEM_ERROR:     aItem.readError( rStrm );   break;
-            case OOBIN_ID_PCITEM_INDEX:     aItem.readIndex( rStrm );   break;
-            default:    OSL_ENSURE( false, "OoxPivotCacheRecordsFragment::importPCRecordItem - unexpected record" );
+            case BIFF12_ID_PCITEM_MISSING:                              break;
+            case BIFF12_ID_PCITEM_STRING:   aItem.readString( rStrm );  break;
+            case BIFF12_ID_PCITEM_DOUBLE:   aItem.readDouble( rStrm );  break;
+            case BIFF12_ID_PCITEM_DATE:     aItem.readDate( rStrm );    break;
+            case BIFF12_ID_PCITEM_BOOL:     aItem.readBool( rStrm );    break;
+            case BIFF12_ID_PCITEM_ERROR:    aItem.readError( rStrm );   break;
+            case BIFF12_ID_PCITEM_INDEX:    aItem.readIndex( rStrm );   break;
+            default:    OSL_ENSURE( false, "PivotCacheRecordsFragment::importPCRecordItem - unexpected record" );
         }
         mrPivotCache.writeSourceDataCell( *this, mnCol, mnRow, aItem );
         ++mnCol;
@@ -345,7 +349,7 @@ bool lclSeekToPCDField( BiffInputStream& rStrm )
 // ----------------------------------------------------------------------------
 
 BiffPivotCacheFragment::BiffPivotCacheFragment(
-        const WorkbookHelper& rHelper, const ::rtl::OUString& rStrmName, PivotCache& rPivotCache ) :
+        const WorkbookHelper& rHelper, const OUString& rStrmName, PivotCache& rPivotCache ) :
     BiffWorkbookFragmentBase( rHelper, rStrmName, true ),
     mrPivotCache( rPivotCache )
 {
@@ -353,14 +357,15 @@ BiffPivotCacheFragment::BiffPivotCacheFragment(
 
 bool BiffPivotCacheFragment::importFragment()
 {
-    if( mrStrm.startNextRecord() && (mrStrm.getRecId() == BIFF_ID_PCDEFINITION) )
+    BiffInputStream& rStrm = getInputStream();
+    if( rStrm.startNextRecord() && (rStrm.getRecId() == BIFF_ID_PCDEFINITION) )
     {
         // read PCDEFINITION and optional PCDEFINITION2 records
-        mrPivotCache.importPCDefinition( mrStrm );
+        mrPivotCache.importPCDefinition( rStrm );
 
         // read cache fields as long as another PCDFIELD record can be found
-        while( lclSeekToPCDField( mrStrm ) )
-            mrPivotCache.createCacheField( true ).importPCDField( mrStrm );
+        while( lclSeekToPCDField( rStrm ) )
+            mrPivotCache.createCacheField( true ).importPCDField( rStrm );
 
         // finalize the cache (check source range etc.)
         mrPivotCache.finalizeImport();
@@ -372,12 +377,12 @@ bool BiffPivotCacheFragment::importFragment()
                 unchanged. Stream should point to source data table now. */
             BiffPivotCacheRecordsContext aContext( *this, mrPivotCache );
             if( aContext.isValidSheet() )
-                while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
-                    aContext.importRecord();
+                while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
+                    aContext.importRecord( rStrm );
         }
     }
 
-    return mrStrm.getRecId() == BIFF_ID_EOF;
+    return rStrm.getRecId() == BIFF_ID_EOF;
 }
 
 // ============================================================================
@@ -409,28 +414,28 @@ BiffPivotCacheRecordsContext::BiffPivotCacheRecordsContext(
     }
 }
 
-void BiffPivotCacheRecordsContext::importRecord()
+void BiffPivotCacheRecordsContext::importRecord( BiffInputStream& rStrm )
 {
-    if( mrStrm.getRecId() == BIFF_ID_PCITEM_INDEXLIST )
+    if( rStrm.getRecId() == BIFF_ID_PCITEM_INDEXLIST )
     {
         OSL_ENSURE( mbHasShared, "BiffPivotCacheRecordsContext::importRecord - unexpected PCITEM_INDEXLIST record" );
         // PCITEM_INDEXLIST record always in front of a new data row
         startNextRow();
-        mrPivotCache.importPCItemIndexList( mrStrm, *this, mnRow );
+        mrPivotCache.importPCItemIndexList( rStrm, *this, mnRow );
         mbInRow = !maUnsharedCols.empty();  // mbInRow remains true, if unshared items are expected
         return;
     }
 
     PivotCacheItem aItem;
-    switch( mrStrm.getRecId() )
+    switch( rStrm.getRecId() )
     {
         case BIFF_ID_PCITEM_MISSING:                                        break;
-        case BIFF_ID_PCITEM_STRING:     aItem.readString( mrStrm, *this );  break;
-        case BIFF_ID_PCITEM_DOUBLE:     aItem.readDouble( mrStrm );         break;
-        case BIFF_ID_PCITEM_INTEGER:    aItem.readInteger( mrStrm );        break;
-        case BIFF_ID_PCITEM_DATE:       aItem.readDate( mrStrm );           break;
-        case BIFF_ID_PCITEM_BOOL:       aItem.readBool( mrStrm );           break;
-        case BIFF_ID_PCITEM_ERROR:      aItem.readError( mrStrm );          break;
+        case BIFF_ID_PCITEM_STRING:     aItem.readString( rStrm, *this );   break;
+        case BIFF_ID_PCITEM_DOUBLE:     aItem.readDouble( rStrm );          break;
+        case BIFF_ID_PCITEM_INTEGER:    aItem.readInteger( rStrm );         break;
+        case BIFF_ID_PCITEM_DATE:       aItem.readDate( rStrm );            break;
+        case BIFF_ID_PCITEM_BOOL:       aItem.readBool( rStrm );            break;
+        case BIFF_ID_PCITEM_ERROR:      aItem.readError( rStrm );           break;
         default:                        return; // unknown record, ignore
     }
 
@@ -462,4 +467,3 @@ void BiffPivotCacheRecordsContext::startNextRow()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/pivottablebuffer.cxx b/oox/source/xls/pivottablebuffer.cxx
index b4e3e1c52a65..df611b0cb3c4 100644
--- a/oox/source/xls/pivottablebuffer.cxx
+++ b/oox/source/xls/pivottablebuffer.cxx
@@ -26,6 +26,7 @@
  ************************************************************************/
 
 #include "oox/xls/pivottablebuffer.hxx"
+
 #include 
 #include 
 #include 
@@ -45,37 +46,27 @@
 #include 
 #include 
 #include 
-#include "properties.hxx"
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/helper/recordinputstream.hxx"
 #include "oox/xls/addressconverter.hxx"
 #include "oox/xls/biffinputstream.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::DataPilotFieldOrientation;
-using ::com::sun::star::sheet::XDataPilotDataLayoutFieldSupplier;
-using ::com::sun::star::sheet::XDataPilotDescriptor;
-using ::com::sun::star::sheet::XDataPilotField;
-using ::com::sun::star::sheet::XDataPilotTables;
-using ::com::sun::star::sheet::XDataPilotTablesSupplier;
-using ::com::sun::star::sheet::XSheetOperation;
+#include "properties.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
 namespace {
 
 const sal_Int32 OOX_PT_DATALAYOUTFIELD              = -2;           /// Placeholder index of data layout field.
@@ -85,83 +76,90 @@ const sal_Int32 OOX_PT_NEXT_ITEM                    = 0x001000FD;   /// Calculat
 
 // ----------------------------------------------------------------------------
 
-const sal_uInt32 OOBIN_PTFIELD_DATAFIELD            = 0x00000008;
-const sal_uInt32 OOBIN_PTFIELD_DEFAULT              = 0x00000100;
-const sal_uInt32 OOBIN_PTFIELD_SUM                  = 0x00000200;
-const sal_uInt32 OOBIN_PTFIELD_COUNTA               = 0x00000400;
-const sal_uInt32 OOBIN_PTFIELD_AVERAGE              = 0x00000800;
-const sal_uInt32 OOBIN_PTFIELD_MAX                  = 0x00001000;
-const sal_uInt32 OOBIN_PTFIELD_MIN                  = 0x00002000;
-const sal_uInt32 OOBIN_PTFIELD_PRODUCT              = 0x00004000;
-const sal_uInt32 OOBIN_PTFIELD_COUNT                = 0x00008000;
-const sal_uInt32 OOBIN_PTFIELD_STDDEV               = 0x00010000;
-const sal_uInt32 OOBIN_PTFIELD_STDDEVP              = 0x00020000;
-const sal_uInt32 OOBIN_PTFIELD_VAR                  = 0x00040000;
-const sal_uInt32 OOBIN_PTFIELD_VARP                 = 0x00080000;
-
-const sal_uInt32 OOBIN_PTFIELD_SHOWALL              = 0x00000020;
-const sal_uInt32 OOBIN_PTFIELD_OUTLINE              = 0x00000040;
-const sal_uInt32 OOBIN_PTFIELD_INSERTBLANKROW       = 0x00000080;
-const sal_uInt32 OOBIN_PTFIELD_SUBTOTALTOP          = 0x00000100;
-const sal_uInt32 OOBIN_PTFIELD_INSERTPAGEBREAK      = 0x00000800;
-const sal_uInt32 OOBIN_PTFIELD_AUTOSORT             = 0x00001000;
-const sal_uInt32 OOBIN_PTFIELD_SORTASCENDING        = 0x00002000;
-const sal_uInt32 OOBIN_PTFIELD_AUTOSHOW             = 0x00004000;
-const sal_uInt32 OOBIN_PTFIELD_AUTOSHOWTOP          = 0x00008000;
-const sal_uInt32 OOBIN_PTFIELD_MULTIPAGEITEMS       = 0x00080000;
-
-const sal_uInt16 OOBIN_PTFITEM_HIDDEN               = 0x0001;
-const sal_uInt16 OOBIN_PTFITEM_HIDEDETAILS          = 0x0002;
-
-const sal_uInt8 OOBIN_PTPAGEFIELD_HASNAME           = 0x01;
-const sal_uInt8 OOBIN_PTPAGEFIELD_HASOLAPCAPTION    = 0x02;
-const sal_Int32 OOBIN_PTPAGEFIELD_MULTIITEMS        = 0x001000FE;
-
-const sal_uInt16 OOBIN_PTFILTER_HASNAME             = 0x0001;
-const sal_uInt16 OOBIN_PTFILTER_HASDESCRIPTION      = 0x0002;
-const sal_uInt16 OOBIN_PTFILTER_HASSTRVALUE1        = 0x0004;
-const sal_uInt16 OOBIN_PTFILTER_HASSTRVALUE2        = 0x0008;
-
-const sal_uInt8 OOBIN_TOP10FILTER_TOP               = 0x01;
-const sal_uInt8 OOBIN_TOP10FILTER_PERCENT           = 0x02;
-
-const sal_uInt32 OOBIN_PTDEF_SHOWITEMS              = 0x00000100;
-const sal_uInt32 OOBIN_PTDEF_DISABLEFIELDLIST       = 0x00000400;
-const sal_uInt32 OOBIN_PTDEF_HIDECALCMEMBERS        = 0x00001000;
-const sal_uInt32 OOBIN_PTDEF_WITHHIDDENTOTALS       = 0x00002000;
-const sal_uInt32 OOBIN_PTDEF_HIDEDRILL              = 0x00100000;
-const sal_uInt32 OOBIN_PTDEF_PRINTDRILL             = 0x00200000;
-const sal_uInt32 OOBIN_PTDEF_HIDEHEADERS            = 0x80000000;
-
-const sal_uInt32 OOBIN_PTDEF_SHOWEMPTYROW           = 0x00000004;
-const sal_uInt32 OOBIN_PTDEF_SHOWEMPTYCOL           = 0x00000008;
-const sal_uInt32 OOBIN_PTDEF_ENABLEDRILL            = 0x00000020;
-const sal_uInt32 OOBIN_PTDEF_PRESERVEFORMATTING     = 0x00000080;
-const sal_uInt32 OOBIN_PTDEF_SHOWERROR              = 0x00000200;
-const sal_uInt32 OOBIN_PTDEF_SHOWMISSING            = 0x00000400;
-const sal_uInt32 OOBIN_PTDEF_PAGEOVERTHENDOWN       = 0x00000800;
-const sal_uInt32 OOBIN_PTDEF_SUBTOTALHIDDENITEMS    = 0x00001000;
-const sal_uInt32 OOBIN_PTDEF_ROWGRANDTOTALS         = 0x00002000;
-const sal_uInt32 OOBIN_PTDEF_COLGRANDTOTALS         = 0x00004000;
-const sal_uInt32 OOBIN_PTDEF_FIELDPRINTTITLES       = 0x00008000;
-const sal_uInt32 OOBIN_PTDEF_ITEMPRINTTITLES        = 0x00020000;
-const sal_uInt32 OOBIN_PTDEF_MERGEITEM              = 0x00040000;
-const sal_uInt32 OOBIN_PTDEF_HASDATACAPTION         = 0x00080000;
-const sal_uInt32 OOBIN_PTDEF_HASGRANDTOTALCAPTION   = 0x00100000;
-const sal_uInt32 OOBIN_PTDEF_HASPAGESTYLE           = 0x00200000;
-const sal_uInt32 OOBIN_PTDEF_HASPIVOTTABLESTYLE     = 0x00400000;
-const sal_uInt32 OOBIN_PTDEF_HASVACATEDSTYLE        = 0x00800000;
-const sal_uInt32 OOBIN_PTDEF_HASTAG                 = 0x40000000;
-
-const sal_uInt32 OOBIN_PTDEF_NOERRORCAPTION         = 0x00000040;
-const sal_uInt32 OOBIN_PTDEF_NOMISSINGCAPTION       = 0x00000080;
-const sal_uInt32 OOBIN_PTDEF_HASROWHEADERCAPTION    = 0x00000400;
-const sal_uInt32 OOBIN_PTDEF_HASCOLHEADERCAPTION    = 0x00000800;
-const sal_uInt32 OOBIN_PTDEF_FIELDLISTSORTASC       = 0x00001000;
-const sal_uInt32 OOBIN_PTDEF_NOCUSTOMLISTSORT       = 0x00004000;
-
-const sal_uInt8 OOBIN_PTDEF_ROWAXIS                 = 1;
-const sal_uInt8 OOBIN_PTDEF_COLAXIS                 = 2;
+const sal_uInt32 BIFF12_PTFIELD_DATAFIELD           = 0x00000008;
+const sal_uInt32 BIFF12_PTFIELD_DEFAULT             = 0x00000100;
+const sal_uInt32 BIFF12_PTFIELD_SUM                 = 0x00000200;
+const sal_uInt32 BIFF12_PTFIELD_COUNTA              = 0x00000400;
+const sal_uInt32 BIFF12_PTFIELD_AVERAGE             = 0x00000800;
+const sal_uInt32 BIFF12_PTFIELD_MAX                 = 0x00001000;
+const sal_uInt32 BIFF12_PTFIELD_MIN                 = 0x00002000;
+const sal_uInt32 BIFF12_PTFIELD_PRODUCT             = 0x00004000;
+const sal_uInt32 BIFF12_PTFIELD_COUNT               = 0x00008000;
+const sal_uInt32 BIFF12_PTFIELD_STDDEV              = 0x00010000;
+const sal_uInt32 BIFF12_PTFIELD_STDDEVP             = 0x00020000;
+const sal_uInt32 BIFF12_PTFIELD_VAR                 = 0x00040000;
+const sal_uInt32 BIFF12_PTFIELD_VARP                = 0x00080000;
+
+const sal_uInt32 BIFF12_PTFIELD_SHOWALL             = 0x00000020;
+const sal_uInt32 BIFF12_PTFIELD_OUTLINE             = 0x00000040;
+const sal_uInt32 BIFF12_PTFIELD_INSERTBLANKROW      = 0x00000080;
+const sal_uInt32 BIFF12_PTFIELD_SUBTOTALTOP         = 0x00000100;
+const sal_uInt32 BIFF12_PTFIELD_INSERTPAGEBREAK     = 0x00000800;
+const sal_uInt32 BIFF12_PTFIELD_AUTOSORT            = 0x00001000;
+const sal_uInt32 BIFF12_PTFIELD_SORTASCENDING       = 0x00002000;
+const sal_uInt32 BIFF12_PTFIELD_AUTOSHOW            = 0x00004000;
+const sal_uInt32 BIFF12_PTFIELD_AUTOSHOWTOP         = 0x00008000;
+const sal_uInt32 BIFF12_PTFIELD_MULTIPAGEITEMS      = 0x00080000;
+
+const sal_uInt16 BIFF12_PTFITEM_HIDDEN              = 0x0001;
+const sal_uInt16 BIFF12_PTFITEM_HIDEDETAILS         = 0x0002;
+
+const sal_uInt8 BIFF12_PTPAGEFIELD_HASNAME          = 0x01;
+const sal_uInt8 BIFF12_PTPAGEFIELD_HASOLAPCAPTION   = 0x02;
+const sal_Int32 BIFF12_PTPAGEFIELD_MULTIITEMS       = 0x001000FE;
+
+const sal_uInt16 BIFF12_PTFILTER_HASNAME            = 0x0001;
+const sal_uInt16 BIFF12_PTFILTER_HASDESCRIPTION     = 0x0002;
+const sal_uInt16 BIFF12_PTFILTER_HASSTRVALUE1       = 0x0004;
+const sal_uInt16 BIFF12_PTFILTER_HASSTRVALUE2       = 0x0008;
+
+const sal_uInt8 BIFF12_TOP10FILTER_TOP              = 0x01;
+const sal_uInt8 BIFF12_TOP10FILTER_PERCENT          = 0x02;
+
+const sal_uInt32 BIFF12_PTDEF_SHOWITEMS             = 0x00000100;
+const sal_uInt32 BIFF12_PTDEF_DISABLEFIELDLIST      = 0x00000400;
+const sal_uInt32 BIFF12_PTDEF_HIDECALCMEMBERS       = 0x00001000;
+const sal_uInt32 BIFF12_PTDEF_WITHHIDDENTOTALS      = 0x00002000;
+const sal_uInt32 BIFF12_PTDEF_HIDEDRILL             = 0x00100000;
+const sal_uInt32 BIFF12_PTDEF_PRINTDRILL            = 0x00200000;
+const sal_uInt32 BIFF12_PTDEF_HIDEHEADERS           = 0x80000000;
+
+const sal_uInt32 BIFF12_PTDEF_SHOWEMPTYROW          = 0x00000004;
+const sal_uInt32 BIFF12_PTDEF_SHOWEMPTYCOL          = 0x00000008;
+const sal_uInt32 BIFF12_PTDEF_ENABLEDRILL           = 0x00000020;
+const sal_uInt32 BIFF12_PTDEF_PRESERVEFORMATTING    = 0x00000080;
+const sal_uInt32 BIFF12_PTDEF_USEAUTOFORMAT         = 0x00000100;
+const sal_uInt32 BIFF12_PTDEF_SHOWERROR             = 0x00000200;
+const sal_uInt32 BIFF12_PTDEF_SHOWMISSING           = 0x00000400;
+const sal_uInt32 BIFF12_PTDEF_PAGEOVERTHENDOWN      = 0x00000800;
+const sal_uInt32 BIFF12_PTDEF_SUBTOTALHIDDENITEMS   = 0x00001000;
+const sal_uInt32 BIFF12_PTDEF_ROWGRANDTOTALS        = 0x00002000;
+const sal_uInt32 BIFF12_PTDEF_COLGRANDTOTALS        = 0x00004000;
+const sal_uInt32 BIFF12_PTDEF_FIELDPRINTTITLES      = 0x00008000;
+const sal_uInt32 BIFF12_PTDEF_ITEMPRINTTITLES       = 0x00020000;
+const sal_uInt32 BIFF12_PTDEF_MERGEITEM             = 0x00040000;
+const sal_uInt32 BIFF12_PTDEF_HASDATACAPTION        = 0x00080000;
+const sal_uInt32 BIFF12_PTDEF_HASGRANDTOTALCAPTION  = 0x00100000;
+const sal_uInt32 BIFF12_PTDEF_HASPAGESTYLE          = 0x00200000;
+const sal_uInt32 BIFF12_PTDEF_HASPIVOTTABLESTYLE    = 0x00400000;
+const sal_uInt32 BIFF12_PTDEF_HASVACATEDSTYLE       = 0x00800000;
+const sal_uInt32 BIFF12_PTDEF_APPLYNUMFMT           = 0x01000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYFONT             = 0x02000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYALIGNMENT        = 0x04000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYBORDER           = 0x08000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYFILL             = 0x10000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYPROTECTION       = 0x20000000;
+const sal_uInt32 BIFF12_PTDEF_HASTAG                = 0x40000000;
+
+const sal_uInt32 BIFF12_PTDEF_NOERRORCAPTION        = 0x00000040;
+const sal_uInt32 BIFF12_PTDEF_NOMISSINGCAPTION      = 0x00000080;
+const sal_uInt32 BIFF12_PTDEF_HASROWHEADERCAPTION   = 0x00000400;
+const sal_uInt32 BIFF12_PTDEF_HASCOLHEADERCAPTION   = 0x00000800;
+const sal_uInt32 BIFF12_PTDEF_FIELDLISTSORTASC      = 0x00001000;
+const sal_uInt32 BIFF12_PTDEF_NOCUSTOMLISTSORT      = 0x00004000;
+
+const sal_uInt8 BIFF12_PTDEF_ROWAXIS                = 1;
+const sal_uInt8 BIFF12_PTDEF_COLAXIS                = 2;
 
 // ----------------------------------------------------------------------------
 
@@ -233,7 +231,7 @@ PTFieldItemModel::PTFieldItemModel() :
 {
 }
 
-void PTFieldItemModel::setBinType( sal_uInt16 nType )
+void PTFieldItemModel::setBiffType( sal_uInt16 nType )
 {
     static const sal_Int32 spnTypes[] = { XML_data, XML_default,
         XML_sum, XML_countA, XML_avg, XML_max, XML_min, XML_product, XML_count,
@@ -275,7 +273,7 @@ PTFieldModel::PTFieldModel() :
 {
 }
 
-void PTFieldModel::setBinAxis( sal_uInt8 nAxis )
+void PTFieldModel::setBiffAxis( sal_uInt8 nAxis )
 {
     /*  Weird. The axis field is organized as bit field, but only one of the
         row/col/page flags are allowed at the same time and refer to the values
@@ -293,7 +291,7 @@ void PTFieldModel::setBinAxis( sal_uInt8 nAxis )
 
 PTPageFieldModel::PTPageFieldModel() :
     mnField( -1 ),
-    mnItem( OOBIN_PTPAGEFIELD_MULTIITEMS )
+    mnItem( BIFF12_PTPAGEFIELD_MULTIITEMS )
 {
 }
 
@@ -309,13 +307,13 @@ PTDataFieldModel::PTDataFieldModel() :
 {
 }
 
-void PTDataFieldModel::setBinSubtotal( sal_Int32 nSubtotal )
+void PTDataFieldModel::setBiffSubtotal( sal_Int32 nSubtotal )
 {
     static sal_Int32 spnSubtotals[] = { XML_sum, XML_count, XML_average, XML_max, XML_min, XML_product, XML_countNums, XML_stdDev, XML_stdDevp, XML_var, XML_varp };
     mnSubtotal = STATIC_ARRAY_SELECT( spnSubtotals, nSubtotal, XML_TOKEN_INVALID );
 }
 
-void PTDataFieldModel::setBinShowDataAs( sal_Int32 nShowDataAs )
+void PTDataFieldModel::setBiffShowDataAs( sal_Int32 nShowDataAs )
 {
     static sal_Int32 spnShowDataAs[] = { XML_normal, XML_difference, XML_percent, XML_percentDiff, XML_runTotal, XML_percentOfRow, XML_percentOfCol, XML_percentOfTotal, XML_index };
     mnShowDataAs = STATIC_ARRAY_SELECT( spnShowDataAs, nShowDataAs, XML_TOKEN_INVALID );
@@ -391,32 +389,32 @@ void PivotTableField::importPTField( RecordInputStream& rStrm )
     sal_uInt32 nFlags1, nFlags2;
     rStrm >> nFlags1 >> maModel.mnNumFmtId >> nFlags2 >> maModel.mnAutoShowItems >> maModel.mnAutoShowRankBy;
 
-    maModel.setBinAxis( extractValue< sal_uInt8 >( nFlags1, 0, 3 ) );
-    maModel.mbDataField       = getFlag( nFlags1, OOBIN_PTFIELD_DATAFIELD );
-    maModel.mbDefaultSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_DEFAULT );
-    maModel.mbSumSubtotal     = getFlag( nFlags1, OOBIN_PTFIELD_SUM );
-    maModel.mbCountASubtotal  = getFlag( nFlags1, OOBIN_PTFIELD_COUNTA );
-    maModel.mbAverageSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_AVERAGE );
-    maModel.mbMaxSubtotal     = getFlag( nFlags1, OOBIN_PTFIELD_MAX );
-    maModel.mbMinSubtotal     = getFlag( nFlags1, OOBIN_PTFIELD_MIN );
-    maModel.mbProductSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_PRODUCT );
-    maModel.mbCountSubtotal   = getFlag( nFlags1, OOBIN_PTFIELD_COUNT );
-    maModel.mbStdDevSubtotal  = getFlag( nFlags1, OOBIN_PTFIELD_STDDEV );
-    maModel.mbStdDevPSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_STDDEVP );
-    maModel.mbVarSubtotal     = getFlag( nFlags1, OOBIN_PTFIELD_VAR );
-    maModel.mbVarPSubtotal    = getFlag( nFlags1, OOBIN_PTFIELD_VARP );
-
-    maModel.mbShowAll         = getFlag( nFlags2, OOBIN_PTFIELD_SHOWALL );
-    maModel.mbOutline         = getFlag( nFlags2, OOBIN_PTFIELD_OUTLINE );
-    maModel.mbSubtotalTop     = getFlag( nFlags2, OOBIN_PTFIELD_SUBTOTALTOP );
-    maModel.mbInsertBlankRow  = getFlag( nFlags2, OOBIN_PTFIELD_INSERTBLANKROW );
-    maModel.mbInsertPageBreak = getFlag( nFlags2, OOBIN_PTFIELD_INSERTPAGEBREAK );
-    maModel.mbAutoShow        = getFlag( nFlags2, OOBIN_PTFIELD_AUTOSHOW );
-    maModel.mbTopAutoShow     = getFlag( nFlags2, OOBIN_PTFIELD_AUTOSHOWTOP );
-    maModel.mbMultiPageItems  = getFlag( nFlags2, OOBIN_PTFIELD_MULTIPAGEITEMS );
-
-    bool bAutoSort = getFlag( nFlags2, OOBIN_PTFIELD_AUTOSORT );
-    bool bAscending = getFlag( nFlags2, OOBIN_PTFIELD_SORTASCENDING );
+    maModel.setBiffAxis( extractValue< sal_uInt8 >( nFlags1, 0, 3 ) );
+    maModel.mbDataField       = getFlag( nFlags1, BIFF12_PTFIELD_DATAFIELD );
+    maModel.mbDefaultSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_DEFAULT );
+    maModel.mbSumSubtotal     = getFlag( nFlags1, BIFF12_PTFIELD_SUM );
+    maModel.mbCountASubtotal  = getFlag( nFlags1, BIFF12_PTFIELD_COUNTA );
+    maModel.mbAverageSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_AVERAGE );
+    maModel.mbMaxSubtotal     = getFlag( nFlags1, BIFF12_PTFIELD_MAX );
+    maModel.mbMinSubtotal     = getFlag( nFlags1, BIFF12_PTFIELD_MIN );
+    maModel.mbProductSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_PRODUCT );
+    maModel.mbCountSubtotal   = getFlag( nFlags1, BIFF12_PTFIELD_COUNT );
+    maModel.mbStdDevSubtotal  = getFlag( nFlags1, BIFF12_PTFIELD_STDDEV );
+    maModel.mbStdDevPSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_STDDEVP );
+    maModel.mbVarSubtotal     = getFlag( nFlags1, BIFF12_PTFIELD_VAR );
+    maModel.mbVarPSubtotal    = getFlag( nFlags1, BIFF12_PTFIELD_VARP );
+
+    maModel.mbShowAll         = getFlag( nFlags2, BIFF12_PTFIELD_SHOWALL );
+    maModel.mbOutline         = getFlag( nFlags2, BIFF12_PTFIELD_OUTLINE );
+    maModel.mbSubtotalTop     = getFlag( nFlags2, BIFF12_PTFIELD_SUBTOTALTOP );
+    maModel.mbInsertBlankRow  = getFlag( nFlags2, BIFF12_PTFIELD_INSERTBLANKROW );
+    maModel.mbInsertPageBreak = getFlag( nFlags2, BIFF12_PTFIELD_INSERTPAGEBREAK );
+    maModel.mbAutoShow        = getFlag( nFlags2, BIFF12_PTFIELD_AUTOSHOW );
+    maModel.mbTopAutoShow     = getFlag( nFlags2, BIFF12_PTFIELD_AUTOSHOWTOP );
+    maModel.mbMultiPageItems  = getFlag( nFlags2, BIFF12_PTFIELD_MULTIPAGEITEMS );
+
+    bool bAutoSort = getFlag( nFlags2, BIFF12_PTFIELD_AUTOSORT );
+    bool bAscending = getFlag( nFlags2, BIFF12_PTFIELD_SORTASCENDING );
     maModel.mnSortType = bAutoSort ? (bAscending ? XML_ascending : XML_descending) : XML_manual;
 }
 
@@ -427,9 +425,9 @@ void PivotTableField::importPTFItem( RecordInputStream& rStrm )
     sal_uInt16 nFlags;
     rStrm >> nType >> nFlags >> aModel.mnCacheItem;
 
-    aModel.setBinType( nType );
-    aModel.mbShowDetails = !getFlag( nFlags, OOBIN_PTFITEM_HIDEDETAILS );
-    aModel.mbHidden      = getFlag( nFlags, OOBIN_PTFITEM_HIDDEN );
+    aModel.setBiffType( nType );
+    aModel.mbShowDetails = !getFlag( nFlags, BIFF12_PTFITEM_HIDEDETAILS );
+    aModel.mbHidden      = getFlag( nFlags, BIFF12_PTFITEM_HIDDEN );
 
     maItems.push_back( aModel );
 }
@@ -450,7 +448,7 @@ void PivotTableField::importPTField( BiffInputStream& rStrm )
     rStrm >> nAxis >> nSubtCount >> nSubtotals;
     rStrm.skip( 2 );    // item count
 
-    maModel.setBinAxis( extractValue< sal_uInt8 >( nAxis, 0, 3 ) );
+    maModel.setBiffAxis( extractValue< sal_uInt8 >( nAxis, 0, 3 ) );
     maModel.mbDataField       = getFlag( nAxis, BIFF_PTFIELD_DATAFIELD );
 
     maModel.mbDefaultSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_DEFAULT );
@@ -509,7 +507,7 @@ void PivotTableField::importPTFItem( BiffInputStream& rStrm )
     sal_Int16 nCacheItem;
     rStrm >> nType >> nFlags >> nCacheItem;
 
-    aModel.setBinType( nType );
+    aModel.setBiffType( nType );
     aModel.mnCacheItem = nCacheItem;
     aModel.mbShowDetails = !getFlag( nFlags, BIFF_PTFITEM_HIDEDETAILS );
     aModel.mbHidden      = getFlag( nFlags, BIFF_PTFITEM_HIDDEN );
@@ -627,7 +625,7 @@ void PivotTableField::convertPageField( const PTPageFieldModel& rPageField )
         if( maModel.mbMultiPageItems )
         {
             // multiple items may be selected
-            OSL_ENSURE( rPageField.mnItem == OOBIN_PTPAGEFIELD_MULTIITEMS, "PivotTableField::convertPageField - unexpected cache item index" );
+            OSL_ENSURE( rPageField.mnItem == BIFF12_PTPAGEFIELD_MULTIITEMS, "PivotTableField::convertPageField - unexpected cache item index" );
             // try to find a single visible item
             bool bHasMultiItems = false;
             for( ItemModelVector::iterator aIt = maItems.begin(), aEnd = maItems.end(); (aIt != aEnd) && !bHasMultiItems; ++aIt )
@@ -799,7 +797,7 @@ Reference< XDataPilotField > PivotTableField::convertRowColPageField( sal_Int32
             aPropSet.setProperty( PROP_LayoutInfo, aLayoutInfo );
             aPropSet.setProperty( PROP_ShowEmpty, maModel.mbShowAll );
 
-            // auto show (OOXML3/OOBIN3 only)
+            // auto show (OOXML/BIFF12 only)
             if( maModel.mbAutoShow )
             {
                 DataPilotFieldAutoShowInfo aAutoShowInfo;
@@ -916,13 +914,13 @@ void PivotTableFilter::importPTFilter( RecordInputStream& rStrm )
     rStrm >> maModel.mnField >> maModel.mnMemPropField >> nType;
     rStrm.skip( 4 );    // unused
     rStrm >> maModel.mnId >> maModel.mnMeasureField >> maModel.mnMeasureHier >> nFlags;
-    if( getFlag( nFlags, OOBIN_PTFILTER_HASNAME ) )
+    if( getFlag( nFlags, BIFF12_PTFILTER_HASNAME ) )
         rStrm >> maModel.maName;
-    if( getFlag( nFlags, OOBIN_PTFILTER_HASDESCRIPTION ) )
+    if( getFlag( nFlags, BIFF12_PTFILTER_HASDESCRIPTION ) )
         rStrm >> maModel.maDescription;
-    if( getFlag( nFlags, OOBIN_PTFILTER_HASSTRVALUE1 ) )
+    if( getFlag( nFlags, BIFF12_PTFILTER_HASSTRVALUE1 ) )
         rStrm >> maModel.maStrValue1;
-    if( getFlag( nFlags, OOBIN_PTFILTER_HASSTRVALUE2 ) )
+    if( getFlag( nFlags, BIFF12_PTFILTER_HASSTRVALUE2 ) )
         rStrm >> maModel.maStrValue2;
 
     static sal_Int32 spnTypes[] =
@@ -954,9 +952,9 @@ void PivotTableFilter::importTop10Filter( RecordInputStream& rStrm )
     sal_uInt8 nFlags;
     rStrm >> nFlags >> maModel.mfValue;
 
-    OSL_ENSURE( getFlag( nFlags, OOBIN_TOP10FILTER_PERCENT ) == (maModel.mnType == XML_percent),
+    OSL_ENSURE( getFlag( nFlags, BIFF12_TOP10FILTER_PERCENT ) == (maModel.mnType == XML_percent),
         "PivotTableFilter::importTop10 - unexpected value of percent attribute" );
-    maModel.mbTopFilter = getFlag( nFlags, OOBIN_TOP10FILTER_TOP );
+    maModel.mbTopFilter = getFlag( nFlags, BIFF12_TOP10FILTER_TOP );
 }
 
 void PivotTableFilter::finalizeImport()
@@ -1000,6 +998,7 @@ PTDefinitionModel::PTDefinitionModel() :
     mbPrintDrill( false ),
     mbEnableDrill( true ),
     mbPreserveFormatting( true ),
+    mbUseAutoFormat( false ),
     mbPageOverThenDown( false ),
     mbSubtotalHiddenItems( false ),
     mbRowGrandTotals( true ),
@@ -1053,6 +1052,7 @@ void PivotTable::importPivotTableDefinition( const AttributeList& rAttribs )
     maDefModel.mnPageWrap            = rAttribs.getInteger( XML_pageWrap, 0 );
     maDefModel.mnIndent              = rAttribs.getInteger( XML_indent, 1 );
     maDefModel.mnChartFormat         = rAttribs.getInteger( XML_chartFormat, 0 );
+    maDefModel.mnAutoFormatId        = rAttribs.getInteger( XML_autoFormatId, 0 );
     maDefModel.mbDataOnRows          = rAttribs.getBool( XML_dataOnRows, false );
     maDefModel.mbShowError           = rAttribs.getBool( XML_showError, false );
     maDefModel.mbShowMissing         = rAttribs.getBool( XML_showMissing, true );
@@ -1064,6 +1064,7 @@ void PivotTable::importPivotTableDefinition( const AttributeList& rAttribs )
     maDefModel.mbPrintDrill          = rAttribs.getBool( XML_printDrill, false );
     maDefModel.mbEnableDrill         = rAttribs.getBool( XML_enableDrill, true );
     maDefModel.mbPreserveFormatting  = rAttribs.getBool( XML_preserveFormatting, true );
+    maDefModel.mbUseAutoFormat       = rAttribs.getBool( XML_useAutoFormatting, false );
     maDefModel.mbPageOverThenDown    = rAttribs.getBool( XML_pageOverThenDown, false );
     maDefModel.mbSubtotalHiddenItems = rAttribs.getBool( XML_subtotalHiddenItems, false );
     maDefModel.mbRowGrandTotals      = rAttribs.getBool( XML_rowGrandTotals, true );
@@ -1076,6 +1077,13 @@ void PivotTable::importPivotTableDefinition( const AttributeList& rAttribs )
     maDefModel.mbShowHeaders         = rAttribs.getBool( XML_showHeaders, true );
     maDefModel.mbFieldListSortAsc    = rAttribs.getBool( XML_fieldListSortAscending, false );
     maDefModel.mbCustomListSort      = rAttribs.getBool( XML_customListSort, true );
+    maDefModel.mbApplyNumFmt         = rAttribs.getBool( XML_applyNumberFormats, false );
+    maDefModel.mbApplyFont           = rAttribs.getBool( XML_applyFontFormats, false );
+    maDefModel.mbApplyAlignment      = rAttribs.getBool( XML_applyAlignmentFormats, false );
+    maDefModel.mbApplyBorder         = rAttribs.getBool( XML_applyBorderFormats, false );
+    maDefModel.mbApplyFill           = rAttribs.getBool( XML_applyPatternFormats, false );
+    // OOXML and BIFF12 documentation differ: OOXML mentions width/height, BIFF12 mentions protection
+    maDefModel.mbApplyProtection     = rAttribs.getBool( XML_applyWidthHeightFormats, false );
 }
 
 void PivotTable::importLocation( const AttributeList& rAttribs, sal_Int16 nSheet )
@@ -1104,7 +1112,7 @@ void PivotTable::importPageField( const AttributeList& rAttribs )
     aModel.maName      = rAttribs.getXString( XML_name, OUString() );
     aModel.mnField     = rAttribs.getInteger( XML_fld, -1 );
     // specification is wrong, XML_item is not the cache item, but the field item
-    aModel.mnItem      = rAttribs.getInteger( XML_item, OOBIN_PTPAGEFIELD_MULTIITEMS );
+    aModel.mnItem      = rAttribs.getInteger( XML_item, BIFF12_PTPAGEFIELD_MULTIITEMS );
     maPageFields.push_back( aModel );
 }
 
@@ -1129,56 +1137,64 @@ void PivotTable::importPTDefinition( RecordInputStream& rStrm )
     maDefModel.mnPageWrap = rStrm.readuInt8();
     rStrm.skip( 2 );    // refresh versions
     rStrm >> maDefModel.mnDataPosition;
-    rStrm.skip( 4 );    // 2 bytes autoformat id, 2 bytes unused
+    maDefModel.mnAutoFormatId = rStrm.readuInt16();
+    rStrm.skip( 2 );    // unused
     rStrm >> maDefModel.mnChartFormat >> maDefModel.mnCacheId >> maDefModel.maName;
-    if( getFlag( nFlags2, OOBIN_PTDEF_HASDATACAPTION ) )
+    if( getFlag( nFlags2, BIFF12_PTDEF_HASDATACAPTION ) )
         rStrm >> maDefModel.maDataCaption;
-    if( getFlag( nFlags2, OOBIN_PTDEF_HASGRANDTOTALCAPTION ) )
+    if( getFlag( nFlags2, BIFF12_PTDEF_HASGRANDTOTALCAPTION ) )
         rStrm >> maDefModel.maGrandTotalCaption;
-    if( !getFlag( nFlags3, OOBIN_PTDEF_NOERRORCAPTION ) )   // missing flag indicates existing string
+    if( !getFlag( nFlags3, BIFF12_PTDEF_NOERRORCAPTION ) )   // missing flag indicates existing string
         rStrm >> maDefModel.maErrorCaption;
-    if( !getFlag( nFlags3, OOBIN_PTDEF_NOMISSINGCAPTION ) ) // missing flag indicates existing string
+    if( !getFlag( nFlags3, BIFF12_PTDEF_NOMISSINGCAPTION ) ) // missing flag indicates existing string
         rStrm >> maDefModel.maMissingCaption;
-    if( getFlag( nFlags2, OOBIN_PTDEF_HASPAGESTYLE ) )
+    if( getFlag( nFlags2, BIFF12_PTDEF_HASPAGESTYLE ) )
         rStrm >> maDefModel.maPageStyle;
-    if( getFlag( nFlags2, OOBIN_PTDEF_HASPIVOTTABLESTYLE ) )
+    if( getFlag( nFlags2, BIFF12_PTDEF_HASPIVOTTABLESTYLE ) )
         rStrm >> maDefModel.maPivotTableStyle;
-    if( getFlag( nFlags2, OOBIN_PTDEF_HASVACATEDSTYLE ) )
+    if( getFlag( nFlags2, BIFF12_PTDEF_HASVACATEDSTYLE ) )
         rStrm >> maDefModel.maVacatedStyle;
-    if( getFlag( nFlags2, OOBIN_PTDEF_HASTAG ) )
+    if( getFlag( nFlags2, BIFF12_PTDEF_HASTAG ) )
         rStrm >> maDefModel.maTag;
-    if( getFlag( nFlags3, OOBIN_PTDEF_HASCOLHEADERCAPTION ) )   // TODO: right order (col/row)? spec is unclear
+    if( getFlag( nFlags3, BIFF12_PTDEF_HASCOLHEADERCAPTION ) )   // TODO: right order (col/row)? spec is unclear
         rStrm >> maDefModel.maColHeaderCaption;
-    if( getFlag( nFlags3, OOBIN_PTDEF_HASROWHEADERCAPTION ) )
+    if( getFlag( nFlags3, BIFF12_PTDEF_HASROWHEADERCAPTION ) )
         rStrm >> maDefModel.maRowHeaderCaption;
 
-    OSL_ENSURE( (nDataAxis == OOBIN_PTDEF_ROWAXIS) || (nDataAxis == OOBIN_PTDEF_COLAXIS),
+    OSL_ENSURE( (nDataAxis == BIFF12_PTDEF_ROWAXIS) || (nDataAxis == BIFF12_PTDEF_COLAXIS),
         "PivotTable::importPTDefinition - unexpected axis position for data field" );
 
     maDefModel.mnIndent              = extractValue< sal_uInt8 >( nFlags1, 24, 7 );
-    maDefModel.mbDataOnRows          = nDataAxis == OOBIN_PTDEF_ROWAXIS;
-    maDefModel.mbShowError           = getFlag( nFlags2, OOBIN_PTDEF_SHOWERROR );
-    maDefModel.mbShowMissing         = getFlag( nFlags2, OOBIN_PTDEF_SHOWMISSING );
-    maDefModel.mbShowItems           = getFlag( nFlags1, OOBIN_PTDEF_SHOWITEMS );
-    maDefModel.mbDisableFieldList    = getFlag( nFlags1, OOBIN_PTDEF_DISABLEFIELDLIST );
-    maDefModel.mbShowCalcMembers     = !getFlag( nFlags1, OOBIN_PTDEF_HIDECALCMEMBERS );
-    maDefModel.mbVisualTotals        = !getFlag( nFlags1, OOBIN_PTDEF_WITHHIDDENTOTALS );
-    maDefModel.mbShowDrill           = !getFlag( nFlags1, OOBIN_PTDEF_HIDEDRILL );
-    maDefModel.mbPrintDrill          = getFlag( nFlags1, OOBIN_PTDEF_PRINTDRILL );
-    maDefModel.mbEnableDrill         = getFlag( nFlags2, OOBIN_PTDEF_ENABLEDRILL );
-    maDefModel.mbPreserveFormatting  = getFlag( nFlags2, OOBIN_PTDEF_PRESERVEFORMATTING );
-    maDefModel.mbPageOverThenDown    = getFlag( nFlags2, OOBIN_PTDEF_PAGEOVERTHENDOWN );
-    maDefModel.mbSubtotalHiddenItems = getFlag( nFlags2, OOBIN_PTDEF_SUBTOTALHIDDENITEMS );
-    maDefModel.mbRowGrandTotals      = getFlag( nFlags2, OOBIN_PTDEF_ROWGRANDTOTALS );
-    maDefModel.mbColGrandTotals      = getFlag( nFlags2, OOBIN_PTDEF_COLGRANDTOTALS );
-    maDefModel.mbFieldPrintTitles    = getFlag( nFlags2, OOBIN_PTDEF_FIELDPRINTTITLES );
-    maDefModel.mbItemPrintTitles     = getFlag( nFlags2, OOBIN_PTDEF_ITEMPRINTTITLES );
-    maDefModel.mbMergeItem           = getFlag( nFlags2, OOBIN_PTDEF_MERGEITEM );
-    maDefModel.mbShowEmptyRow        = getFlag( nFlags2, OOBIN_PTDEF_SHOWEMPTYROW );
-    maDefModel.mbShowEmptyCol        = getFlag( nFlags2, OOBIN_PTDEF_SHOWEMPTYCOL );
-    maDefModel.mbShowHeaders         = !getFlag( nFlags1, OOBIN_PTDEF_HIDEHEADERS );
-    maDefModel.mbFieldListSortAsc    = getFlag( nFlags3, OOBIN_PTDEF_FIELDLISTSORTASC );
-    maDefModel.mbCustomListSort      = !getFlag( nFlags3, OOBIN_PTDEF_NOCUSTOMLISTSORT );
+    maDefModel.mbDataOnRows          = nDataAxis == BIFF12_PTDEF_ROWAXIS;
+    maDefModel.mbShowError           = getFlag( nFlags2, BIFF12_PTDEF_SHOWERROR );
+    maDefModel.mbShowMissing         = getFlag( nFlags2, BIFF12_PTDEF_SHOWMISSING );
+    maDefModel.mbShowItems           = getFlag( nFlags1, BIFF12_PTDEF_SHOWITEMS );
+    maDefModel.mbDisableFieldList    = getFlag( nFlags1, BIFF12_PTDEF_DISABLEFIELDLIST );
+    maDefModel.mbShowCalcMembers     = !getFlag( nFlags1, BIFF12_PTDEF_HIDECALCMEMBERS );
+    maDefModel.mbVisualTotals        = !getFlag( nFlags1, BIFF12_PTDEF_WITHHIDDENTOTALS );
+    maDefModel.mbShowDrill           = !getFlag( nFlags1, BIFF12_PTDEF_HIDEDRILL );
+    maDefModel.mbPrintDrill          = getFlag( nFlags1, BIFF12_PTDEF_PRINTDRILL );
+    maDefModel.mbEnableDrill         = getFlag( nFlags2, BIFF12_PTDEF_ENABLEDRILL );
+    maDefModel.mbPreserveFormatting  = getFlag( nFlags2, BIFF12_PTDEF_PRESERVEFORMATTING );
+    maDefModel.mbUseAutoFormat       = getFlag( nFlags2, BIFF12_PTDEF_USEAUTOFORMAT );
+    maDefModel.mbPageOverThenDown    = getFlag( nFlags2, BIFF12_PTDEF_PAGEOVERTHENDOWN );
+    maDefModel.mbSubtotalHiddenItems = getFlag( nFlags2, BIFF12_PTDEF_SUBTOTALHIDDENITEMS );
+    maDefModel.mbRowGrandTotals      = getFlag( nFlags2, BIFF12_PTDEF_ROWGRANDTOTALS );
+    maDefModel.mbColGrandTotals      = getFlag( nFlags2, BIFF12_PTDEF_COLGRANDTOTALS );
+    maDefModel.mbFieldPrintTitles    = getFlag( nFlags2, BIFF12_PTDEF_FIELDPRINTTITLES );
+    maDefModel.mbItemPrintTitles     = getFlag( nFlags2, BIFF12_PTDEF_ITEMPRINTTITLES );
+    maDefModel.mbMergeItem           = getFlag( nFlags2, BIFF12_PTDEF_MERGEITEM );
+    maDefModel.mbApplyNumFmt         = getFlag( nFlags2, BIFF12_PTDEF_APPLYNUMFMT );
+    maDefModel.mbApplyFont           = getFlag( nFlags2, BIFF12_PTDEF_APPLYFONT );
+    maDefModel.mbApplyAlignment      = getFlag( nFlags2, BIFF12_PTDEF_APPLYALIGNMENT );
+    maDefModel.mbApplyBorder         = getFlag( nFlags2, BIFF12_PTDEF_APPLYBORDER );
+    maDefModel.mbApplyFill           = getFlag( nFlags2, BIFF12_PTDEF_APPLYFILL );
+    maDefModel.mbApplyProtection     = getFlag( nFlags2, BIFF12_PTDEF_APPLYPROTECTION );
+    maDefModel.mbShowEmptyRow        = getFlag( nFlags2, BIFF12_PTDEF_SHOWEMPTYROW );
+    maDefModel.mbShowEmptyCol        = getFlag( nFlags2, BIFF12_PTDEF_SHOWEMPTYCOL );
+    maDefModel.mbShowHeaders         = !getFlag( nFlags1, BIFF12_PTDEF_HIDEHEADERS );
+    maDefModel.mbFieldListSortAsc    = getFlag( nFlags3, BIFF12_PTDEF_FIELDLISTSORTASC );
+    maDefModel.mbCustomListSort      = !getFlag( nFlags3, BIFF12_PTDEF_NOCUSTOMLISTSORT );
 }
 
 void PivotTable::importPTLocation( RecordInputStream& rStrm, sal_Int16 nSheet )
@@ -1207,7 +1223,7 @@ void PivotTable::importPTPageField( RecordInputStream& rStrm )
     rStrm >> aModel.mnField >> aModel.mnItem;
     rStrm.skip( 4 );    // hierarchy
     rStrm >> nFlags;
-    if( getFlag( nFlags, OOBIN_PTPAGEFIELD_HASNAME ) )
+    if( getFlag( nFlags, BIFF12_PTPAGEFIELD_HASNAME ) )
         rStrm >> aModel.maName;
     maPageFields.push_back( aModel );
 }
@@ -1220,8 +1236,8 @@ void PivotTable::importPTDataField( RecordInputStream& rStrm )
     rStrm >> aModel.mnField >> nSubtotal >> nShowDataAs >> aModel.mnBaseField >> aModel.mnBaseItem >> aModel.mnNumFmtId >> nHasName;
     if( nHasName == 1 )
         rStrm >> aModel.maName;
-    aModel.setBinSubtotal( nSubtotal );
-    aModel.setBinShowDataAs( nShowDataAs );
+    aModel.setBiffSubtotal( nSubtotal );
+    aModel.setBiffShowDataAs( nShowDataAs );
     maDataFields.push_back( aModel );
 }
 
@@ -1297,7 +1313,7 @@ void PivotTable::importPTPageFields( BiffInputStream& rStrm )
         rStrm >> nField >> nItem;
         rStrm.skip( 2 );    // dropdown object ID
         aModel.mnField = nField;
-        aModel.mnItem = (nItem == BIFF_PTPAGEFIELDS_ALLITEMS) ? OOBIN_PTPAGEFIELD_MULTIITEMS : nItem;
+        aModel.mnItem = (nItem == BIFF_PTPAGEFIELDS_ALLITEMS) ? BIFF12_PTPAGEFIELD_MULTIITEMS : nItem;
         maPageFields.push_back( aModel );
     }
 }
@@ -1311,8 +1327,8 @@ void PivotTable::importPTDataField( BiffInputStream& rStrm )
     aModel.maName = lclReadPivotString( *this, rStrm, nNameLen );
 
     aModel.mnField = nField;
-    aModel.setBinSubtotal( nSubtotal );
-    aModel.setBinShowDataAs( nShowDataAs );
+    aModel.setBiffSubtotal( nSubtotal );
+    aModel.setBiffShowDataAs( nShowDataAs );
     aModel.mnBaseField = nBaseField;
     switch( nBaseItem )
     {
@@ -1550,4 +1566,3 @@ void PivotTableBuffer::finalizeImport()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/pivottablefragment.cxx b/oox/source/xls/pivottablefragment.cxx
index 9b34e1bda593..1486a600e131 100644
--- a/oox/source/xls/pivottablefragment.cxx
+++ b/oox/source/xls/pivottablefragment.cxx
@@ -26,25 +26,28 @@
  ************************************************************************/
 
 #include "oox/xls/pivottablefragment.hxx"
+
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/pivottablebuffer.hxx"
 
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
-OoxPivotTableFieldContext::OoxPivotTableFieldContext( OoxWorksheetFragmentBase& rFragment, PivotTableField& rTableField ) :
-    OoxWorksheetContextBase( rFragment ),
+using ::oox::core::ContextHandlerRef;
+using ::oox::core::RecordInfo;
+using ::rtl::OUString;
+
+// ============================================================================
+
+PivotTableFieldContext::PivotTableFieldContext( WorksheetFragmentBase& rFragment, PivotTableField& rTableField ) :
+    WorksheetContextBase( rFragment ),
     mrTableField( rTableField )
 {
 }
 
-ContextHandlerRef OoxPivotTableFieldContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotTableFieldContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -74,43 +77,43 @@ ContextHandlerRef OoxPivotTableFieldContext::onCreateContext( sal_Int32 nElement
     return 0;
 }
 
-void OoxPivotTableFieldContext::onStartElement( const AttributeList& rAttribs )
+void PivotTableFieldContext::onStartElement( const AttributeList& rAttribs )
 {
     if( isRootElement() )
         mrTableField.importPivotField( rAttribs );
 }
 
-ContextHandlerRef OoxPivotTableFieldContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotTableFieldContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
-        case OOBIN_ID_PTFIELD:
+        case BIFF12_ID_PTFIELD:
             switch( nRecId )
             {
-                case OOBIN_ID_PTFITEMS:         return this;
-                case OOBIN_ID_AUTOSORTSCOPE:    return this;
+                case BIFF12_ID_PTFITEMS:        return this;
+                case BIFF12_ID_AUTOSORTSCOPE:   return this;
             }
         break;
-        case OOBIN_ID_PTFITEMS:
-            if( nRecId == OOBIN_ID_PTFITEM ) mrTableField.importPTFItem( rStrm );
+        case BIFF12_ID_PTFITEMS:
+            if( nRecId == BIFF12_ID_PTFITEM ) mrTableField.importPTFItem( rStrm );
         break;
-        case OOBIN_ID_AUTOSORTSCOPE:
-            if( nRecId == OOBIN_ID_PIVOTAREA ) return this;
+        case BIFF12_ID_AUTOSORTSCOPE:
+            if( nRecId == BIFF12_ID_PIVOTAREA ) return this;
         break;
-        case OOBIN_ID_PIVOTAREA:
-            if( nRecId == OOBIN_ID_PTREFERENCES ) return this;
+        case BIFF12_ID_PIVOTAREA:
+            if( nRecId == BIFF12_ID_PTREFERENCES ) return this;
         break;
-        case OOBIN_ID_PTREFERENCES:
-            if( nRecId == OOBIN_ID_PTREFERENCE ) { mrTableField.importPTReference( rStrm ); return this; }
+        case BIFF12_ID_PTREFERENCES:
+            if( nRecId == BIFF12_ID_PTREFERENCE ) { mrTableField.importPTReference( rStrm ); return this; }
         break;
-        case OOBIN_ID_PTREFERENCE:
-            if( nRecId == OOBIN_ID_PTREFERENCEITEM ) mrTableField.importPTReferenceItem( rStrm );
+        case BIFF12_ID_PTREFERENCE:
+            if( nRecId == BIFF12_ID_PTREFERENCEITEM ) mrTableField.importPTReferenceItem( rStrm );
         break;
     }
     return 0;
 }
 
-void OoxPivotTableFieldContext::onStartRecord( RecordInputStream& rStrm )
+void PivotTableFieldContext::onStartRecord( RecordInputStream& rStrm )
 {
     if( isRootElement() )
         mrTableField.importPTField( rStrm );
@@ -118,13 +121,13 @@ void OoxPivotTableFieldContext::onStartRecord( RecordInputStream& rStrm )
 
 // ============================================================================
 
-OoxPivotTableFilterContext::OoxPivotTableFilterContext( OoxWorksheetFragmentBase& rFragment, PivotTableFilter& rTableFilter ) :
-    OoxWorksheetContextBase( rFragment ),
+PivotTableFilterContext::PivotTableFilterContext( WorksheetFragmentBase& rFragment, PivotTableFilter& rTableFilter ) :
+    WorksheetContextBase( rFragment ),
     mrTableFilter( rTableFilter )
 {
 }
 
-ContextHandlerRef OoxPivotTableFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotTableFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -141,30 +144,30 @@ ContextHandlerRef OoxPivotTableFilterContext::onCreateContext( sal_Int32 nElemen
     return 0;
 }
 
-void OoxPivotTableFilterContext::onStartElement( const AttributeList& rAttribs )
+void PivotTableFilterContext::onStartElement( const AttributeList& rAttribs )
 {
     if( isRootElement() )
         mrTableFilter.importFilter( rAttribs );
 }
 
-ContextHandlerRef OoxPivotTableFilterContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotTableFilterContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
-        case OOBIN_ID_PTFILTER:
-            if( nRecId == OOBIN_ID_AUTOFILTER ) return this;
+        case BIFF12_ID_PTFILTER:
+            if( nRecId == BIFF12_ID_AUTOFILTER ) return this;
         break;
-        case OOBIN_ID_AUTOFILTER:
-            if( nRecId == OOBIN_ID_FILTERCOLUMN ) return this;
+        case BIFF12_ID_AUTOFILTER:
+            if( nRecId == BIFF12_ID_FILTERCOLUMN ) return this;
         break;
-        case OOBIN_ID_FILTERCOLUMN:
-            if( nRecId == OOBIN_ID_TOP10FILTER ) mrTableFilter.importTop10Filter( rStrm );
+        case BIFF12_ID_FILTERCOLUMN:
+            if( nRecId == BIFF12_ID_TOP10FILTER ) mrTableFilter.importTop10Filter( rStrm );
         break;
     }
     return 0;
 }
 
-void OoxPivotTableFilterContext::onStartRecord( RecordInputStream& rStrm )
+void PivotTableFilterContext::onStartRecord( RecordInputStream& rStrm )
 {
     if( isRootElement() )
         mrTableFilter.importPTFilter( rStrm );
@@ -172,13 +175,13 @@ void OoxPivotTableFilterContext::onStartRecord( RecordInputStream& rStrm )
 
 // ============================================================================
 
-OoxPivotTableFragment::OoxPivotTableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
-    OoxWorksheetFragmentBase( rHelper, rFragmentPath ),
-    mrPivotTable( rHelper.getPivotTables().createPivotTable() )
+PivotTableFragment::PivotTableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+    WorksheetFragmentBase( rHelper, rFragmentPath ),
+    mrPivotTable( getPivotTables().createPivotTable() )
 {
 }
 
-ContextHandlerRef OoxPivotTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -200,7 +203,7 @@ ContextHandlerRef OoxPivotTableFragment::onCreateContext( sal_Int32 nElement, co
         break;
 
         case XLS_TOKEN( pivotFields ):
-            if( nElement == XLS_TOKEN( pivotField ) ) return new OoxPivotTableFieldContext( *this, mrPivotTable.createTableField() );
+            if( nElement == XLS_TOKEN( pivotField ) ) return new PivotTableFieldContext( *this, mrPivotTable.createTableField() );
         break;
         case XLS_TOKEN( rowFields ):
             if( nElement == XLS_TOKEN( field ) ) mrPivotTable.importRowField( rAttribs );
@@ -215,75 +218,75 @@ ContextHandlerRef OoxPivotTableFragment::onCreateContext( sal_Int32 nElement, co
             if( nElement == XLS_TOKEN( dataField ) ) mrPivotTable.importDataField( rAttribs );
         break;
         case XLS_TOKEN( filters ):
-            if( nElement == XLS_TOKEN( filter ) ) return new OoxPivotTableFilterContext( *this, mrPivotTable.createTableFilter() );
+            if( nElement == XLS_TOKEN( filter ) ) return new PivotTableFilterContext( *this, mrPivotTable.createTableFilter() );
         break;
     }
     return 0;
 }
 
-ContextHandlerRef OoxPivotTableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotTableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
         case XML_ROOT_CONTEXT:
-            if( nRecId == OOBIN_ID_PTDEFINITION ) { mrPivotTable.importPTDefinition( rStrm ); return this; }
+            if( nRecId == BIFF12_ID_PTDEFINITION ) { mrPivotTable.importPTDefinition( rStrm ); return this; }
         break;
 
-        case OOBIN_ID_PTDEFINITION:
+        case BIFF12_ID_PTDEFINITION:
             switch( nRecId )
             {
-                case OOBIN_ID_PTLOCATION:   mrPivotTable.importPTLocation( rStrm, getSheetIndex() );    break;
-                case OOBIN_ID_PTFIELDS:     return this;
-                case OOBIN_ID_PTROWFIELDS:  mrPivotTable.importPTRowFields( rStrm );                    break;
-                case OOBIN_ID_PTCOLFIELDS:  mrPivotTable.importPTColFields( rStrm );                    break;
-                case OOBIN_ID_PTPAGEFIELDS: return this;
-                case OOBIN_ID_PTDATAFIELDS: return this;
-                case OOBIN_ID_PTFILTERS:    return this;
+                case BIFF12_ID_PTLOCATION:      mrPivotTable.importPTLocation( rStrm, getSheetIndex() );    break;
+                case BIFF12_ID_PTFIELDS:        return this;
+                case BIFF12_ID_PTROWFIELDS:     mrPivotTable.importPTRowFields( rStrm );                    break;
+                case BIFF12_ID_PTCOLFIELDS:     mrPivotTable.importPTColFields( rStrm );                    break;
+                case BIFF12_ID_PTPAGEFIELDS:    return this;
+                case BIFF12_ID_PTDATAFIELDS:    return this;
+                case BIFF12_ID_PTFILTERS:       return this;
             }
         break;
 
-        case OOBIN_ID_PTFIELDS:
-            if( nRecId == OOBIN_ID_PTFIELD ) return new OoxPivotTableFieldContext( *this, mrPivotTable.createTableField() );
+        case BIFF12_ID_PTFIELDS:
+            if( nRecId == BIFF12_ID_PTFIELD ) return new PivotTableFieldContext( *this, mrPivotTable.createTableField() );
         break;
-        case OOBIN_ID_PTPAGEFIELDS:
-            if( nRecId == OOBIN_ID_PTPAGEFIELD ) mrPivotTable.importPTPageField( rStrm );
+        case BIFF12_ID_PTPAGEFIELDS:
+            if( nRecId == BIFF12_ID_PTPAGEFIELD ) mrPivotTable.importPTPageField( rStrm );
         break;
-        case OOBIN_ID_PTDATAFIELDS:
-            if( nRecId == OOBIN_ID_PTDATAFIELD ) mrPivotTable.importPTDataField( rStrm );
+        case BIFF12_ID_PTDATAFIELDS:
+            if( nRecId == BIFF12_ID_PTDATAFIELD ) mrPivotTable.importPTDataField( rStrm );
         break;
-        case OOBIN_ID_PTFILTERS:
-            if( nRecId == OOBIN_ID_PTFILTER ) return new OoxPivotTableFilterContext( *this, mrPivotTable.createTableFilter() );
+        case BIFF12_ID_PTFILTERS:
+            if( nRecId == BIFF12_ID_PTFILTER ) return new PivotTableFilterContext( *this, mrPivotTable.createTableFilter() );
         break;
     }
     return 0;
 }
 
-const RecordInfo* OoxPivotTableFragment::getRecordInfos() const
+const RecordInfo* PivotTableFragment::getRecordInfos() const
 {
     static const RecordInfo spRecInfos[] =
     {
-        { OOBIN_ID_AUTOFILTER,      OOBIN_ID_AUTOFILTER + 1         },
-        { OOBIN_ID_AUTOSORTSCOPE,   OOBIN_ID_AUTOSORTSCOPE + 1      },
-        { OOBIN_ID_FILTERCOLUMN,    OOBIN_ID_FILTERCOLUMN + 1       },
-        { OOBIN_ID_PIVOTAREA,       OOBIN_ID_PIVOTAREA + 1          },
-        { OOBIN_ID_PTCOLFIELDS,     OOBIN_ID_PTCOLFIELDS + 1        },
-        { OOBIN_ID_PTDATAFIELD,     OOBIN_ID_PTDATAFIELD + 1        },
-        { OOBIN_ID_PTDATAFIELDS,    OOBIN_ID_PTDATAFIELDS + 1       },
-        { OOBIN_ID_PTDEFINITION,    OOBIN_ID_PTDEFINITION + 35      },
-        { OOBIN_ID_PTFIELD,         OOBIN_ID_PTFIELD + 1            },
-        { OOBIN_ID_PTFIELDS,        OOBIN_ID_PTFIELDS + 1           },
-        { OOBIN_ID_PTFILTER,        OOBIN_ID_PTFILTER + 1           },
-        { OOBIN_ID_PTFILTERS,       OOBIN_ID_PTFILTERS + 1          },
-        { OOBIN_ID_PTFITEM,         OOBIN_ID_PTFITEM - 1            },
-        { OOBIN_ID_PTFITEMS,        OOBIN_ID_PTFITEMS + 1           },
-        { OOBIN_ID_PTLOCATION,      OOBIN_ID_PTLOCATION - 1         },
-        { OOBIN_ID_PTPAGEFIELD,     OOBIN_ID_PTPAGEFIELD + 1        },
-        { OOBIN_ID_PTPAGEFIELDS,    OOBIN_ID_PTPAGEFIELDS + 1       },
-        { OOBIN_ID_PTREFERENCE,     OOBIN_ID_PTREFERENCE + 1        },
-        { OOBIN_ID_PTREFERENCEITEM, OOBIN_ID_PTREFERENCEITEM + 1    },
-        { OOBIN_ID_PTREFERENCES,    OOBIN_ID_PTREFERENCES + 1       },
-        { OOBIN_ID_PTROWFIELDS,     OOBIN_ID_PTROWFIELDS + 1        },
-        { -1,                       -1                              }
+        { BIFF12_ID_AUTOFILTER,         BIFF12_ID_AUTOFILTER + 1        },
+        { BIFF12_ID_AUTOSORTSCOPE,      BIFF12_ID_AUTOSORTSCOPE + 1     },
+        { BIFF12_ID_FILTERCOLUMN,       BIFF12_ID_FILTERCOLUMN + 1      },
+        { BIFF12_ID_PIVOTAREA,          BIFF12_ID_PIVOTAREA + 1         },
+        { BIFF12_ID_PTCOLFIELDS,        BIFF12_ID_PTCOLFIELDS + 1       },
+        { BIFF12_ID_PTDATAFIELD,        BIFF12_ID_PTDATAFIELD + 1       },
+        { BIFF12_ID_PTDATAFIELDS,       BIFF12_ID_PTDATAFIELDS + 1      },
+        { BIFF12_ID_PTDEFINITION,       BIFF12_ID_PTDEFINITION + 35     },
+        { BIFF12_ID_PTFIELD,            BIFF12_ID_PTFIELD + 1           },
+        { BIFF12_ID_PTFIELDS,           BIFF12_ID_PTFIELDS + 1          },
+        { BIFF12_ID_PTFILTER,           BIFF12_ID_PTFILTER + 1          },
+        { BIFF12_ID_PTFILTERS,          BIFF12_ID_PTFILTERS + 1         },
+        { BIFF12_ID_PTFITEM,            BIFF12_ID_PTFITEM - 1           },
+        { BIFF12_ID_PTFITEMS,           BIFF12_ID_PTFITEMS + 1          },
+        { BIFF12_ID_PTLOCATION,         BIFF12_ID_PTLOCATION - 1        },
+        { BIFF12_ID_PTPAGEFIELD,        BIFF12_ID_PTPAGEFIELD + 1       },
+        { BIFF12_ID_PTPAGEFIELDS,       BIFF12_ID_PTPAGEFIELDS + 1      },
+        { BIFF12_ID_PTREFERENCE,        BIFF12_ID_PTREFERENCE + 1       },
+        { BIFF12_ID_PTREFERENCEITEM,    BIFF12_ID_PTREFERENCEITEM + 1   },
+        { BIFF12_ID_PTREFERENCES,       BIFF12_ID_PTREFERENCES + 1      },
+        { BIFF12_ID_PTROWFIELDS,        BIFF12_ID_PTROWFIELDS + 1       },
+        { -1,                           -1                              }
     };
     return spRecInfos;
 }
@@ -291,22 +294,22 @@ const RecordInfo* OoxPivotTableFragment::getRecordInfos() const
 // ============================================================================
 // ============================================================================
 
-BiffPivotTableContext::BiffPivotTableContext( const BiffWorksheetFragmentBase& rFragment, PivotTable& rPivotTable ) :
+BiffPivotTableContext::BiffPivotTableContext( const BiffWorksheetFragmentBase& rFragment ) :
     BiffWorksheetContextBase( rFragment ),
-    mrPivotTable( rPivotTable )
+    mrPivotTable( getPivotTables().createPivotTable() )
 {
 }
 
-void BiffPivotTableContext::importRecord()
+void BiffPivotTableContext::importRecord( BiffInputStream& rStrm )
 {
-    switch( mrStrm.getRecId() )
+    switch( rStrm.getRecId() )
     {
-        case BIFF_ID_PTDEFINITION:      mrPivotTable.importPTDefinition( mrStrm, getSheetIndex() ); break;
-        case BIFF_ID_PTDEFINITION2:     mrPivotTable.importPTDefinition2( mrStrm );                 break;
-        case BIFF_ID_PTFIELD:           mrPivotTable.createTableField().importPTField( mrStrm );    break;
-        case BIFF_ID_PTROWCOLFIELDS:    mrPivotTable.importPTRowColFields( mrStrm );                break;
-        case BIFF_ID_PTPAGEFIELDS:      mrPivotTable.importPTPageFields( mrStrm );                  break;
-        case BIFF_ID_PTDATAFIELD:       mrPivotTable.importPTDataField( mrStrm );                   break;
+        case BIFF_ID_PTDEFINITION:      mrPivotTable.importPTDefinition( rStrm, getSheetIndex() );  break;
+        case BIFF_ID_PTDEFINITION2:     mrPivotTable.importPTDefinition2( rStrm );                  break;
+        case BIFF_ID_PTFIELD:           mrPivotTable.createTableField().importPTField( rStrm );     break;
+        case BIFF_ID_PTROWCOLFIELDS:    mrPivotTable.importPTRowColFields( rStrm );                 break;
+        case BIFF_ID_PTPAGEFIELDS:      mrPivotTable.importPTPageFields( rStrm );                   break;
+        case BIFF_ID_PTDATAFIELD:       mrPivotTable.importPTDataField( rStrm );                    break;
     }
 }
 
@@ -314,4 +317,3 @@ void BiffPivotTableContext::importRecord()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/querytablebuffer.cxx b/oox/source/xls/querytablebuffer.cxx
new file mode 100644
index 000000000000..8f65fe1438db
--- /dev/null
+++ b/oox/source/xls/querytablebuffer.cxx
@@ -0,0 +1,396 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * 
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "oox/xls/querytablebuffer.hxx"
+
+#include 
+#include 
+#include 
+#include "oox/core/filterbase.hxx"
+#include "oox/helper/attributelist.hxx"
+#include "oox/helper/recordinputstream.hxx"
+#include "oox/xls/addressconverter.hxx"
+#include "oox/xls/biffinputstream.hxx"
+#include "oox/xls/connectionsbuffer.hxx"
+#include "oox/xls/defnamesbuffer.hxx"
+#include "properties.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
+namespace {
+
+const sal_uInt32 BIFF12_QUERYTABLE_HEADERS          = 0x00000001;
+const sal_uInt32 BIFF12_QUERYTABLE_ROWNUMBERS       = 0x00000002;
+const sal_uInt32 BIFF12_QUERYTABLE_DISABLEREFRESH   = 0x00000004;
+const sal_uInt32 BIFF12_QUERYTABLE_BACKGROUND       = 0x00000008;
+const sal_uInt32 BIFF12_QUERYTABLE_FIRSTBACKGROUND  = 0x00000010;
+const sal_uInt32 BIFF12_QUERYTABLE_REFRESHONLOAD    = 0x00000020;
+const sal_uInt32 BIFF12_QUERYTABLE_FILLFORMULAS     = 0x00000100;
+const sal_uInt32 BIFF12_QUERYTABLE_SAVEDATA         = 0x00000200;
+const sal_uInt32 BIFF12_QUERYTABLE_DISABLEEDIT      = 0x00000400;
+const sal_uInt32 BIFF12_QUERYTABLE_PRESERVEFORMAT   = 0x00000800;
+const sal_uInt32 BIFF12_QUERYTABLE_ADJUSTCOLWIDTH   = 0x00001000;
+const sal_uInt32 BIFF12_QUERYTABLE_INTERMEDIATE     = 0x00002000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYNUMFMT      = 0x00004000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYFONT        = 0x00008000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYALIGNMENT   = 0x00010000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYBORDER      = 0x00020000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYFILL        = 0x00040000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYPROTECTION  = 0x00080000;
+
+const sal_uInt16 BIFF_QUERYTABLE_HEADERS            = 0x0001;
+const sal_uInt16 BIFF_QUERYTABLE_ROWNUMBERS         = 0x0002;
+const sal_uInt16 BIFF_QUERYTABLE_DISABLEREFRESH     = 0x0004;
+const sal_uInt16 BIFF_QUERYTABLE_BACKGROUND         = 0x0008;
+const sal_uInt16 BIFF_QUERYTABLE_FIRSTBACKGROUND    = 0x0010;
+const sal_uInt16 BIFF_QUERYTABLE_REFRESHONLOAD      = 0x0020;
+const sal_uInt16 BIFF_QUERYTABLE_DELETEUNUSED       = 0x0040;
+const sal_uInt16 BIFF_QUERYTABLE_FILLFORMULAS       = 0x0080;
+const sal_uInt16 BIFF_QUERYTABLE_ADJUSTCOLWIDTH     = 0x0100;
+const sal_uInt16 BIFF_QUERYTABLE_SAVEDATA           = 0x0200;
+const sal_uInt16 BIFF_QUERYTABLE_DISABLEEDIT        = 0x0400;
+const sal_uInt16 BIFF_QUERYTABLE_OVERWRITEEXISTING  = 0x2000;
+
+const sal_uInt16 BIFF_QUERYTABLE_APPLYNUMFMT        = 0x0001;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYFONT          = 0x0002;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYALIGNMENT     = 0x0004;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYBORDER        = 0x0008;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYFILL          = 0x0010;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYPROTECTION    = 0x0020;
+
+const sal_uInt32 BIFF_QTREFRESH_PRESERVEFORMAT      = 0x00000001;
+const sal_uInt32 BIFF_QTREFRESH_ADJUSTCOLWIDTH      = 0x00000002;
+
+// ----------------------------------------------------------------------------
+
+void lclAppendWebQueryTableName( OUStringBuffer& rTables, const OUString& rTableName )
+{
+    if( rTableName.getLength() > 0 )
+    {
+        if( rTables.getLength() > 0 )
+            rTables.append( sal_Unicode( ';' ) );
+        rTables.appendAscii( RTL_CONSTASCII_STRINGPARAM( "HTML__" ) ).append( rTableName );
+    }
+}
+
+void lclAppendWebQueryTableIndex( OUStringBuffer& rTables, sal_Int32 nTableIndex )
+{
+    if( nTableIndex > 0 )
+    {
+        if( rTables.getLength() > 0 )
+            rTables.append( sal_Unicode( ';' ) );
+        rTables.appendAscii( RTL_CONSTASCII_STRINGPARAM( "HTML_" ) ).append( nTableIndex );
+    }
+}
+
+OUString lclBuildWebQueryTables( const WebPrModel::TablesVector& rTables )
+{
+    if( rTables.empty() )
+        return CREATE_OUSTRING( "HTML_tables" );
+
+    OUStringBuffer aTables;
+    for( WebPrModel::TablesVector::const_iterator aIt = rTables.begin(), aEnd = rTables.end(); aIt != aEnd; ++aIt )
+    {
+        if( aIt->has< OUString >() )
+            lclAppendWebQueryTableName( aTables, aIt->get< OUString >() );
+        else if( aIt->has< sal_Int32 >() )
+            lclAppendWebQueryTableIndex( aTables, aIt->get< sal_Int32 >() );
+    }
+    return aTables.makeStringAndClear();
+}
+
+Reference< XAreaLink > lclFindAreaLink(
+        const Reference< XAreaLinks >& rxAreaLinks, const CellAddress& rDestPos,
+        const OUString& rFileUrl, const OUString& rTables, const OUString& rFilterName, const OUString& rFilterOptions )
+{
+    try
+    {
+        Reference< XEnumerationAccess > xAreaLinksEA( rxAreaLinks, UNO_QUERY_THROW );
+        Reference< XEnumeration > xAreaLinksEnum( xAreaLinksEA->createEnumeration(), UNO_SET_THROW );
+        while( xAreaLinksEnum->hasMoreElements() )
+        {
+            Reference< XAreaLink > xAreaLink( xAreaLinksEnum->nextElement(), UNO_QUERY_THROW );
+            PropertySet aPropSet( xAreaLink );
+            CellRangeAddress aDestArea = xAreaLink->getDestArea();
+            OUString aString;
+            if( (rDestPos.Sheet == aDestArea.Sheet) && (rDestPos.Column == aDestArea.StartColumn) && (rDestPos.Row == aDestArea.StartRow) &&
+                    (rTables == xAreaLink->getSourceArea()) &&
+                    aPropSet.getProperty( aString, PROP_Url ) && (rFileUrl == aString) &&
+                    aPropSet.getProperty( aString, PROP_Filter ) && (rFilterName == aString) &&
+                    aPropSet.getProperty( aString, PROP_FilterOptions ) && (rFilterOptions == aString) )
+                return xAreaLink;
+        }
+    }
+    catch( Exception& )
+    {
+    }
+    return Reference< XAreaLink >();
+}
+
+} // namespace
+
+// ============================================================================
+
+QueryTableModel::QueryTableModel() :
+    mnConnId( -1 ),
+    mnGrowShrinkType( XML_insertDelete ),
+    mbHeaders( true ),
+    mbRowNumbers( false ),
+    mbDisableRefresh( false ),
+    mbBackground( true ),
+    mbFirstBackground( false ),
+    mbRefreshOnLoad( false ),
+    mbFillFormulas( false ),
+    mbRemoveDataOnSave( false ),
+    mbDisableEdit( false ),
+    mbPreserveFormat( true ),
+    mbAdjustColWidth( true ),
+    mbIntermediate( false )
+{
+}
+
+// ----------------------------------------------------------------------------
+
+QueryTable::QueryTable( const WorksheetHelper& rHelper ) :
+    WorksheetHelper( rHelper )
+{
+}
+
+void QueryTable::importQueryTable( const AttributeList& rAttribs )
+{
+    maModel.maDefName          = rAttribs.getXString( XML_name, OUString() );
+    maModel.mnConnId           = rAttribs.getInteger( XML_connectionId, -1 );
+    maModel.mnGrowShrinkType   = rAttribs.getToken( XML_growShrinkType, XML_insertDelete );
+    maModel.mnAutoFormatId     = rAttribs.getInteger( XML_autoFormatId, 0 );
+    maModel.mbHeaders          = rAttribs.getBool( XML_headers, true );
+    maModel.mbRowNumbers       = rAttribs.getBool( XML_rowNumbers, false );
+    maModel.mbDisableRefresh   = rAttribs.getBool( XML_disableRefresh, false );
+    maModel.mbBackground       = rAttribs.getBool( XML_backgroundRefresh, true );
+    maModel.mbFirstBackground  = rAttribs.getBool( XML_firstBackgroundRefresh, false );
+    maModel.mbRefreshOnLoad    = rAttribs.getBool( XML_refreshOnLoad, false );
+    maModel.mbFillFormulas     = rAttribs.getBool( XML_fillFormulas, false );
+    maModel.mbRemoveDataOnSave = rAttribs.getBool( XML_removeDataOnSave, false );
+    maModel.mbDisableEdit      = rAttribs.getBool( XML_disableEdit, false );
+    maModel.mbPreserveFormat   = rAttribs.getBool( XML_preserveFormatting, true );
+    maModel.mbAdjustColWidth   = rAttribs.getBool( XML_adjustColumnWidth, true );
+    maModel.mbIntermediate     = rAttribs.getBool( XML_intermediate, false );
+    maModel.mbApplyNumFmt      = rAttribs.getBool( XML_applyNumberFormats, false );
+    maModel.mbApplyFont        = rAttribs.getBool( XML_applyFontFormats, false );
+    maModel.mbApplyAlignment   = rAttribs.getBool( XML_applyAlignmentFormats, false );
+    maModel.mbApplyBorder      = rAttribs.getBool( XML_applyBorderFormats, false );
+    maModel.mbApplyFill        = rAttribs.getBool( XML_applyPatternFormats, false );
+    // OOXML and BIFF12 documentation differ: OOXML mentions width/height, BIFF12 mentions protection
+    maModel.mbApplyProtection  = rAttribs.getBool( XML_applyWidthHeightFormats, false );
+}
+
+void QueryTable::importQueryTable( RecordInputStream& rStrm )
+{
+    sal_uInt32 nFlags;
+    rStrm >> nFlags;
+    maModel.mnAutoFormatId = rStrm.readuInt16();
+    rStrm >> maModel.mnConnId >> maModel.maDefName;
+
+    static const sal_Int32 spnGrowShrinkTypes[] = { XML_insertClear, XML_insertDelete, XML_overwriteClear };
+    maModel.mnGrowShrinkType = STATIC_ARRAY_SELECT( spnGrowShrinkTypes, extractValue< sal_uInt8 >( nFlags, 6, 2 ), XML_insertDelete );
+
+    maModel.mbHeaders           = getFlag( nFlags, BIFF12_QUERYTABLE_HEADERS );
+    maModel.mbRowNumbers        = getFlag( nFlags, BIFF12_QUERYTABLE_ROWNUMBERS );
+    maModel.mbDisableRefresh    = getFlag( nFlags, BIFF12_QUERYTABLE_DISABLEREFRESH );
+    maModel.mbBackground        = getFlag( nFlags, BIFF12_QUERYTABLE_BACKGROUND );
+    maModel.mbFirstBackground   = getFlag( nFlags, BIFF12_QUERYTABLE_FIRSTBACKGROUND );
+    maModel.mbRefreshOnLoad     = getFlag( nFlags, BIFF12_QUERYTABLE_REFRESHONLOAD );
+    maModel.mbFillFormulas      = getFlag( nFlags, BIFF12_QUERYTABLE_FILLFORMULAS );
+    maModel.mbRemoveDataOnSave  = !getFlag( nFlags, BIFF12_QUERYTABLE_SAVEDATA ); // flag negated in BIFF12
+    maModel.mbDisableEdit       = getFlag( nFlags, BIFF12_QUERYTABLE_DISABLEEDIT );
+    maModel.mbPreserveFormat    = getFlag( nFlags, BIFF12_QUERYTABLE_PRESERVEFORMAT );
+    maModel.mbAdjustColWidth    = getFlag( nFlags, BIFF12_QUERYTABLE_ADJUSTCOLWIDTH );
+    maModel.mbIntermediate      = getFlag( nFlags, BIFF12_QUERYTABLE_INTERMEDIATE );
+    maModel.mbApplyNumFmt       = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYNUMFMT );
+    maModel.mbApplyFont         = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYFONT );
+    maModel.mbApplyAlignment    = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYALIGNMENT );
+    maModel.mbApplyBorder       = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYBORDER );
+    maModel.mbApplyFill         = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYFILL );
+    maModel.mbApplyProtection   = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYPROTECTION );
+}
+
+void QueryTable::importQueryTable( BiffInputStream& rStrm )
+{
+    sal_uInt16 nFlags, nAutoFormatFlags;
+    rStrm >> nFlags;
+    maModel.mnAutoFormatId = rStrm.readuInt16();
+    rStrm >> nAutoFormatFlags;
+    rStrm.skip( 4 );
+    maModel.maDefName = rStrm.readUniString();
+
+    bool bDeleteUnused = getFlag( nFlags, BIFF_QUERYTABLE_DELETEUNUSED );
+    bool bOverwriteExisting = getFlag( nFlags, BIFF_QUERYTABLE_OVERWRITEEXISTING );
+    OSL_ENSURE( !bDeleteUnused || !bOverwriteExisting, "QueryTable::importQueryTable - invalid flags" );
+    maModel.mnGrowShrinkType = bDeleteUnused ? XML_insertDelete : (bOverwriteExisting ? XML_overwriteClear : XML_insertClear);
+
+    maModel.mbHeaders           = getFlag( nFlags, BIFF_QUERYTABLE_HEADERS );
+    maModel.mbRowNumbers        = getFlag( nFlags, BIFF_QUERYTABLE_ROWNUMBERS );
+    maModel.mbDisableRefresh    = getFlag( nFlags, BIFF_QUERYTABLE_DISABLEREFRESH );
+    maModel.mbBackground        = getFlag( nFlags, BIFF_QUERYTABLE_BACKGROUND );
+    maModel.mbFirstBackground   = getFlag( nFlags, BIFF_QUERYTABLE_FIRSTBACKGROUND );
+    maModel.mbRefreshOnLoad     = getFlag( nFlags, BIFF_QUERYTABLE_REFRESHONLOAD );
+    maModel.mbFillFormulas      = getFlag( nFlags, BIFF_QUERYTABLE_FILLFORMULAS );
+    maModel.mbRemoveDataOnSave  = !getFlag( nFlags, BIFF_QUERYTABLE_SAVEDATA ); // flag negated in BIFF
+    maModel.mbDisableEdit       = getFlag( nFlags, BIFF_QUERYTABLE_DISABLEEDIT );
+    maModel.mbAdjustColWidth    = getFlag( nFlags, BIFF_QUERYTABLE_ADJUSTCOLWIDTH );
+    maModel.mbApplyNumFmt       = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYNUMFMT );
+    maModel.mbApplyFont         = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYFONT );
+    maModel.mbApplyAlignment    = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYALIGNMENT );
+    maModel.mbApplyBorder       = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYBORDER );
+    maModel.mbApplyFill         = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYFILL );
+    maModel.mbApplyProtection   = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYPROTECTION );
+
+    // create a new connection object that will store settings from following records
+    OSL_ENSURE( maModel.mnConnId == -1, "QueryTable::importQueryTable - multiple call" );
+    ConnectionRef xConnection = getConnections().createConnection();
+    OSL_ENSURE( xConnection.get(), "QueryTable::importQueryTable - cannot create connection object" );
+    if( xConnection.get() )
+    {
+        maModel.mnConnId = xConnection->getConnectionId();
+
+        // a DBQUERY record with some PCITEM_STRING records must follow
+        bool bHasDbQuery = (rStrm.getNextRecId() == BIFF_ID_DBQUERY) && rStrm.startNextRecord();
+        OSL_ENSURE( bHasDbQuery, "QueryTable::importQueryTable - missing DBQUERY record" );
+        if( bHasDbQuery )
+            xConnection->importDbQuery( rStrm );
+    }
+}
+
+void QueryTable::importQueryTableRefresh( BiffInputStream& rStrm )
+{
+    rStrm.skip( 4 );
+    bool bPivot = rStrm.readuInt16() != 0;
+    OSL_ENSURE( !bPivot, "QueryTable::importQueryTableRefresh - unexpected pivot flag" );
+    if( !bPivot )
+    {
+        rStrm.skip( 2 );
+        sal_uInt32 nFlags = rStrm.readuInt32();
+        maModel.mbPreserveFormat = getFlag( nFlags, BIFF_QTREFRESH_PRESERVEFORMAT );
+        maModel.mbAdjustColWidth = getFlag( nFlags, BIFF_QTREFRESH_ADJUSTCOLWIDTH );
+    }
+}
+
+void QueryTable::importQueryTableSettings( BiffInputStream& rStrm )
+{
+    ConnectionRef xConnection = getConnections().getConnection( maModel.mnConnId );
+    OSL_ENSURE( xConnection.get(), "QueryTable::importQueryTableSettings - missing connection object" );
+    if( xConnection.get() )
+        xConnection->importQueryTableSettings( rStrm );
+}
+
+void QueryTable::finalizeImport()
+{
+    ConnectionRef xConnection = getConnections().getConnection( maModel.mnConnId );
+    OSL_ENSURE( xConnection.get(), "QueryTable::finalizeImport - missing connection object" );
+    if( xConnection.get() && (xConnection->getConnectionType() == BIFF12_CONNECTION_HTML) )
+    {
+        // check that valid web query properties exist
+        const WebPrModel* pWebPr = xConnection->getModel().mxWebPr.get();
+        if( pWebPr && !pWebPr->mbXml )
+        {
+            OUString aFileUrl = getBaseFilter().getAbsoluteUrl( pWebPr->maUrl );
+            if( aFileUrl.getLength() > 0 )
+            {
+                // resolve destination cell range (stored as defined name containing the range)
+                OUString aDefName = maModel.maDefName.replace( ' ', '_' ).replace( '-', '_' );
+                DefinedNameRef xDefName = getDefinedNames().getByModelName( aDefName, getSheetIndex() );
+                OSL_ENSURE( xDefName.get(), "QueryTable::finalizeImport - missing defined name" );
+                if( xDefName.get() )
+                {
+                    CellRangeAddress aDestRange;
+                    bool bIsRange = xDefName->getAbsoluteRange( aDestRange ) && (aDestRange.Sheet == getSheetIndex());
+                    OSL_ENSURE( bIsRange, "QueryTable::finalizeImport - defined name does not contain valid cell range" );
+                    if( bIsRange && getAddressConverter().checkCellRange( aDestRange, false, true ) )
+                    {
+                        CellAddress aDestPos( aDestRange.Sheet, aDestRange.StartColumn, aDestRange.StartRow );
+                        // find tables mode: entire document, all tables, or specific tables
+                        OUString aTables = pWebPr->mbHtmlTables ? lclBuildWebQueryTables( pWebPr->maTables ) : CREATE_OUSTRING( "HTML_all" );
+                        if( aTables.getLength() > 0 ) try
+                        {
+                            PropertySet aDocProps( getDocument() );
+                            Reference< XAreaLinks > xAreaLinks( aDocProps.getAnyProperty( PROP_AreaLinks ), UNO_QUERY_THROW );
+                            OUString aFilterName = CREATE_OUSTRING( "calc_HTML_WebQuery" );
+                            OUString aFilterOptions;
+                            xAreaLinks->insertAtPosition( aDestPos, aFileUrl, aTables, aFilterName, aFilterOptions );
+                            // set refresh interval (convert minutes to seconds)
+                            sal_Int32 nRefreshPeriod = xConnection->getModel().mnInterval * 60;
+                            if( nRefreshPeriod > 0 )
+                            {
+                                PropertySet aPropSet( lclFindAreaLink( xAreaLinks, aDestPos, aFileUrl, aTables, aFilterName, aFilterOptions ) );
+                                aPropSet.setProperty( PROP_RefreshPeriod, nRefreshPeriod );
+                            }
+                        }
+                        catch( Exception& )
+                        {
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+// ============================================================================
+
+QueryTableBuffer::QueryTableBuffer( const WorksheetHelper& rHelper ) :
+    WorksheetHelper( rHelper )
+{
+}
+
+QueryTable& QueryTableBuffer::createQueryTable()
+{
+    QueryTableVector::value_type xQueryTable( new QueryTable( *this ) );
+    maQueryTables.push_back( xQueryTable );
+    return *xQueryTable;
+}
+
+void QueryTableBuffer::finalizeImport()
+{
+    maQueryTables.forEachMem( &QueryTable::finalizeImport );
+}
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
diff --git a/oox/source/xls/querytablefragment.cxx b/oox/source/xls/querytablefragment.cxx
index 303852b8492b..493fb22bc632 100644
--- a/oox/source/xls/querytablefragment.cxx
+++ b/oox/source/xls/querytablefragment.cxx
@@ -26,31 +26,81 @@
  ************************************************************************/
 
 #include "oox/xls/querytablefragment.hxx"
-#include "oox/xls/webquerybuffer.hxx"
 
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
+#include "oox/xls/biffinputstream.hxx"
+#include "oox/xls/querytablebuffer.hxx"
 
 namespace oox {
 namespace xls {
 
-OoxQueryTableFragment::OoxQueryTableFragment(
-        const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
-    OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+// ============================================================================
+
+using ::oox::core::ContextHandlerRef;
+using ::oox::core::RecordInfo;
+using ::rtl::OUString;
+
+// ============================================================================
+
+QueryTableFragment::QueryTableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+    WorksheetFragmentBase( rHelper, rFragmentPath ),
+    mrQueryTable( getQueryTables().createQueryTable() )
+{
+}
+
+ContextHandlerRef QueryTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
+    switch( getCurrentElement() )
+    {
+        case XML_ROOT_CONTEXT:
+            if( nElement == XLS_TOKEN( queryTable ) )
+                mrQueryTable.importQueryTable( rAttribs );
+        break;
+    }
+    return 0;
 }
 
-ContextHandlerRef OoxQueryTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef QueryTableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
         case XML_ROOT_CONTEXT:
-            if( nElement == XLS_TOKEN( queryTable ) ) getWebQueries().importQueryTable( rAttribs );
+            if( nRecId == BIFF12_ID_QUERYTABLE )
+                mrQueryTable.importQueryTable( rStrm );
         break;
     }
     return 0;
 }
 
+const RecordInfo* QueryTableFragment::getRecordInfos() const
+{
+    static const RecordInfo spRecInfos[] =
+    {
+        { BIFF12_ID_QUERYTABLE,         BIFF12_ID_QUERYTABLE + 1        },
+        { BIFF12_ID_QUERYTABLEREFRESH,  BIFF12_ID_QUERYTABLEREFRESH + 1 },
+        { -1,                           -1                              }
+    };
+    return spRecInfos;
+}
+
+// ============================================================================
+
+BiffQueryTableContext::BiffQueryTableContext( const BiffWorksheetFragmentBase& rFragment ) :
+    BiffWorksheetContextBase( rFragment ),
+    mrQueryTable( getQueryTables().createQueryTable() )
+{
+}
+
+void BiffQueryTableContext::importRecord( BiffInputStream& rStrm )
+{
+    switch( rStrm.getRecId() )
+    {
+        case BIFF_ID_QUERYTABLE:            mrQueryTable.importQueryTable( rStrm );         break;
+        case BIFF_ID_QUERYTABLEREFRESH:     mrQueryTable.importQueryTableRefresh( rStrm );  break;
+        case BIFF_ID_QUERYTABLESETTINGS:    mrQueryTable.importQueryTableSettings( rStrm ); break;
+    }
+}
+
+// ============================================================================
+
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/richstring.cxx b/oox/source/xls/richstring.cxx
index 4e82b1e696f0..2fc659f83536 100644
--- a/oox/source/xls/richstring.cxx
+++ b/oox/source/xls/richstring.cxx
@@ -26,29 +26,32 @@
  ************************************************************************/
 
 #include "oox/xls/richstring.hxx"
-#include 
+
 #include 
+#include 
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/helper/recordinputstream.hxx"
 #include "oox/xls/biffinputstream.hxx"
 
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
 using ::rtl::OString;
 using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::text::XText;
-using ::com::sun::star::text::XTextRange;
-
-namespace oox {
-namespace xls {
 
 // ============================================================================
 
 namespace {
 
-const sal_uInt8 OOBIN_STRINGFLAG_FONTS          = 0x01;
-const sal_uInt8 OOBIN_STRINGFLAG_PHONETICS      = 0x02;
+const sal_uInt8 BIFF12_STRINGFLAG_FONTS         = 0x01;
+const sal_uInt8 BIFF12_STRINGFLAG_PHONETICS     = 0x02;
 
 } // namespace
 
@@ -190,7 +193,7 @@ PhoneticDataModel::PhoneticDataModel() :
 {
 }
 
-void PhoneticDataModel::setBinData( sal_Int32 nType, sal_Int32 nAlignment )
+void PhoneticDataModel::setBiffData( sal_Int32 nType, sal_Int32 nAlignment )
 {
     static const sal_Int32 spnTypeIds[] = { XML_halfwidthKatakana, XML_fullwidthKatakana, XML_hiragana, XML_noConversion };
     mnType = STATIC_ARRAY_SELECT( spnTypeIds, nType, XML_fullwidthKatakana );
@@ -219,7 +222,7 @@ void PhoneticSettings::importPhoneticPr( RecordInputStream& rStrm )
     sal_Int32 nType, nAlignment;
     rStrm >> nFontId >> nType >> nAlignment;
     maModel.mnFontId = nFontId;
-    maModel.setBinData( nType, nAlignment );
+    maModel.setBiffData( nType, nAlignment );
 }
 
 void PhoneticSettings::importPhoneticPr( BiffInputStream& rStrm )
@@ -227,7 +230,7 @@ void PhoneticSettings::importPhoneticPr( BiffInputStream& rStrm )
     sal_uInt16 nFontId, nFlags;
     rStrm >> nFontId >> nFlags;
     maModel.mnFontId = nFontId;
-    maModel.setBinData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
+    maModel.setBiffData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
     // following: range list with cells showing phonetic text
 }
 
@@ -236,7 +239,7 @@ void PhoneticSettings::importStringData( RecordInputStream& rStrm )
     sal_uInt16 nFontId, nFlags;
     rStrm >> nFontId >> nFlags;
     maModel.mnFontId = nFontId;
-    maModel.setBinData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
+    maModel.setBiffData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
 }
 
 void PhoneticSettings::importStringData( BiffInputStream& rStrm )
@@ -244,7 +247,7 @@ void PhoneticSettings::importStringData( BiffInputStream& rStrm )
     sal_uInt16 nFontId, nFlags;
     rStrm >> nFontId >> nFlags;
     maModel.mnFontId = nFontId;
-    maModel.setBinData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
+    maModel.setBiffData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
 }
 
 // ============================================================================
@@ -385,7 +388,7 @@ void RichString::importString( RecordInputStream& rStrm, bool bRich )
     sal_uInt8 nFlags = bRich ? rStrm.readuInt8() : 0;
     OUString aBaseText = rStrm.readString();
 
-    if( !rStrm.isEof() && getFlag( nFlags, OOBIN_STRINGFLAG_FONTS ) )
+    if( !rStrm.isEof() && getFlag( nFlags, BIFF12_STRINGFLAG_FONTS ) )
     {
         FontPortionModelList aPortions;
         aPortions.importPortions( rStrm );
@@ -396,7 +399,7 @@ void RichString::importString( RecordInputStream& rStrm, bool bRich )
         createPortion()->setText( aBaseText );
     }
 
-    if( !rStrm.isEof() && getFlag( nFlags, OOBIN_STRINGFLAG_PHONETICS ) )
+    if( !rStrm.isEof() && getFlag( nFlags, BIFF12_STRINGFLAG_PHONETICS ) )
     {
         OUString aPhoneticText = rStrm.readString();
         PhoneticPortionModelList aPortions;
@@ -610,4 +613,3 @@ void RichString::createPhoneticPortions( const ::rtl::OUString& rText, PhoneticP
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/richstringcontext.cxx b/oox/source/xls/richstringcontext.cxx
index ba022041f651..a3cfbe054406 100644
--- a/oox/source/xls/richstringcontext.cxx
+++ b/oox/source/xls/richstringcontext.cxx
@@ -26,19 +26,20 @@
  ************************************************************************/
 
 #include "oox/xls/richstringcontext.hxx"
-#include "oox/xls/stylesfragment.hxx"
 
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
+#include "oox/xls/stylesfragment.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
 
-ContextHandlerRef OoxRichStringContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef RichStringContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     if( isRootElement() )
     {
@@ -65,7 +66,7 @@ ContextHandlerRef OoxRichStringContext::onCreateContext( sal_Int32 nElement, con
             {
                 case XLS_TOKEN( rPr ):
                     if( mxPortion.get() )
-                        return new OoxFontContext( *this, mxPortion->createFont() );
+                        return new FontContext( *this, mxPortion->createFont() );
                 break;
 
                 case XLS_TOKEN( t ):
@@ -84,7 +85,7 @@ ContextHandlerRef OoxRichStringContext::onCreateContext( sal_Int32 nElement, con
     return 0;
 }
 
-void OoxRichStringContext::onCharacters( const OUString& rChars )
+void RichStringContext::onCharacters( const OUString& rChars )
 {
     if( isCurrentElement( XLS_TOKEN( t ) ) ) switch( getParentElement() )
     {
@@ -102,4 +103,3 @@ void OoxRichStringContext::onCharacters( const OUString& rChars )
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/scenariobuffer.cxx b/oox/source/xls/scenariobuffer.cxx
index a4a2627f3efb..2c55d2fab4e5 100644
--- a/oox/source/xls/scenariobuffer.cxx
+++ b/oox/source/xls/scenariobuffer.cxx
@@ -26,39 +26,34 @@
  ************************************************************************/
 
 #include "oox/xls/scenariobuffer.hxx"
+
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include "properties.hxx"
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/helper/recordinputstream.hxx"
 #include "oox/xls/addressconverter.hxx"
 #include "oox/xls/biffinputstream.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::sheet::XScenario;
-using ::com::sun::star::sheet::XScenarios;
-using ::com::sun::star::sheet::XScenariosSupplier;
-using ::com::sun::star::sheet::XSpreadsheet;
+#include "properties.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
 namespace {
 
 const sal_Int32 BIFF_SCENARIO_DELETED       = 0x4000;
@@ -303,4 +298,3 @@ void ScenarioBuffer::finalizeImport()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/scenariocontext.cxx b/oox/source/xls/scenariocontext.cxx
index 8d1341688a74..1ecb8ce1fe59 100644
--- a/oox/source/xls/scenariocontext.cxx
+++ b/oox/source/xls/scenariocontext.cxx
@@ -26,22 +26,25 @@
  ************************************************************************/
 
 #include "oox/xls/scenariocontext.hxx"
-#include "oox/xls/scenariobuffer.hxx"
 
-using ::oox::core::ContextHandlerRef;
+#include "oox/xls/scenariobuffer.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
-OoxScenarioContext::OoxScenarioContext( OoxWorksheetContextBase& rParent, SheetScenarios& rSheetScenarios ) :
-    OoxWorksheetContextBase( rParent ),
+using ::oox::core::ContextHandlerRef;
+
+// ============================================================================
+
+ScenarioContext::ScenarioContext( WorksheetContextBase& rParent, SheetScenarios& rSheetScenarios ) :
+    WorksheetContextBase( rParent ),
     mrScenario( rSheetScenarios.createScenario() )
 {
 }
 
-ContextHandlerRef OoxScenarioContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ScenarioContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -52,24 +55,24 @@ ContextHandlerRef OoxScenarioContext::onCreateContext( sal_Int32 nElement, const
     return 0;
 }
 
-void OoxScenarioContext::onStartElement( const AttributeList& rAttribs )
+void ScenarioContext::onStartElement( const AttributeList& rAttribs )
 {
     if( isRootElement() )
         mrScenario.importScenario( rAttribs );
 }
 
-ContextHandlerRef OoxScenarioContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ScenarioContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
-        case OOBIN_ID_SCENARIO:
-            if( nRecId == OOBIN_ID_INPUTCELLS ) mrScenario.importInputCells( rStrm );
+        case BIFF12_ID_SCENARIO:
+            if( nRecId == BIFF12_ID_INPUTCELLS ) mrScenario.importInputCells( rStrm );
         break;
     }
     return 0;
 }
 
-void OoxScenarioContext::onStartRecord( RecordInputStream& rStrm )
+void ScenarioContext::onStartRecord( RecordInputStream& rStrm )
 {
     if( isRootElement() )
         mrScenario.importScenario( rStrm );
@@ -77,41 +80,41 @@ void OoxScenarioContext::onStartRecord( RecordInputStream& rStrm )
 
 // ============================================================================
 
-OoxScenariosContext::OoxScenariosContext( OoxWorksheetFragmentBase& rFragment ) :
-    OoxWorksheetContextBase( rFragment ),
+ScenariosContext::ScenariosContext( WorksheetFragmentBase& rFragment ) :
+    WorksheetContextBase( rFragment ),
     mrSheetScenarios( getScenarios().createSheetScenarios( getSheetIndex() ) )
 {
 }
 
-ContextHandlerRef OoxScenariosContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
+ContextHandlerRef ScenariosContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
 {
     switch( getCurrentElement() )
     {
         case XLS_TOKEN( scenarios ):
-            if( nElement == XLS_TOKEN( scenario ) ) return new OoxScenarioContext( *this, mrSheetScenarios );
+            if( nElement == XLS_TOKEN( scenario ) ) return new ScenarioContext( *this, mrSheetScenarios );
         break;
     }
     return 0;
 }
 
-void OoxScenariosContext::onStartElement( const AttributeList& rAttribs )
+void ScenariosContext::onStartElement( const AttributeList& rAttribs )
 {
     if( isRootElement() )
         mrSheetScenarios.importScenarios( rAttribs );
 }
 
-ContextHandlerRef OoxScenariosContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& )
+ContextHandlerRef ScenariosContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& )
 {
     switch( getCurrentElement() )
     {
-        case OOBIN_ID_SCENARIOS:
-            if( nRecId == OOBIN_ID_SCENARIO ) return new OoxScenarioContext( *this, mrSheetScenarios );
+        case BIFF12_ID_SCENARIOS:
+            if( nRecId == BIFF12_ID_SCENARIO ) return new ScenarioContext( *this, mrSheetScenarios );
         break;
     }
     return 0;
 }
 
-void OoxScenariosContext::onStartRecord( RecordInputStream& rStrm )
+void ScenariosContext::onStartRecord( RecordInputStream& rStrm )
 {
     if( isRootElement() )
         mrSheetScenarios.importScenarios( rStrm );
@@ -121,4 +124,3 @@ void OoxScenariosContext::onStartRecord( RecordInputStream& rStrm )
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/sharedformulabuffer.cxx b/oox/source/xls/sharedformulabuffer.cxx
index c95d52910bec..748a0c0576ae 100644
--- a/oox/source/xls/sharedformulabuffer.cxx
+++ b/oox/source/xls/sharedformulabuffer.cxx
@@ -26,30 +26,30 @@
  ************************************************************************/
 
 #include "oox/xls/sharedformulabuffer.hxx"
-#include 
+
 #include 
-#include "properties.hxx"
+#include 
 #include "oox/helper/propertyset.hxx"
 #include "oox/helper/recordinputstream.hxx"
 #include "oox/xls/addressconverter.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/formulaparser.hxx"
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::XFormulaTokens;
-using ::com::sun::star::sheet::XNamedRange;
+#include "properties.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
 namespace {
 
 bool operator==( const CellAddress& rAddr1, const CellAddress& rAddr2 )
@@ -212,4 +212,3 @@ void SharedFormulaBuffer::updateCachedCell( const CellAddress& rBaseAddr, const
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/sharedstringsbuffer.cxx b/oox/source/xls/sharedstringsbuffer.cxx
index f2a92ef06c0a..59d3a905bc40 100644
--- a/oox/source/xls/sharedstringsbuffer.cxx
+++ b/oox/source/xls/sharedstringsbuffer.cxx
@@ -26,16 +26,19 @@
  ************************************************************************/
 
 #include "oox/xls/sharedstringsbuffer.hxx"
-#include "oox/xls/biffinputstream.hxx"
 
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::text::XText;
+#include "oox/xls/biffinputstream.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
+// ============================================================================
+
 SharedStringsBuffer::SharedStringsBuffer( const WorkbookHelper& rHelper ) :
      WorkbookHelper( rHelper )
 {
@@ -81,4 +84,3 @@ void SharedStringsBuffer::convertString( const Reference< XText >& rxText, sal_I
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/sharedstringsfragment.cxx b/oox/source/xls/sharedstringsfragment.cxx
index b868ca08523d..041e87f52980 100644
--- a/oox/source/xls/sharedstringsfragment.cxx
+++ b/oox/source/xls/sharedstringsfragment.cxx
@@ -26,27 +26,28 @@
  ************************************************************************/
 
 #include "oox/xls/sharedstringsfragment.hxx"
-#include "oox/xls/sharedstringsbuffer.hxx"
-#include "oox/xls/richstringcontext.hxx"
 
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
+#include "oox/xls/richstringcontext.hxx"
+#include "oox/xls/sharedstringsbuffer.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
-OoxSharedStringsFragment::OoxSharedStringsFragment(
+using ::oox::core::ContextHandlerRef;
+using ::oox::core::RecordInfo;
+using ::rtl::OUString;
+
+// ============================================================================
+
+SharedStringsFragment::SharedStringsFragment(
         const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
-    OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+    WorkbookFragmentBase( rHelper, rFragmentPath )
 {
 }
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxSharedStringsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& )
+ContextHandlerRef SharedStringsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& )
 {
     switch( getCurrentElement() )
     {
@@ -57,42 +58,40 @@ ContextHandlerRef OoxSharedStringsFragment::onCreateContext( sal_Int32 nElement,
 
         case XLS_TOKEN( sst ):
             if( nElement == XLS_TOKEN( si ) )
-                return new OoxRichStringContext( *this, getSharedStrings().createRichString() );
+                return new RichStringContext( *this, getSharedStrings().createRichString() );
         break;
     }
     return 0;
 }
 
-ContextHandlerRef OoxSharedStringsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef SharedStringsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
         case XML_ROOT_CONTEXT:
-            if( nRecId == OOBIN_ID_SST )
+            if( nRecId == BIFF12_ID_SST )
                 return this;
         break;
 
-        case OOBIN_ID_SST:
-            if( nRecId == OOBIN_ID_SI )
+        case BIFF12_ID_SST:
+            if( nRecId == BIFF12_ID_SI )
                 getSharedStrings().createRichString()->importString( rStrm, true );
         break;
     }
     return 0;
 }
 
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxSharedStringsFragment::getRecordInfos() const
+const RecordInfo* SharedStringsFragment::getRecordInfos() const
 {
     static const RecordInfo spRecInfos[] =
     {
-        { OOBIN_ID_SST,     OOBIN_ID_SST + 1    },
+        { BIFF12_ID_SST,    BIFF12_ID_SST + 1   },
         { -1,               -1                  }
     };
     return spRecInfos;
 }
 
-void OoxSharedStringsFragment::finalizeImport()
+void SharedStringsFragment::finalizeImport()
 {
     getSharedStrings().finalizeImport();
 }
@@ -101,4 +100,3 @@ void OoxSharedStringsFragment::finalizeImport()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/sheetdatacontext.cxx b/oox/source/xls/sheetdatacontext.cxx
index 667d093d2cb6..e132ec74b689 100644
--- a/oox/source/xls/sheetdatacontext.cxx
+++ b/oox/source/xls/sheetdatacontext.cxx
@@ -26,11 +26,12 @@
  ************************************************************************/
 
 #include "oox/xls/sheetdatacontext.hxx"
+
+#include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/propertyset.hxx"
@@ -42,44 +43,39 @@
 #include "oox/xls/sharedformulabuffer.hxx"
 #include "oox/xls/unitconverter.hxx"
 
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::CellContentType_EMPTY;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::sheet::XFormulaTokens;
-using ::com::sun::star::sheet::XArrayFormulaTokens;
-using ::com::sun::star::text::XText;
-using ::oox::core::ContextHandlerRef;
-
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
 namespace {
 
 // record constants -----------------------------------------------------------
 
-const sal_uInt32 OOBIN_CELL_SHOWPHONETIC    = 0x01000000;
+const sal_uInt32 BIFF12_CELL_SHOWPHONETIC   = 0x01000000;
 
-const sal_uInt8 OOBIN_DATATABLE_ROW         = 0x01;
-const sal_uInt8 OOBIN_DATATABLE_2D          = 0x02;
-const sal_uInt8 OOBIN_DATATABLE_REF1DEL     = 0x04;
-const sal_uInt8 OOBIN_DATATABLE_REF2DEL     = 0x08;
+const sal_uInt8 BIFF12_DATATABLE_ROW        = 0x01;
+const sal_uInt8 BIFF12_DATATABLE_2D         = 0x02;
+const sal_uInt8 BIFF12_DATATABLE_REF1DEL    = 0x04;
+const sal_uInt8 BIFF12_DATATABLE_REF2DEL    = 0x08;
 
-const sal_uInt16 OOBIN_ROW_THICKTOP         = 0x0001;
-const sal_uInt16 OOBIN_ROW_THICKBOTTOM      = 0x0002;
-const sal_uInt16 OOBIN_ROW_COLLAPSED        = 0x0800;
-const sal_uInt16 OOBIN_ROW_HIDDEN           = 0x1000;
-const sal_uInt16 OOBIN_ROW_CUSTOMHEIGHT     = 0x2000;
-const sal_uInt16 OOBIN_ROW_CUSTOMFORMAT     = 0x4000;
-const sal_uInt8 OOBIN_ROW_SHOWPHONETIC      = 0x01;
+const sal_uInt16 BIFF12_ROW_THICKTOP        = 0x0001;
+const sal_uInt16 BIFF12_ROW_THICKBOTTOM     = 0x0002;
+const sal_uInt16 BIFF12_ROW_COLLAPSED       = 0x0800;
+const sal_uInt16 BIFF12_ROW_HIDDEN          = 0x1000;
+const sal_uInt16 BIFF12_ROW_CUSTOMHEIGHT    = 0x2000;
+const sal_uInt16 BIFF12_ROW_CUSTOMFORMAT    = 0x4000;
+const sal_uInt8 BIFF12_ROW_SHOWPHONETIC     = 0x01;
 
 const sal_uInt8 BIFF_BOOLERR_BOOL           = 0;
 const sal_uInt8 BIFF_BOOLERR_ERROR          = 1;
@@ -162,14 +158,12 @@ void ArrayFormulaContext::setTokens( const ApiTokenSequence& rTokens )
 
 // ============================================================================
 
-OoxSheetDataContext::OoxSheetDataContext( OoxWorksheetFragmentBase& rFragment ) :
-    OoxWorksheetContextBase( rFragment )
+SheetDataContext::SheetDataContext( WorksheetFragmentBase& rFragment ) :
+    WorksheetContextBase( rFragment )
 {
 }
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxSheetDataContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef SheetDataContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -186,7 +180,7 @@ ContextHandlerRef OoxSheetDataContext::onCreateContext( sal_Int32 nElement, cons
             {
                 case XLS_TOKEN( is ):
                     mxInlineStr.reset( new RichString( *this ) );
-                    return new OoxRichStringContext( *this, mxInlineStr );
+                    return new RichStringContext( *this, mxInlineStr );
                 case XLS_TOKEN( v ):
                     return this;
                 case XLS_TOKEN( f ):
@@ -198,7 +192,7 @@ ContextHandlerRef OoxSheetDataContext::onCreateContext( sal_Int32 nElement, cons
     return 0;
 }
 
-void OoxSheetDataContext::onCharacters( const OUString& rChars )
+void SheetDataContext::onCharacters( const OUString& rChars )
 {
     switch( getCurrentElement() )
     {
@@ -252,7 +246,7 @@ void OoxSheetDataContext::onCharacters( const OUString& rChars )
                     break;
 
                     default:
-                        OSL_ENSURE( false, "OoxSheetDataContext::onCharacters - unknown formula type" );
+                        OSL_ENSURE( false, "SheetDataContext::onCharacters - unknown formula type" );
                 }
             }
             catch( Exception& )
@@ -262,7 +256,7 @@ void OoxSheetDataContext::onCharacters( const OUString& rChars )
     }
 }
 
-void OoxSheetDataContext::onEndElement()
+void SheetDataContext::onEndElement()
 {
     if( isCurrentElement( XLS_TOKEN( c ) ) && maCurrCell.mxCell.is() )
     {
@@ -294,43 +288,43 @@ void OoxSheetDataContext::onEndElement()
     }
 }
 
-ContextHandlerRef OoxSheetDataContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef SheetDataContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
-        case OOBIN_ID_SHEETDATA:
+        case BIFF12_ID_SHEETDATA:
             switch( nRecId )
             {
-                case OOBIN_ID_ROW:              importRow( rStrm );                             return this;
+                case BIFF12_ID_ROW:             importRow( rStrm );                             return this;
             }
         break;
 
-        case OOBIN_ID_ROW:
+        case BIFF12_ID_ROW:
             switch( nRecId )
             {
-                case OOBIN_ID_ARRAY:            importArray( rStrm );                           break;
-                case OOBIN_ID_CELL_BOOL:        importCellBool( rStrm, CELLTYPE_VALUE );        break;
-                case OOBIN_ID_CELL_BLANK:       importCellBlank( rStrm, CELLTYPE_VALUE );       break;
-                case OOBIN_ID_CELL_DOUBLE:      importCellDouble( rStrm, CELLTYPE_VALUE );      break;
-                case OOBIN_ID_CELL_ERROR:       importCellError( rStrm, CELLTYPE_VALUE );       break;
-                case OOBIN_ID_CELL_RK:          importCellRk( rStrm, CELLTYPE_VALUE );          break;
-                case OOBIN_ID_CELL_RSTRING:     importCellRString( rStrm, CELLTYPE_VALUE );     break;
-                case OOBIN_ID_CELL_SI:          importCellSi( rStrm, CELLTYPE_VALUE );          break;
-                case OOBIN_ID_CELL_STRING:      importCellString( rStrm, CELLTYPE_VALUE );      break;
-                case OOBIN_ID_DATATABLE:        importDataTable( rStrm );                       break;
-                case OOBIN_ID_FORMULA_BOOL:     importCellBool( rStrm, CELLTYPE_FORMULA );      break;
-                case OOBIN_ID_FORMULA_DOUBLE:   importCellDouble( rStrm, CELLTYPE_FORMULA );    break;
-                case OOBIN_ID_FORMULA_ERROR:    importCellError( rStrm, CELLTYPE_FORMULA );     break;
-                case OOBIN_ID_FORMULA_STRING:   importCellString( rStrm, CELLTYPE_FORMULA );    break;
-                case OOBIN_ID_MULTCELL_BOOL:    importCellBool( rStrm, CELLTYPE_MULTI );        break;
-                case OOBIN_ID_MULTCELL_BLANK:   importCellBlank( rStrm, CELLTYPE_MULTI );       break;
-                case OOBIN_ID_MULTCELL_DOUBLE:  importCellDouble( rStrm, CELLTYPE_MULTI );      break;
-                case OOBIN_ID_MULTCELL_ERROR:   importCellError( rStrm, CELLTYPE_MULTI );       break;
-                case OOBIN_ID_MULTCELL_RK:      importCellRk( rStrm, CELLTYPE_MULTI );          break;
-                case OOBIN_ID_MULTCELL_RSTRING: importCellRString( rStrm, CELLTYPE_MULTI );     break;
-                case OOBIN_ID_MULTCELL_SI:      importCellSi( rStrm, CELLTYPE_MULTI );          break;
-                case OOBIN_ID_MULTCELL_STRING:  importCellString( rStrm, CELLTYPE_MULTI );      break;
-                case OOBIN_ID_SHAREDFMLA:       importSharedFmla( rStrm );                      break;
+                case BIFF12_ID_ARRAY:           importArray( rStrm );                           break;
+                case BIFF12_ID_CELL_BOOL:       importCellBool( rStrm, CELLTYPE_VALUE );        break;
+                case BIFF12_ID_CELL_BLANK:      importCellBlank( rStrm, CELLTYPE_VALUE );       break;
+                case BIFF12_ID_CELL_DOUBLE:     importCellDouble( rStrm, CELLTYPE_VALUE );      break;
+                case BIFF12_ID_CELL_ERROR:      importCellError( rStrm, CELLTYPE_VALUE );       break;
+                case BIFF12_ID_CELL_RK:         importCellRk( rStrm, CELLTYPE_VALUE );          break;
+                case BIFF12_ID_CELL_RSTRING:    importCellRString( rStrm, CELLTYPE_VALUE );     break;
+                case BIFF12_ID_CELL_SI:         importCellSi( rStrm, CELLTYPE_VALUE );          break;
+                case BIFF12_ID_CELL_STRING:     importCellString( rStrm, CELLTYPE_VALUE );      break;
+                case BIFF12_ID_DATATABLE:       importDataTable( rStrm );                       break;
+                case BIFF12_ID_FORMULA_BOOL:    importCellBool( rStrm, CELLTYPE_FORMULA );      break;
+                case BIFF12_ID_FORMULA_DOUBLE:  importCellDouble( rStrm, CELLTYPE_FORMULA );    break;
+                case BIFF12_ID_FORMULA_ERROR:   importCellError( rStrm, CELLTYPE_FORMULA );     break;
+                case BIFF12_ID_FORMULA_STRING:  importCellString( rStrm, CELLTYPE_FORMULA );    break;
+                case BIFF12_ID_MULTCELL_BOOL:   importCellBool( rStrm, CELLTYPE_MULTI );        break;
+                case BIFF12_ID_MULTCELL_BLANK:  importCellBlank( rStrm, CELLTYPE_MULTI );       break;
+                case BIFF12_ID_MULTCELL_DOUBLE: importCellDouble( rStrm, CELLTYPE_MULTI );      break;
+                case BIFF12_ID_MULTCELL_ERROR:  importCellError( rStrm, CELLTYPE_MULTI );       break;
+                case BIFF12_ID_MULTCELL_RK:     importCellRk( rStrm, CELLTYPE_MULTI );          break;
+                case BIFF12_ID_MULTCELL_RSTRING:importCellRString( rStrm, CELLTYPE_MULTI );     break;
+                case BIFF12_ID_MULTCELL_SI:     importCellSi( rStrm, CELLTYPE_MULTI );          break;
+                case BIFF12_ID_MULTCELL_STRING: importCellString( rStrm, CELLTYPE_MULTI );      break;
+                case BIFF12_ID_SHAREDFMLA:      importSharedFmla( rStrm );                      break;
             }
         break;
     }
@@ -339,7 +333,7 @@ ContextHandlerRef OoxSheetDataContext::onCreateRecordContext( sal_Int32 nRecId,
 
 // private --------------------------------------------------------------------
 
-void OoxSheetDataContext::importRow( const AttributeList& rAttribs )
+void SheetDataContext::importRow( const AttributeList& rAttribs )
 {
     RowModel aModel;
     aModel.mnFirstRow     = aModel.mnLastRow = rAttribs.getInteger( XML_r, -1 );
@@ -357,7 +351,7 @@ void OoxSheetDataContext::importRow( const AttributeList& rAttribs )
     setRowModel( aModel );
 }
 
-void OoxSheetDataContext::importCell( const AttributeList& rAttribs )
+void SheetDataContext::importCell( const AttributeList& rAttribs )
 {
     maCurrCell.reset();
     maCurrCell.mxCell         = getCell( rAttribs.getString( XML_r, OUString() ), &maCurrCell.maAddress );
@@ -371,7 +365,7 @@ void OoxSheetDataContext::importCell( const AttributeList& rAttribs )
         extendUsedArea( maCurrCell.maAddress );
 }
 
-void OoxSheetDataContext::importFormula( const AttributeList& rAttribs )
+void SheetDataContext::importFormula( const AttributeList& rAttribs )
 {
     maCurrCell.maFormulaRef   = rAttribs.getString( XML_ref, OUString() );
     maCurrCell.mnFormulaType  = rAttribs.getToken( XML_t, XML_normal );
@@ -384,7 +378,7 @@ void OoxSheetDataContext::importFormula( const AttributeList& rAttribs )
     maTableData.mbRef2Deleted = rAttribs.getBool( XML_del2, false );
 }
 
-void OoxSheetDataContext::importCellHeader( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellHeader( RecordInputStream& rStrm, CellType eCellType )
 {
     maCurrCell.reset();
 
@@ -400,14 +394,14 @@ void OoxSheetDataContext::importCellHeader( RecordInputStream& rStrm, CellType e
 
     maCurrCell.mxCell         = getCell( maCurrPos, &maCurrCell.maAddress );
     maCurrCell.mnXfId         = extractValue< sal_Int32 >( nXfId, 0, 24 );
-    maCurrCell.mbShowPhonetic = getFlag( nXfId, OOBIN_CELL_SHOWPHONETIC );
+    maCurrCell.mbShowPhonetic = getFlag( nXfId, BIFF12_CELL_SHOWPHONETIC );
 
     // update used area of the sheet
     if( maCurrCell.mxCell.is() )
         extendUsedArea( maCurrCell.maAddress );
 }
 
-void OoxSheetDataContext::importCellBool( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellBool( RecordInputStream& rStrm, CellType eCellType )
 {
     importCellHeader( rStrm, eCellType );
     maCurrCell.mnCellType = XML_b;
@@ -428,14 +422,14 @@ void OoxSheetDataContext::importCellBool( RecordInputStream& rStrm, CellType eCe
     setCellFormat( maCurrCell );
 }
 
-void OoxSheetDataContext::importCellBlank( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellBlank( RecordInputStream& rStrm, CellType eCellType )
 {
-    OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "OoxSheetDataContext::importCellBlank - no formula cells supported" );
+    OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellBlank - no formula cells supported" );
     importCellHeader( rStrm, eCellType );
     setCellFormat( maCurrCell );
 }
 
-void OoxSheetDataContext::importCellDouble( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellDouble( RecordInputStream& rStrm, CellType eCellType )
 {
     importCellHeader( rStrm, eCellType );
     maCurrCell.mnCellType = XML_n;
@@ -450,7 +444,7 @@ void OoxSheetDataContext::importCellDouble( RecordInputStream& rStrm, CellType e
     setCellFormat( maCurrCell );
 }
 
-void OoxSheetDataContext::importCellError( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellError( RecordInputStream& rStrm, CellType eCellType )
 {
     importCellHeader( rStrm, eCellType );
     maCurrCell.mnCellType = XML_e;
@@ -465,9 +459,9 @@ void OoxSheetDataContext::importCellError( RecordInputStream& rStrm, CellType eC
     setCellFormat( maCurrCell );
 }
 
-void OoxSheetDataContext::importCellRk( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellRk( RecordInputStream& rStrm, CellType eCellType )
 {
-    OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "OoxSheetDataContext::importCellRk - no formula cells supported" );
+    OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellRk - no formula cells supported" );
     importCellHeader( rStrm, eCellType );
     maCurrCell.mnCellType = XML_n;
     if( maCurrCell.mxCell.is() && (maCurrCell.mxCell->getType() == CellContentType_EMPTY) )
@@ -475,9 +469,9 @@ void OoxSheetDataContext::importCellRk( RecordInputStream& rStrm, CellType eCell
     setCellFormat( maCurrCell );
 }
 
-void OoxSheetDataContext::importCellRString( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellRString( RecordInputStream& rStrm, CellType eCellType )
 {
-    OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "OoxSheetDataContext::importCellRString - no formula cells supported" );
+    OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellRString - no formula cells supported" );
     importCellHeader( rStrm, eCellType );
     maCurrCell.mnCellType = XML_inlineStr;
     Reference< XText > xText( maCurrCell.mxCell, UNO_QUERY );
@@ -491,9 +485,9 @@ void OoxSheetDataContext::importCellRString( RecordInputStream& rStrm, CellType
     setCellFormat( maCurrCell );
 }
 
-void OoxSheetDataContext::importCellSi( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellSi( RecordInputStream& rStrm, CellType eCellType )
 {
-    OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "OoxSheetDataContext::importCellSi - no formula cells supported" );
+    OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellSi - no formula cells supported" );
     importCellHeader( rStrm, eCellType );
     maCurrCell.mnCellType = XML_s;
     if( maCurrCell.mxCell.is() && (maCurrCell.mxCell->getType() == CellContentType_EMPTY) )
@@ -501,7 +495,7 @@ void OoxSheetDataContext::importCellSi( RecordInputStream& rStrm, CellType eCell
     setCellFormat( maCurrCell );
 }
 
-void OoxSheetDataContext::importCellString( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellString( RecordInputStream& rStrm, CellType eCellType )
 {
     importCellHeader( rStrm, eCellType );
     maCurrCell.mnCellType = XML_inlineStr;
@@ -519,7 +513,7 @@ void OoxSheetDataContext::importCellString( RecordInputStream& rStrm, CellType e
     setCellFormat( maCurrCell );
 }
 
-void OoxSheetDataContext::importCellFormula( RecordInputStream& rStrm )
+void SheetDataContext::importCellFormula( RecordInputStream& rStrm )
 {
     rStrm.skip( 2 );
     Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, UNO_QUERY );
@@ -530,7 +524,7 @@ void OoxSheetDataContext::importCellFormula( RecordInputStream& rStrm )
     }
 }
 
-void OoxSheetDataContext::importRow( RecordInputStream& rStrm )
+void SheetDataContext::importRow( RecordInputStream& rStrm )
 {
     RowModel aModel;
 
@@ -538,23 +532,23 @@ void OoxSheetDataContext::importRow( RecordInputStream& rStrm )
     sal_uInt8 nFlags2;
     rStrm >> maCurrPos.mnRow >> aModel.mnXfId >> nHeight >> nFlags1 >> nFlags2;
 
-    // row index is 0-based in OOBIN, but RowModel expects 1-based
+    // row index is 0-based in BIFF12, but RowModel expects 1-based
     aModel.mnFirstRow     = aModel.mnLastRow = maCurrPos.mnRow + 1;
-    // row height is in twips in OOBIN, convert to points
+    // row height is in twips in BIFF12, convert to points
     aModel.mfHeight       = nHeight / 20.0;
     aModel.mnLevel        = extractValue< sal_Int32 >( nFlags1, 8, 3 );
-    aModel.mbCustomHeight = getFlag( nFlags1, OOBIN_ROW_CUSTOMHEIGHT );
-    aModel.mbCustomFormat = getFlag( nFlags1, OOBIN_ROW_CUSTOMFORMAT );
-    aModel.mbShowPhonetic = getFlag( nFlags2, OOBIN_ROW_SHOWPHONETIC );
-    aModel.mbHidden       = getFlag( nFlags1, OOBIN_ROW_HIDDEN );
-    aModel.mbCollapsed    = getFlag( nFlags1, OOBIN_ROW_COLLAPSED );
-    aModel.mbThickTop     = getFlag( nFlags1, OOBIN_ROW_THICKTOP );
-    aModel.mbThickBottom  = getFlag( nFlags1, OOBIN_ROW_THICKBOTTOM );
+    aModel.mbCustomHeight = getFlag( nFlags1, BIFF12_ROW_CUSTOMHEIGHT );
+    aModel.mbCustomFormat = getFlag( nFlags1, BIFF12_ROW_CUSTOMFORMAT );
+    aModel.mbShowPhonetic = getFlag( nFlags2, BIFF12_ROW_SHOWPHONETIC );
+    aModel.mbHidden       = getFlag( nFlags1, BIFF12_ROW_HIDDEN );
+    aModel.mbCollapsed    = getFlag( nFlags1, BIFF12_ROW_COLLAPSED );
+    aModel.mbThickTop     = getFlag( nFlags1, BIFF12_ROW_THICKTOP );
+    aModel.mbThickBottom  = getFlag( nFlags1, BIFF12_ROW_THICKBOTTOM );
     // set row properties in the current sheet
     setRowModel( aModel );
 }
 
-void OoxSheetDataContext::importArray( RecordInputStream& rStrm )
+void SheetDataContext::importArray( RecordInputStream& rStrm )
 {
     BinRange aRange;
     rStrm >> aRange;
@@ -569,12 +563,12 @@ void OoxSheetDataContext::importArray( RecordInputStream& rStrm )
     }
 }
 
-void OoxSheetDataContext::importSharedFmla( RecordInputStream& rStrm )
+void SheetDataContext::importSharedFmla( RecordInputStream& rStrm )
 {
     getSharedFormulas().importSharedFmla( rStrm, maCurrCell.maAddress );
 }
 
-void OoxSheetDataContext::importDataTable( RecordInputStream& rStrm )
+void SheetDataContext::importDataTable( RecordInputStream& rStrm )
 {
     BinRange aRange;
     rStrm >> aRange;
@@ -587,10 +581,10 @@ void OoxSheetDataContext::importDataTable( RecordInputStream& rStrm )
         rStrm >> aRef1 >> aRef2 >> nFlags;
         aModel.maRef1        = FormulaProcessorBase::generateAddress2dString( aRef1, false );
         aModel.maRef2        = FormulaProcessorBase::generateAddress2dString( aRef2, false );
-        aModel.mbRowTable    = getFlag( nFlags, OOBIN_DATATABLE_ROW );
-        aModel.mb2dTable     = getFlag( nFlags, OOBIN_DATATABLE_2D );
-        aModel.mbRef1Deleted = getFlag( nFlags, OOBIN_DATATABLE_REF1DEL );
-        aModel.mbRef2Deleted = getFlag( nFlags, OOBIN_DATATABLE_REF2DEL );
+        aModel.mbRowTable    = getFlag( nFlags, BIFF12_DATATABLE_ROW );
+        aModel.mb2dTable     = getFlag( nFlags, BIFF12_DATATABLE_2D );
+        aModel.mbRef1Deleted = getFlag( nFlags, BIFF12_DATATABLE_REF1DEL );
+        aModel.mbRef2Deleted = getFlag( nFlags, BIFF12_DATATABLE_REF2DEL );
         setTableOperation( aTableRange, aModel );
     }
 }
@@ -622,80 +616,80 @@ BiffSheetDataContext::BiffSheetDataContext( const BiffWorksheetFragmentBase& rPa
     }
 }
 
-void BiffSheetDataContext::importRecord()
+void BiffSheetDataContext::importRecord( BiffInputStream& rStrm )
 {
-    sal_uInt16 nRecId = mrStrm.getRecId();
+    sal_uInt16 nRecId = rStrm.getRecId();
     switch( nRecId )
     {
         // records in all BIFF versions
         case BIFF2_ID_ARRAY:        // #i72713#
-        case BIFF3_ID_ARRAY:        importArray();          break;
+        case BIFF3_ID_ARRAY:        importArray( rStrm );   break;
         case BIFF2_ID_BLANK:
-        case BIFF3_ID_BLANK:        importBlank();          break;
+        case BIFF3_ID_BLANK:        importBlank( rStrm );   break;
         case BIFF2_ID_BOOLERR:
-        case BIFF3_ID_BOOLERR:      importBoolErr();        break;
-        case BIFF2_ID_INTEGER:      importInteger();        break;
-        case BIFF_ID_IXFE:          mrStrm >> mnBiff2XfId;  break;
+        case BIFF3_ID_BOOLERR:      importBoolErr( rStrm ); break;
+        case BIFF2_ID_INTEGER:      importInteger( rStrm ); break;
+        case BIFF_ID_IXFE:          rStrm >> mnBiff2XfId;   break;
         case BIFF2_ID_LABEL:
-        case BIFF3_ID_LABEL:        importLabel();          break;
+        case BIFF3_ID_LABEL:        importLabel( rStrm );   break;
         case BIFF2_ID_NUMBER:
-        case BIFF3_ID_NUMBER:       importNumber();         break;
-        case BIFF_ID_RK:            importRk();             break;
+        case BIFF3_ID_NUMBER:       importNumber( rStrm );  break;
+        case BIFF_ID_RK:            importRk( rStrm );      break;
 
         // BIFF specific records
         default: switch( getBiff() )
         {
             case BIFF2: switch( nRecId )
             {
-                case BIFF2_ID_DATATABLE:    importDataTable();  break;
-                case BIFF2_ID_DATATABLE2:   importDataTable();  break;
-                case BIFF2_ID_FORMULA:      importFormula();    break;
-                case BIFF2_ID_ROW:          importRow();        break;
+                case BIFF2_ID_DATATABLE:    importDataTable( rStrm );   break;
+                case BIFF2_ID_DATATABLE2:   importDataTable( rStrm );   break;
+                case BIFF2_ID_FORMULA:      importFormula( rStrm );     break;
+                case BIFF2_ID_ROW:          importRow( rStrm );         break;
             }
             break;
 
             case BIFF3: switch( nRecId )
             {
-                case BIFF3_ID_DATATABLE:    importDataTable();  break;
-                case BIFF3_ID_FORMULA:      importFormula();    break;
-                case BIFF3_ID_ROW:          importRow();        break;
+                case BIFF3_ID_DATATABLE:    importDataTable( rStrm );   break;
+                case BIFF3_ID_FORMULA:      importFormula( rStrm );     break;
+                case BIFF3_ID_ROW:          importRow( rStrm );         break;
             }
             break;
 
             case BIFF4: switch( nRecId )
             {
-                case BIFF3_ID_DATATABLE:    importDataTable();  break;
-                case BIFF4_ID_FORMULA:      importFormula();    break;
-                case BIFF3_ID_ROW:          importRow();        break;
+                case BIFF3_ID_DATATABLE:    importDataTable( rStrm );   break;
+                case BIFF4_ID_FORMULA:      importFormula( rStrm );     break;
+                case BIFF3_ID_ROW:          importRow( rStrm );         break;
             }
             break;
 
             case BIFF5: switch( nRecId )
             {
-                case BIFF3_ID_DATATABLE:    importDataTable();  break;
+                case BIFF3_ID_DATATABLE:    importDataTable( rStrm );   break;
                 case BIFF3_ID_FORMULA:
                 case BIFF4_ID_FORMULA:
-                case BIFF5_ID_FORMULA:      importFormula();    break;
-                case BIFF_ID_MULTBLANK:     importMultBlank();  break;
-                case BIFF_ID_MULTRK:        importMultRk();     break;
-                case BIFF3_ID_ROW:          importRow();        break;
-                case BIFF_ID_RSTRING:       importLabel();      break;
-                case BIFF_ID_SHAREDFMLA:    importSharedFmla(); break;
+                case BIFF5_ID_FORMULA:      importFormula( rStrm );     break;
+                case BIFF_ID_MULTBLANK:     importMultBlank( rStrm );   break;
+                case BIFF_ID_MULTRK:        importMultRk( rStrm );      break;
+                case BIFF3_ID_ROW:          importRow( rStrm );         break;
+                case BIFF_ID_RSTRING:       importLabel( rStrm );       break;
+                case BIFF_ID_SHAREDFMLA:    importSharedFmla( rStrm );  break;
             }
             break;
 
             case BIFF8: switch( nRecId )
             {
-                case BIFF3_ID_DATATABLE:    importDataTable();  break;
+                case BIFF3_ID_DATATABLE:    importDataTable( rStrm );   break;
                 case BIFF3_ID_FORMULA:
                 case BIFF4_ID_FORMULA:
-                case BIFF5_ID_FORMULA:      importFormula();    break;
-                case BIFF_ID_LABELSST:      importLabelSst();   break;
-                case BIFF_ID_MULTBLANK:     importMultBlank();  break;
-                case BIFF_ID_MULTRK:        importMultRk();     break;
-                case BIFF3_ID_ROW:          importRow();        break;
-                case BIFF_ID_RSTRING:       importLabel();      break;
-                case BIFF_ID_SHAREDFMLA:    importSharedFmla(); break;
+                case BIFF5_ID_FORMULA:      importFormula( rStrm );     break;
+                case BIFF_ID_LABELSST:      importLabelSst( rStrm );    break;
+                case BIFF_ID_MULTBLANK:     importMultBlank( rStrm );   break;
+                case BIFF_ID_MULTRK:        importMultRk( rStrm );      break;
+                case BIFF3_ID_ROW:          importRow( rStrm );         break;
+                case BIFF_ID_RSTRING:       importLabel( rStrm );       break;
+                case BIFF_ID_SHAREDFMLA:    importSharedFmla( rStrm );  break;
             }
             break;
 
@@ -715,44 +709,44 @@ void BiffSheetDataContext::setCurrCell( const BinAddress& rAddr )
         extendUsedArea( maCurrCell.maAddress );
 }
 
-void BiffSheetDataContext::importXfId( bool bBiff2 )
+void BiffSheetDataContext::importXfId( BiffInputStream& rStrm, bool bBiff2 )
 {
     if( bBiff2 )
     {
         sal_uInt8 nBiff2XfId;
-        mrStrm >> nBiff2XfId;
-        mrStrm.skip( 2 );
+        rStrm >> nBiff2XfId;
+        rStrm.skip( 2 );
         maCurrCell.mnXfId = nBiff2XfId & BIFF2_XF_MASK;
         if( maCurrCell.mnXfId == BIFF2_XF_EXTENDED_IDS )
             maCurrCell.mnXfId = mnBiff2XfId;
     }
     else
     {
-        maCurrCell.mnXfId = mrStrm.readuInt16();
+        maCurrCell.mnXfId = rStrm.readuInt16();
     }
 }
 
-void BiffSheetDataContext::importCellHeader( bool bBiff2 )
+void BiffSheetDataContext::importCellHeader( BiffInputStream& rStrm, bool bBiff2 )
 {
     BinAddress aAddr;
-    mrStrm >> aAddr;
+    rStrm >> aAddr;
     setCurrCell( aAddr );
-    importXfId( bBiff2 );
+    importXfId( rStrm, bBiff2 );
 }
 
-void BiffSheetDataContext::importBlank()
+void BiffSheetDataContext::importBlank( BiffInputStream& rStrm )
 {
-    importCellHeader( mrStrm.getRecId() == BIFF2_ID_BLANK );
+    importCellHeader( rStrm, rStrm.getRecId() == BIFF2_ID_BLANK );
     setCellFormat( maCurrCell );
 }
 
-void BiffSheetDataContext::importBoolErr()
+void BiffSheetDataContext::importBoolErr( BiffInputStream& rStrm )
 {
-    importCellHeader( mrStrm.getRecId() == BIFF2_ID_BOOLERR );
+    importCellHeader( rStrm, rStrm.getRecId() == BIFF2_ID_BOOLERR );
     if( maCurrCell.mxCell.is() )
     {
         sal_uInt8 nValue, nType;
-        mrStrm >> nValue >> nType;
+        rStrm >> nValue >> nType;
         switch( nType )
         {
             case BIFF_BOOLERR_BOOL:
@@ -772,33 +766,33 @@ void BiffSheetDataContext::importBoolErr()
     setCellFormat( maCurrCell );
 }
 
-void BiffSheetDataContext::importFormula()
+void BiffSheetDataContext::importFormula( BiffInputStream& rStrm )
 {
-    importCellHeader( getBiff() == BIFF2 );
+    importCellHeader( rStrm, getBiff() == BIFF2 );
     maCurrCell.mnCellType = XML_n;
     Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, UNO_QUERY );
     if( xTokens.is() )
     {
-        mrStrm.skip( mnFormulaIgnoreSize );
+        rStrm.skip( mnFormulaIgnoreSize );
         ExtCellFormulaContext aContext( *this, xTokens, maCurrCell.maAddress );
-        getFormulaParser().importFormula( aContext, mrStrm );
+        getFormulaParser().importFormula( aContext, rStrm );
     }
     setCellFormat( maCurrCell );
 }
 
-void BiffSheetDataContext::importInteger()
+void BiffSheetDataContext::importInteger( BiffInputStream& rStrm )
 {
-    importCellHeader( true );
+    importCellHeader( rStrm, true );
     maCurrCell.mnCellType = XML_n;
     if( maCurrCell.mxCell.is() )
-        maCurrCell.mxCell->setValue( mrStrm.readuInt16() );
+        maCurrCell.mxCell->setValue( rStrm.readuInt16() );
     setCellFormat( maCurrCell );
 }
 
-void BiffSheetDataContext::importLabel()
+void BiffSheetDataContext::importLabel( BiffInputStream& rStrm )
 {
-    bool bBiff2Xf = mrStrm.getRecId() == BIFF2_ID_LABEL;
-    importCellHeader( bBiff2Xf );
+    bool bBiff2Xf = rStrm.getRecId() == BIFF2_ID_LABEL;
+    importCellHeader( rStrm, bBiff2Xf );
     maCurrCell.mnCellType = XML_inlineStr;
     Reference< XText > xText( maCurrCell.mxCell, UNO_QUERY );
     if( xText.is() )
@@ -813,7 +807,7 @@ void BiffSheetDataContext::importLabel()
         RichString aString( *this );
         if( getBiff() == BIFF8 )
         {
-            aString.importUniString( mrStrm );
+            aString.importUniString( rStrm );
         }
         else
         {
@@ -822,8 +816,8 @@ void BiffSheetDataContext::importLabel()
             if( const Font* pFont = getStyles().getFontFromCellXf( maCurrCell.mnXfId ).get() )
                 eTextEnc = pFont->getFontEncoding();
             BiffStringFlags nFlags = bBiff2Xf ? BIFF_STR_8BITLENGTH : BIFF_STR_DEFAULT;
-            setFlag( nFlags, BIFF_STR_EXTRAFONTS, mrStrm.getRecId() == BIFF_ID_RSTRING );
-            aString.importByteString( mrStrm, eTextEnc, nFlags );
+            setFlag( nFlags, BIFF_STR_EXTRAFONTS, rStrm.getRecId() == BIFF_ID_RSTRING );
+            aString.importByteString( rStrm, eTextEnc, nFlags );
         }
         aString.finalizeImport();
         aString.convert( xText, maCurrCell.mnXfId );
@@ -831,81 +825,81 @@ void BiffSheetDataContext::importLabel()
     setCellFormat( maCurrCell );
 }
 
-void BiffSheetDataContext::importLabelSst()
+void BiffSheetDataContext::importLabelSst( BiffInputStream& rStrm )
 {
-    importCellHeader( false );
+    importCellHeader( rStrm, false );
     maCurrCell.mnCellType = XML_s;
     if( maCurrCell.mxCell.is() )
-        setSharedStringCell( maCurrCell.mxCell, mrStrm.readInt32(), maCurrCell.mnXfId );
+        setSharedStringCell( maCurrCell.mxCell, rStrm.readInt32(), maCurrCell.mnXfId );
     setCellFormat( maCurrCell );
 }
 
-void BiffSheetDataContext::importMultBlank()
+void BiffSheetDataContext::importMultBlank( BiffInputStream& rStrm )
 {
     BinAddress aAddr;
-    for( mrStrm >> aAddr; mrStrm.getRemaining() > 2; ++aAddr.mnCol )
+    for( rStrm >> aAddr; rStrm.getRemaining() > 2; ++aAddr.mnCol )
     {
         setCurrCell( aAddr );
-        importXfId( false );
+        importXfId( rStrm, false );
         setCellFormat( maCurrCell );
     }
 }
 
-void BiffSheetDataContext::importMultRk()
+void BiffSheetDataContext::importMultRk( BiffInputStream& rStrm )
 {
     BinAddress aAddr;
-    for( mrStrm >> aAddr; mrStrm.getRemaining() > 2; ++aAddr.mnCol )
+    for( rStrm >> aAddr; rStrm.getRemaining() > 2; ++aAddr.mnCol )
     {
         setCurrCell( aAddr );
         maCurrCell.mnCellType = XML_n;
-        importXfId( false );
-        sal_Int32 nRkValue = mrStrm.readInt32();
+        importXfId( rStrm, false );
+        sal_Int32 nRkValue = rStrm.readInt32();
         if( maCurrCell.mxCell.is() )
             maCurrCell.mxCell->setValue( BiffHelper::calcDoubleFromRk( nRkValue ) );
         setCellFormat( maCurrCell );
     }
 }
 
-void BiffSheetDataContext::importNumber()
+void BiffSheetDataContext::importNumber( BiffInputStream& rStrm )
 {
-    importCellHeader( mrStrm.getRecId() == BIFF2_ID_NUMBER );
+    importCellHeader( rStrm, rStrm.getRecId() == BIFF2_ID_NUMBER );
     maCurrCell.mnCellType = XML_n;
     if( maCurrCell.mxCell.is() )
-        maCurrCell.mxCell->setValue( mrStrm.readDouble() );
+        maCurrCell.mxCell->setValue( rStrm.readDouble() );
     setCellFormat( maCurrCell );
 }
 
-void BiffSheetDataContext::importRk()
+void BiffSheetDataContext::importRk( BiffInputStream& rStrm )
 {
-    importCellHeader( false );
+    importCellHeader( rStrm, false );
     maCurrCell.mnCellType = XML_n;
     if( maCurrCell.mxCell.is() )
-        maCurrCell.mxCell->setValue( BiffHelper::calcDoubleFromRk( mrStrm.readInt32() ) );
+        maCurrCell.mxCell->setValue( BiffHelper::calcDoubleFromRk( rStrm.readInt32() ) );
     setCellFormat( maCurrCell );
 }
 
-void BiffSheetDataContext::importRow()
+void BiffSheetDataContext::importRow( BiffInputStream& rStrm )
 {
     RowModel aModel;
 
     sal_uInt16 nRow, nHeight;
-    mrStrm >> nRow;
-    mrStrm.skip( 4 );
-    mrStrm >> nHeight;
+    rStrm >> nRow;
+    rStrm.skip( 4 );
+    rStrm >> nHeight;
     if( getBiff() == BIFF2 )
     {
-        mrStrm.skip( 2 );
-        aModel.mbCustomFormat = mrStrm.readuInt8() == BIFF2_ROW_CUSTOMFORMAT;
+        rStrm.skip( 2 );
+        aModel.mbCustomFormat = rStrm.readuInt8() == BIFF2_ROW_CUSTOMFORMAT;
         if( aModel.mbCustomFormat )
         {
-            mrStrm.skip( 5 );
-            aModel.mnXfId = mrStrm.readuInt16();
+            rStrm.skip( 5 );
+            aModel.mnXfId = rStrm.readuInt16();
         }
     }
     else
     {
-        mrStrm.skip( 4 );
-        sal_uInt32 nFlags = mrStrm.readuInt32();
+        rStrm.skip( 4 );
+        sal_uInt32 nFlags = rStrm.readuInt32();
         aModel.mnXfId         = extractValue< sal_Int32 >( nFlags, 16, 12 );
         aModel.mnLevel        = extractValue< sal_Int32 >( nFlags, 0, 3 );
         aModel.mbCustomFormat = getFlag( nFlags, BIFF_ROW_CUSTOMFORMAT );
@@ -925,52 +919,52 @@ void BiffSheetDataContext::importRow()
     setRowModel( aModel );
 }
 
-void BiffSheetDataContext::importArray()
+void BiffSheetDataContext::importArray( BiffInputStream& rStrm )
 {
     BinRange aRange;
-    aRange.read( mrStrm, false );    // columns always 8-bit
+    aRange.read( rStrm, false );    // columns always 8-bit
     CellRangeAddress aArrayRange;
     Reference< XCellRange > xRange = getCellRange( aRange, &aArrayRange );
     Reference< XArrayFormulaTokens > xTokens( xRange, UNO_QUERY );
     if( xRange.is() && xTokens.is() )
     {
-        mrStrm.skip( mnArrayIgnoreSize );
+        rStrm.skip( mnArrayIgnoreSize );
         ArrayFormulaContext aContext( xTokens, aArrayRange );
-        getFormulaParser().importFormula( aContext, mrStrm );
+        getFormulaParser().importFormula( aContext, rStrm );
     }
 }
 
-void BiffSheetDataContext::importSharedFmla()
+void BiffSheetDataContext::importSharedFmla( BiffInputStream& rStrm )
 {
-    getSharedFormulas().importSharedFmla( mrStrm, maCurrCell.maAddress );
+    getSharedFormulas().importSharedFmla( rStrm, maCurrCell.maAddress );
 }
 
-void BiffSheetDataContext::importDataTable()
+void BiffSheetDataContext::importDataTable( BiffInputStream& rStrm )
 {
     BinRange aRange;
-    aRange.read( mrStrm, false );    // columns always 8-bit
+    aRange.read( rStrm, false );    // columns always 8-bit
     CellRangeAddress aTableRange;
     if( getAddressConverter().convertToCellRange( aTableRange, aRange, getSheetIndex(), true, true ) )
     {
         DataTableModel aModel;
         BinAddress aRef1, aRef2;
-        switch( mrStrm.getRecId() )
+        switch( rStrm.getRecId() )
         {
             case BIFF2_ID_DATATABLE:
-                mrStrm.skip( 1 );
-                aModel.mbRowTable = mrStrm.readuInt8() != 0;
+                rStrm.skip( 1 );
+                aModel.mbRowTable = rStrm.readuInt8() != 0;
                 aModel.mb2dTable = false;
-                mrStrm >> aRef1;
+                rStrm >> aRef1;
             break;
             case BIFF2_ID_DATATABLE2:
-                mrStrm.skip( 2 );
+                rStrm.skip( 2 );
                 aModel.mb2dTable = true;
-                mrStrm >> aRef1 >> aRef2;
+                rStrm >> aRef1 >> aRef2;
             break;
             case BIFF3_ID_DATATABLE:
             {
                 sal_uInt16 nFlags;
-                mrStrm >> nFlags >> aRef1 >> aRef2;
+                rStrm >> nFlags >> aRef1 >> aRef2;
                 aModel.mbRowTable = getFlag( nFlags, BIFF_DATATABLE_ROW );
                 aModel.mb2dTable = getFlag( nFlags, BIFF_DATATABLE_2D );
                 aModel.mbRef1Deleted = getFlag( nFlags, BIFF_DATATABLE_REF1DEL );
@@ -990,4 +984,3 @@ void BiffSheetDataContext::importDataTable()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx
index 34cb65546b6c..36e5741818f3 100644
--- a/oox/source/xls/stylesbuffer.cxx
+++ b/oox/source/xls/stylesbuffer.cxx
@@ -78,11 +78,11 @@ namespace {
 
 // OOXML constants ------------------------------------------------------------
 
-// OOX predefined color indexes (also used in BIFF3-BIFF8)
-const sal_Int32 OOX_COLOR_USEROFFSET        = 0;        /// First user defined color in palette (OOX).
-const sal_Int32 BIFF_COLOR_USEROFFSET       = 8;        /// First user defined color in palette (BIFF).
+// OOXML predefined color indexes (also used in BIFF3-BIFF8)
+const sal_Int32 OOX_COLOR_USEROFFSET        = 0;        /// First user defined color in palette (OOXML/BIFF12).
+const sal_Int32 BIFF_COLOR_USEROFFSET       = 8;        /// First user defined color in palette (BIFF3-BIFF8).
 
-// OOX font family (also used in BIFF)
+// OOXML font family (also used in BIFF)
 const sal_Int32 OOX_FONTFAMILY_NONE         = 0;
 const sal_Int32 OOX_FONTFAMILY_ROMAN        = 1;
 const sal_Int32 OOX_FONTFAMILY_SWISS        = 2;
@@ -90,102 +90,102 @@ const sal_Int32 OOX_FONTFAMILY_MODERN       = 3;
 const sal_Int32 OOX_FONTFAMILY_SCRIPT       = 4;
 const sal_Int32 OOX_FONTFAMILY_DECORATIVE   = 5;
 
-// OOX cell text direction (also used in BIFF)
+// OOXML cell text direction (also used in BIFF)
 const sal_Int32 OOX_XF_TEXTDIR_CONTEXT      = 0;
 const sal_Int32 OOX_XF_TEXTDIR_LTR          = 1;
 const sal_Int32 OOX_XF_TEXTDIR_RTL          = 2;
 
-// OOX cell rotation (also used in BIFF)
+// OOXML cell rotation (also used in BIFF)
 const sal_Int32 OOX_XF_ROTATION_NONE        = 0;
 const sal_Int32 OOX_XF_ROTATION_90CCW       = 90;
 const sal_Int32 OOX_XF_ROTATION_90CW        = 180;
 const sal_Int32 OOX_XF_ROTATION_STACKED     = 255;
 
-// OOX cell indentation
+// OOXML cell indentation
 const sal_Int32 OOX_XF_INDENT_NONE          = 0;
 
-// OOX built-in cell styles (also used in BIFF)
+// OOXML built-in cell styles (also used in BIFF)
 const sal_Int32 OOX_STYLE_NORMAL            = 0;        /// Default cell style.
 const sal_Int32 OOX_STYLE_ROWLEVEL          = 1;        /// RowLevel_x cell style.
 const sal_Int32 OOX_STYLE_COLLEVEL          = 2;        /// ColLevel_x cell style.
 
 const sal_Int32 OOX_STYLE_LEVELCOUNT        = 7;        /// Number of outline level styles.
 
-// OOBIN constants ------------------------------------------------------------
-
-// OOBIN color types
-const sal_uInt8 OOBIN_COLOR_AUTO            = 0;
-const sal_uInt8 OOBIN_COLOR_INDEXED         = 1;
-const sal_uInt8 OOBIN_COLOR_RGB             = 2;
-const sal_uInt8 OOBIN_COLOR_THEME           = 3;
-
-// OOBIN diagonal borders
-const sal_uInt8 OOBIN_BORDER_DIAG_TLBR      = 0x01;     /// Top-left to bottom-right.
-const sal_uInt8 OOBIN_BORDER_DIAG_BLTR      = 0x02;     /// Bottom-left to top-right.
-
-// OOBIN gradient fill
-const sal_Int32 OOBIN_FILL_GRADIENT         = 40;
-
-// OOBIN XF flags
-const sal_uInt32 OOBIN_XF_WRAPTEXT          = 0x00400000;
-const sal_uInt32 OOBIN_XF_JUSTLASTLINE      = 0x00800000;
-const sal_uInt32 OOBIN_XF_SHRINK            = 0x01000000;
-const sal_uInt32 OOBIN_XF_LOCKED            = 0x10000000;
-const sal_uInt32 OOBIN_XF_HIDDEN            = 0x20000000;
-
-// OOBIN XF attribute used flags
-const sal_uInt16 OOBIN_XF_NUMFMT_USED       = 0x0001;
-const sal_uInt16 OOBIN_XF_FONT_USED         = 0x0002;
-const sal_uInt16 OOBIN_XF_ALIGN_USED        = 0x0004;
-const sal_uInt16 OOBIN_XF_BORDER_USED       = 0x0008;
-const sal_uInt16 OOBIN_XF_AREA_USED         = 0x0010;
-const sal_uInt16 OOBIN_XF_PROT_USED         = 0x0020;
-
-// OOBIN DXF constants
-const sal_uInt16 OOBIN_DXF_FILL_PATTERN     = 0;
-const sal_uInt16 OOBIN_DXF_FILL_FGCOLOR     = 1;
-const sal_uInt16 OOBIN_DXF_FILL_BGCOLOR     = 2;
-const sal_uInt16 OOBIN_DXF_FILL_GRADIENT    = 3;
-const sal_uInt16 OOBIN_DXF_FILL_STOP        = 4;
-const sal_uInt16 OOBIN_DXF_FONT_COLOR       = 5;
-const sal_uInt16 OOBIN_DXF_BORDER_TOP       = 6;
-const sal_uInt16 OOBIN_DXF_BORDER_BOTTOM    = 7;
-const sal_uInt16 OOBIN_DXF_BORDER_LEFT      = 8;
-const sal_uInt16 OOBIN_DXF_BORDER_RIGHT     = 9;
-const sal_uInt16 OOBIN_DXF_BORDER_DIAG      = 10;
-const sal_uInt16 OOBIN_DXF_BORDER_VERT      = 11;
-const sal_uInt16 OOBIN_DXF_BORDER_HOR       = 12;
-const sal_uInt16 OOBIN_DXF_BORDER_DIAGUP    = 13;
-const sal_uInt16 OOBIN_DXF_BORDER_DIAGDOWN  = 14;
-const sal_uInt16 OOBIN_DXF_FONT_NAME        = 24;
-const sal_uInt16 OOBIN_DXF_FONT_WEIGHT      = 25;
-const sal_uInt16 OOBIN_DXF_FONT_UNDERLINE   = 26;
-const sal_uInt16 OOBIN_DXF_FONT_ESCAPEMENT  = 27;
-const sal_uInt16 OOBIN_DXF_FONT_ITALIC      = 28;
-const sal_uInt16 OOBIN_DXF_FONT_STRIKE      = 29;
-const sal_uInt16 OOBIN_DXF_FONT_OUTLINE     = 30;
-const sal_uInt16 OOBIN_DXF_FONT_SHADOW      = 31;
-const sal_uInt16 OOBIN_DXF_FONT_CONDENSE    = 32;
-const sal_uInt16 OOBIN_DXF_FONT_EXTEND      = 33;
-const sal_uInt16 OOBIN_DXF_FONT_CHARSET     = 34;
-const sal_uInt16 OOBIN_DXF_FONT_FAMILY      = 35;
-const sal_uInt16 OOBIN_DXF_FONT_HEIGHT      = 36;
-const sal_uInt16 OOBIN_DXF_FONT_SCHEME      = 37;
-const sal_uInt16 OOBIN_DXF_NUMFMT_CODE      = 38;
-const sal_uInt16 OOBIN_DXF_NUMFMT_ID        = 41;
-
-// OOBIN CELLSTYLE flags
-const sal_uInt16 OOBIN_CELLSTYLE_BUILTIN    = 0x0001;
-const sal_uInt16 OOBIN_CELLSTYLE_HIDDEN     = 0x0002;
-const sal_uInt16 OOBIN_CELLSTYLE_CUSTOM     = 0x0004;
-
-// OOBIN and BIFF constants ---------------------------------------------------
+// BIFF12 constants -----------------------------------------------------------
+
+// BIFF12 color types
+const sal_uInt8 BIFF12_COLOR_AUTO           = 0;
+const sal_uInt8 BIFF12_COLOR_INDEXED        = 1;
+const sal_uInt8 BIFF12_COLOR_RGB            = 2;
+const sal_uInt8 BIFF12_COLOR_THEME          = 3;
+
+// BIFF12 diagonal borders
+const sal_uInt8 BIFF12_BORDER_DIAG_TLBR     = 0x01;     /// Top-left to bottom-right.
+const sal_uInt8 BIFF12_BORDER_DIAG_BLTR     = 0x02;     /// Bottom-left to top-right.
+
+// BIFF12 gradient fill
+const sal_Int32 BIFF12_FILL_GRADIENT        = 40;
+
+// BIFF12 XF flags
+const sal_uInt32 BIFF12_XF_WRAPTEXT         = 0x00400000;
+const sal_uInt32 BIFF12_XF_JUSTLASTLINE     = 0x00800000;
+const sal_uInt32 BIFF12_XF_SHRINK           = 0x01000000;
+const sal_uInt32 BIFF12_XF_LOCKED           = 0x10000000;
+const sal_uInt32 BIFF12_XF_HIDDEN           = 0x20000000;
+
+// BIFF12 XF attribute used flags
+const sal_uInt16 BIFF12_XF_NUMFMT_USED      = 0x0001;
+const sal_uInt16 BIFF12_XF_FONT_USED        = 0x0002;
+const sal_uInt16 BIFF12_XF_ALIGN_USED       = 0x0004;
+const sal_uInt16 BIFF12_XF_BORDER_USED      = 0x0008;
+const sal_uInt16 BIFF12_XF_AREA_USED        = 0x0010;
+const sal_uInt16 BIFF12_XF_PROT_USED        = 0x0020;
+
+// BIFF12 DXF constants
+const sal_uInt16 BIFF12_DXF_FILL_PATTERN    = 0;
+const sal_uInt16 BIFF12_DXF_FILL_FGCOLOR    = 1;
+const sal_uInt16 BIFF12_DXF_FILL_BGCOLOR    = 2;
+const sal_uInt16 BIFF12_DXF_FILL_GRADIENT   = 3;
+const sal_uInt16 BIFF12_DXF_FILL_STOP       = 4;
+const sal_uInt16 BIFF12_DXF_FONT_COLOR      = 5;
+const sal_uInt16 BIFF12_DXF_BORDER_TOP      = 6;
+const sal_uInt16 BIFF12_DXF_BORDER_BOTTOM   = 7;
+const sal_uInt16 BIFF12_DXF_BORDER_LEFT     = 8;
+const sal_uInt16 BIFF12_DXF_BORDER_RIGHT    = 9;
+const sal_uInt16 BIFF12_DXF_BORDER_DIAG     = 10;
+const sal_uInt16 BIFF12_DXF_BORDER_VERT     = 11;
+const sal_uInt16 BIFF12_DXF_BORDER_HOR      = 12;
+const sal_uInt16 BIFF12_DXF_BORDER_DIAGUP   = 13;
+const sal_uInt16 BIFF12_DXF_BORDER_DIAGDOWN = 14;
+const sal_uInt16 BIFF12_DXF_FONT_NAME       = 24;
+const sal_uInt16 BIFF12_DXF_FONT_WEIGHT     = 25;
+const sal_uInt16 BIFF12_DXF_FONT_UNDERLINE  = 26;
+const sal_uInt16 BIFF12_DXF_FONT_ESCAPEMENT = 27;
+const sal_uInt16 BIFF12_DXF_FONT_ITALIC     = 28;
+const sal_uInt16 BIFF12_DXF_FONT_STRIKE     = 29;
+const sal_uInt16 BIFF12_DXF_FONT_OUTLINE    = 30;
+const sal_uInt16 BIFF12_DXF_FONT_SHADOW     = 31;
+const sal_uInt16 BIFF12_DXF_FONT_CONDENSE   = 32;
+const sal_uInt16 BIFF12_DXF_FONT_EXTEND     = 33;
+const sal_uInt16 BIFF12_DXF_FONT_CHARSET    = 34;
+const sal_uInt16 BIFF12_DXF_FONT_FAMILY     = 35;
+const sal_uInt16 BIFF12_DXF_FONT_HEIGHT     = 36;
+const sal_uInt16 BIFF12_DXF_FONT_SCHEME     = 37;
+const sal_uInt16 BIFF12_DXF_NUMFMT_CODE     = 38;
+const sal_uInt16 BIFF12_DXF_NUMFMT_ID       = 41;
+
+// BIFF12 CELLSTYLE flags
+const sal_uInt16 BIFF12_CELLSTYLE_BUILTIN   = 0x0001;
+const sal_uInt16 BIFF12_CELLSTYLE_HIDDEN    = 0x0002;
+const sal_uInt16 BIFF12_CELLSTYLE_CUSTOM    = 0x0004;
+
+// BIFF constants -------------------------------------------------------------
 
 // BIFF predefined color indexes
 const sal_uInt16 BIFF2_COLOR_BLACK          = 0;        /// Black (text) in BIFF2.
 const sal_uInt16 BIFF2_COLOR_WHITE          = 1;        /// White (background) in BIFF2.
 
-// BIFF font flags, also used in OOBIN
+// BIFF font flags, also used in BIFF12
 const sal_uInt16 BIFF_FONTFLAG_BOLD         = 0x0001;
 const sal_uInt16 BIFF_FONTFLAG_ITALIC       = 0x0002;
 const sal_uInt16 BIFF_FONTFLAG_UNDERLINE    = 0x0004;
@@ -197,7 +197,7 @@ const sal_uInt16 BIFF_FONTFLAG_CONDENSE     = 0x0040;
 // BIFF font weight
 const sal_uInt16 BIFF_FONTWEIGHT_BOLD       = 450;
 
-// BIFF font underline, also used in OOBIN
+// BIFF font underline, also used in BIFF12
 const sal_uInt8 BIFF_FONTUNDERL_NONE        = 0;
 const sal_uInt8 BIFF_FONTUNDERL_SINGLE      = 1;
 const sal_uInt8 BIFF_FONTUNDERL_DOUBLE      = 2;
@@ -308,7 +308,7 @@ ExcelGraphicHelper::ExcelGraphicHelper( const WorkbookHelper& rHelper ) :
 
 sal_Int32 ExcelGraphicHelper::getSchemeColor( sal_Int32 nToken ) const
 {
-    if( getFilterType() == FILTER_OOX )
+    if( getFilterType() == FILTER_OOXML )
         return getTheme().getColorByToken( nToken );
     return GraphicHelper::getSchemeColor( nToken );
 }
@@ -382,18 +382,18 @@ void Color::importColor( RecordInputStream& rStrm )
 
     switch( extractValue< sal_uInt8 >( nFlags, 1, 7 ) )
     {
-        case OOBIN_COLOR_AUTO:
+        case BIFF12_COLOR_AUTO:
             setAuto();
             rStrm.skip( 4 );
         break;
-        case OOBIN_COLOR_INDEXED:
+        case BIFF12_COLOR_INDEXED:
             setIndexed( nIndex, fTint );
             rStrm.skip( 4 );
         break;
-        case OOBIN_COLOR_RGB:
+        case BIFF12_COLOR_RGB:
             setRgb( lclReadRgbColor( rStrm ), fTint );
         break;
-        case OOBIN_COLOR_THEME:
+        case BIFF12_COLOR_THEME:
             setTheme( nIndex, fTint );
             rStrm.skip( 4 );
         break;
@@ -468,7 +468,7 @@ static const sal_Int32 spnDefColors5[] =
 /* 56 */    0x1D2FBE, 0x286676, 0x004500, 0x453E01, 0x6A2813, 0x85396A, 0x4A3285, 0x424242
 };
 
-/** Default color table for BIFF8/OOX. */
+/** Default color table for BIFF8/BIFF12/OOXML. */
 static const sal_Int32 spnDefColors8[] =
 {
 /*  0 */    PALETTE_EGA_COLORS_LIGHT,
@@ -494,7 +494,7 @@ ColorPalette::ColorPalette( const WorkbookHelper& rHelper ) :
     // default colors
     switch( getFilterType() )
     {
-        case FILTER_OOX:
+        case FILTER_OOXML:
             maColors.insert( maColors.begin(), spnDefColors8, STATIC_ARRAY_END( spnDefColors8 ) );
             mnAppendIndex = OOX_COLOR_USEROFFSET;
         break;
@@ -624,7 +624,7 @@ FontModel::FontModel() :
 {
 }
 
-void FontModel::setBinScheme( sal_uInt8 nScheme )
+void FontModel::setBiff12Scheme( sal_uInt8 nScheme )
 {
     static const sal_Int32 spnSchemes[] = { XML_none, XML_major, XML_minor };
     mnScheme = STATIC_ARRAY_SELECT( spnSchemes, nScheme, XML_none );
@@ -802,15 +802,15 @@ void Font::importFont( RecordInputStream& rStrm )
     rStrm.skip( 1 );
     rStrm >> maModel.maColor >> nScheme >> maModel.maName;
 
-    // equal constants in BIFF and OOBIN for weight, underline, and escapement
-    maModel.setBinScheme( nScheme );
+    // equal constants in all BIFFs for weight, underline, and escapement
+    maModel.setBiff12Scheme( nScheme );
     maModel.setBiffHeight( nHeight );
     maModel.setBiffWeight( nWeight );
     maModel.setBiffUnderline( nUnderline );
     maModel.setBiffEscapement( nEscapement );
     maModel.mnFamily    = nFamily;
     maModel.mnCharSet   = nCharSet;
-    // equal flags in BIFF and OOBIN
+    // equal flags in all BIFFs
     maModel.mbItalic    = getFlag( nFlags, BIFF_FONTFLAG_ITALIC );
     maModel.mbStrikeout = getFlag( nFlags, BIFF_FONTFLAG_STRIKEOUT );
     maModel.mbOutline   = getFlag( nFlags, BIFF_FONTFLAG_OUTLINE );
@@ -834,7 +834,7 @@ void Font::importDxfColor( RecordInputStream& rStrm )
 void Font::importDxfScheme( RecordInputStream& rStrm )
 {
     OSL_ENSURE( mbDxf, "Font::importDxfScheme - missing conditional formatting flag" );
-    maModel.setBinScheme( rStrm.readuInt8() );
+    maModel.setBiff12Scheme( rStrm.readuInt8() );
     maUsedFlags.mbSchemeUsed = true;
 }
 
@@ -1046,7 +1046,8 @@ void Font::finalizeImport()
     // supported script types
     if( maUsedFlags.mbNameUsed )
     {
-        Reference< XDevice > xDevice = getReferenceDevice();
+        PropertySet aDocProps( getDocument() );
+        Reference< XDevice > xDevice( aDocProps.getAnyProperty( PROP_ReferenceDevice ), UNO_QUERY );
         if( xDevice.is() )
         {
             Reference< XFont2 > xFont( xDevice->getFont( maApiData.maDesc ), UNO_QUERY );
@@ -1233,7 +1234,7 @@ AlignmentModel::AlignmentModel() :
 {
 }
 
-void AlignmentModel::setBinHorAlign( sal_uInt8 nHorAlign )
+void AlignmentModel::setBiffHorAlign( sal_uInt8 nHorAlign )
 {
     static const sal_Int32 spnHorAligns[] = {
         XML_general, XML_left, XML_center, XML_right,
@@ -1241,14 +1242,14 @@ void AlignmentModel::setBinHorAlign( sal_uInt8 nHorAlign )
     mnHorAlign = STATIC_ARRAY_SELECT( spnHorAligns, nHorAlign, XML_general );
 }
 
-void AlignmentModel::setBinVerAlign( sal_uInt8 nVerAlign )
+void AlignmentModel::setBiffVerAlign( sal_uInt8 nVerAlign )
 {
     static const sal_Int32 spnVerAligns[] = {
         XML_top, XML_center, XML_bottom, XML_justify, XML_distributed };
     mnVerAlign = STATIC_ARRAY_SELECT( spnVerAligns, nVerAlign, XML_bottom );
 }
 
-void AlignmentModel::setBinTextOrient( sal_uInt8 nTextOrient )
+void AlignmentModel::setBiffTextOrient( sal_uInt8 nTextOrient )
 {
     static const sal_Int32 spnRotations[] = {
         OOX_XF_ROTATION_NONE, OOX_XF_ROTATION_STACKED,
@@ -1302,49 +1303,49 @@ void Alignment::importAlignment( const AttributeList& rAttribs )
     maModel.mbJustLastLine = rAttribs.getBool( XML_justifyLastLine, false );
 }
 
-void Alignment::setBinData( sal_uInt32 nFlags )
+void Alignment::setBiff12Data( sal_uInt32 nFlags )
 {
-    maModel.setBinHorAlign( extractValue< sal_uInt8 >( nFlags, 16, 3 ) );
-    maModel.setBinVerAlign( extractValue< sal_uInt8 >( nFlags, 19, 3 ) );
+    maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nFlags, 16, 3 ) );
+    maModel.setBiffVerAlign( extractValue< sal_uInt8 >( nFlags, 19, 3 ) );
     maModel.mnTextDir      = extractValue< sal_Int32 >( nFlags, 26, 2 );
     maModel.mnRotation     = extractValue< sal_Int32 >( nFlags, 0, 8 );
     maModel.mnIndent       = extractValue< sal_uInt8 >( nFlags, 8, 8 );
-    maModel.mbWrapText     = getFlag( nFlags, OOBIN_XF_WRAPTEXT );
-    maModel.mbShrink       = getFlag( nFlags, OOBIN_XF_SHRINK );
-    maModel.mbJustLastLine = getFlag( nFlags, OOBIN_XF_JUSTLASTLINE );
+    maModel.mbWrapText     = getFlag( nFlags, BIFF12_XF_WRAPTEXT );
+    maModel.mbShrink       = getFlag( nFlags, BIFF12_XF_SHRINK );
+    maModel.mbJustLastLine = getFlag( nFlags, BIFF12_XF_JUSTLASTLINE );
 }
 
 void Alignment::setBiff2Data( sal_uInt8 nFlags )
 {
-    maModel.setBinHorAlign( extractValue< sal_uInt8 >( nFlags, 0, 3 ) );
+    maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nFlags, 0, 3 ) );
 }
 
 void Alignment::setBiff3Data( sal_uInt16 nAlign )
 {
-    maModel.setBinHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
+    maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
     maModel.mbWrapText = getFlag( nAlign, BIFF_XF_WRAPTEXT ); // new in BIFF3
 }
 
 void Alignment::setBiff4Data( sal_uInt16 nAlign )
 {
-    maModel.setBinHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
-    maModel.setBinVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 2 ) ); // new in BIFF4
-    maModel.setBinTextOrient( extractValue< sal_uInt8 >( nAlign, 6, 2 ) ); // new in BIFF4
+    maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
+    maModel.setBiffVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 2 ) ); // new in BIFF4
+    maModel.setBiffTextOrient( extractValue< sal_uInt8 >( nAlign, 6, 2 ) ); // new in BIFF4
     maModel.mbWrapText = getFlag( nAlign, BIFF_XF_WRAPTEXT );
 }
 
 void Alignment::setBiff5Data( sal_uInt16 nAlign )
 {
-    maModel.setBinHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
-    maModel.setBinVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 3 ) );
-    maModel.setBinTextOrient( extractValue< sal_uInt8 >( nAlign, 8, 2 ) );
+    maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
+    maModel.setBiffVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 3 ) );
+    maModel.setBiffTextOrient( extractValue< sal_uInt8 >( nAlign, 8, 2 ) );
     maModel.mbWrapText = getFlag( nAlign, BIFF_XF_WRAPTEXT );
 }
 
 void Alignment::setBiff8Data( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib )
 {
-    maModel.setBinHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
-    maModel.setBinVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 3 ) );
+    maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
+    maModel.setBiffVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 3 ) );
     maModel.mnTextDir      = extractValue< sal_Int32 >( nMiscAttrib, 6, 2 ); // new in BIFF8
     maModel.mnRotation     = extractValue< sal_Int32 >( nAlign, 8, 8 ); // new in BIFF8
     maModel.mnIndent       = extractValue< sal_uInt8 >( nMiscAttrib, 0, 4 ); // new in BIFF8
@@ -1382,11 +1383,11 @@ void Alignment::finalizeImport()
     }
 
     /*  indentation: expressed as number of blocks of 3 space characters in
-        OOX, and as multiple of 10 points in BIFF. */
+        OOXML/BIFF12, and as multiple of 10 points in BIFF8. */
     sal_Int32 nIndent = 0;
     switch( getFilterType() )
     {
-        case FILTER_OOX:    nIndent = getUnitConverter().scaleToMm100( 3.0 * maModel.mnIndent, UNIT_SPACE );  break;
+        case FILTER_OOXML:  nIndent = getUnitConverter().scaleToMm100( 3.0 * maModel.mnIndent, UNIT_SPACE );  break;
         case FILTER_BIFF:   nIndent = getUnitConverter().scaleToMm100( 10.0 * maModel.mnIndent, UNIT_POINT ); break;
         case FILTER_UNKNOWN: break;
     }
@@ -1466,10 +1467,10 @@ void Protection::importProtection( const AttributeList& rAttribs )
     maModel.mbHidden = rAttribs.getBool( XML_hidden, false );
 }
 
-void Protection::setBinData( sal_uInt32 nFlags )
+void Protection::setBiff12Data( sal_uInt32 nFlags )
 {
-    maModel.mbLocked = getFlag( nFlags, OOBIN_XF_LOCKED );
-    maModel.mbHidden = getFlag( nFlags, OOBIN_XF_HIDDEN );
+    maModel.mbLocked = getFlag( nFlags, BIFF12_XF_LOCKED );
+    maModel.mbHidden = getFlag( nFlags, BIFF12_XF_HIDDEN );
 }
 
 void Protection::setBiff2Data( sal_uInt8 nNumFmt )
@@ -1655,8 +1656,8 @@ void Border::importColor( sal_Int32 nElement, const AttributeList& rAttribs )
 void Border::importBorder( RecordInputStream& rStrm )
 {
     sal_uInt8 nFlags = rStrm.readuInt8();
-    maModel.mbDiagTLtoBR = getFlag( nFlags, OOBIN_BORDER_DIAG_TLBR );
-    maModel.mbDiagBLtoTR = getFlag( nFlags, OOBIN_BORDER_DIAG_BLTR );
+    maModel.mbDiagTLtoBR = getFlag( nFlags, BIFF12_BORDER_DIAG_TLBR );
+    maModel.mbDiagBLtoTR = getFlag( nFlags, BIFF12_BORDER_DIAG_BLTR );
     maModel.maTop.setBiffStyle( rStrm.readuInt16() );
     rStrm >> maModel.maTop.maColor;
     maModel.maBottom.setBiffStyle( rStrm.readuInt16() );
@@ -1830,7 +1831,7 @@ PatternFillModel::PatternFillModel( bool bDxf ) :
     maFillColor.setIndexed( OOX_COLOR_WINDOWBACK );
 }
 
-void PatternFillModel::setBinPattern( sal_Int32 nPattern )
+void PatternFillModel::setBiffPattern( sal_Int32 nPattern )
 {
     static const sal_Int32 spnPatternIds[] = {
         XML_none, XML_solid, XML_mediumGray, XML_darkGray,
@@ -1845,8 +1846,8 @@ void PatternFillModel::setBiffData( sal_uInt16 nPatternColor, sal_uInt16 nFillCo
 {
     maPatternColor.setIndexed( nPatternColor );
     maFillColor.setIndexed( nFillColor );
-    // patterns equal in BIFF and OOBIN
-    setBinPattern( nPattern );
+    // patterns equal in all BIFFs
+    setBiffPattern( nPattern );
 }
 
 // ----------------------------------------------------------------------------
@@ -1980,7 +1981,7 @@ void Fill::importFill( RecordInputStream& rStrm )
 {
     OSL_ENSURE( !mbDxf, "Fill::importFill - unexpected conditional formatting flag" );
     sal_Int32 nPattern = rStrm.readInt32();
-    if( nPattern == OOBIN_FILL_GRADIENT )
+    if( nPattern == BIFF12_FILL_GRADIENT )
     {
         mxGradientModel.reset( new GradientFillModel );
         sal_Int32 nStopCount;
@@ -1993,7 +1994,7 @@ void Fill::importFill( RecordInputStream& rStrm )
     else
     {
         mxPatternModel.reset( new PatternFillModel( mbDxf ) );
-        mxPatternModel->setBinPattern( nPattern );
+        mxPatternModel->setBiffPattern( nPattern );
         rStrm >> mxPatternModel->maPatternColor >> mxPatternModel->maFillColor;
     }
 }
@@ -2003,7 +2004,7 @@ void Fill::importDxfPattern( RecordInputStream& rStrm )
     OSL_ENSURE( mbDxf, "Fill::importDxfPattern - missing conditional formatting flag" );
     if( !mxPatternModel )
         mxPatternModel.reset( new PatternFillModel( mbDxf ) );
-    mxPatternModel->setBinPattern( rStrm.readuInt8() );
+    mxPatternModel->setBiffPattern( rStrm.readuInt8() );
     mxPatternModel->mbPatternUsed = true;
 }
 
@@ -2103,7 +2104,7 @@ void Fill::finalizeImport()
 
     if( mxPatternModel.get() )
     {
-        // finalize the OOX data struct
+        // finalize the OOXML data struct
         PatternFillModel& rModel = *mxPatternModel;
         if( mbDxf )
         {
@@ -2264,16 +2265,16 @@ void Xf::importXf( RecordInputStream& rStrm, bool bCellXf )
     maModel.mnFillId = rStrm.readuInt16();
     maModel.mnBorderId = rStrm.readuInt16();
     sal_uInt32 nFlags = rStrm.readuInt32();
-    maAlignment.setBinData( nFlags );
-    maProtection.setBinData( nFlags );
+    maAlignment.setBiff12Data( nFlags );
+    maProtection.setBiff12Data( nFlags );
     // used flags, see comments in Xf::setBiffUsedFlags()
     sal_uInt16 nUsedFlags = rStrm.readuInt16();
-    maModel.mbFontUsed   = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_FONT_USED );
-    maModel.mbNumFmtUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_NUMFMT_USED );
-    maModel.mbAlignUsed  = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_ALIGN_USED );
-    maModel.mbProtUsed   = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_PROT_USED );
-    maModel.mbBorderUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_BORDER_USED );
-    maModel.mbAreaUsed   = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_AREA_USED );
+    maModel.mbFontUsed   = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_FONT_USED );
+    maModel.mbNumFmtUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_NUMFMT_USED );
+    maModel.mbAlignUsed  = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_ALIGN_USED );
+    maModel.mbProtUsed   = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_PROT_USED );
+    maModel.mbBorderUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_BORDER_USED );
+    maModel.mbAreaUsed   = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_AREA_USED );
 }
 
 void Xf::importXf( BiffInputStream& rStrm )
@@ -2561,28 +2562,28 @@ void Dxf::importDxf( RecordInputStream& rStrm )
         nRecEnd += nSubRecSize;
         switch( nSubRecId )
         {
-            case OOBIN_DXF_FILL_PATTERN:    createFill( false )->importDxfPattern( rStrm );                         break;
-            case OOBIN_DXF_FILL_FGCOLOR:    createFill( false )->importDxfFgColor( rStrm );                         break;
-            case OOBIN_DXF_FILL_BGCOLOR:    createFill( false )->importDxfBgColor( rStrm );                         break;
-            case OOBIN_DXF_FILL_GRADIENT:   createFill( false )->importDxfGradient( rStrm );                        break;
-            case OOBIN_DXF_FILL_STOP:       createFill( false )->importDxfStop( rStrm );                            break;
-            case OOBIN_DXF_FONT_COLOR:      createFont( false )->importDxfColor( rStrm );                           break;
-            case OOBIN_DXF_BORDER_TOP:      createBorder( false )->importDxfBorder( XLS_TOKEN( top ), rStrm );      break;
-            case OOBIN_DXF_BORDER_BOTTOM:   createBorder( false )->importDxfBorder( XLS_TOKEN( bottom ), rStrm );   break;
-            case OOBIN_DXF_BORDER_LEFT:     createBorder( false )->importDxfBorder( XLS_TOKEN( left ), rStrm );     break;
-            case OOBIN_DXF_BORDER_RIGHT:    createBorder( false )->importDxfBorder( XLS_TOKEN( right ), rStrm );    break;
-            case OOBIN_DXF_FONT_NAME:       createFont( false )->importDxfName( rStrm );                            break;
-            case OOBIN_DXF_FONT_WEIGHT:     createFont( false )->importDxfWeight( rStrm );                          break;
-            case OOBIN_DXF_FONT_UNDERLINE:  createFont( false )->importDxfUnderline( rStrm );                       break;
-            case OOBIN_DXF_FONT_ESCAPEMENT: createFont( false )->importDxfEscapement( rStrm );                      break;
-            case OOBIN_DXF_FONT_ITALIC:     createFont( false )->importDxfFlag( XML_i, rStrm );                     break;
-            case OOBIN_DXF_FONT_STRIKE:     createFont( false )->importDxfFlag( XML_strike, rStrm );                break;
-            case OOBIN_DXF_FONT_OUTLINE:    createFont( false )->importDxfFlag( XML_outline, rStrm );               break;
-            case OOBIN_DXF_FONT_SHADOW:     createFont( false )->importDxfFlag( XML_shadow, rStrm );                break;
-            case OOBIN_DXF_FONT_HEIGHT:     createFont( false )->importDxfHeight( rStrm );                          break;
-            case OOBIN_DXF_FONT_SCHEME:     createFont( false )->importDxfScheme( rStrm );                          break;
-            case OOBIN_DXF_NUMFMT_CODE:     aFmtCode = rStrm.readString( false );                                   break;
-            case OOBIN_DXF_NUMFMT_ID:       nNumFmtId = rStrm.readuInt16();                                         break;
+            case BIFF12_DXF_FILL_PATTERN:       createFill( false )->importDxfPattern( rStrm );                         break;
+            case BIFF12_DXF_FILL_FGCOLOR:       createFill( false )->importDxfFgColor( rStrm );                         break;
+            case BIFF12_DXF_FILL_BGCOLOR:       createFill( false )->importDxfBgColor( rStrm );                         break;
+            case BIFF12_DXF_FILL_GRADIENT:      createFill( false )->importDxfGradient( rStrm );                        break;
+            case BIFF12_DXF_FILL_STOP:          createFill( false )->importDxfStop( rStrm );                            break;
+            case BIFF12_DXF_FONT_COLOR:         createFont( false )->importDxfColor( rStrm );                           break;
+            case BIFF12_DXF_BORDER_TOP:         createBorder( false )->importDxfBorder( XLS_TOKEN( top ), rStrm );      break;
+            case BIFF12_DXF_BORDER_BOTTOM:      createBorder( false )->importDxfBorder( XLS_TOKEN( bottom ), rStrm );   break;
+            case BIFF12_DXF_BORDER_LEFT:        createBorder( false )->importDxfBorder( XLS_TOKEN( left ), rStrm );     break;
+            case BIFF12_DXF_BORDER_RIGHT:       createBorder( false )->importDxfBorder( XLS_TOKEN( right ), rStrm );    break;
+            case BIFF12_DXF_FONT_NAME:          createFont( false )->importDxfName( rStrm );                            break;
+            case BIFF12_DXF_FONT_WEIGHT:        createFont( false )->importDxfWeight( rStrm );                          break;
+            case BIFF12_DXF_FONT_UNDERLINE:     createFont( false )->importDxfUnderline( rStrm );                       break;
+            case BIFF12_DXF_FONT_ESCAPEMENT:    createFont( false )->importDxfEscapement( rStrm );                      break;
+            case BIFF12_DXF_FONT_ITALIC:        createFont( false )->importDxfFlag( XML_i, rStrm );                     break;
+            case BIFF12_DXF_FONT_STRIKE:        createFont( false )->importDxfFlag( XML_strike, rStrm );                break;
+            case BIFF12_DXF_FONT_OUTLINE:       createFont( false )->importDxfFlag( XML_outline, rStrm );               break;
+            case BIFF12_DXF_FONT_SHADOW:        createFont( false )->importDxfFlag( XML_shadow, rStrm );                break;
+            case BIFF12_DXF_FONT_HEIGHT:        createFont( false )->importDxfHeight( rStrm );                          break;
+            case BIFF12_DXF_FONT_SCHEME:        createFont( false )->importDxfScheme( rStrm );                          break;
+            case BIFF12_DXF_NUMFMT_CODE:        aFmtCode = rStrm.readString( false );                                   break;
+            case BIFF12_DXF_NUMFMT_ID:          nNumFmtId = rStrm.readuInt16();                                         break;
         }
         rStrm.seek( nRecEnd );
     }
@@ -2858,9 +2859,9 @@ void CellStyle::importCellStyle( RecordInputStream& rStrm )
     maModel.mnBuiltinId = rStrm.readInt8();
     maModel.mnLevel = rStrm.readInt8();
     rStrm >> maModel.maName;
-    maModel.mbBuiltin = getFlag( nFlags, OOBIN_CELLSTYLE_BUILTIN );
-    maModel.mbCustom = getFlag( nFlags, OOBIN_CELLSTYLE_CUSTOM );
-    maModel.mbHidden = getFlag( nFlags, OOBIN_CELLSTYLE_HIDDEN );
+    maModel.mbBuiltin = getFlag( nFlags, BIFF12_CELLSTYLE_BUILTIN );
+    maModel.mbCustom = getFlag( nFlags, BIFF12_CELLSTYLE_CUSTOM );
+    maModel.mbHidden = getFlag( nFlags, BIFF12_CELLSTYLE_HIDDEN );
 }
 
 void CellStyle::importStyle( BiffInputStream& rStrm )
@@ -3100,6 +3101,19 @@ OUString CellStyleBuffer::createCellStyle( const CellStyleRef& rxCellStyle ) con
 
 // ============================================================================
 
+AutoFormatModel::AutoFormatModel() :
+    mnAutoFormatId( 0 ),
+    mbApplyNumFmt( false ),
+    mbApplyFont( false ),
+    mbApplyAlignment( false ),
+    mbApplyBorder( false ),
+    mbApplyFill( false ),
+    mbApplyProtection( false )
+{
+}
+
+// ============================================================================
+
 StylesBuffer::StylesBuffer( const WorkbookHelper& rHelper ) :
     WorkbookHelper( rHelper ),
     maPalette( rHelper ),
@@ -3331,7 +3345,7 @@ bool StylesBuffer::equalBorders( sal_Int32 nBorderId1, sal_Int32 nBorderId2 ) co
 
     switch( getFilterType() )
     {
-        case FILTER_OOX:
+        case FILTER_OOXML:
             // in OOXML, borders are assumed to be unique
             return false;
 
@@ -3356,7 +3370,7 @@ bool StylesBuffer::equalFills( sal_Int32 nFillId1, sal_Int32 nFillId2 ) const
 
     switch( getFilterType() )
     {
-        case FILTER_OOX:
+        case FILTER_OOXML:
             // in OOXML, fills are assumed to be unique
             return false;
 
diff --git a/oox/source/xls/stylesfragment.cxx b/oox/source/xls/stylesfragment.cxx
index 217fce443209..1014cece5210 100644
--- a/oox/source/xls/stylesfragment.cxx
+++ b/oox/source/xls/stylesfragment.cxx
@@ -26,23 +26,26 @@
  ************************************************************************/
 
 #include "oox/xls/stylesfragment.hxx"
-#include "oox/helper/attributelist.hxx"
 
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
+#include "oox/helper/attributelist.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
-OoxIndexedColorsContext::OoxIndexedColorsContext( OoxWorkbookFragmentBase& rFragment ) :
-    OoxWorkbookContextBase( rFragment )
+using ::oox::core::ContextHandlerRef;
+using ::oox::core::RecordInfo;
+using ::rtl::OUString;
+
+// ============================================================================
+
+IndexedColorsContext::IndexedColorsContext( WorkbookFragmentBase& rFragment ) :
+    WorkbookContextBase( rFragment )
 {
 }
 
-ContextHandlerRef OoxIndexedColorsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef IndexedColorsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -53,12 +56,12 @@ ContextHandlerRef OoxIndexedColorsContext::onCreateContext( sal_Int32 nElement,
     return 0;
 }
 
-ContextHandlerRef OoxIndexedColorsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef IndexedColorsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
-        case OOBIN_ID_INDEXEDCOLORS:
-            if( nRecId == OOBIN_ID_RGBCOLOR ) getStyles().importPaletteColor( rStrm );
+        case BIFF12_ID_INDEXEDCOLORS:
+            if( nRecId == BIFF12_ID_RGBCOLOR ) getStyles().importPaletteColor( rStrm );
         break;
     }
     return 0;
@@ -66,7 +69,7 @@ ContextHandlerRef OoxIndexedColorsContext::onCreateRecordContext( sal_Int32 nRec
 
 // ============================================================================
 
-ContextHandlerRef OoxFontContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef FontContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     if( mxFont.get() )
         mxFont->importAttribs( nElement, rAttribs );
@@ -75,13 +78,13 @@ ContextHandlerRef OoxFontContext::onCreateContext( sal_Int32 nElement, const Att
 
 // ============================================================================
 
-void OoxBorderContext::onStartElement( const AttributeList& rAttribs )
+void BorderContext::onStartElement( const AttributeList& rAttribs )
 {
     if( mxBorder.get() && (getCurrentElement() == XLS_TOKEN( border )) )
         mxBorder->importBorder( rAttribs );
 }
 
-ContextHandlerRef OoxBorderContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef BorderContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     if( mxBorder.get() ) switch( getCurrentElement() )
     {
@@ -98,7 +101,7 @@ ContextHandlerRef OoxBorderContext::onCreateContext( sal_Int32 nElement, const A
 
 // ============================================================================
 
-ContextHandlerRef OoxFillContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef FillContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     if( mxFill.get() ) switch( getCurrentElement() )
     {
@@ -133,13 +136,13 @@ ContextHandlerRef OoxFillContext::onCreateContext( sal_Int32 nElement, const Att
 
 // ============================================================================
 
-void OoxXfContext::onStartElement( const AttributeList& rAttribs )
+void XfContext::onStartElement( const AttributeList& rAttribs )
 {
     if( mxXf.get() && (getCurrentElement() == XLS_TOKEN( xf )) )
         mxXf->importXf( rAttribs, mbCellXf );
 }
 
-ContextHandlerRef OoxXfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef XfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     if( mxXf.get() ) switch( getCurrentElement() )
     {
@@ -156,16 +159,16 @@ ContextHandlerRef OoxXfContext::onCreateContext( sal_Int32 nElement, const Attri
 
 // ============================================================================
 
-ContextHandlerRef OoxDxfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef DxfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     if( mxDxf.get() ) switch( getCurrentElement() )
     {
         case XLS_TOKEN( dxf ):
             switch( nElement )
             {
-                case XLS_TOKEN( font ):         return new OoxFontContext( *this, mxDxf->createFont() );
-                case XLS_TOKEN( border ):       return new OoxBorderContext( *this, mxDxf->createBorder() );
-                case XLS_TOKEN( fill ):         return new OoxFillContext( *this, mxDxf->createFill() );
+                case XLS_TOKEN( font ):         return new FontContext( *this, mxDxf->createFont() );
+                case XLS_TOKEN( border ):       return new BorderContext( *this, mxDxf->createBorder() );
+                case XLS_TOKEN( fill ):         return new FillContext( *this, mxDxf->createFill() );
 
                 case XLS_TOKEN( numFmt ):       mxDxf->importNumFmt( rAttribs );        break;
 #if 0
@@ -180,14 +183,12 @@ ContextHandlerRef OoxDxfContext::onCreateContext( sal_Int32 nElement, const Attr
 
 // ============================================================================
 
-OoxStylesFragment::OoxStylesFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
-    OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+StylesFragment::StylesFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
+    WorkbookFragmentBase( rHelper, rFragmentPath )
 {
 }
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxStylesFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef StylesFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -211,28 +212,28 @@ ContextHandlerRef OoxStylesFragment::onCreateContext( sal_Int32 nElement, const
         break;
 
         case XLS_TOKEN( colors ):
-            if( nElement == XLS_TOKEN( indexedColors ) ) return new OoxIndexedColorsContext( *this );
+            if( nElement == XLS_TOKEN( indexedColors ) ) return new IndexedColorsContext( *this );
         break;
         case XLS_TOKEN( numFmts ):
             if( nElement == XLS_TOKEN( numFmt ) ) getStyles().importNumFmt( rAttribs );
         break;
         case XLS_TOKEN( fonts ):
-            if( nElement == XLS_TOKEN( font ) ) return new OoxFontContext( *this, getStyles().createFont() );
+            if( nElement == XLS_TOKEN( font ) ) return new FontContext( *this, getStyles().createFont() );
         break;
         case XLS_TOKEN( borders ):
-            if( nElement == XLS_TOKEN( border ) ) return new OoxBorderContext( *this, getStyles().createBorder() );
+            if( nElement == XLS_TOKEN( border ) ) return new BorderContext( *this, getStyles().createBorder() );
         break;
         case XLS_TOKEN( fills ):
-            if( nElement == XLS_TOKEN( fill ) ) return new OoxFillContext( *this, getStyles().createFill() );
+            if( nElement == XLS_TOKEN( fill ) ) return new FillContext( *this, getStyles().createFill() );
         break;
         case XLS_TOKEN( cellXfs ):
-            if( nElement == XLS_TOKEN( xf ) ) return new OoxXfContext( *this, getStyles().createCellXf(), true );
+            if( nElement == XLS_TOKEN( xf ) ) return new XfContext( *this, getStyles().createCellXf(), true );
         break;
         case XLS_TOKEN( cellStyleXfs ):
-            if( nElement == XLS_TOKEN( xf ) ) return new OoxXfContext( *this, getStyles().createStyleXf(), false );
+            if( nElement == XLS_TOKEN( xf ) ) return new XfContext( *this, getStyles().createStyleXf(), false );
         break;
         case XLS_TOKEN( dxfs ):
-            if( nElement == XLS_TOKEN( dxf ) ) return new OoxDxfContext( *this, getStyles().createDxf() );
+            if( nElement == XLS_TOKEN( dxf ) ) return new DxfContext( *this, getStyles().createDxf() );
         break;
         case XLS_TOKEN( cellStyles ):
             if( nElement == XLS_TOKEN( cellStyle ) ) getStyles().importCellStyle( rAttribs );
@@ -241,85 +242,83 @@ ContextHandlerRef OoxStylesFragment::onCreateContext( sal_Int32 nElement, const
     return 0;
 }
 
-ContextHandlerRef OoxStylesFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef StylesFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
         case XML_ROOT_CONTEXT:
-            if( nRecId == OOBIN_ID_STYLESHEET ) return this;
+            if( nRecId == BIFF12_ID_STYLESHEET ) return this;
         break;
 
-        case OOBIN_ID_STYLESHEET:
+        case BIFF12_ID_STYLESHEET:
             switch( nRecId )
             {
-                case OOBIN_ID_COLORS:
-                case OOBIN_ID_NUMFMTS:
-                case OOBIN_ID_FONTS:
-                case OOBIN_ID_BORDERS:
-                case OOBIN_ID_FILLS:
-                case OOBIN_ID_CELLXFS:
-                case OOBIN_ID_CELLSTYLEXFS:
-                case OOBIN_ID_DXFS:
-                case OOBIN_ID_CELLSTYLES:   return this;
+                case BIFF12_ID_COLORS:
+                case BIFF12_ID_NUMFMTS:
+                case BIFF12_ID_FONTS:
+                case BIFF12_ID_BORDERS:
+                case BIFF12_ID_FILLS:
+                case BIFF12_ID_CELLXFS:
+                case BIFF12_ID_CELLSTYLEXFS:
+                case BIFF12_ID_DXFS:
+                case BIFF12_ID_CELLSTYLES:      return this;
             }
         break;
 
-        case OOBIN_ID_COLORS:
-            if( nRecId == OOBIN_ID_INDEXEDCOLORS ) return new OoxIndexedColorsContext( *this );
+        case BIFF12_ID_COLORS:
+            if( nRecId == BIFF12_ID_INDEXEDCOLORS ) return new IndexedColorsContext( *this );
         break;
-        case OOBIN_ID_NUMFMTS:
-            if( nRecId == OOBIN_ID_NUMFMT ) getStyles().importNumFmt( rStrm );
+        case BIFF12_ID_NUMFMTS:
+            if( nRecId == BIFF12_ID_NUMFMT ) getStyles().importNumFmt( rStrm );
         break;
-        case OOBIN_ID_FONTS:
-            if( nRecId == OOBIN_ID_FONT ) getStyles().createFont()->importFont( rStrm );
+        case BIFF12_ID_FONTS:
+            if( nRecId == BIFF12_ID_FONT ) getStyles().createFont()->importFont( rStrm );
         break;
-        case OOBIN_ID_BORDERS:
-            if( nRecId == OOBIN_ID_BORDER ) getStyles().createBorder()->importBorder( rStrm );
+        case BIFF12_ID_BORDERS:
+            if( nRecId == BIFF12_ID_BORDER ) getStyles().createBorder()->importBorder( rStrm );
         break;
-        case OOBIN_ID_FILLS:
-            if( nRecId == OOBIN_ID_FILL ) getStyles().createFill()->importFill( rStrm );
+        case BIFF12_ID_FILLS:
+            if( nRecId == BIFF12_ID_FILL ) getStyles().createFill()->importFill( rStrm );
         break;
-        case OOBIN_ID_CELLXFS:
-            if( nRecId == OOBIN_ID_XF ) getStyles().createCellXf()->importXf( rStrm, true );
+        case BIFF12_ID_CELLXFS:
+            if( nRecId == BIFF12_ID_XF ) getStyles().createCellXf()->importXf( rStrm, true );
         break;
-        case OOBIN_ID_CELLSTYLEXFS:
-            if( nRecId == OOBIN_ID_XF ) getStyles().createStyleXf()->importXf( rStrm, false );
+        case BIFF12_ID_CELLSTYLEXFS:
+            if( nRecId == BIFF12_ID_XF ) getStyles().createStyleXf()->importXf( rStrm, false );
         break;
-        case OOBIN_ID_DXFS:
-            if( nRecId == OOBIN_ID_DXF ) getStyles().createDxf()->importDxf( rStrm );
+        case BIFF12_ID_DXFS:
+            if( nRecId == BIFF12_ID_DXF ) getStyles().createDxf()->importDxf( rStrm );
         break;
-        case OOBIN_ID_CELLSTYLES:
-            if( nRecId == OOBIN_ID_CELLSTYLE ) getStyles().importCellStyle( rStrm );
+        case BIFF12_ID_CELLSTYLES:
+            if( nRecId == BIFF12_ID_CELLSTYLE ) getStyles().importCellStyle( rStrm );
         break;
     }
     return 0;
 }
 
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxStylesFragment::getRecordInfos() const
+const RecordInfo* StylesFragment::getRecordInfos() const
 {
     static const RecordInfo spRecInfos[] =
     {
-        { OOBIN_ID_BORDERS,         OOBIN_ID_BORDERS + 1        },
-        { OOBIN_ID_CELLSTYLES,      OOBIN_ID_CELLSTYLES + 1     },
-        { OOBIN_ID_CELLSTYLEXFS,    OOBIN_ID_CELLSTYLEXFS + 1   },
-        { OOBIN_ID_CELLXFS,         OOBIN_ID_CELLXFS + 1        },
-        { OOBIN_ID_COLORS,          OOBIN_ID_COLORS + 1         },
-        { OOBIN_ID_DXFS,            OOBIN_ID_DXFS + 1           },
-        { OOBIN_ID_FILLS,           OOBIN_ID_FILLS + 1          },
-        { OOBIN_ID_FONTS,           OOBIN_ID_FONTS + 1          },
-        { OOBIN_ID_INDEXEDCOLORS,   OOBIN_ID_INDEXEDCOLORS + 1  },
-        { OOBIN_ID_MRUCOLORS,       OOBIN_ID_MRUCOLORS + 1      },
-        { OOBIN_ID_NUMFMTS,         OOBIN_ID_NUMFMTS + 1        },
-        { OOBIN_ID_STYLESHEET,      OOBIN_ID_STYLESHEET + 1     },
-        { OOBIN_ID_TABLESTYLES,     OOBIN_ID_TABLESTYLES + 1    },
+        { BIFF12_ID_BORDERS,        BIFF12_ID_BORDERS + 1       },
+        { BIFF12_ID_CELLSTYLES,     BIFF12_ID_CELLSTYLES + 1    },
+        { BIFF12_ID_CELLSTYLEXFS,   BIFF12_ID_CELLSTYLEXFS + 1  },
+        { BIFF12_ID_CELLXFS,        BIFF12_ID_CELLXFS + 1       },
+        { BIFF12_ID_COLORS,         BIFF12_ID_COLORS + 1        },
+        { BIFF12_ID_DXFS,           BIFF12_ID_DXFS + 1          },
+        { BIFF12_ID_FILLS,          BIFF12_ID_FILLS + 1         },
+        { BIFF12_ID_FONTS,          BIFF12_ID_FONTS + 1         },
+        { BIFF12_ID_INDEXEDCOLORS,  BIFF12_ID_INDEXEDCOLORS + 1 },
+        { BIFF12_ID_MRUCOLORS,      BIFF12_ID_MRUCOLORS + 1     },
+        { BIFF12_ID_NUMFMTS,        BIFF12_ID_NUMFMTS + 1       },
+        { BIFF12_ID_STYLESHEET,     BIFF12_ID_STYLESHEET + 1    },
+        { BIFF12_ID_TABLESTYLES,    BIFF12_ID_TABLESTYLES + 1   },
         { -1,                       -1                          }
     };
     return spRecInfos;
 }
 
-void OoxStylesFragment::finalizeImport()
+void StylesFragment::finalizeImport()
 {
     getStyles().finalizeImport();
 }
@@ -328,4 +327,3 @@ void OoxStylesFragment::finalizeImport()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/tablebuffer.cxx b/oox/source/xls/tablebuffer.cxx
index 452df7a1171a..1d4444986adc 100644
--- a/oox/source/xls/tablebuffer.cxx
+++ b/oox/source/xls/tablebuffer.cxx
@@ -26,28 +26,29 @@
  ************************************************************************/
 
 #include "oox/xls/tablebuffer.hxx"
-#include 
+
 #include 
-#include "properties.hxx"
+#include 
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/containerhelper.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/helper/recordinputstream.hxx"
 #include "oox/xls/addressconverter.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::sheet::XDatabaseRanges;
-using ::com::sun::star::sheet::XDatabaseRange;
+#include "properties.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
 TableModel::TableModel() :
     mnId( -1 ),
     mnType( XML_worksheet ),
@@ -98,11 +99,13 @@ void Table::finalizeImport()
     if( bValidRange && (maModel.mnId > 0) && (maModel.maDisplayName.getLength() > 0) ) try
     {
         // find an unused name
-        Reference< XDatabaseRanges > xDatabaseRanges = getDatabaseRanges();
+        PropertySet aDocProps( getDocument() );
+        Reference< XDatabaseRanges > xDatabaseRanges( aDocProps.getAnyProperty( PROP_DatabaseRanges ), UNO_QUERY_THROW );
         Reference< XNameAccess > xNameAccess( xDatabaseRanges, UNO_QUERY_THROW );
         OUString aName = ContainerHelper::getUnusedName( xNameAccess, maModel.maDisplayName, '_' );
         xDatabaseRanges->addNewByName( aName, maModel.maRange );
         Reference< XDatabaseRange > xDatabaseRange( xDatabaseRanges->getByName( aName ), UNO_QUERY_THROW );
+        // get formula token index of the database range
         PropertySet aPropSet( xDatabaseRange );
         if( !aPropSet.getProperty( mnTokenIndex, PROP_TokenIndex ) )
             mnTokenIndex = -1;
@@ -153,16 +156,16 @@ TableRef TableBuffer::getTable( const OUString& rDispName ) const
 
 // private --------------------------------------------------------------------
 
-void TableBuffer::insertTable( TableRef xTable )
+void TableBuffer::insertTable( const TableRef& rxTable )
 {
-    sal_Int32 nTableId = xTable->getTableId();
-    const OUString& rDispName = xTable->getDisplayName();
+    sal_Int32 nTableId = rxTable->getTableId();
+    const OUString& rDispName = rxTable->getDisplayName();
     if( (nTableId > 0) && (rDispName.getLength() > 0) )
     {
-        OSL_ENSURE( maIdTables.find( nTableId ) == maIdTables.end(), "TableBuffer::insertTable - multiple table identifier" );
-        maIdTables[ nTableId ] = xTable;
-        OSL_ENSURE( maNameTables.find( rDispName ) == maNameTables.end(), "TableBuffer::insertTable - multiple table name" );
-        maNameTables[ rDispName ] = xTable;
+        OSL_ENSURE( !maIdTables.has( nTableId ), "TableBuffer::insertTable - multiple table identifier" );
+        maIdTables[ nTableId ] = rxTable;
+        OSL_ENSURE( !maNameTables.has( rDispName ), "TableBuffer::insertTable - multiple table name" );
+        maNameTables[ rDispName ] = rxTable;
     }
 }
 
@@ -170,4 +173,3 @@ void TableBuffer::insertTable( TableRef xTable )
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/tablefragment.cxx b/oox/source/xls/tablefragment.cxx
index 800a45cd9530..54415081a288 100644
--- a/oox/source/xls/tablefragment.cxx
+++ b/oox/source/xls/tablefragment.cxx
@@ -27,23 +27,23 @@
 
 #include "oox/xls/tablefragment.hxx"
 
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
-OoxTableFragment::OoxTableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
-    OoxWorksheetFragmentBase( rHelper, rFragmentPath )
+using ::oox::core::ContextHandlerRef;
+using ::oox::core::RecordInfo;
+using ::rtl::OUString;
+
+// ============================================================================
+
+TableFragment::TableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+    WorksheetFragmentBase( rHelper, rFragmentPath )
 {
 }
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef TableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -55,25 +55,23 @@ ContextHandlerRef OoxTableFragment::onCreateContext( sal_Int32 nElement, const A
     return 0;
 }
 
-ContextHandlerRef OoxTableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef TableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
         case XML_ROOT_CONTEXT:
-            if( nRecId == OOBIN_ID_TABLE )
+            if( nRecId == BIFF12_ID_TABLE )
                 mxTable = getTables().importTable( rStrm, getSheetIndex() );
         break;
     }
     return 0;
 }
 
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxTableFragment::getRecordInfos() const
+const RecordInfo* TableFragment::getRecordInfos() const
 {
     static const RecordInfo spRecInfos[] =
     {
-        { OOBIN_ID_TABLE,   OOBIN_ID_TABLE + 1  },
+        { BIFF12_ID_TABLE,  BIFF12_ID_TABLE + 1 },
         { -1,               -1                  }
     };
     return spRecInfos;
@@ -83,4 +81,3 @@ const RecordInfo* OoxTableFragment::getRecordInfos() const
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/themebuffer.cxx b/oox/source/xls/themebuffer.cxx
index 23617287dc57..0884dfcb0b56 100644
--- a/oox/source/xls/themebuffer.cxx
+++ b/oox/source/xls/themebuffer.cxx
@@ -26,16 +26,19 @@
  ************************************************************************/
 
 #include "oox/xls/themebuffer.hxx"
+
 #include "oox/xls/stylesbuffer.hxx"
 #include "tokens.hxx"
 
-using ::oox::drawingml::ClrScheme;
-
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using ::oox::drawingml::ClrScheme;
+
+// ============================================================================
+
 namespace {
 
 /** Specifies default theme fonts for a specific locale. */
@@ -91,7 +94,7 @@ ThemeBuffer::ThemeBuffer( const WorkbookHelper& rHelper ) :
 {
     switch( getFilterType() )
     {
-        case FILTER_OOX:
+        case FILTER_OOXML:
             //! TODO: locale dependent font name
             mxDefFontModel->maName = CREATE_OUSTRING( "Cambria" );
             mxDefFontModel->mfHeight = 11.0;
@@ -119,4 +122,3 @@ sal_Int32 ThemeBuffer::getColorByToken( sal_Int32 nToken ) const
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/unitconverter.cxx b/oox/source/xls/unitconverter.cxx
index 170a1f66f2e2..8aa9ee35a718 100644
--- a/oox/source/xls/unitconverter.cxx
+++ b/oox/source/xls/unitconverter.cxx
@@ -26,30 +26,32 @@
  ************************************************************************/
 
 #include "oox/xls/unitconverter.hxx"
-#include 
+
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
+#include 
 #include "oox/core/filterbase.hxx"
+#include "oox/helper/propertyset.hxx"
 #include "oox/xls/stylesbuffer.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::awt::FontDescriptor;
-using ::com::sun::star::awt::XDevice;
-using ::com::sun::star::awt::DeviceInfo;
-using ::com::sun::star::awt::XFont;
-using ::com::sun::star::util::Date;
-using ::com::sun::star::util::DateTime;
+#include "properties.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
 namespace {
 
 const double MM100_PER_INCH         = 2540.0;
@@ -132,7 +134,8 @@ UnitConverter::UnitConverter( const WorkbookHelper& rHelper ) :
 
 void UnitConverter::finalizeImport()
 {
-    Reference< XDevice > xDevice = getReferenceDevice();
+    PropertySet aDocProps( getDocument() );
+    Reference< XDevice > xDevice( aDocProps.getAnyProperty( PROP_ReferenceDevice ), UNO_QUERY );
     if( xDevice.is() )
     {
         // get reference device metric first, needed to get character widths below
@@ -255,4 +258,3 @@ double UnitConverter::getCoefficient( Unit eUnit ) const
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/viewsettings.cxx b/oox/source/xls/viewsettings.cxx
index 05dfa7bf9f96..0fed205c8010 100644
--- a/oox/source/xls/viewsettings.cxx
+++ b/oox/source/xls/viewsettings.cxx
@@ -26,128 +26,124 @@
  ************************************************************************/
 
 #include "oox/xls/viewsettings.hxx"
+
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include "properties.hxx"
+#include "oox/core/filterbase.hxx"
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/containerhelper.hxx"
 #include "oox/helper/propertymap.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
 #include "oox/xls/addressconverter.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/unitconverter.hxx"
 #include "oox/xls/workbooksettings.hxx"
 #include "oox/xls/worksheetbuffer.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::container::XIndexContainer;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::document::XViewDataSupplier;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::oox::core::FilterBase;
+#include "properties.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::FilterBase;
+using ::rtl::OUString;
+
+// ============================================================================
+
 namespace {
 
-const sal_Int32 OOX_BOOKVIEW_TABBARRATIO_DEF    = 600;      /// Default tabbar ratio.
-const sal_Int32 OOX_SHEETVIEW_NORMALZOOM_DEF    = 100;      /// Default zoom for normal view.
-const sal_Int32 OOX_SHEETVIEW_SHEETLAYZOOM_DEF  = 60;       /// Default zoom for pagebreak preview.
-const sal_Int32 OOX_SHEETVIEW_PAGELAYZOOM_DEF   = 100;      /// Default zoom for page layout view.
-
-const sal_uInt8 OOBIN_PANE_FROZEN               = 0x01;
-const sal_uInt8 OOBIN_PANE_FROZENNOSPLIT        = 0x02;
-
-const sal_uInt16 OOBIN_SHEETVIEW_WINPROTECTED   = 0x0001;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWFORMULAS   = 0x0002;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWGRID       = 0x0004;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWHEADINGS   = 0x0008;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWZEROS      = 0x0010;
-const sal_uInt16 OOBIN_SHEETVIEW_RIGHTTOLEFT    = 0x0020;
-const sal_uInt16 OOBIN_SHEETVIEW_SELECTED       = 0x0040;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWRULER      = 0x0080;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWOUTLINE    = 0x0100;
-const sal_uInt16 OOBIN_SHEETVIEW_DEFGRIDCOLOR   = 0x0200;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWWHITESPACE = 0x0400;
-
-const sal_uInt16 OOBIN_CHARTSHEETVIEW_SELECTED  = 0x0001;
-const sal_uInt16 OOBIN_CHARTSHEETVIEW_ZOOMTOFIT = 0x0002;
-
-const sal_uInt8 OOBIN_WBVIEW_HIDDEN             = 0x01;
-const sal_uInt8 OOBIN_WBVIEW_MINIMIZED          = 0x02;
-const sal_uInt8 OOBIN_WBVIEW_SHOWHORSCROLL      = 0x08;
-const sal_uInt8 OOBIN_WBVIEW_SHOWVERSCROLL      = 0x10;
-const sal_uInt8 OOBIN_WBVIEW_SHOWTABBAR         = 0x20;
-const sal_uInt8 OOBIN_WBVIEW_AUTOFILTERGROUP    = 0x40;
-
-const sal_uInt8 BIFF_PANE_BOTTOMRIGHT           = 0;        /// Bottom-right pane.
-const sal_uInt8 BIFF_PANE_TOPRIGHT              = 1;        /// Right, or top-right pane.
-const sal_uInt8 BIFF_PANE_BOTTOMLEFT            = 2;        /// Bottom, or bottom-left pane.
-const sal_uInt8 BIFF_PANE_TOPLEFT               = 3;        /// Single, top, left, or top-left pane.
-
-const sal_uInt16 BIFF_WINDOW1_HIDDEN            = 0x0001;
-const sal_uInt16 BIFF_WINDOW1_MINIMIZED         = 0x0002;
-const sal_uInt16 BIFF_WINDOW1_SHOWHORSCROLL     = 0x0008;
-const sal_uInt16 BIFF_WINDOW1_SHOWVERSCROLL     = 0x0010;
-const sal_uInt16 BIFF_WINDOW1_SHOWTABBAR        = 0x0020;
-
-const sal_uInt16 BIFF_WINDOW2_SHOWFORMULAS      = 0x0001;
-const sal_uInt16 BIFF_WINDOW2_SHOWGRID          = 0x0002;
-const sal_uInt16 BIFF_WINDOW2_SHOWHEADINGS      = 0x0004;
-const sal_uInt16 BIFF_WINDOW2_FROZEN            = 0x0008;
-const sal_uInt16 BIFF_WINDOW2_SHOWZEROS         = 0x0010;
-const sal_uInt16 BIFF_WINDOW2_DEFGRIDCOLOR      = 0x0020;
-const sal_uInt16 BIFF_WINDOW2_RIGHTTOLEFT       = 0x0040;
-const sal_uInt16 BIFF_WINDOW2_SHOWOUTLINE       = 0x0080;
-const sal_uInt16 BIFF_WINDOW2_FROZENNOSPLIT     = 0x0100;
-const sal_uInt16 BIFF_WINDOW2_SELECTED          = 0x0200;
-const sal_uInt16 BIFF_WINDOW2_DISPLAYED         = 0x0400;
-const sal_uInt16 BIFF_WINDOW2_PAGEBREAKMODE     = 0x0800;
+const sal_Int32 OOX_BOOKVIEW_TABBARRATIO_DEF        = 600;      /// Default tabbar ratio.
+const sal_Int32 OOX_SHEETVIEW_NORMALZOOM_DEF        = 100;      /// Default zoom for normal view.
+const sal_Int32 OOX_SHEETVIEW_SHEETLAYZOOM_DEF      = 60;       /// Default zoom for pagebreak preview.
+const sal_Int32 OOX_SHEETVIEW_PAGELAYZOOM_DEF       = 100;      /// Default zoom for page layout view.
+
+const sal_uInt8 BIFF12_PANE_FROZEN                  = 0x01;
+const sal_uInt8 BIFF12_PANE_FROZENNOSPLIT           = 0x02;
+
+const sal_uInt16 BIFF12_SHEETVIEW_WINPROTECTED      = 0x0001;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWFORMULAS      = 0x0002;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWGRID          = 0x0004;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWHEADINGS      = 0x0008;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWZEROS         = 0x0010;
+const sal_uInt16 BIFF12_SHEETVIEW_RIGHTTOLEFT       = 0x0020;
+const sal_uInt16 BIFF12_SHEETVIEW_SELECTED          = 0x0040;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWRULER         = 0x0080;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWOUTLINE       = 0x0100;
+const sal_uInt16 BIFF12_SHEETVIEW_DEFGRIDCOLOR      = 0x0200;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWWHITESPACE    = 0x0400;
+
+const sal_uInt16 BIFF12_CHARTSHEETVIEW_SELECTED     = 0x0001;
+const sal_uInt16 BIFF12_CHARTSHEETVIEW_ZOOMTOFIT    = 0x0002;
+
+const sal_uInt8 BIFF12_WBVIEW_HIDDEN                = 0x01;
+const sal_uInt8 BIFF12_WBVIEW_MINIMIZED             = 0x02;
+const sal_uInt8 BIFF12_WBVIEW_SHOWHORSCROLL         = 0x08;
+const sal_uInt8 BIFF12_WBVIEW_SHOWVERSCROLL         = 0x10;
+const sal_uInt8 BIFF12_WBVIEW_SHOWTABBAR            = 0x20;
+const sal_uInt8 BIFF12_WBVIEW_AUTOFILTERGROUP       = 0x40;
+
+const sal_uInt8 BIFF_PANE_BOTTOMRIGHT               = 0;        /// Bottom-right pane.
+const sal_uInt8 BIFF_PANE_TOPRIGHT                  = 1;        /// Right, or top-right pane.
+const sal_uInt8 BIFF_PANE_BOTTOMLEFT                = 2;        /// Bottom, or bottom-left pane.
+const sal_uInt8 BIFF_PANE_TOPLEFT                   = 3;        /// Single, top, left, or top-left pane.
+
+const sal_uInt16 BIFF_WINDOW1_HIDDEN                = 0x0001;
+const sal_uInt16 BIFF_WINDOW1_MINIMIZED             = 0x0002;
+const sal_uInt16 BIFF_WINDOW1_SHOWHORSCROLL         = 0x0008;
+const sal_uInt16 BIFF_WINDOW1_SHOWVERSCROLL         = 0x0010;
+const sal_uInt16 BIFF_WINDOW1_SHOWTABBAR            = 0x0020;
+
+const sal_uInt16 BIFF_WINDOW2_SHOWFORMULAS          = 0x0001;
+const sal_uInt16 BIFF_WINDOW2_SHOWGRID              = 0x0002;
+const sal_uInt16 BIFF_WINDOW2_SHOWHEADINGS          = 0x0004;
+const sal_uInt16 BIFF_WINDOW2_FROZEN                = 0x0008;
+const sal_uInt16 BIFF_WINDOW2_SHOWZEROS             = 0x0010;
+const sal_uInt16 BIFF_WINDOW2_DEFGRIDCOLOR          = 0x0020;
+const sal_uInt16 BIFF_WINDOW2_RIGHTTOLEFT           = 0x0040;
+const sal_uInt16 BIFF_WINDOW2_SHOWOUTLINE           = 0x0080;
+const sal_uInt16 BIFF_WINDOW2_FROZENNOSPLIT         = 0x0100;
+const sal_uInt16 BIFF_WINDOW2_SELECTED              = 0x0200;
+const sal_uInt16 BIFF_WINDOW2_DISPLAYED             = 0x0400;
+const sal_uInt16 BIFF_WINDOW2_PAGEBREAKMODE         = 0x0800;
 
 // Attention: view settings in Calc do not use com.sun.star.view.DocumentZoomType!
-const sal_Int16 API_ZOOMTYPE_PERCENT            = 0;        /// Zoom value in percent.
+const sal_Int16 API_ZOOMTYPE_PERCENT                = 0;        /// Zoom value in percent.
 
-const sal_Int32 API_ZOOMVALUE_MIN               = 20;       /// Minimum zoom in Calc.
-const sal_Int32 API_ZOOMVALUE_MAX               = 400;      /// Maximum zoom in Calc.
+const sal_Int32 API_ZOOMVALUE_MIN                   = 20;       /// Minimum zoom in Calc.
+const sal_Int32 API_ZOOMVALUE_MAX                   = 400;      /// Maximum zoom in Calc.
 
 // no predefined constants for split mode
-const sal_Int16 API_SPLITMODE_NONE              = 0;        /// No splits in window.
-const sal_Int16 API_SPLITMODE_SPLIT             = 1;        /// Window is split.
-const sal_Int16 API_SPLITMODE_FREEZE            = 2;        /// Window has frozen panes.
+const sal_Int16 API_SPLITMODE_NONE                  = 0;        /// No splits in window.
+const sal_Int16 API_SPLITMODE_SPLIT                 = 1;        /// Window is split.
+const sal_Int16 API_SPLITMODE_FREEZE                = 2;        /// Window has frozen panes.
 
 // no predefined constants for pane idetifiers
-const sal_Int16 API_SPLITPANE_TOPLEFT           = 0;        /// Top-left, or top pane.
-const sal_Int16 API_SPLITPANE_TOPRIGHT          = 1;        /// Top-right pane.
-const sal_Int16 API_SPLITPANE_BOTTOMLEFT        = 2;        /// Bottom-left, bottom, left, or single pane.
-const sal_Int16 API_SPLITPANE_BOTTOMRIGHT       = 3;        /// Bottom-right, or right pane.
+const sal_Int16 API_SPLITPANE_TOPLEFT               = 0;        /// Top-left, or top pane.
+const sal_Int16 API_SPLITPANE_TOPRIGHT              = 1;        /// Top-right pane.
+const sal_Int16 API_SPLITPANE_BOTTOMLEFT            = 2;        /// Bottom-left, bottom, left, or single pane.
+const sal_Int16 API_SPLITPANE_BOTTOMRIGHT           = 3;        /// Bottom-right, or right pane.
 
 // ----------------------------------------------------------------------------
 
-/** Returns the OOXML pane identifier from the passed OOBIN or BIFF pane id. */
-sal_Int32 lclGetOoxPaneId( sal_Int32 nBinPaneId, sal_Int32 nDefaultPaneId )
+/** Returns the OOXML pane identifier from the passed BIFF pane id. */
+sal_Int32 lclGetOoxPaneId( sal_Int32 nBiffPaneId, sal_Int32 nDefaultPaneId )
 {
     static const sal_Int32 spnPaneIds[] = { XML_bottomRight, XML_topRight, XML_bottomLeft, XML_topLeft };
-    return STATIC_ARRAY_SELECT( spnPaneIds, nBinPaneId, nDefaultPaneId );
+    return STATIC_ARRAY_SELECT( spnPaneIds, nBiffPaneId, nDefaultPaneId );
 }
 
 } // namespace
@@ -312,14 +308,14 @@ void SheetViewSettings::importSheetView( RecordInputStream& rStrm )
     rModel.maFirstPos = getAddressConverter().createValidCellAddress( aFirstPos, getSheetIndex(), false );
     static const sal_Int32 spnViewTypes[] = { XML_normal, XML_pageBreakPreview, XML_pageLayout };
     rModel.mnViewType = STATIC_ARRAY_SELECT( spnViewTypes, nViewType, XML_normal );
-    rModel.mbSelected     = getFlag( nFlags, OOBIN_SHEETVIEW_SELECTED );
-    rModel.mbRightToLeft  = getFlag( nFlags, OOBIN_SHEETVIEW_RIGHTTOLEFT );
-    rModel.mbDefGridColor = getFlag( nFlags, OOBIN_SHEETVIEW_DEFGRIDCOLOR );
-    rModel.mbShowFormulas = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWFORMULAS );
-    rModel.mbShowGrid     = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWGRID );
-    rModel.mbShowHeadings = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWHEADINGS );
-    rModel.mbShowZeros    = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWZEROS );
-    rModel.mbShowOutline  = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWOUTLINE );
+    rModel.mbSelected     = getFlag( nFlags, BIFF12_SHEETVIEW_SELECTED );
+    rModel.mbRightToLeft  = getFlag( nFlags, BIFF12_SHEETVIEW_RIGHTTOLEFT );
+    rModel.mbDefGridColor = getFlag( nFlags, BIFF12_SHEETVIEW_DEFGRIDCOLOR );
+    rModel.mbShowFormulas = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWFORMULAS );
+    rModel.mbShowGrid     = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWGRID );
+    rModel.mbShowHeadings = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWHEADINGS );
+    rModel.mbShowZeros    = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWZEROS );
+    rModel.mbShowOutline  = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWOUTLINE );
 }
 
 void SheetViewSettings::importPane( RecordInputStream& rStrm )
@@ -336,7 +332,7 @@ void SheetViewSettings::importPane( RecordInputStream& rStrm )
 
         rModel.maSecondPos    = getAddressConverter().createValidCellAddress( aSecondPos, getSheetIndex(), false );
         rModel.mnActivePaneId = lclGetOoxPaneId( nActivePaneId, XML_topLeft );
-        rModel.mnPaneState    = getFlagValue( nFlags, OOBIN_PANE_FROZEN, getFlagValue( nFlags, OOBIN_PANE_FROZENNOSPLIT, XML_frozen, XML_frozenSplit ), XML_split );
+        rModel.mnPaneState    = getFlagValue( nFlags, BIFF12_PANE_FROZEN, getFlagValue( nFlags, BIFF12_PANE_FROZENNOSPLIT, XML_frozen, XML_frozenSplit ), XML_split );
     }
 }
 
@@ -366,8 +362,8 @@ void SheetViewSettings::importChartSheetView( RecordInputStream& rStrm )
     sal_uInt16 nFlags;
     rStrm >> nFlags >> rModel.mnCurrentZoom >> rModel.mnWorkbookViewId;
 
-    rModel.mbSelected  = getFlag( nFlags, OOBIN_CHARTSHEETVIEW_SELECTED );
-    rModel.mbZoomToFit = getFlag( nFlags, OOBIN_CHARTSHEETVIEW_ZOOMTOFIT );
+    rModel.mbSelected  = getFlag( nFlags, BIFF12_CHARTSHEETVIEW_SELECTED );
+    rModel.mbZoomToFit = getFlag( nFlags, BIFF12_CHARTSHEETVIEW_ZOOMTOFIT );
 }
 
 void SheetViewSettings::importWindow2( BiffInputStream& rStrm )
@@ -662,11 +658,11 @@ void ViewSettings::importWorkbookView( RecordInputStream& rStrm )
     WorkbookViewModel& rModel = createWorkbookView();
     sal_uInt8 nFlags;
     rStrm >> rModel.mnWinX >> rModel.mnWinY >> rModel.mnWinWidth >> rModel.mnWinHeight >> rModel.mnTabBarWidth >> rModel.mnFirstVisSheet >> rModel.mnActiveSheet >> nFlags;
-    rModel.mnVisibility    = getFlagValue( nFlags, OOBIN_WBVIEW_HIDDEN, XML_hidden, XML_visible );
-    rModel.mbShowTabBar    = getFlag( nFlags, OOBIN_WBVIEW_SHOWTABBAR );
-    rModel.mbShowHorScroll = getFlag( nFlags, OOBIN_WBVIEW_SHOWHORSCROLL );
-    rModel.mbShowVerScroll = getFlag( nFlags, OOBIN_WBVIEW_SHOWVERSCROLL );
-    rModel.mbMinimized     = getFlag( nFlags, OOBIN_WBVIEW_MINIMIZED );
+    rModel.mnVisibility    = getFlagValue( nFlags, BIFF12_WBVIEW_HIDDEN, XML_hidden, XML_visible );
+    rModel.mbShowTabBar    = getFlag( nFlags, BIFF12_WBVIEW_SHOWTABBAR );
+    rModel.mbShowHorScroll = getFlag( nFlags, BIFF12_WBVIEW_SHOWHORSCROLL );
+    rModel.mbShowVerScroll = getFlag( nFlags, BIFF12_WBVIEW_SHOWVERSCROLL );
+    rModel.mbMinimized     = getFlag( nFlags, BIFF12_WBVIEW_MINIMIZED );
 }
 
 void ViewSettings::importOleSize( RecordInputStream& rStrm )
diff --git a/oox/source/xls/webquerybuffer.cxx b/oox/source/xls/webquerybuffer.cxx
deleted file mode 100644
index 2babebd4a8d7..000000000000
--- a/oox/source/xls/webquerybuffer.cxx
+++ /dev/null
@@ -1,199 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * 
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "oox/xls/webquerybuffer.hxx"
-#include "oox/helper/attributelist.hxx"
-
-#define DEBUG_OOX_WEBQUERY_BUFFER 1
-
-#if DEBUG_OOX_WEBQUERY_BUFFER
-#include 
-#endif
-
-using ::rtl::OUString;
-
-namespace oox {
-namespace xls {
-
-const sal_Int32 Connection::CONNECTION_ODBC_SOURCE    = 1;
-const sal_Int32 Connection::CONNECTION_DAO_SOURCE     = 2;
-const sal_Int32 Connection::CONNECTION_FILE_SOURCE    = 3;
-const sal_Int32 Connection::CONNECTION_WEBQUERY       = 4;
-const sal_Int32 Connection::CONNECTION_OLEDB_SOURCE   = 5;
-const sal_Int32 Connection::CONNECTION_TEXT_SOURCE    = 6;
-const sal_Int32 Connection::CONNECTION_ADO_RECORD_SET = 7;
-const sal_Int32 Connection::CONNECTION_DSP            = 8;
-
-// ============================================================================
-
-WebQueryBuffer::WebQueryBuffer( const WorkbookHelper& rHelper ) :
-    WorkbookHelper( rHelper )
-{
-    maQueryTableMap.clear();
-}
-
-void WebQueryBuffer::importQueryTable( const AttributeList& rAttribs )
-{
-    OUString aName = rAttribs.getString( XML_name, OUString() );
-    if ( !aName.getLength() )
-        return;
-
-    QueryTable aQTable;
-    aQTable.mnConnectionId = rAttribs.getInteger( XML_connectionId, 0 );
-
-    maQueryTableMap.insert( QueryTableHashMap::value_type( aName, aQTable ) );
-
-    // All documented attributes of queryTable:
-    //   adjustColumnWidth (bool)
-    //   applyAlignmentFormats (bool)
-    //   applyBorderFormats (bool)
-    //   applyFontFormats (bool)
-    //   applyNumberFormats (bool)
-    //   applyPatternFormats (bool)
-    //   applyWidthHeightFormats (bool)
-    //   autoFormatId (unsigned int)
-    //   backgroundRefresh (bool)
-    //   connectionId (unsigned int)
-    //   disableEdit (bool)
-    //   disableRefresh (bool)
-    //   fillFormulas (bool)
-    //   firstBackgroundRefresh (bool)
-    //   growShrinkType (insertClear, insertDelete, overwriteClear)
-    //   headers (bool)
-    //   intermediate (bool)
-    //   name (string)
-    //   preserveFormatting(bool)
-    //   refreshOnLoad (bool)
-    //   removeDataOnSave (bool)
-    //   rowNumbers (bool)
-}
-
-void WebQueryBuffer::importConnection( const AttributeList& rAttribs )
-{
-    if ( !rAttribs.hasAttribute( XML_id ) || !rAttribs.hasAttribute( XML_name ) )
-    {
-        mnCurConnId = -1;
-        return;
-    }
-
-    sal_uInt32 nId = rAttribs.getUnsigned( XML_id, 0 );
-    if ( maConnections.size() < (nId + 1) )
-        maConnections.resize(nId + 1);
-
-    Connection aConn;
-    aConn.maName = rAttribs.getString( XML_name, OUString() );
-    aConn.mnType = rAttribs.getInteger( XML_type, 0 );
-    maConnections[nId] = aConn;
-    mnCurConnId = nId;
-
-    // All documented attributes of connection.
-    //   background (bool)
-    //   credentials (integrated, none, prompt, stored)
-    //   deleted (bool)
-    //   description (string)
-    //   id (unsigned int)
-    //   interval (unsigned int)
-    //   keepAlive (bool)
-    //   minRefreshableVersion (unsigned byte)
-    //   name (string)
-    //   new (bool)
-    //   odcFile (string)
-    //   onlyUseConnectionFile (bool)
-    //   reconnectionMethod (unsigned int)
-    //   refreshedVersion (unsigned byte)
-    //   refreshOnLoad (bool)
-    //   saveData (bool)
-    //   savePassword (bool)
-    //   singleSignOnId (string)
-    //   sourceFile (string)
-    //   type (unsigned int)
-}
-
-void WebQueryBuffer::importWebPr( const AttributeList& rAttribs )
-{
-    if ( 0 > mnCurConnId )
-        return;
-
-    Connection& rConn = maConnections[mnCurConnId];
-    rConn.mpProperties.reset( new WebProperties );
-    WebProperties* pWebPr = static_cast< WebProperties* >( rConn.mpProperties.get() );
-    pWebPr->maURL = rAttribs.getString( XML_url, OUString() );
-
-    // All available attributes:
-    //   consecutive (bool)
-    //   editPage (string)
-    //   firstRow (bool)
-    //   htmlFormat (all, none, rtf)
-    //   htmlTables (bool)
-    //   parsePre (bool)
-    //   post (string)
-    //   sourceData (bool)
-    //   textDates (bool)
-    //   url (string)
-    //   xl2000 (bool)
-    //   xl97 (bool)
-    //   xml (bool)
-}
-
-void WebQueryBuffer::dump() const
-{
-#if DEBUG_OOX_WEBQUERY_BUFFER
-    fprintf(stdout, "----------------------------------------\n");
-    {
-        using ::std::vector;
-        vector< Connection >::const_iterator itr = maConnections.begin(), itrEnd = maConnections.end();
-        sal_Int32 nId = 0;
-        for (; itr != itrEnd; ++itr, ++nId)
-        {
-            if ( itr->mnType == Connection::CONNECTION_WEBQUERY )
-            {
-                WebProperties* pWebPr = static_cast< WebProperties* >( itr->mpProperties.get() );
-                fprintf(stdout, "WebQueryBuffer::dump: id = %d  url = %s\n",
-                        (int)nId,
-                        OUStringToOString(pWebPr->maURL, RTL_TEXTENCODING_UTF8).getStr());
-            }
-        }
-    }
-
-    QueryTableHashMap::const_iterator itr = maQueryTableMap.begin(), itrEnd = maQueryTableMap.end();
-    for (; itr != itrEnd; ++itr)
-    {
-        fprintf(stdout, "WebQueryBuffer::dump: name = %s  connection ID = %d\n",
-                OUStringToOString(itr->first, RTL_TEXTENCODING_UTF8).getStr(),
-                (int)(itr->second.mnConnectionId));
-    }
-
-    fprintf(stdout, "----------------------------------------\n");
-    fflush(stdout);
-#endif
-}
-
-// ============================================================================
-
-} // namespace xls
-} // namespace oox
-
diff --git a/oox/source/xls/workbookfragment.cxx b/oox/source/xls/workbookfragment.cxx
index 6322bd94c480..60e77c60c6bd 100644
--- a/oox/source/xls/workbookfragment.cxx
+++ b/oox/source/xls/workbookfragment.cxx
@@ -26,14 +26,15 @@
  ************************************************************************/
 
 #include "oox/xls/workbookfragment.hxx"
+
 #include 
+#include "oox/core/filterbase.hxx"
+#include "oox/drawingml/themefragmenthandler.hxx"
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/progressbar.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/helper/recordinputstream.hxx"
 #include "oox/ole/olestorage.hxx"
-#include "oox/core/filterbase.hxx"
-#include "oox/drawingml/themefragmenthandler.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/chartsheetfragment.hxx"
 #include "oox/xls/connectionsfragment.hxx"
@@ -50,22 +51,21 @@
 #include "oox/xls/worksheetbuffer.hxx"
 #include "oox/xls/worksheetfragment.hxx"
 
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::table::CellAddress;
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
 using ::oox::core::ContextHandlerRef;
 using ::oox::core::FragmentHandlerRef;
 using ::oox::core::RecordInfo;
 using ::oox::core::Relation;
 using ::oox::drawingml::ThemeFragmentHandler;
-
-namespace oox {
-namespace xls {
+using ::rtl::OUString;
 
 // ============================================================================
 
@@ -77,15 +77,12 @@ const double PROGRESS_LENGTH_GLOBALS        = 0.1;      /// 10% of progress bar
 
 // ============================================================================
 
-OoxWorkbookFragment::OoxWorkbookFragment(
-        const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
-    OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+WorkbookFragment::WorkbookFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
+    WorkbookFragmentBase( rHelper, rFragmentPath )
 {
 }
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxWorkbookFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef WorkbookFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -128,79 +125,77 @@ ContextHandlerRef OoxWorkbookFragment::onCreateContext( sal_Int32 nElement, cons
     return 0;
 }
 
-void OoxWorkbookFragment::onCharacters( const OUString& rChars )
+void WorkbookFragment::onCharacters( const OUString& rChars )
 {
     if( isCurrentElement( XLS_TOKEN( definedName ) ) && mxCurrName.get() )
         mxCurrName->setFormula( rChars );
 }
 
-ContextHandlerRef OoxWorkbookFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef WorkbookFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
         case XML_ROOT_CONTEXT:
-            if( nRecId == OOBIN_ID_WORKBOOK ) return this;
+            if( nRecId == BIFF12_ID_WORKBOOK ) return this;
         break;
 
-        case OOBIN_ID_WORKBOOK:
+        case BIFF12_ID_WORKBOOK:
             switch( nRecId )
             {
-                case OOBIN_ID_SHEETS:
-                case OOBIN_ID_BOOKVIEWS:
-                case OOBIN_ID_EXTERNALREFS:
-                case OOBIN_ID_PIVOTCACHES:      return this;
-
-                case OOBIN_ID_FILESHARING:      getWorkbookSettings().importFileSharing( rStrm );   break;
-                case OOBIN_ID_WORKBOOKPR:       getWorkbookSettings().importWorkbookPr( rStrm );    break;
-                case OOBIN_ID_CALCPR:           getWorkbookSettings().importCalcPr( rStrm );        break;
-                case OOBIN_ID_OLESIZE:          getViewSettings().importOleSize( rStrm );           break;
-                case OOBIN_ID_DEFINEDNAME:      getDefinedNames().importDefinedName( rStrm );       break;
+                case BIFF12_ID_SHEETS:
+                case BIFF12_ID_BOOKVIEWS:
+                case BIFF12_ID_EXTERNALREFS:
+                case BIFF12_ID_PIVOTCACHES:     return this;
+
+                case BIFF12_ID_FILESHARING:     getWorkbookSettings().importFileSharing( rStrm );   break;
+                case BIFF12_ID_WORKBOOKPR:      getWorkbookSettings().importWorkbookPr( rStrm );    break;
+                case BIFF12_ID_CALCPR:          getWorkbookSettings().importCalcPr( rStrm );        break;
+                case BIFF12_ID_OLESIZE:         getViewSettings().importOleSize( rStrm );           break;
+                case BIFF12_ID_DEFINEDNAME:     getDefinedNames().importDefinedName( rStrm );       break;
             }
         break;
 
-        case OOBIN_ID_SHEETS:
-            if( nRecId == OOBIN_ID_SHEET ) getWorksheets().importSheet( rStrm );
+        case BIFF12_ID_SHEETS:
+            if( nRecId == BIFF12_ID_SHEET ) getWorksheets().importSheet( rStrm );
         break;
-        case OOBIN_ID_BOOKVIEWS:
-            if( nRecId == OOBIN_ID_WORKBOOKVIEW ) getViewSettings().importWorkbookView( rStrm );
+        case BIFF12_ID_BOOKVIEWS:
+            if( nRecId == BIFF12_ID_WORKBOOKVIEW ) getViewSettings().importWorkbookView( rStrm );
         break;
 
-        case OOBIN_ID_EXTERNALREFS:
+        case BIFF12_ID_EXTERNALREFS:
             switch( nRecId )
             {
-                case OOBIN_ID_EXTERNALREF:      importExternalRef( rStrm );                         break;
-                case OOBIN_ID_EXTERNALSELF:     getExternalLinks().importExternalSelf( rStrm );     break;
-                case OOBIN_ID_EXTERNALSAME:     getExternalLinks().importExternalSame( rStrm );     break;
-                case OOBIN_ID_EXTERNALADDIN:    getExternalLinks().importExternalAddin( rStrm );    break;
-                case OOBIN_ID_EXTERNALSHEETS:   getExternalLinks().importExternalSheets( rStrm );   break;
+                case BIFF12_ID_EXTERNALREF:     importExternalRef( rStrm );                         break;
+                case BIFF12_ID_EXTERNALSELF:    getExternalLinks().importExternalSelf( rStrm );     break;
+                case BIFF12_ID_EXTERNALSAME:    getExternalLinks().importExternalSame( rStrm );     break;
+                case BIFF12_ID_EXTERNALADDIN:   getExternalLinks().importExternalAddin( rStrm );    break;
+                case BIFF12_ID_EXTERNALSHEETS:  getExternalLinks().importExternalSheets( rStrm );   break;
             }
         break;
 
-        case OOBIN_ID_PIVOTCACHES:
-            if( nRecId == OOBIN_ID_PIVOTCACHE ) importPivotCache( rStrm );
+        case BIFF12_ID_PIVOTCACHES:
+            if( nRecId == BIFF12_ID_PIVOTCACHE ) importPivotCache( rStrm );
     }
     return 0;
 }
 
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxWorkbookFragment::getRecordInfos() const
+const RecordInfo* WorkbookFragment::getRecordInfos() const
 {
     static const RecordInfo spRecInfos[] =
     {
-        { OOBIN_ID_BOOKVIEWS,       OOBIN_ID_BOOKVIEWS + 1      },
-        { OOBIN_ID_EXTERNALREFS,    OOBIN_ID_EXTERNALREFS + 1   },
-        { OOBIN_ID_FUNCTIONGROUPS,  OOBIN_ID_FUNCTIONGROUPS + 2 },
-        { OOBIN_ID_PIVOTCACHE,      OOBIN_ID_PIVOTCACHE + 1     },
-        { OOBIN_ID_PIVOTCACHES,     OOBIN_ID_PIVOTCACHES + 1    },
-        { OOBIN_ID_SHEETS,          OOBIN_ID_SHEETS + 1         },
-        { OOBIN_ID_WORKBOOK,        OOBIN_ID_WORKBOOK + 1       },
-        { -1,                       -1                          }
+        { BIFF12_ID_BOOKVIEWS,      BIFF12_ID_BOOKVIEWS + 1         },
+        { BIFF12_ID_EXTERNALREFS,   BIFF12_ID_EXTERNALREFS + 1      },
+        { BIFF12_ID_FUNCTIONGROUPS, BIFF12_ID_FUNCTIONGROUPS + 2    },
+        { BIFF12_ID_PIVOTCACHE,     BIFF12_ID_PIVOTCACHE + 1        },
+        { BIFF12_ID_PIVOTCACHES,    BIFF12_ID_PIVOTCACHES + 1       },
+        { BIFF12_ID_SHEETS,         BIFF12_ID_SHEETS + 1            },
+        { BIFF12_ID_WORKBOOK,       BIFF12_ID_WORKBOOK + 1          },
+        { -1,                       -1                              }
     };
     return spRecInfos;
 }
 
-void OoxWorkbookFragment::finalizeImport()
+void WorkbookFragment::finalizeImport()
 {
     ISegmentProgressBarRef xGlobalSegment = getProgressBar().createSegment( PROGRESS_LENGTH_GLOBALS );
 
@@ -213,19 +208,19 @@ void OoxWorkbookFragment::finalizeImport()
     // read the styles substream (requires finalized theme buffer)
     OUString aStylesFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "styles" ) );
     if( aStylesFragmentPath.getLength() > 0 )
-        importOoxFragment( new OoxStylesFragment( *this, aStylesFragmentPath ) );
+        importOoxFragment( new StylesFragment( *this, aStylesFragmentPath ) );
     xGlobalSegment->setPosition( 0.5 );
 
     // read the shared string table substream (requires finalized styles buffer)
     OUString aSstFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "sharedStrings" ) );
     if( aSstFragmentPath.getLength() > 0 )
-        importOoxFragment( new OoxSharedStringsFragment( *this, aSstFragmentPath ) );
+        importOoxFragment( new SharedStringsFragment( *this, aSstFragmentPath ) );
     xGlobalSegment->setPosition( 0.75 );
 
     // read the connections substream
     OUString aConnFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "connections" ) );
     if( aConnFragmentPath.getLength() > 0 )
-        importOoxFragment( new OoxConnectionsFragment( *this, aConnFragmentPath ) );
+        importOoxFragment( new ConnectionsFragment( *this, aConnFragmentPath ) );
     xGlobalSegment->setPosition( 1.0 );
 
     /*  Create fragments for all sheets, before importing them. Needed to do
@@ -244,35 +239,35 @@ void OoxWorkbookFragment::finalizeImport()
         {
             // get fragment path of the sheet
             OUString aFragmentPath = getFragmentPathFromRelation( *pRelation );
-            OSL_ENSURE( aFragmentPath.getLength() > 0, "OoxWorkbookFragment::finalizeImport - cannot access sheet fragment" );
+            OSL_ENSURE( aFragmentPath.getLength() > 0, "WorkbookFragment::finalizeImport - cannot access sheet fragment" );
             if( aFragmentPath.getLength() > 0 )
             {
-                ::rtl::Reference< OoxWorksheetFragmentBase > xFragment;
+                ::rtl::Reference< WorksheetFragmentBase > xFragment;
                 double fSegmentLength = getProgressBar().getFreeLength() / (nWorksheetCount - nWorksheet);
                 ISegmentProgressBarRef xSheetSegment = getProgressBar().createSegment( fSegmentLength );
 
                 // create the fragment according to the sheet type
                 if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "worksheet" ) )
                 {
-                    xFragment.set( new OoxWorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_WORKSHEET, nCalcSheet ) );
+                    xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_WORKSHEET, nCalcSheet ) );
                 }
                 else if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "chartsheet" ) )
                 {
-                    xFragment.set( new OoxChartsheetFragment( *this, aFragmentPath, xSheetSegment, nCalcSheet ) );
+                    xFragment.set( new ChartsheetFragment( *this, aFragmentPath, xSheetSegment, nCalcSheet ) );
                 }
                 else if( (pRelation->maType == CREATE_MSOFFICE_RELATIONSTYPE( "xlMacrosheet" )) ||
                          (pRelation->maType == CREATE_MSOFFICE_RELATIONSTYPE( "xlIntlMacrosheet" )) )
                 {
-                    xFragment.set( new OoxWorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_MACROSHEET, nCalcSheet ) );
+                    xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_MACROSHEET, nCalcSheet ) );
                 }
                 else if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "dialogsheet" ) )
                 {
-                    xFragment.set( new OoxWorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_DIALOGSHEET, nCalcSheet ) );
+                    xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_DIALOGSHEET, nCalcSheet ) );
                 }
 
                 // insert the fragment into the map
-                OSL_ENSURE( xFragment.is(), "OoxWorkbookFragment::finalizeImport - unknown sheet type" );
-                OSL_ENSURE( !xFragment.is() || xFragment->isValidSheet(), "OoxWorkbookFragment::finalizeImport - missing sheet in document" );
+                OSL_ENSURE( xFragment.is(), "WorkbookFragment::finalizeImport - unknown sheet type" );
+                OSL_ENSURE( !xFragment.is() || xFragment->isValidSheet(), "WorkbookFragment::finalizeImport - missing sheet in document" );
                 if( xFragment.is() && xFragment->isValidSheet() )
                     aSheetFragments.push_back( xFragment.get() );
             }
@@ -307,45 +302,45 @@ void OoxWorkbookFragment::finalizeImport()
 
 // private --------------------------------------------------------------------
 
-void OoxWorkbookFragment::importExternalReference( const AttributeList& rAttribs )
+void WorkbookFragment::importExternalReference( const AttributeList& rAttribs )
 {
     if( ExternalLink* pExtLink = getExternalLinks().importExternalReference( rAttribs ).get() )
         importExternalLinkFragment( *pExtLink );
 }
 
-void OoxWorkbookFragment::importDefinedName( const AttributeList& rAttribs )
+void WorkbookFragment::importDefinedName( const AttributeList& rAttribs )
 {
     mxCurrName = getDefinedNames().importDefinedName( rAttribs );
 }
 
-void OoxWorkbookFragment::importPivotCache( const AttributeList& rAttribs )
+void WorkbookFragment::importPivotCache( const AttributeList& rAttribs )
 {
     sal_Int32 nCacheId = rAttribs.getInteger( XML_cacheId, -1 );
     OUString aRelId = rAttribs.getString( R_TOKEN( id ), OUString() );
     importPivotCacheDefFragment( aRelId, nCacheId );
 }
 
-void OoxWorkbookFragment::importExternalRef( RecordInputStream& rStrm )
+void WorkbookFragment::importExternalRef( RecordInputStream& rStrm )
 {
     if( ExternalLink* pExtLink = getExternalLinks().importExternalRef( rStrm ).get() )
         importExternalLinkFragment( *pExtLink );
 }
 
-void OoxWorkbookFragment::importPivotCache( RecordInputStream& rStrm )
+void WorkbookFragment::importPivotCache( RecordInputStream& rStrm )
 {
     sal_Int32 nCacheId = rStrm.readInt32();
     OUString aRelId = rStrm.readString();
     importPivotCacheDefFragment( aRelId, nCacheId );
 }
 
-void OoxWorkbookFragment::importExternalLinkFragment( ExternalLink& rExtLink )
+void WorkbookFragment::importExternalLinkFragment( ExternalLink& rExtLink )
 {
     OUString aFragmentPath = getFragmentPathFromRelId( rExtLink.getRelId() );
     if( aFragmentPath.getLength() > 0 )
-        importOoxFragment( new OoxExternalLinkFragment( *this, aFragmentPath, rExtLink ) );
+        importOoxFragment( new ExternalLinkFragment( *this, aFragmentPath, rExtLink ) );
 }
 
-void OoxWorkbookFragment::importPivotCacheDefFragment( const OUString& rRelId, sal_Int32 nCacheId )
+void WorkbookFragment::importPivotCacheDefFragment( const OUString& rRelId, sal_Int32 nCacheId )
 {
     // pivot caches will be imported on demand, here we just store the fragment path in the buffer
     getPivotCaches().registerPivotCacheFragment( nCacheId, getFragmentPathFromRelId( rRelId ) );
@@ -427,14 +422,15 @@ bool BiffWorkbookFragment::importWorkspaceFragment()
     // import the workspace globals
     ISegmentProgressBarRef xGlobalsProgress = getProgressBar().createSegment( PROGRESS_LENGTH_GLOBALS );
     bool bLoop = true;
-    while( bRet && bLoop && mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
+    BiffInputStream& rStrm = getInputStream();
+    while( bRet && bLoop && rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
     {
-        switch( mrStrm.getRecId() )
+        switch( rStrm.getRecId() )
         {
-            case BIFF_ID_SHEET:         rWorksheets.importSheet( mrStrm );                  break;
-            case BIFF_ID_CODEPAGE:      setCodePage( mrStrm.readuInt16() );                 break;
-            case BIFF_ID_FILEPASS:      bRet = getCodecHelper().importFilePass( mrStrm );   break;
-            case BIFF_ID_SHEETHEADER:   mrStrm.rewindRecord(); bLoop = false;               break;
+            case BIFF_ID_SHEET:         rWorksheets.importSheet( rStrm );                   break;
+            case BIFF_ID_CODEPAGE:      setCodePage( rStrm.readuInt16() );                  break;
+            case BIFF_ID_FILEPASS:      bRet = getCodecHelper().importFilePass( rStrm );    break;
+            case BIFF_ID_SHEETHEADER:   rStrm.rewindRecord(); bLoop = false;                break;
         }
     }
     xGlobalsProgress->setPosition( 1.0 );
@@ -444,15 +440,15 @@ bool BiffWorkbookFragment::importWorkspaceFragment()
     for( sal_Int32 nWorksheet = 0, nWorksheetCount = rWorksheets.getWorksheetCount(); bNextSheet && (nWorksheet < nWorksheetCount); ++nWorksheet )
     {
         // try to start a new sheet fragment (with leading SHEETHEADER record)
-        bNextSheet = mrStrm.startNextRecord() && (mrStrm.getRecId() == BIFF_ID_SHEETHEADER);
+        bNextSheet = rStrm.startNextRecord() && (rStrm.getRecId() == BIFF_ID_SHEETHEADER);
         if( bNextSheet )
         {
             double fSegmentLength = getProgressBar().getFreeLength() / (nWorksheetCount - nWorksheet);
             ISegmentProgressBarRef xSheetProgress = getProgressBar().createSegment( fSegmentLength );
             /*  Read current sheet name (sheet substreams may not be in the
                 same order as SHEET records are). */
-            mrStrm.skip( 4 );
-            OUString aSheetName = mrStrm.readByteStringUC( false, getTextEncoding() );
+            rStrm.skip( 4 );
+            OUString aSheetName = rStrm.readByteStringUC( false, getTextEncoding() );
             sal_Int16 nCurrSheet = rWorksheets.getCalcSheetIndex( aSheetName );
             // load the sheet fragment records
             BiffFragmentType eSheetFragment = startFragment( getBiff() );
@@ -481,27 +477,28 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
 
     bool bRet = true;
     bool bLoop = true;
-    while( bRet && bLoop && mrStrm.startNextRecord() )
+    BiffInputStream& rStrm = getInputStream();
+    while( bRet && bLoop && rStrm.startNextRecord() )
     {
-        sal_uInt16 nRecId = mrStrm.getRecId();
+        sal_uInt16 nRecId = rStrm.getRecId();
         bool bExtLinkRec = false;
 
         /*  #i56376# BIFF5-BIFF8: If an EOF record for globals is missing,
             simulate it. The issue is about a document where the sheet fragment
             starts directly after the EXTSST record, without terminating the
             globals fragment with an EOF record. */
-        if( isBofRecord() || (nRecId == BIFF_ID_EOF) )
+        if( BiffHelper::isBofRecord( rStrm ) || (nRecId == BIFF_ID_EOF) )
         {
             bLoop = false;
         }
         else switch( nRecId )
         {
             // records in all BIFF versions
-            case BIFF_ID_CODEPAGE:      setCodePage( mrStrm.readuInt16() );                 break;
-            case BIFF_ID_DATEMODE:      rWorkbookSett.importDateMode( mrStrm );             break;
-            case BIFF_ID_FILEPASS:      bRet = getCodecHelper().importFilePass( mrStrm );   break;
-            case BIFF_ID_PRECISION:     rWorkbookSett.importPrecision( mrStrm );            break;
-            case BIFF_ID_WINDOW1:       rViewSett.importWindow1( mrStrm );                  break;
+            case BIFF_ID_CODEPAGE:      setCodePage( rStrm.readuInt16() );                  break;
+            case BIFF_ID_DATEMODE:      rWorkbookSett.importDateMode( rStrm );              break;
+            case BIFF_ID_FILEPASS:      bRet = getCodecHelper().importFilePass( rStrm );    break;
+            case BIFF_ID_PRECISION:     rWorkbookSett.importPrecision( rStrm );             break;
+            case BIFF_ID_WINDOW1:       rViewSett.importWindow1( rStrm );                   break;
 
             // BIFF specific records
             default: switch( getBiff() )
@@ -511,10 +508,10 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
                     case BIFF2_ID_DEFINEDNAME:  bExtLinkRec = true;                 break;
                     case BIFF2_ID_EXTERNALNAME: bExtLinkRec = true;                 break;
                     case BIFF_ID_EXTERNSHEET:   bExtLinkRec = true;                 break;
-                    case BIFF2_ID_FONT:         rStyles.importFont( mrStrm );       break;
-                    case BIFF_ID_FONTCOLOR:     rStyles.importFontColor( mrStrm );  break;
-                    case BIFF2_ID_FORMAT:       rStyles.importFormat( mrStrm );     break;
-                    case BIFF2_ID_XF:           rStyles.importXf( mrStrm );         break;
+                    case BIFF2_ID_FONT:         rStyles.importFont( rStrm );        break;
+                    case BIFF_ID_FONTCOLOR:     rStyles.importFontColor( rStrm );   break;
+                    case BIFF2_ID_FORMAT:       rStyles.importFormat( rStrm );      break;
+                    case BIFF2_ID_XF:           rStyles.importXf( rStrm );          break;
                 }
                 break;
 
@@ -524,14 +521,14 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
                     case BIFF3_ID_DEFINEDNAME:  bExtLinkRec = true;                         break;
                     case BIFF3_ID_EXTERNALNAME: bExtLinkRec = true;                         break;
                     case BIFF_ID_EXTERNSHEET:   bExtLinkRec = true;                         break;
-                    case BIFF_ID_FILESHARING:   rWorkbookSett.importFileSharing( mrStrm );  break;
-                    case BIFF3_ID_FONT:         rStyles.importFont( mrStrm );               break;
-                    case BIFF2_ID_FORMAT:       rStyles.importFormat( mrStrm );             break;
-                    case BIFF_ID_HIDEOBJ:       rWorkbookSett.importHideObj( mrStrm );      break;
-                    case BIFF_ID_PALETTE:       rStyles.importPalette( mrStrm );            break;
-                    case BIFF_ID_STYLE:         rStyles.importStyle( mrStrm );              break;
+                    case BIFF_ID_FILESHARING:   rWorkbookSett.importFileSharing( rStrm );   break;
+                    case BIFF3_ID_FONT:         rStyles.importFont( rStrm );                break;
+                    case BIFF2_ID_FORMAT:       rStyles.importFormat( rStrm );              break;
+                    case BIFF_ID_HIDEOBJ:       rWorkbookSett.importHideObj( rStrm );       break;
+                    case BIFF_ID_PALETTE:       rStyles.importPalette( rStrm );             break;
+                    case BIFF_ID_STYLE:         rStyles.importStyle( rStrm );               break;
                     case BIFF_ID_XCT:           bExtLinkRec = true;                         break;
-                    case BIFF3_ID_XF:           rStyles.importXf( mrStrm );                 break;
+                    case BIFF3_ID_XF:           rStyles.importXf( rStrm );                  break;
                 }
                 break;
 
@@ -541,62 +538,62 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
                     case BIFF3_ID_DEFINEDNAME:  bExtLinkRec = true;                         break;
                     case BIFF3_ID_EXTERNALNAME: bExtLinkRec = true;                         break;
                     case BIFF_ID_EXTERNSHEET:   bExtLinkRec = true;                         break;
-                    case BIFF_ID_FILESHARING:   rWorkbookSett.importFileSharing( mrStrm );  break;
-                    case BIFF3_ID_FONT:         rStyles.importFont( mrStrm );               break;
-                    case BIFF4_ID_FORMAT:       rStyles.importFormat( mrStrm );             break;
-                    case BIFF_ID_HIDEOBJ:       rWorkbookSett.importHideObj( mrStrm );      break;
-                    case BIFF_ID_PALETTE:       rStyles.importPalette( mrStrm );            break;
-                    case BIFF_ID_STYLE:         rStyles.importStyle( mrStrm );              break;
+                    case BIFF_ID_FILESHARING:   rWorkbookSett.importFileSharing( rStrm );   break;
+                    case BIFF3_ID_FONT:         rStyles.importFont( rStrm );                break;
+                    case BIFF4_ID_FORMAT:       rStyles.importFormat( rStrm );              break;
+                    case BIFF_ID_HIDEOBJ:       rWorkbookSett.importHideObj( rStrm );       break;
+                    case BIFF_ID_PALETTE:       rStyles.importPalette( rStrm );             break;
+                    case BIFF_ID_STYLE:         rStyles.importStyle( rStrm );               break;
                     case BIFF_ID_XCT:           bExtLinkRec = true;                         break;
-                    case BIFF4_ID_XF:           rStyles.importXf( mrStrm );                 break;
+                    case BIFF4_ID_XF:           rStyles.importXf( rStrm );                  break;
                 }
                 break;
 
                 case BIFF5: switch( nRecId )
                 {
-                    case BIFF_ID_BOOKBOOL:      rWorkbookSett.importBookBool( mrStrm );     break;
+                    case BIFF_ID_BOOKBOOL:      rWorkbookSett.importBookBool( rStrm );      break;
                     case BIFF_ID_CRN:           bExtLinkRec = true;                         break;
                     case BIFF5_ID_DEFINEDNAME:  bExtLinkRec = true;                         break;
                     case BIFF5_ID_EXTERNALNAME: bExtLinkRec = true;                         break;
                     case BIFF_ID_EXTERNSHEET:   bExtLinkRec = true;                         break;
-                    case BIFF_ID_FILESHARING:   rWorkbookSett.importFileSharing( mrStrm );  break;
-                    case BIFF5_ID_FONT:         rStyles.importFont( mrStrm );               break;
-                    case BIFF4_ID_FORMAT:       rStyles.importFormat( mrStrm );             break;
-                    case BIFF_ID_HIDEOBJ:       rWorkbookSett.importHideObj( mrStrm );      break;
-                    case BIFF_ID_OLESIZE:       rViewSett.importOleSize( mrStrm );          break;
-                    case BIFF_ID_PALETTE:       rStyles.importPalette( mrStrm );            break;
-                    case BIFF_ID_PIVOTCACHE:    rPivotCaches.importPivotCacheRef( mrStrm ); break;
-                    case BIFF_ID_SHEET:         rWorksheets.importSheet( mrStrm );          break;
-                    case BIFF_ID_STYLE:         rStyles.importStyle( mrStrm );              break;
+                    case BIFF_ID_FILESHARING:   rWorkbookSett.importFileSharing( rStrm );   break;
+                    case BIFF5_ID_FONT:         rStyles.importFont( rStrm );                break;
+                    case BIFF4_ID_FORMAT:       rStyles.importFormat( rStrm );              break;
+                    case BIFF_ID_HIDEOBJ:       rWorkbookSett.importHideObj( rStrm );       break;
+                    case BIFF_ID_OLESIZE:       rViewSett.importOleSize( rStrm );           break;
+                    case BIFF_ID_PALETTE:       rStyles.importPalette( rStrm );             break;
+                    case BIFF_ID_PIVOTCACHE:    rPivotCaches.importPivotCacheRef( rStrm );  break;
+                    case BIFF_ID_SHEET:         rWorksheets.importSheet( rStrm );           break;
+                    case BIFF_ID_STYLE:         rStyles.importStyle( rStrm );               break;
                     case BIFF_ID_XCT:           bExtLinkRec = true;                         break;
-                    case BIFF5_ID_XF:           rStyles.importXf( mrStrm );                 break;
+                    case BIFF5_ID_XF:           rStyles.importXf( rStrm );                  break;
                 }
                 break;
 
                 case BIFF8: switch( nRecId )
                 {
-                    case BIFF_ID_BOOKBOOL:          rWorkbookSett.importBookBool( mrStrm );     break;
-                    case BIFF_ID_CODENAME:          rWorkbookSett.importCodeName( mrStrm );     break;
+                    case BIFF_ID_BOOKBOOL:          rWorkbookSett.importBookBool( rStrm );      break;
+                    case BIFF_ID_CODENAME:          rWorkbookSett.importCodeName( rStrm );      break;
                     case BIFF_ID_CRN:               bExtLinkRec = true;                         break;
                     case BIFF5_ID_DEFINEDNAME:      bExtLinkRec = true;                         break;
                     case BIFF_ID_EXTERNALBOOK:      bExtLinkRec = true;                         break;
                     case BIFF5_ID_EXTERNALNAME:     bExtLinkRec = true;                         break;
                     case BIFF_ID_EXTERNSHEET:       bExtLinkRec = true;                         break;
-                    case BIFF_ID_FILESHARING:       rWorkbookSett.importFileSharing( mrStrm );  break;
-                    case BIFF5_ID_FONT:             rStyles.importFont( mrStrm );               break;
-                    case BIFF4_ID_FORMAT:           rStyles.importFormat( mrStrm );             break;
-                    case BIFF_ID_HIDEOBJ:           rWorkbookSett.importHideObj( mrStrm );      break;
-                    case BIFF_ID_OLESIZE:           rViewSett.importOleSize( mrStrm );          break;
-                    case BIFF_ID_PALETTE:           rStyles.importPalette( mrStrm );            break;
-                    case BIFF_ID_PIVOTCACHE:        rPivotCaches.importPivotCacheRef( mrStrm ); break;
-                    case BIFF_ID_SHEET:             rWorksheets.importSheet( mrStrm );          break;
-                    case BIFF_ID_SST:               rSharedStrings.importSst( mrStrm );         break;
-                    case BIFF_ID_STYLE:             rStyles.importStyle( mrStrm );              break;
-                    case BIFF_ID_USESELFS:          rWorkbookSett.importUsesElfs( mrStrm );     break;
+                    case BIFF_ID_FILESHARING:       rWorkbookSett.importFileSharing( rStrm );   break;
+                    case BIFF5_ID_FONT:             rStyles.importFont( rStrm );                break;
+                    case BIFF4_ID_FORMAT:           rStyles.importFormat( rStrm );              break;
+                    case BIFF_ID_HIDEOBJ:           rWorkbookSett.importHideObj( rStrm );       break;
+                    case BIFF_ID_OLESIZE:           rViewSett.importOleSize( rStrm );           break;
+                    case BIFF_ID_PALETTE:           rStyles.importPalette( rStrm );             break;
+                    case BIFF_ID_PIVOTCACHE:        rPivotCaches.importPivotCacheRef( rStrm );  break;
+                    case BIFF_ID_SHEET:             rWorksheets.importSheet( rStrm );           break;
+                    case BIFF_ID_SST:               rSharedStrings.importSst( rStrm );          break;
+                    case BIFF_ID_STYLE:             rStyles.importStyle( rStrm );               break;
+                    case BIFF_ID_USESELFS:          rWorkbookSett.importUsesElfs( rStrm );      break;
                     case BIFF_ID_VBAPROJECT:        bHasVbaProject = true;                      break;
                     case BIFF_ID_VBAPROJECTEMPTY:   bEmptyVbaProject = true;                    break;
                     case BIFF_ID_XCT:               bExtLinkRec = true;                         break;
-                    case BIFF5_ID_XF:               rStyles.importXf( mrStrm );                 break;
+                    case BIFF5_ID_XF:               rStyles.importXf( rStrm );                  break;
                 }
                 break;
 
@@ -605,7 +602,7 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
         }
 
         if( bExtLinkRec )
-            aExtLinkRecs.push_back( mrStrm.getRecHandle() );
+            aExtLinkRecs.push_back( rStrm.getRecHandle() );
     }
 
     // finalize global buffers
@@ -622,16 +619,16 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
     if( bRet && !aExtLinkRecs.empty() )
     {
         // remember current stream position (the EOF record)
-        sal_Int64 nEofHandle = mrStrm.getRecHandle();
-        // this fragment class implements import of external link records
-        BiffExternalLinkFragment aLinkFragment( *this, true );
+        sal_Int64 nEofHandle = rStrm.getRecHandle();
+        // context handler implementing import of external link records
+        BiffExternalSheetDataContext aSheetContext( *this, true );
         // import all records by using their cached record handle
-        for( RecordHandleVec::const_iterator aIt = aExtLinkRecs.begin(), aEnd = aExtLinkRecs.end(); (aIt != aEnd) && mrStrm.startRecordByHandle( *aIt ); ++aIt )
-            aLinkFragment.importRecord();
+        for( RecordHandleVec::const_iterator aIt = aExtLinkRecs.begin(), aEnd = aExtLinkRecs.end(); (aIt != aEnd) && rStrm.startRecordByHandle( *aIt ); ++aIt )
+            aSheetContext.importRecord( rStrm );
         // finalize global buffers
-        aLinkFragment.finalizeImport();
+        getDefinedNames().finalizeImport();
         // seek back to the EOF record of the workbook globals fragment
-        bRet = mrStrm.startRecordByHandle( nEofHandle );
+        bRet = rStrm.startRecordByHandle( nEofHandle );
     }
 
     // open the VBA project storage
@@ -639,8 +636,8 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
         setVbaProjectStorage( getBaseFilter().openSubStorage( CREATE_OUSTRING( "_VBA_PROJECT_CUR" ), false ) );
 
     // #i56376# missing EOF - rewind before worksheet BOF record (see above)
-    if( bRet && isBofRecord() )
-        mrStrm.rewindRecord();
+    if( bRet && BiffHelper::isBofRecord( rStrm ) )
+        rStrm.rewindRecord();
 
     rProgressBar.setPosition( 1.0 );
     return bRet;
@@ -669,6 +666,7 @@ bool BiffWorkbookFragment::importSheetFragment( ISegmentProgressBar& rProgressBa
     createBuffersPerSheet( nCalcSheet );
 
     // preprocess some records
+    BiffInputStream& rStrm = getInputStream();
     switch( getBiff() )
     {
         // load the workbook globals fragment records in BIFF2-BIFF4
@@ -677,12 +675,12 @@ bool BiffWorkbookFragment::importSheetFragment( ISegmentProgressBar& rProgressBa
         case BIFF4:
         {
             // remember current record to seek back below
-            sal_Int64 nRecHandle = mrStrm.getRecHandle();
+            sal_Int64 nRecHandle = rStrm.getRecHandle();
             // import the global records
             ISegmentProgressBarRef xGlobalsProgress = rProgressBar.createSegment( PROGRESS_LENGTH_GLOBALS );
             importGlobalsFragment( *xGlobalsProgress );
             // rewind stream to fragment BOF record
-            mrStrm.startRecordByHandle( nRecHandle );
+            rStrm.startRecordByHandle( nRecHandle );
         }
         break;
 
@@ -690,11 +688,11 @@ bool BiffWorkbookFragment::importSheetFragment( ISegmentProgressBar& rProgressBa
         case BIFF5:
         {
             // remember current record to seek back below
-            sal_Int64 nRecHandle = mrStrm.getRecHandle();
+            sal_Int64 nRecHandle = rStrm.getRecHandle();
             // fragment implementing import of external link records
-            BiffExternalLinkFragment( *this, false ).importFragment();
+            BiffExternalLinkFragment( *this ).importFragment();
             // rewind stream to fragment BOF record
-            mrStrm.startRecordByHandle( nRecHandle );
+            rStrm.startRecordByHandle( nRecHandle );
         }
         break;
 
@@ -731,4 +729,3 @@ bool BiffWorkbookFragment::importSheetFragment( ISegmentProgressBar& rProgressBa
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx
index 11c0474544cb..aa29e45c1d19 100644
--- a/oox/source/xls/workbookhelper.cxx
+++ b/oox/source/xls/workbookhelper.cxx
@@ -27,12 +27,9 @@
 
 #include "oox/xls/workbookhelper.hxx"
 
-#include 
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -48,6 +45,7 @@
 #include "oox/xls/addressconverter.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/biffcodec.hxx"
+#include "oox/xls/connectionsbuffer.hxx"
 #include "oox/xls/defnamesbuffer.hxx"
 #include "oox/xls/excelchartconverter.hxx"
 #include "oox/xls/excelfilter.hxx"
@@ -63,7 +61,6 @@
 #include "oox/xls/themebuffer.hxx"
 #include "oox/xls/unitconverter.hxx"
 #include "oox/xls/viewsettings.hxx"
-#include "oox/xls/webquerybuffer.hxx"
 #include "oox/xls/workbooksettings.hxx"
 #include "oox/xls/worksheetbuffer.hxx"
 #include "properties.hxx"
@@ -133,16 +130,6 @@ public:
 
     /** Returns a reference to the source/target spreadsheet document model. */
     inline Reference< XSpreadsheetDocument > getDocument() const { return mxDoc; }
-    /** Returns the reference device of the document. */
-    Reference< XDevice > getReferenceDevice() const;
-    /** Returns the container for defined names from the Calc document. */
-    Reference< XNamedRanges > getNamedRanges() const;
-    /** Returns the container for database ranges from the Calc document. */
-    Reference< XDatabaseRanges > getDatabaseRanges() const;
-    /** Returns the container for external documents from the Calc document. */
-    Reference< XExternalDocLinks > getExternalDocLinks() const;
-    /** Returns the container for DDE links from the Calc document. */
-    Reference< XNameAccess > getDdeLinks() const;
     /** Returns the cell or page styles container from the Calc document. */
     Reference< XNameContainer > getStyleFamily( bool bPageStyles ) const;
     /** Returns the specified cell or page style from the Calc document. */
@@ -174,8 +161,8 @@ public:
     inline TableBuffer& getTables() const { return *mxTables; }
     /** Returns the scenarios collection. */
     inline ScenarioBuffer& getScenarios() const { return *mxScenarios; }
-    /** Returns the web queries. */
-    inline WebQueryBuffer& getWebQueries() const { return *mxWebQueries; }
+    /** Returns the collection of external data connections. */
+    inline ConnectionsBuffer&  getConnections() const { return *mxConnections; }
     /** Returns the collection of pivot caches. */
     inline PivotCacheBuffer& getPivotCaches() const { return *mxPivotCaches; }
     /** Returns the collection of pivot tables. */
@@ -194,12 +181,12 @@ public:
     /** Returns the page/print settings converter. */
     inline PageSettingsConverter& getPageSettingsConverter() const { return *mxPageSettConverter; }
 
-    // OOX specific -----------------------------------------------------------
+    // OOXML/BIFF12 specific --------------------------------------------------
 
-    /** Returns the base OOX filter object. */
+    /** Returns the base OOXML/BIFF12 filter object. */
     inline XmlFilterBase& getOoxFilter() const { return *mpOoxFilter; }
 
-    // BIFF specific ----------------------------------------------------------
+    // BIFF2-BIFF8 specific ---------------------------------------------------
 
     /** Returns the base BIFF filter object. */
     inline BinaryFilterBase& getBiffFilter() const { return *mpBiffFilter; }
@@ -238,7 +225,7 @@ private:
     typedef ::std::auto_ptr< DefinedNamesBuffer >       DefNamesBfrPtr;
     typedef ::std::auto_ptr< TableBuffer >              TableBfrPtr;
     typedef ::std::auto_ptr< ScenarioBuffer >           ScenarioBfrPtr;
-    typedef ::std::auto_ptr< WebQueryBuffer >           WebQueryBfrPtr;
+    typedef ::std::auto_ptr< ConnectionsBuffer >        ConnectionsBfrPtr;
     typedef ::std::auto_ptr< PivotCacheBuffer >         PivotCacheBfrPtr;
     typedef ::std::auto_ptr< PivotTableBuffer >         PivotTableBfrPtr;
     typedef ::std::auto_ptr< FormulaParser >            FormulaParserPtr;
@@ -272,7 +259,7 @@ private:
     DefNamesBfrPtr      mxDefNames;             /// All defined names.
     TableBfrPtr         mxTables;               /// All tables (database ranges).
     ScenarioBfrPtr      mxScenarios;            /// All scenarios.
-    WebQueryBfrPtr      mxWebQueries;           /// Web queries buffer.
+    ConnectionsBfrPtr   mxConnections;          /// All external data connections.
     PivotCacheBfrPtr    mxPivotCaches;          /// All pivot caches in the document.
     PivotTableBfrPtr    mxPivotTables;          /// All pivot tables in the document.
 
@@ -283,11 +270,11 @@ private:
     ExcelChartConvPtr   mxChartConverter;       /// Chart object converter.
     PageSettConvPtr     mxPageSettConverter;    /// Page/print settings converter.
 
-    // OOX specific
-    XmlFilterBase*      mpOoxFilter;            /// Base OOX filter object.
+    // OOXML/BIFF12 specific
+    XmlFilterBase*      mpOoxFilter;            /// Base OOXML/BIFF12 filter object.
 
-    // BIFF specific
-    BinaryFilterBase*   mpBiffFilter;           /// Base BIFF filter object.
+    // BIFF2-BIFF8 specific
+    BinaryFilterBase*   mpBiffFilter;           /// Base BIFF2-BIFF8 filter object.
     BiffCodecHelperPtr  mxCodecHelper;          /// Encoder/decoder helper.
     BiffType            meBiff;                 /// BIFF version for BIFF import/export.
     rtl_TextEncoding    meTextEnc;              /// BIFF byte string text encoding.
@@ -299,7 +286,7 @@ private:
 WorkbookData::WorkbookData( ExcelFilter& rFilter ) :
     mrBaseFilter( rFilter ),
     mrExcelBase( rFilter ),
-    meFilterType( FILTER_OOX ),
+    meFilterType( FILTER_OOXML ),
     mpOoxFilter( &rFilter ),
     mpBiffFilter( 0 ),
     meBiff( BIFF_UNKNOWN )
@@ -330,46 +317,6 @@ WorkbookData::~WorkbookData()
 
 // document model -------------------------------------------------------------
 
-Reference< XDevice > WorkbookData::getReferenceDevice() const
-{
-    PropertySet aPropSet( mxDoc );
-    Reference< XDevice > xDevice;
-    aPropSet.getProperty( xDevice, PROP_ReferenceDevice );
-    return xDevice;
-}
-
-Reference< XNamedRanges > WorkbookData::getNamedRanges() const
-{
-    PropertySet aPropSet( mxDoc );
-    Reference< XNamedRanges > xNamedRanges;
-    aPropSet.getProperty( xNamedRanges, PROP_NamedRanges );
-    return xNamedRanges;
-}
-
-Reference< XDatabaseRanges > WorkbookData::getDatabaseRanges() const
-{
-    PropertySet aPropSet( mxDoc );
-    Reference< XDatabaseRanges > xDatabaseRanges;
-    aPropSet.getProperty( xDatabaseRanges, PROP_DatabaseRanges );
-    return xDatabaseRanges;
-}
-
-Reference< XExternalDocLinks > WorkbookData::getExternalDocLinks() const
-{
-    PropertySet aPropSet( mxDoc );
-    Reference< XExternalDocLinks > xDocLinks;
-    aPropSet.getProperty( xDocLinks, PROP_ExternalDocLinks );
-    return xDocLinks;
-}
-
-Reference< XNameAccess > WorkbookData::getDdeLinks() const
-{
-    PropertySet aPropSet( mxDoc );
-    Reference< XNameAccess > xDdeLinks;
-    aPropSet.getProperty( xDdeLinks, PROP_DDELinks );
-    return xDdeLinks;
-}
-
 Reference< XNameContainer > WorkbookData::getStyleFamily( bool bPageStyles ) const
 {
     Reference< XNameContainer > xStylesNC;
@@ -404,7 +351,8 @@ Reference< XStyle > WorkbookData::getStyleObject( const OUString& rStyleName, bo
 Reference< XNamedRange > WorkbookData::createNamedRangeObject( OUString& orName, sal_Int32 nNameFlags ) const
 {
     // find an unused name
-    Reference< XNamedRanges > xNamedRanges = getNamedRanges();
+    PropertySet aDocProps( mxDoc );
+    Reference< XNamedRanges > xNamedRanges( aDocProps.getAnyProperty( PROP_NamedRanges ), UNO_QUERY );
     Reference< XNameAccess > xNameAccess( xNamedRanges, UNO_QUERY );
     if( xNameAccess.is() )
         orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' );
@@ -530,7 +478,7 @@ void WorkbookData::initialize( bool bWorkbookFile )
     mxDefNames.reset( new DefinedNamesBuffer( *this ) );
     mxTables.reset( new TableBuffer( *this ) );
     mxScenarios.reset( new ScenarioBuffer( *this ) );
-    mxWebQueries.reset( new WebQueryBuffer( *this ) );
+    mxConnections.reset( new ConnectionsBuffer( *this ) );
     mxPivotCaches.reset( new PivotCacheBuffer( *this ) );
     mxPivotTables.reset( new PivotTableBuffer( *this ) );
 
@@ -552,7 +500,7 @@ void WorkbookData::initialize( bool bWorkbookFile )
         // disable automatic update of linked sheets and DDE links
         aPropSet.setProperty( PROP_IsExecuteLinkEnabled, false );
         // #i79890# disable automatic update of defined names
-        Reference< XActionLockable > xLockable( getNamedRanges(), UNO_QUERY );
+        Reference< XActionLockable > xLockable( aPropSet.getAnyProperty( PROP_NamedRanges ), UNO_QUERY );
         if( xLockable.is() )
             xLockable->addActionLock();
 
@@ -573,7 +521,7 @@ void WorkbookData::initialize( bool bWorkbookFile )
             mxCodecHelper.reset( new BiffCodecHelper( *this ) );
         break;
 
-        case FILTER_OOX:
+        case FILTER_OOXML:
         break;
 
         case FILTER_UNKNOWN:
@@ -590,7 +538,7 @@ void WorkbookData::finalize()
         // #i74668# do not insert default sheets
         aPropSet.setProperty( PROP_IsLoaded, true );
         // #i79890# enable automatic update of defined names (before IsAdjustHeightEnabled!)
-        Reference< XActionLockable > xLockable( getNamedRanges(), UNO_QUERY );
+        Reference< XActionLockable > xLockable( aPropSet.getAnyProperty( PROP_NamedRanges ), UNO_QUERY );
         if( xLockable.is() )
             xLockable->removeActionLock();
         // enable automatic update of linked sheets and DDE links
@@ -695,31 +643,6 @@ Reference< XMultiServiceFactory > WorkbookHelper::getDocumentFactory() const
     return mrBookData.getBaseFilter().getModelFactory();
 }
 
-Reference< XDevice > WorkbookHelper::getReferenceDevice() const
-{
-    return mrBookData.getReferenceDevice();
-}
-
-Reference< XNamedRanges > WorkbookHelper::getNamedRanges() const
-{
-    return mrBookData.getNamedRanges();
-}
-
-Reference< XDatabaseRanges > WorkbookHelper::getDatabaseRanges() const
-{
-    return mrBookData.getDatabaseRanges();
-}
-
-Reference< XExternalDocLinks > WorkbookHelper::getExternalDocLinks() const
-{
-    return mrBookData.getExternalDocLinks();
-}
-
-Reference< XNameAccess > WorkbookHelper::getDdeLinks() const
-{
-    return mrBookData.getDdeLinks();
-}
-
 Reference< XSpreadsheet > WorkbookHelper::getSheetFromDoc( sal_Int16 nSheet ) const
 {
     Reference< XSpreadsheet > xSheet;
@@ -848,9 +771,9 @@ ScenarioBuffer& WorkbookHelper::getScenarios() const
     return mrBookData.getScenarios();
 }
 
-WebQueryBuffer& WorkbookHelper::getWebQueries() const
+ConnectionsBuffer& WorkbookHelper::getConnections() const
 {
-    return mrBookData.getWebQueries();
+    return mrBookData.getConnections();
 }
 
 PivotCacheBuffer& WorkbookHelper::getPivotCaches() const
@@ -890,11 +813,11 @@ PageSettingsConverter& WorkbookHelper::getPageSettingsConverter() const
     return mrBookData.getPageSettingsConverter();
 }
 
-// OOX specific ---------------------------------------------------------------
+// OOXML/BIFF12 specific ------------------------------------------------------
 
 XmlFilterBase& WorkbookHelper::getOoxFilter() const
 {
-    OSL_ENSURE( mrBookData.getFilterType() == FILTER_OOX, "WorkbookHelper::getOoxFilter - invalid call" );
+    OSL_ENSURE( mrBookData.getFilterType() == FILTER_OOXML, "WorkbookHelper::getOoxFilter - invalid call" );
     return mrBookData.getOoxFilter();
 }
 
diff --git a/oox/source/xls/workbooksettings.cxx b/oox/source/xls/workbooksettings.cxx
index 51d60ebafe3b..526bb375a7cf 100644
--- a/oox/source/xls/workbooksettings.cxx
+++ b/oox/source/xls/workbooksettings.cxx
@@ -26,48 +26,47 @@
  ************************************************************************/
 
 #include "oox/xls/workbooksettings.hxx"
+
 #include 
 #include 
 #include 
 #include 
-#include "properties.hxx"
+#include "oox/core/filterbase.hxx"
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/unitconverter.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::sheet::XCalculatable;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::util::Date;
-using ::com::sun::star::util::XNumberFormatsSupplier;
-using ::comphelper::MediaDescriptor;
-using ::oox::core::CodecHelper;
+#include "properties.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::comphelper::MediaDescriptor;
+using ::oox::core::CodecHelper;
+using ::rtl::OUString;
+
+// ============================================================================
+
 namespace {
 
-const sal_uInt32 OOBIN_WORKBOOKPR_DATE1904  = 0x00000001;
-const sal_uInt32 OOBIN_WORKBOOKPR_STRIPEXT  = 0x00000080;
+const sal_uInt32 BIFF12_WORKBOOKPR_DATE1904     = 0x00000001;
+const sal_uInt32 BIFF12_WORKBOOKPR_STRIPEXT     = 0x00000080;
 
-const sal_uInt16 OOBIN_CALCPR_A1            = 0x0002;
-const sal_uInt16 OOBIN_CALCPR_ITERATE       = 0x0004;
-const sal_uInt16 OOBIN_CALCPR_FULLPRECISION = 0x0008;
-const sal_uInt16 OOBIN_CALCPR_CALCCOMPLETED = 0x0010;
-const sal_uInt16 OOBIN_CALCPR_CALCONSAVE    = 0x0020;
-const sal_uInt16 OOBIN_CALCPR_CONCURRENT    = 0x0040;
-const sal_uInt16 OOBIN_CALCPR_MANUALPROC    = 0x0080;
+const sal_uInt16 BIFF12_CALCPR_A1               = 0x0002;
+const sal_uInt16 BIFF12_CALCPR_ITERATE          = 0x0004;
+const sal_uInt16 BIFF12_CALCPR_FULLPRECISION    = 0x0008;
+const sal_uInt16 BIFF12_CALCPR_CALCCOMPLETED    = 0x0010;
+const sal_uInt16 BIFF12_CALCPR_CALCONSAVE       = 0x0020;
+const sal_uInt16 BIFF12_CALCPR_CONCURRENT       = 0x0040;
+const sal_uInt16 BIFF12_CALCPR_MANUALPROC       = 0x0080;
 
 // no predefined constants for show objects mode
 const sal_Int16 API_SHOWMODE_SHOW               = 0;        /// Show drawing objects.
@@ -95,7 +94,7 @@ WorkbookSettingsModel::WorkbookSettingsModel() :
 {
 }
 
-void WorkbookSettingsModel::setBinObjectMode( sal_uInt16 nObjMode )
+void WorkbookSettingsModel::setBiffObjectMode( sal_uInt16 nObjMode )
 {
     static const sal_Int32 spnObjModes[] = { XML_all, XML_placeholders, XML_none };
     mnShowObjectMode = STATIC_ARRAY_SELECT( spnObjModes, nObjMode, XML_all );
@@ -168,10 +167,10 @@ void WorkbookSettings::importWorkbookPr( RecordInputStream& rStrm )
 {
     sal_uInt32 nFlags;
     rStrm >> nFlags >> maBookSettings.mnDefaultThemeVer >> maBookSettings.maCodeName;
-    maBookSettings.setBinObjectMode( extractValue< sal_uInt16 >( nFlags, 13, 2 ) );
+    maBookSettings.setBiffObjectMode( extractValue< sal_uInt16 >( nFlags, 13, 2 ) );
     // set flag means: strip external link values
-    maBookSettings.mbSaveExtLinkValues = !getFlag( nFlags, OOBIN_WORKBOOKPR_STRIPEXT );
-    setDateMode( getFlag( nFlags, OOBIN_WORKBOOKPR_DATE1904 ) );
+    maBookSettings.mbSaveExtLinkValues = !getFlag( nFlags, BIFF12_WORKBOOKPR_STRIPEXT );
+    setDateMode( getFlag( nFlags, BIFF12_WORKBOOKPR_DATE1904 ) );
 }
 
 void WorkbookSettings::importCalcPr( RecordInputStream& rStrm )
@@ -181,14 +180,14 @@ void WorkbookSettings::importCalcPr( RecordInputStream& rStrm )
     rStrm >> maCalcSettings.mnCalcId >> nCalcMode >> maCalcSettings.mnIterateCount >> maCalcSettings.mfIterateDelta >> nProcCount >> nFlags;
 
     static const sal_Int32 spnCalcModes[] = { XML_manual, XML_auto, XML_autoNoTable };
-    maCalcSettings.mnRefMode       = getFlagValue( nFlags, OOBIN_CALCPR_A1, XML_A1, XML_R1C1 );
+    maCalcSettings.mnRefMode       = getFlagValue( nFlags, BIFF12_CALCPR_A1, XML_A1, XML_R1C1 );
     maCalcSettings.mnCalcMode      = STATIC_ARRAY_SELECT( spnCalcModes, nCalcMode, XML_auto );
-    maCalcSettings.mnProcCount     = getFlagValue< sal_Int32 >( nFlags, OOBIN_CALCPR_MANUALPROC, nProcCount, -1 );
-    maCalcSettings.mbCalcOnSave    = getFlag( nFlags, OOBIN_CALCPR_CALCONSAVE );
-    maCalcSettings.mbCalcCompleted = getFlag( nFlags, OOBIN_CALCPR_CALCCOMPLETED );
-    maCalcSettings.mbFullPrecision = getFlag( nFlags, OOBIN_CALCPR_FULLPRECISION );
-    maCalcSettings.mbIterate       = getFlag( nFlags, OOBIN_CALCPR_ITERATE );
-    maCalcSettings.mbConcurrent    = getFlag( nFlags, OOBIN_CALCPR_CONCURRENT );
+    maCalcSettings.mnProcCount     = getFlagValue< sal_Int32 >( nFlags, BIFF12_CALCPR_MANUALPROC, nProcCount, -1 );
+    maCalcSettings.mbCalcOnSave    = getFlag( nFlags, BIFF12_CALCPR_CALCONSAVE );
+    maCalcSettings.mbCalcCompleted = getFlag( nFlags, BIFF12_CALCPR_CALCCOMPLETED );
+    maCalcSettings.mbFullPrecision = getFlag( nFlags, BIFF12_CALCPR_FULLPRECISION );
+    maCalcSettings.mbIterate       = getFlag( nFlags, BIFF12_CALCPR_ITERATE );
+    maCalcSettings.mbConcurrent    = getFlag( nFlags, BIFF12_CALCPR_CONCURRENT );
 }
 
 void WorkbookSettings::setSaveExtLinkValues( bool bSaveExtLinks )
@@ -248,7 +247,7 @@ void WorkbookSettings::importFileSharing( BiffInputStream& rStrm )
 
 void WorkbookSettings::importHideObj( BiffInputStream& rStrm )
 {
-    maBookSettings.setBinObjectMode( rStrm.readuInt16() );
+    maBookSettings.setBiffObjectMode( rStrm.readuInt16() );
 }
 
 void WorkbookSettings::importIteration( BiffInputStream& rStrm )
@@ -288,7 +287,7 @@ void WorkbookSettings::finalizeImport()
     PropertySet aPropSet( getDocument() );
     switch( getFilterType() )
     {
-        case FILTER_OOX:
+        case FILTER_OOXML:
         case FILTER_BIFF:
             aPropSet.setProperty( PROP_IgnoreCase,          true );     // always in Excel
             aPropSet.setProperty( PROP_RegularExpressions,  false );    // not supported in Excel
@@ -367,4 +366,3 @@ void WorkbookSettings::setDateMode( bool bDateMode1904 )
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/worksheetbuffer.cxx b/oox/source/xls/worksheetbuffer.cxx
index 6f8d50ff38f6..fbfaef8daed5 100644
--- a/oox/source/xls/worksheetbuffer.cxx
+++ b/oox/source/xls/worksheetbuffer.cxx
@@ -26,37 +26,36 @@
  ************************************************************************/
 
 #include "oox/xls/worksheetbuffer.hxx"
-#include 
+
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include "properties.hxx"
+#include 
+#include 
+#include "oox/core/filterbase.hxx"
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/excelhandlers.hxx"
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::sheet::XSpreadsheetDocument;
-using ::com::sun::star::sheet::XSpreadsheets;
+#include "properties.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
 SheetInfoModel::SheetInfoModel() :
     mnBiffHandle( -1 ),
     mnSheetId( -1 ),
@@ -258,4 +257,3 @@ void WorksheetBuffer::insertSheet( const SheetInfoModel& rModel )
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/worksheetfragment.cxx b/oox/source/xls/worksheetfragment.cxx
index 7b397792d117..19dc8e34c70f 100644
--- a/oox/source/xls/worksheetfragment.cxx
+++ b/oox/source/xls/worksheetfragment.cxx
@@ -26,10 +26,11 @@
  ************************************************************************/
 
 #include "oox/xls/worksheetfragment.hxx"
-#include "oox/helper/attributelist.hxx"
-#include "oox/helper/recordinputstream.hxx"
+
 #include "oox/core/filterbase.hxx"
 #include "oox/core/relations.hxx"
+#include "oox/helper/attributelist.hxx"
+#include "oox/helper/recordinputstream.hxx"
 #include "oox/xls/addressconverter.hxx"
 #include "oox/xls/autofiltercontext.hxx"
 #include "oox/xls/biffinputstream.hxx"
@@ -38,7 +39,6 @@
 #include "oox/xls/drawingfragment.hxx"
 #include "oox/xls/externallinkbuffer.hxx"
 #include "oox/xls/pagesettings.hxx"
-#include "oox/xls/pivottablebuffer.hxx"
 #include "oox/xls/pivottablefragment.hxx"
 #include "oox/xls/querytablefragment.hxx"
 #include "oox/xls/scenariobuffer.hxx"
@@ -49,20 +49,20 @@
 #include "oox/xls/workbooksettings.hxx"
 #include "oox/xls/worksheetsettings.hxx"
 
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
 using ::oox::core::ContextHandlerRef;
 using ::oox::core::RecordInfo;
 using ::oox::core::Relations;
 using ::oox::core::RelationsRef;
-
-namespace oox {
-namespace xls {
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
 
 // ============================================================================
 
@@ -87,23 +87,23 @@ const sal_uInt32 BIFF_DATAVAL_SHOWERROR     = 0x00080000;
 
 const sal_uInt32 BIFF_SHRFEATHEAD_SHEETPROT = 2;
 
-const sal_Int32 OOBIN_OLEOBJECT_CONTENT     = 1;
-const sal_Int32 OOBIN_OLEOBJECT_ICON        = 4;
-const sal_Int32 OOBIN_OLEOBJECT_ALWAYS      = 1;
-const sal_Int32 OOBIN_OLEOBJECT_ONCALL      = 3;
-const sal_uInt16 OOBIN_OLEOBJECT_LINKED     = 0x0001;
-const sal_uInt16 OOBIN_OLEOBJECT_AUTOLOAD   = 0x0002;
+const sal_Int32 BIFF12_OLEOBJECT_CONTENT    = 1;
+const sal_Int32 BIFF12_OLEOBJECT_ICON       = 4;
+const sal_Int32 BIFF12_OLEOBJECT_ALWAYS     = 1;
+const sal_Int32 BIFF12_OLEOBJECT_ONCALL     = 3;
+const sal_uInt16 BIFF12_OLEOBJECT_LINKED    = 0x0001;
+const sal_uInt16 BIFF12_OLEOBJECT_AUTOLOAD  = 0x0002;
 
 } // namespace
 
 // ============================================================================
 
-OoxDataValidationsContext::OoxDataValidationsContext( OoxWorksheetFragmentBase& rFragment ) :
-    OoxWorksheetContextBase( rFragment )
+DataValidationsContext::DataValidationsContext( WorksheetFragmentBase& rFragment ) :
+    WorksheetContextBase( rFragment )
 {
 }
 
-ContextHandlerRef OoxDataValidationsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef DataValidationsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -138,7 +138,7 @@ ApiTokenSequence lclImportDataValFormula( FormulaParser& rParser, const OUString
 
 } // namespace
 
-void OoxDataValidationsContext::onCharacters( const OUString& rChars )
+void DataValidationsContext::onCharacters( const OUString& rChars )
 {
     if( mxValModel.get() ) switch( getCurrentElement() )
     {
@@ -156,7 +156,7 @@ void OoxDataValidationsContext::onCharacters( const OUString& rChars )
     }
 }
 
-void OoxDataValidationsContext::onEndElement()
+void DataValidationsContext::onEndElement()
 {
     if( isCurrentElement( XLS_TOKEN( dataValidation ) ) && mxValModel.get() )
     {
@@ -166,14 +166,14 @@ void OoxDataValidationsContext::onEndElement()
 }
 
 
-ContextHandlerRef OoxDataValidationsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef DataValidationsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
-    if( nRecId == OOBIN_ID_DATAVALIDATION )
+    if( nRecId == BIFF12_ID_DATAVALIDATION )
         importDataValidation( rStrm );
     return 0;
 }
 
-void OoxDataValidationsContext::importDataValidation( const AttributeList& rAttribs )
+void DataValidationsContext::importDataValidation( const AttributeList& rAttribs )
 {
     mxValModel.reset( new ValidationModel );
     getAddressConverter().convertToCellRangeList( mxValModel->maRanges, rAttribs.getString( XML_sqref, OUString() ), getSheetIndex(), true );
@@ -193,7 +193,7 @@ void OoxDataValidationsContext::importDataValidation( const AttributeList& rAttr
     mxValModel->mbAllowBlank   = rAttribs.getBool( XML_allowBlank, false );
 }
 
-void OoxDataValidationsContext::importDataValidation( RecordInputStream& rStrm )
+void DataValidationsContext::importDataValidation( RecordInputStream& rStrm )
 {
     ValidationModel aModel;
 
@@ -201,10 +201,10 @@ void OoxDataValidationsContext::importDataValidation( RecordInputStream& rStrm )
     BinRangeList aRanges;
     rStrm >> nFlags >> aRanges >> aModel.maErrorTitle >> aModel.maErrorMessage >> aModel.maInputTitle >> aModel.maInputMessage;
 
-    // equal flags in BIFF and OOBIN
-    aModel.setBinType( extractValue< sal_uInt8 >( nFlags, 0, 4 ) );
-    aModel.setBinOperator( extractValue< sal_uInt8 >( nFlags, 20, 4 ) );
-    aModel.setBinErrorStyle( extractValue< sal_uInt8 >( nFlags, 4, 3 ) );
+    // equal flags in all BIFFs
+    aModel.setBiffType( extractValue< sal_uInt8 >( nFlags, 0, 4 ) );
+    aModel.setBiffOperator( extractValue< sal_uInt8 >( nFlags, 20, 4 ) );
+    aModel.setBiffErrorStyle( extractValue< sal_uInt8 >( nFlags, 4, 3 ) );
     aModel.mbAllowBlank   = getFlag( nFlags, BIFF_DATAVAL_ALLOWBLANK );
     aModel.mbNoDropDown   = getFlag( nFlags, BIFF_DATAVAL_NODROPDOWN );
     aModel.mbShowInputMsg = getFlag( nFlags, BIFF_DATAVAL_SHOWINPUT );
@@ -231,24 +231,22 @@ void OoxDataValidationsContext::importDataValidation( RecordInputStream& rStrm )
 
 // ============================================================================
 
-OoxWorksheetFragment::OoxWorksheetFragment( const WorkbookHelper& rHelper,
-        const OUString& rFragmentPath, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
-    OoxWorksheetFragmentBase( rHelper, rFragmentPath, xProgressBar, eSheetType, nSheet )
+WorksheetFragment::WorksheetFragment( const WorkbookHelper& rHelper,
+        const OUString& rFragmentPath, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+    WorksheetFragmentBase( rHelper, rFragmentPath, rxProgressBar, eSheetType, nSheet )
 {
     // import data tables related to this worksheet
     RelationsRef xTableRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "table" ) );
     for( Relations::const_iterator aIt = xTableRels->begin(), aEnd = xTableRels->end(); aIt != aEnd; ++aIt )
-        importOoxFragment( new OoxTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
+        importOoxFragment( new TableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
 
     // import comments related to this worksheet
     OUString aCommentsFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "comments" ) );
     if( aCommentsFragmentPath.getLength() > 0 )
-        importOoxFragment( new OoxCommentsFragment( *this, aCommentsFragmentPath ) );
+        importOoxFragment( new CommentsFragment( *this, aCommentsFragmentPath ) );
 }
 
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef WorksheetFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
 {
     switch( getCurrentElement() )
     {
@@ -268,10 +266,10 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
         case XLS_TOKEN( dialogsheet ):
             switch( nElement )
             {
-                case XLS_TOKEN( sheetData ):                return new OoxSheetDataContext( *this );
-                case XLS_TOKEN( autoFilter ):               return new OoxAutoFilterContext( *this );
-                case XLS_TOKEN( conditionalFormatting ):    return new OoxCondFormatContext( *this );
-                case XLS_TOKEN( dataValidations ):          return new OoxDataValidationsContext( *this );
+                case XLS_TOKEN( sheetData ):                return new SheetDataContext( *this );
+                case XLS_TOKEN( autoFilter ):               return new AutoFilterContext( *this );
+                case XLS_TOKEN( conditionalFormatting ):    return new CondFormatContext( *this );
+                case XLS_TOKEN( dataValidations ):          return new DataValidationsContext( *this );
 
                 case XLS_TOKEN( sheetViews ):
                 case XLS_TOKEN( cols ):
@@ -295,7 +293,7 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
                 case XLS_TOKEN( drawing ):          importDrawing( rAttribs );                                      break;
                 case XLS_TOKEN( legacyDrawing ):    importLegacyDrawing( rAttribs );                                break;
                 case XLS_TOKEN( scenarios ):
-                    return new OoxScenariosContext( *this );
+                    return new ScenariosContext( *this );
             }
         break;
 
@@ -360,7 +358,7 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
     return 0;
 }
 
-void OoxWorksheetFragment::onCharacters( const OUString& rChars )
+void WorksheetFragment::onCharacters( const OUString& rChars )
 {
     switch( getCurrentElement() )
     {
@@ -375,118 +373,115 @@ void OoxWorksheetFragment::onCharacters( const OUString& rChars )
     }
 }
 
-ContextHandlerRef OoxWorksheetFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef WorksheetFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
 {
     switch( getCurrentElement() )
     {
         case XML_ROOT_CONTEXT:
-            if( nRecId == OOBIN_ID_WORKSHEET ) return this;
+            if( nRecId == BIFF12_ID_WORKSHEET ) return this;
         break;
 
-        case OOBIN_ID_WORKSHEET:
+        case BIFF12_ID_WORKSHEET:
             switch( nRecId )
             {
-                case OOBIN_ID_SHEETDATA:        return new OoxSheetDataContext( *this );
-                case OOBIN_ID_CONDFORMATTING:   return new OoxCondFormatContext( *this );
-                case OOBIN_ID_DATAVALIDATIONS:  return new OoxDataValidationsContext( *this );
-
-                case OOBIN_ID_SHEETVIEWS:
-                case OOBIN_ID_COLS:
-                case OOBIN_ID_MERGECELLS:
-                case OOBIN_ID_ROWBREAKS:
-                case OOBIN_ID_COLBREAKS:
-                case OOBIN_ID_OLEOBJECTS:
-                case OOBIN_ID_CONTROLS:         return this;
-
-                case OOBIN_ID_SHEETPR:          getWorksheetSettings().importSheetPr( rStrm );              break;
-                case OOBIN_ID_DIMENSION:        importDimension( rStrm );                                   break;
-                case OOBIN_ID_SHEETFORMATPR:    importSheetFormatPr( rStrm );                               break;
-                case OOBIN_ID_HYPERLINK:        importHyperlink( rStrm );                                   break;
-                case OOBIN_ID_PAGEMARGINS:      getPageSettings().importPageMargins( rStrm );               break;
-                case OOBIN_ID_PAGESETUP:        getPageSettings().importPageSetup( getRelations(), rStrm ); break;
-                case OOBIN_ID_PRINTOPTIONS:     getPageSettings().importPrintOptions( rStrm );              break;
-                case OOBIN_ID_HEADERFOOTER:     getPageSettings().importHeaderFooter( rStrm );              break;
-                case OOBIN_ID_PICTURE:          getPageSettings().importPicture( getRelations(), rStrm );   break;
-                case OOBIN_ID_SHEETPROTECTION:  getWorksheetSettings().importSheetProtection( rStrm );      break;
-                case OOBIN_ID_PHONETICPR:       getWorksheetSettings().importPhoneticPr( rStrm );           break;
-                case OOBIN_ID_DRAWING:          importDrawing( rStrm );                                     break;
-                case OOBIN_ID_LEGACYDRAWING:    importLegacyDrawing( rStrm );                               break;
-                case OOBIN_ID_SCENARIOS:
-                    return new OoxScenariosContext( *this );
+                case BIFF12_ID_SHEETDATA:       return new SheetDataContext( *this );
+                case BIFF12_ID_CONDFORMATTING:  return new CondFormatContext( *this );
+                case BIFF12_ID_DATAVALIDATIONS: return new DataValidationsContext( *this );
+                case BIFF12_ID_SCENARIOS:       return new ScenariosContext( *this );
+
+                case BIFF12_ID_SHEETVIEWS:
+                case BIFF12_ID_COLS:
+                case BIFF12_ID_MERGECELLS:
+                case BIFF12_ID_ROWBREAKS:
+                case BIFF12_ID_COLBREAKS:
+                case BIFF12_ID_OLEOBJECTS:
+                case BIFF12_ID_CONTROLS:        return this;
+
+                case BIFF12_ID_SHEETPR:         getWorksheetSettings().importSheetPr( rStrm );              break;
+                case BIFF12_ID_DIMENSION:       importDimension( rStrm );                                   break;
+                case BIFF12_ID_SHEETFORMATPR:   importSheetFormatPr( rStrm );                               break;
+                case BIFF12_ID_HYPERLINK:       importHyperlink( rStrm );                                   break;
+                case BIFF12_ID_PAGEMARGINS:     getPageSettings().importPageMargins( rStrm );               break;
+                case BIFF12_ID_PAGESETUP:       getPageSettings().importPageSetup( getRelations(), rStrm ); break;
+                case BIFF12_ID_PRINTOPTIONS:    getPageSettings().importPrintOptions( rStrm );              break;
+                case BIFF12_ID_HEADERFOOTER:    getPageSettings().importHeaderFooter( rStrm );              break;
+                case BIFF12_ID_PICTURE:         getPageSettings().importPicture( getRelations(), rStrm );   break;
+                case BIFF12_ID_SHEETPROTECTION: getWorksheetSettings().importSheetProtection( rStrm );      break;
+                case BIFF12_ID_PHONETICPR:      getWorksheetSettings().importPhoneticPr( rStrm );           break;
+                case BIFF12_ID_DRAWING:         importDrawing( rStrm );                                     break;
+                case BIFF12_ID_LEGACYDRAWING:   importLegacyDrawing( rStrm );                               break;
             }
         break;
 
-        case OOBIN_ID_SHEETVIEWS:
+        case BIFF12_ID_SHEETVIEWS:
             switch( nRecId )
             {
-                case OOBIN_ID_SHEETVIEW:        getSheetViewSettings().importSheetView( rStrm );            return this;
+                case BIFF12_ID_SHEETVIEW:       getSheetViewSettings().importSheetView( rStrm );            return this;
             }
         break;
-        case OOBIN_ID_SHEETVIEW:
+        case BIFF12_ID_SHEETVIEW:
             switch( nRecId )
             {
-                case OOBIN_ID_PANE:             getSheetViewSettings().importPane( rStrm );                 break;
-                case OOBIN_ID_SELECTION:        getSheetViewSettings().importSelection( rStrm );            break;
+                case BIFF12_ID_PANE:            getSheetViewSettings().importPane( rStrm );                 break;
+                case BIFF12_ID_SELECTION:       getSheetViewSettings().importSelection( rStrm );            break;
             }
         break;
 
-        case OOBIN_ID_COLS:
-            if( nRecId == OOBIN_ID_COL ) importCol( rStrm );
+        case BIFF12_ID_COLS:
+            if( nRecId == BIFF12_ID_COL ) importCol( rStrm );
         break;
-        case OOBIN_ID_MERGECELLS:
-            if( nRecId == OOBIN_ID_MERGECELL ) importMergeCell( rStrm );
+        case BIFF12_ID_MERGECELLS:
+            if( nRecId == BIFF12_ID_MERGECELL ) importMergeCell( rStrm );
         break;
-        case OOBIN_ID_ROWBREAKS:
-            if( nRecId == OOBIN_ID_BRK ) importBrk( rStrm, true );
+        case BIFF12_ID_ROWBREAKS:
+            if( nRecId == BIFF12_ID_BRK ) importBrk( rStrm, true );
         break;
-        case OOBIN_ID_COLBREAKS:
-            if( nRecId == OOBIN_ID_BRK ) importBrk( rStrm, false );
+        case BIFF12_ID_COLBREAKS:
+            if( nRecId == BIFF12_ID_BRK ) importBrk( rStrm, false );
         break;
-        case OOBIN_ID_OLEOBJECTS:
-            if( nRecId == OOBIN_ID_OLEOBJECT ) importOleObject( rStrm );
+        case BIFF12_ID_OLEOBJECTS:
+            if( nRecId == BIFF12_ID_OLEOBJECT ) importOleObject( rStrm );
         break;
-        case OOBIN_ID_CONTROLS:
-            if( nRecId == OOBIN_ID_CONTROL ) importControl( rStrm );
+        case BIFF12_ID_CONTROLS:
+            if( nRecId == BIFF12_ID_CONTROL ) importControl( rStrm );
         break;
     }
     return 0;
 }
 
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxWorksheetFragment::getRecordInfos() const
+const RecordInfo* WorksheetFragment::getRecordInfos() const
 {
     static const RecordInfo spRecInfos[] =
     {
-        { OOBIN_ID_CFRULE,              OOBIN_ID_CFRULE + 1             },
-        { OOBIN_ID_COLBREAKS,           OOBIN_ID_COLBREAKS + 1          },
-        { OOBIN_ID_COLORSCALE,          OOBIN_ID_COLORSCALE + 1         },
-        { OOBIN_ID_COLS,                OOBIN_ID_COLS + 1               },
-        { OOBIN_ID_CONDFORMATTING,      OOBIN_ID_CONDFORMATTING + 1     },
-        { OOBIN_ID_CONTROLS,            OOBIN_ID_CONTROLS + 2           },
-        { OOBIN_ID_CUSTOMSHEETVIEW,     OOBIN_ID_CUSTOMSHEETVIEW + 1    },
-        { OOBIN_ID_CUSTOMSHEETVIEWS,    OOBIN_ID_CUSTOMSHEETVIEWS + 3   },
-        { OOBIN_ID_DATABAR,             OOBIN_ID_DATABAR + 1            },
-        { OOBIN_ID_DATAVALIDATIONS,     OOBIN_ID_DATAVALIDATIONS + 1    },
-        { OOBIN_ID_HEADERFOOTER,        OOBIN_ID_HEADERFOOTER + 1       },
-        { OOBIN_ID_ICONSET,             OOBIN_ID_ICONSET + 1            },
-        { OOBIN_ID_MERGECELLS,          OOBIN_ID_MERGECELLS + 1         },
-        { OOBIN_ID_OLEOBJECTS,          OOBIN_ID_OLEOBJECTS + 2         },
-        { OOBIN_ID_ROW,                 -1                              },
-        { OOBIN_ID_ROWBREAKS,           OOBIN_ID_ROWBREAKS + 1          },
-        { OOBIN_ID_SCENARIO,            OOBIN_ID_SCENARIO + 1           },
-        { OOBIN_ID_SCENARIOS,           OOBIN_ID_SCENARIOS + 1          },
-        { OOBIN_ID_SHEETDATA,           OOBIN_ID_SHEETDATA + 1          },
-        { OOBIN_ID_SHEETVIEW,           OOBIN_ID_SHEETVIEW + 1          },
-        { OOBIN_ID_SHEETVIEWS,          OOBIN_ID_SHEETVIEWS + 1         },
-        { OOBIN_ID_TABLEPARTS,          OOBIN_ID_TABLEPARTS + 2         },
-        { OOBIN_ID_WORKSHEET,           OOBIN_ID_WORKSHEET + 1          },
+        { BIFF12_ID_CFRULE,             BIFF12_ID_CFRULE + 1            },
+        { BIFF12_ID_COLBREAKS,          BIFF12_ID_COLBREAKS + 1         },
+        { BIFF12_ID_COLORSCALE,         BIFF12_ID_COLORSCALE + 1        },
+        { BIFF12_ID_COLS,               BIFF12_ID_COLS + 1              },
+        { BIFF12_ID_CONDFORMATTING,     BIFF12_ID_CONDFORMATTING + 1    },
+        { BIFF12_ID_CONTROLS,           BIFF12_ID_CONTROLS + 2          },
+        { BIFF12_ID_CUSTOMSHEETVIEW,    BIFF12_ID_CUSTOMSHEETVIEW + 1   },
+        { BIFF12_ID_CUSTOMSHEETVIEWS,   BIFF12_ID_CUSTOMSHEETVIEWS + 3  },
+        { BIFF12_ID_DATABAR,            BIFF12_ID_DATABAR + 1           },
+        { BIFF12_ID_DATAVALIDATIONS,    BIFF12_ID_DATAVALIDATIONS + 1   },
+        { BIFF12_ID_HEADERFOOTER,       BIFF12_ID_HEADERFOOTER + 1      },
+        { BIFF12_ID_ICONSET,            BIFF12_ID_ICONSET + 1           },
+        { BIFF12_ID_MERGECELLS,         BIFF12_ID_MERGECELLS + 1        },
+        { BIFF12_ID_OLEOBJECTS,         BIFF12_ID_OLEOBJECTS + 2        },
+        { BIFF12_ID_ROW,                -1                              },
+        { BIFF12_ID_ROWBREAKS,          BIFF12_ID_ROWBREAKS + 1         },
+        { BIFF12_ID_SCENARIO,           BIFF12_ID_SCENARIO + 1          },
+        { BIFF12_ID_SCENARIOS,          BIFF12_ID_SCENARIOS + 1         },
+        { BIFF12_ID_SHEETDATA,          BIFF12_ID_SHEETDATA + 1         },
+        { BIFF12_ID_SHEETVIEW,          BIFF12_ID_SHEETVIEW + 1         },
+        { BIFF12_ID_SHEETVIEWS,         BIFF12_ID_SHEETVIEWS + 1        },
+        { BIFF12_ID_TABLEPARTS,         BIFF12_ID_TABLEPARTS + 2        },
+        { BIFF12_ID_WORKSHEET,          BIFF12_ID_WORKSHEET + 1         },
         { -1,                           -1                              }
     };
     return spRecInfos;
 }
 
-void OoxWorksheetFragment::initializeImport()
+void WorksheetFragment::initializeImport()
 {
     // initial processing in base class WorksheetHelper
     initializeWorksheetImport();
@@ -494,15 +489,15 @@ void OoxWorksheetFragment::initializeImport()
     // import query table fragments related to this worksheet
     RelationsRef xQueryRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "queryTable" ) );
     for( Relations::const_iterator aIt = xQueryRels->begin(), aEnd = xQueryRels->end(); aIt != aEnd; ++aIt )
-        importOoxFragment( new OoxQueryTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
+        importOoxFragment( new QueryTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
 
     // import pivot table fragments related to this worksheet
     RelationsRef xPivotRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "pivotTable" ) );
     for( Relations::const_iterator aIt = xPivotRels->begin(), aEnd = xPivotRels->end(); aIt != aEnd; ++aIt )
-        importOoxFragment( new OoxPivotTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
+        importOoxFragment( new PivotTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
 }
 
-void OoxWorksheetFragment::finalizeImport()
+void WorksheetFragment::finalizeImport()
 {
     // final processing in base class WorksheetHelper
     finalizeWorksheetImport();
@@ -510,13 +505,13 @@ void OoxWorksheetFragment::finalizeImport()
 
 // private --------------------------------------------------------------------
 
-void OoxWorksheetFragment::importPageSetUpPr( const AttributeList& rAttribs )
+void WorksheetFragment::importPageSetUpPr( const AttributeList& rAttribs )
 {
     // for whatever reason, this flag is still stored separated from the page settings
     getPageSettings().setFitToPagesMode( rAttribs.getBool( XML_fitToPage, false ) );
 }
 
-void OoxWorksheetFragment::importDimension( const AttributeList& rAttribs )
+void WorksheetFragment::importDimension( const AttributeList& rAttribs )
 {
     CellRangeAddress aRange;
     getAddressConverter().convertToCellRangeUnchecked( aRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex() );
@@ -528,7 +523,7 @@ void OoxWorksheetFragment::importDimension( const AttributeList& rAttribs )
         extendUsedArea( aRange );
 }
 
-void OoxWorksheetFragment::importSheetFormatPr( const AttributeList& rAttribs )
+void WorksheetFragment::importSheetFormatPr( const AttributeList& rAttribs )
 {
     // default column settings
     setBaseColumnWidth( rAttribs.getInteger( XML_baseColWidth, 8 ) );
@@ -542,7 +537,7 @@ void OoxWorksheetFragment::importSheetFormatPr( const AttributeList& rAttribs )
         rAttribs.getBool( XML_thickBottom, false ) );
 }
 
-void OoxWorksheetFragment::importCol( const AttributeList& rAttribs )
+void WorksheetFragment::importCol( const AttributeList& rAttribs )
 {
     ColumnModel aModel;
     aModel.mnFirstCol     = rAttribs.getInteger( XML_min, -1 );
@@ -557,14 +552,14 @@ void OoxWorksheetFragment::importCol( const AttributeList& rAttribs )
     setColumnModel( aModel );
 }
 
-void OoxWorksheetFragment::importMergeCell( const AttributeList& rAttribs )
+void WorksheetFragment::importMergeCell( const AttributeList& rAttribs )
 {
     CellRangeAddress aRange;
     if( getAddressConverter().convertToCellRange( aRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex(), true, true ) )
         setMergedRange( aRange );
 }
 
-void OoxWorksheetFragment::importHyperlink( const AttributeList& rAttribs )
+void WorksheetFragment::importHyperlink( const AttributeList& rAttribs )
 {
     HyperlinkModel aModel;
     if( getAddressConverter().convertToCellRange( aModel.maRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex(), true, true ) )
@@ -577,7 +572,7 @@ void OoxWorksheetFragment::importHyperlink( const AttributeList& rAttribs )
     }
 }
 
-void OoxWorksheetFragment::importBrk( const AttributeList& rAttribs, bool bRowBreak )
+void WorksheetFragment::importBrk( const AttributeList& rAttribs, bool bRowBreak )
 {
     PageBreakModel aModel;
     aModel.mnColRow = rAttribs.getInteger( XML_id, 0 );
@@ -587,22 +582,22 @@ void OoxWorksheetFragment::importBrk( const AttributeList& rAttribs, bool bRowBr
     setPageBreak( aModel, bRowBreak );
 }
 
-void OoxWorksheetFragment::importDrawing( const AttributeList& rAttribs )
+void WorksheetFragment::importDrawing( const AttributeList& rAttribs )
 {
     setDrawingPath( getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ) );
 }
 
-void OoxWorksheetFragment::importLegacyDrawing( const AttributeList& rAttribs )
+void WorksheetFragment::importLegacyDrawing( const AttributeList& rAttribs )
 {
     setVmlDrawingPath( getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ) );
 }
 
-void OoxWorksheetFragment::importOleObject( const AttributeList& rAttribs )
+void WorksheetFragment::importOleObject( const AttributeList& rAttribs )
 {
     ::oox::vml::OleObjectInfo aInfo;
     aInfo.setShapeId( rAttribs.getInteger( XML_shapeId, 0 ) );
     OSL_ENSURE( rAttribs.hasAttribute( XML_link ) != rAttribs.hasAttribute( R_TOKEN( id ) ),
-        "OoxWorksheetFragment::importOleObject - OLE object must be either linked or embedded" );
+        "WorksheetFragment::importOleObject - OLE object must be either linked or embedded" );
     aInfo.mbLinked = rAttribs.hasAttribute( XML_link );
     if( aInfo.mbLinked )
         aInfo.maTargetLink = getFormulaParser().importOleTargetLink( rAttribs.getString( XML_link, OUString() ) );
@@ -615,7 +610,7 @@ void OoxWorksheetFragment::importOleObject( const AttributeList& rAttribs )
     getVmlDrawing().registerOleObject( aInfo );
 }
 
-void OoxWorksheetFragment::importControl( const AttributeList& rAttribs )
+void WorksheetFragment::importControl( const AttributeList& rAttribs )
 {
     ::oox::vml::ControlInfo aInfo;
     aInfo.setShapeId( rAttribs.getInteger( XML_shapeId, 0 ) );
@@ -624,7 +619,7 @@ void OoxWorksheetFragment::importControl( const AttributeList& rAttribs )
     getVmlDrawing().registerControl( aInfo );
 }
 
-void OoxWorksheetFragment::importDimension( RecordInputStream& rStrm )
+void WorksheetFragment::importDimension( RecordInputStream& rStrm )
 {
     BinRange aBinRange;
     aBinRange.read( rStrm );
@@ -638,7 +633,7 @@ void OoxWorksheetFragment::importDimension( RecordInputStream& rStrm )
         extendUsedArea( aRange );
 }
 
-void OoxWorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm )
+void WorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm )
 {
     sal_Int32 nDefaultWidth;
     sal_uInt16 nBaseWidth, nDefaultHeight, nFlags;
@@ -646,9 +641,9 @@ void OoxWorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm )
 
     // base column with
     setBaseColumnWidth( nBaseWidth );
-    // default width is stored as 1/256th of a character in OOBIN, convert to entire character
+    // default width is stored as 1/256th of a character in BIFF12, convert to entire character
     setDefaultColumnWidth( static_cast< double >( nDefaultWidth ) / 256.0 );
-    // row height is in twips in OOBIN, convert to points; equal flags in BIFF and OOBIN
+    // row height is in twips in BIFF12, convert to points; equal flags in all BIFFs
     setDefaultRowSettings(
         nDefaultHeight / 20.0,
         getFlag( nFlags, BIFF_DEFROW_CUSTOMHEIGHT ),
@@ -657,7 +652,7 @@ void OoxWorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm )
         getFlag( nFlags, BIFF_DEFROW_THICKBOTTOM ) );
 }
 
-void OoxWorksheetFragment::importCol( RecordInputStream& rStrm )
+void WorksheetFragment::importCol( RecordInputStream& rStrm )
 {
     ColumnModel aModel;
 
@@ -665,12 +660,12 @@ void OoxWorksheetFragment::importCol( RecordInputStream& rStrm )
     sal_uInt16 nFlags;
     rStrm >> aModel.mnFirstCol >> aModel.mnLastCol >> nWidth >> aModel.mnXfId >> nFlags;
 
-    // column indexes are 0-based in OOBIN, but ColumnModel expects 1-based
+    // column indexes are 0-based in BIFF12, but ColumnModel expects 1-based
     ++aModel.mnFirstCol;
     ++aModel.mnLastCol;
-    // width is stored as 1/256th of a character in OOBIN, convert to entire character
+    // width is stored as 1/256th of a character in BIFF12, convert to entire character
     aModel.mfWidth        = static_cast< double >( nWidth ) / 256.0;
-    // equal flags in BIFF and OOBIN
+    // equal flags in all BIFFs
     aModel.mnLevel        = extractValue< sal_Int32 >( nFlags, 8, 3 );
     aModel.mbShowPhonetic = getFlag( nFlags, BIFF_COLINFO_SHOWPHONETIC );
     aModel.mbHidden       = getFlag( nFlags, BIFF_COLINFO_HIDDEN );
@@ -679,7 +674,7 @@ void OoxWorksheetFragment::importCol( RecordInputStream& rStrm )
     setColumnModel( aModel );
 }
 
-void OoxWorksheetFragment::importMergeCell( RecordInputStream& rStrm )
+void WorksheetFragment::importMergeCell( RecordInputStream& rStrm )
 {
     BinRange aBinRange;
     rStrm >> aBinRange;
@@ -688,7 +683,7 @@ void OoxWorksheetFragment::importMergeCell( RecordInputStream& rStrm )
         setMergedRange( aRange );
 }
 
-void OoxWorksheetFragment::importHyperlink( RecordInputStream& rStrm )
+void WorksheetFragment::importHyperlink( RecordInputStream& rStrm )
 {
     BinRange aBinRange;
     rStrm >> aBinRange;
@@ -701,7 +696,7 @@ void OoxWorksheetFragment::importHyperlink( RecordInputStream& rStrm )
     }
 }
 
-void OoxWorksheetFragment::importBrk( RecordInputStream& rStrm, bool bRowBreak )
+void WorksheetFragment::importBrk( RecordInputStream& rStrm, bool bRowBreak )
 {
     PageBreakModel aModel;
     sal_Int32 nManual;
@@ -710,35 +705,35 @@ void OoxWorksheetFragment::importBrk( RecordInputStream& rStrm, bool bRowBreak )
     setPageBreak( aModel, bRowBreak );
 }
 
-void OoxWorksheetFragment::importDrawing( RecordInputStream& rStrm )
+void WorksheetFragment::importDrawing( RecordInputStream& rStrm )
 {
     setDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) );
 }
 
-void OoxWorksheetFragment::importLegacyDrawing( RecordInputStream& rStrm )
+void WorksheetFragment::importLegacyDrawing( RecordInputStream& rStrm )
 {
     setVmlDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) );
 }
 
-void OoxWorksheetFragment::importOleObject( RecordInputStream& rStrm )
+void WorksheetFragment::importOleObject( RecordInputStream& rStrm )
 {
     ::oox::vml::OleObjectInfo aInfo;
     sal_Int32 nAspect, nUpdateMode, nShapeId;
     sal_uInt16 nFlags;
     rStrm >> nAspect >> nUpdateMode >> nShapeId >> nFlags >> aInfo.maProgId;
-    aInfo.mbLinked = getFlag( nFlags, OOBIN_OLEOBJECT_LINKED );
+    aInfo.mbLinked = getFlag( nFlags, BIFF12_OLEOBJECT_LINKED );
     if( aInfo.mbLinked )
         aInfo.maTargetLink = getFormulaParser().importOleTargetLink( rStrm );
     else
         importEmbeddedOleData( aInfo.maEmbeddedData, rStrm.readString() );
     aInfo.setShapeId( nShapeId );
-    aInfo.mbShowAsIcon = nAspect == OOBIN_OLEOBJECT_ICON;
-    aInfo.mbAutoUpdate = nUpdateMode == OOBIN_OLEOBJECT_ALWAYS;
-    aInfo.mbAutoLoad = getFlag( nFlags, OOBIN_OLEOBJECT_AUTOLOAD );
+    aInfo.mbShowAsIcon = nAspect == BIFF12_OLEOBJECT_ICON;
+    aInfo.mbAutoUpdate = nUpdateMode == BIFF12_OLEOBJECT_ALWAYS;
+    aInfo.mbAutoLoad = getFlag( nFlags, BIFF12_OLEOBJECT_AUTOLOAD );
     getVmlDrawing().registerOleObject( aInfo );
 }
 
-void OoxWorksheetFragment::importControl( RecordInputStream& rStrm )
+void WorksheetFragment::importControl( RecordInputStream& rStrm )
 {
     ::oox::vml::ControlInfo aInfo;
     aInfo.setShapeId( rStrm.readInt32() );
@@ -747,7 +742,7 @@ void OoxWorksheetFragment::importControl( RecordInputStream& rStrm )
     getVmlDrawing().registerControl( aInfo );
 }
 
-void OoxWorksheetFragment::importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const OUString& rRelId )
+void WorksheetFragment::importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const OUString& rRelId )
 {
     OUString aFragmentPath = getFragmentPathFromRelId( rRelId );
     if( aFragmentPath.getLength() > 0 )
@@ -756,8 +751,9 @@ void OoxWorksheetFragment::importEmbeddedOleData( StreamDataSequence& orEmbedded
 
 // ============================================================================
 
-BiffWorksheetFragment::BiffWorksheetFragment( const BiffWorkbookFragmentBase& rParent, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
-    BiffWorksheetFragmentBase( rParent, xProgressBar, eSheetType, nSheet )
+BiffWorksheetFragment::BiffWorksheetFragment( const BiffWorkbookFragmentBase& rParent,
+        const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+    BiffWorksheetFragmentBase( rParent, rxProgressBar, eSheetType, nSheet )
 {
 }
 
@@ -780,9 +776,10 @@ bool BiffWorksheetFragment::importFragment()
     PageSettings& rPageSett           = getPageSettings();
 
     // process all record in this sheet fragment
-    while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
+    BiffInputStream& rStrm = getInputStream();
+    while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
     {
-        if( isBofRecord() )
+        if( BiffHelper::isBofRecord( rStrm ) )
         {
             // skip unknown embedded fragments (BOF/EOF blocks)
             skipFragment();
@@ -790,127 +787,128 @@ bool BiffWorksheetFragment::importFragment()
         else
         {
             // cache base stream position to detect if record is already processed
-            sal_Int64 nStrmPos = mrStrm.tellBase();
-            sal_uInt16 nRecId = mrStrm.getRecId();
+            sal_Int64 nStrmPos = rStrm.tellBase();
+            sal_uInt16 nRecId = rStrm.getRecId();
 
             switch( nRecId )
             {
                 // records in all BIFF versions
-                case BIFF_ID_BOTTOMMARGIN:      rPageSett.importBottomMargin( mrStrm );     break;
-                case BIFF_ID_CALCCOUNT:         rWorkbookSett.importCalcCount( mrStrm );    break;
-                case BIFF_ID_CALCMODE:          rWorkbookSett.importCalcMode( mrStrm );     break;
-                case BIFF_ID_DEFCOLWIDTH:       importDefColWidth();                        break;
-                case BIFF_ID_DELTA:             rWorkbookSett.importDelta( mrStrm );        break;
-                case BIFF2_ID_DIMENSION:        importDimension();                          break;
-                case BIFF3_ID_DIMENSION:        importDimension();                          break;
-                case BIFF_ID_FOOTER:            rPageSett.importFooter( mrStrm );           break;
-                case BIFF_ID_HEADER:            rPageSett.importHeader( mrStrm );           break;
-                case BIFF_ID_HORPAGEBREAKS:     importPageBreaks( true );                   break;
-                case BIFF_ID_ITERATION:         rWorkbookSett.importIteration( mrStrm );    break;
-                case BIFF_ID_LEFTMARGIN:        rPageSett.importLeftMargin( mrStrm );       break;
-                case BIFF_ID_PANE:              rSheetViewSett.importPane( mrStrm );        break;
-                case BIFF_ID_PASSWORD:          rWorksheetSett.importPassword( mrStrm );    break;
-                case BIFF_ID_PRINTGRIDLINES:    rPageSett.importPrintGridLines( mrStrm );   break;
-                case BIFF_ID_PRINTHEADERS:      rPageSett.importPrintHeaders( mrStrm );     break;
-                case BIFF_ID_PROTECT:           rWorksheetSett.importProtect( mrStrm );     break;
-                case BIFF_ID_REFMODE:           rWorkbookSett.importRefMode( mrStrm );      break;
-                case BIFF_ID_RIGHTMARGIN:       rPageSett.importRightMargin( mrStrm );      break;
-                case BIFF_ID_SELECTION:         rSheetViewSett.importSelection( mrStrm );   break;
-                case BIFF_ID_TOPMARGIN:         rPageSett.importTopMargin( mrStrm );        break;
-                case BIFF_ID_VERPAGEBREAKS:     importPageBreaks( false );                  break;
+                case BIFF_ID_BOTTOMMARGIN:      rPageSett.importBottomMargin( rStrm );      break;
+                case BIFF_ID_CALCCOUNT:         rWorkbookSett.importCalcCount( rStrm );     break;
+                case BIFF_ID_CALCMODE:          rWorkbookSett.importCalcMode( rStrm );      break;
+                case BIFF_ID_DEFCOLWIDTH:       importDefColWidth( rStrm );                 break;
+                case BIFF_ID_DELTA:             rWorkbookSett.importDelta( rStrm );         break;
+                case BIFF2_ID_DIMENSION:        importDimension( rStrm );                   break;
+                case BIFF3_ID_DIMENSION:        importDimension( rStrm );                   break;
+                case BIFF_ID_FOOTER:            rPageSett.importFooter( rStrm );            break;
+                case BIFF_ID_HEADER:            rPageSett.importHeader( rStrm );            break;
+                case BIFF_ID_HORPAGEBREAKS:     importPageBreaks( rStrm, true );            break;
+                case BIFF_ID_ITERATION:         rWorkbookSett.importIteration( rStrm );     break;
+                case BIFF_ID_LEFTMARGIN:        rPageSett.importLeftMargin( rStrm );        break;
+                case BIFF_ID_PANE:              rSheetViewSett.importPane( rStrm );         break;
+                case BIFF_ID_PASSWORD:          rWorksheetSett.importPassword( rStrm );     break;
+                case BIFF_ID_PRINTGRIDLINES:    rPageSett.importPrintGridLines( rStrm );    break;
+                case BIFF_ID_PRINTHEADERS:      rPageSett.importPrintHeaders( rStrm );      break;
+                case BIFF_ID_PROTECT:           rWorksheetSett.importProtect( rStrm );      break;
+                case BIFF_ID_REFMODE:           rWorkbookSett.importRefMode( rStrm );       break;
+                case BIFF_ID_RIGHTMARGIN:       rPageSett.importRightMargin( rStrm );       break;
+                case BIFF_ID_SELECTION:         rSheetViewSett.importSelection( rStrm );    break;
+                case BIFF_ID_TOPMARGIN:         rPageSett.importTopMargin( rStrm );         break;
+                case BIFF_ID_VERPAGEBREAKS:     importPageBreaks( rStrm, false );           break;
 
                 // BIFF specific records
                 default: switch( getBiff() )
                 {
                     case BIFF2: switch( nRecId )
                     {
-                        case BIFF_ID_COLUMNDEFAULT: importColumnDefault();                  break;
-                        case BIFF_ID_COLWIDTH:      importColWidth();                       break;
-                        case BIFF2_ID_DEFROWHEIGHT: importDefRowHeight();                   break;
-                        case BIFF2_ID_WINDOW2:      rSheetViewSett.importWindow2( mrStrm ); break;
+                        case BIFF_ID_COLUMNDEFAULT: importColumnDefault( rStrm );           break;
+                        case BIFF_ID_COLWIDTH:      importColWidth( rStrm );                break;
+                        case BIFF2_ID_DEFROWHEIGHT: importDefRowHeight( rStrm );            break;
+                        case BIFF2_ID_WINDOW2:      rSheetViewSett.importWindow2( rStrm );  break;
                     }
                     break;
 
                     case BIFF3: switch( nRecId )
                     {
-                        case BIFF_ID_COLINFO:       importColInfo();                                break;
-                        case BIFF_ID_DEFCOLWIDTH:   importDefColWidth();                            break;
-                        case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight();                           break;
-                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( mrStrm );            break;
-                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm );   break;
-                        case BIFF_ID_SAVERECALC:    rWorkbookSett.importSaveRecalc( mrStrm );       break;
-                        case BIFF_ID_SHEETPR:       rWorksheetSett.importSheetPr( mrStrm );         break;
-                        case BIFF_ID_UNCALCED:      rWorkbookSett.importUncalced( mrStrm );         break;
-                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( mrStrm );            break;
-                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( mrStrm );         break;
+                        case BIFF_ID_COLINFO:       importColInfo( rStrm );                         break;
+                        case BIFF_ID_DEFCOLWIDTH:   importDefColWidth( rStrm );                     break;
+                        case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm );                    break;
+                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( rStrm );             break;
+                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm );    break;
+                        case BIFF_ID_SAVERECALC:    rWorkbookSett.importSaveRecalc( rStrm );        break;
+                        case BIFF_ID_SHEETPR:       rWorksheetSett.importSheetPr( rStrm );          break;
+                        case BIFF_ID_UNCALCED:      rWorkbookSett.importUncalced( rStrm );          break;
+                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( rStrm );             break;
+                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( rStrm );          break;
 
                     }
                     break;
 
                     case BIFF4: switch( nRecId )
                     {
-                        case BIFF_ID_COLINFO:       importColInfo();                                break;
-                        case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight();                           break;
-                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( mrStrm );            break;
-                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm );   break;
-                        case BIFF_ID_PAGESETUP:     rPageSett.importPageSetup( mrStrm );            break;
-                        case BIFF_ID_SAVERECALC:    rWorkbookSett.importSaveRecalc( mrStrm );       break;
-                        case BIFF_ID_SHEETPR:       rWorksheetSett.importSheetPr( mrStrm );         break;
-                        case BIFF_ID_STANDARDWIDTH: importStandardWidth();                          break;
-                        case BIFF_ID_UNCALCED:      rWorkbookSett.importUncalced( mrStrm );         break;
-                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( mrStrm );            break;
-                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( mrStrm );         break;
+                        case BIFF_ID_COLINFO:       importColInfo( rStrm );                         break;
+                        case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm );                    break;
+                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( rStrm );             break;
+                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm );    break;
+                        case BIFF_ID_PAGESETUP:     rPageSett.importPageSetup( rStrm );             break;
+                        case BIFF_ID_SAVERECALC:    rWorkbookSett.importSaveRecalc( rStrm );        break;
+                        case BIFF_ID_SHEETPR:       rWorksheetSett.importSheetPr( rStrm );          break;
+                        case BIFF_ID_STANDARDWIDTH: importStandardWidth( rStrm );                   break;
+                        case BIFF_ID_UNCALCED:      rWorkbookSett.importUncalced( rStrm );          break;
+                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( rStrm );             break;
+                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( rStrm );          break;
                     }
                     break;
 
                     case BIFF5: switch( nRecId )
                     {
-                        case BIFF_ID_COLINFO:       importColInfo();                                break;
-                        case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight();                           break;
-                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( mrStrm );            break;
-                        case BIFF_ID_MERGEDCELLS:   importMergedCells();                            break;  // #i62300# also in BIFF5
-                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm );   break;
-                        case BIFF_ID_PAGESETUP:     rPageSett.importPageSetup( mrStrm );            break;
-                        case BIFF_ID_PTDEFINITION:  importPTDefinition();                           break;
-                        case BIFF_ID_SAVERECALC:    rWorkbookSett.importSaveRecalc( mrStrm );       break;
-                        case BIFF_ID_SCENPROTECT:   rWorksheetSett.importScenProtect( mrStrm );     break;
-                        case BIFF_ID_SCL:           rSheetViewSett.importScl( mrStrm );             break;
-                        case BIFF_ID_SHEETPR:       rWorksheetSett.importSheetPr( mrStrm );         break;
-                        case BIFF_ID_STANDARDWIDTH: importStandardWidth();                          break;
-                        case BIFF_ID_UNCALCED:      rWorkbookSett.importUncalced( mrStrm );         break;
-                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( mrStrm );            break;
-                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( mrStrm );         break;
+                        case BIFF_ID_COLINFO:       importColInfo( rStrm );                         break;
+                        case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm );                    break;
+                        case BIFF_ID_HCENTER:       rPageSett.importHorCenter( rStrm );             break;
+                        case BIFF_ID_MERGEDCELLS:   importMergedCells( rStrm );                     break;  // #i62300# also in BIFF5
+                        case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm );    break;
+                        case BIFF_ID_PAGESETUP:     rPageSett.importPageSetup( rStrm );             break;
+                        case BIFF_ID_PTDEFINITION:  importPTDefinition( rStrm );                    break;
+                        case BIFF_ID_SAVERECALC:    rWorkbookSett.importSaveRecalc( rStrm );        break;
+                        case BIFF_ID_SCENPROTECT:   rWorksheetSett.importScenProtect( rStrm );      break;
+                        case BIFF_ID_SCL:           rSheetViewSett.importScl( rStrm );              break;
+                        case BIFF_ID_SHEETPR:       rWorksheetSett.importSheetPr( rStrm );          break;
+                        case BIFF_ID_STANDARDWIDTH: importStandardWidth( rStrm );                   break;
+                        case BIFF_ID_UNCALCED:      rWorkbookSett.importUncalced( rStrm );          break;
+                        case BIFF_ID_VCENTER:       rPageSett.importVerCenter( rStrm );             break;
+                        case BIFF3_ID_WINDOW2:      rSheetViewSett.importWindow2( rStrm );          break;
                     }
                     break;
 
                     case BIFF8: switch( nRecId )
                     {
-                        case BIFF_ID_CFHEADER:          rCondFormats.importCfHeader( mrStrm );          break;
-                        case BIFF_ID_CODENAME:          rWorksheetSett.importCodeName( mrStrm );        break;
-                        case BIFF_ID_COLINFO:           importColInfo();                                break;
-                        case BIFF_ID_DATAVALIDATION:    importDataValidation();                         break;
-                        case BIFF_ID_DATAVALIDATIONS:   importDataValidations();                        break;
-                        case BIFF3_ID_DEFROWHEIGHT:     importDefRowHeight();                           break;
-                        case BIFF_ID_HCENTER:           rPageSett.importHorCenter( mrStrm );            break;
-                        case BIFF_ID_HYPERLINK:         importHyperlink();                              break;
-                        case BIFF_ID_LABELRANGES:       importLabelRanges();                            break;
-                        case BIFF_ID_MERGEDCELLS:       importMergedCells();                            break;
-                        case BIFF_ID_OBJECTPROTECT:     rWorksheetSett.importObjectProtect( mrStrm );   break;
-                        case BIFF_ID_PAGESETUP:         rPageSett.importPageSetup( mrStrm );            break;
-                        case BIFF_ID_PHONETICPR:        rWorksheetSett.importPhoneticPr( mrStrm );      break;
-                        case BIFF_ID_PICTURE:           rPageSett.importPicture( mrStrm );              break;
-                        case BIFF_ID_PTDEFINITION:      importPTDefinition();                           break;
-                        case BIFF_ID_SAVERECALC:        rWorkbookSett.importSaveRecalc( mrStrm );       break;
-                        case BIFF_ID_SCENARIOS:         importScenarios();                              break;
-                        case BIFF_ID_SCENPROTECT:       rWorksheetSett.importScenProtect( mrStrm );     break;
-                        case BIFF_ID_SCL:               rSheetViewSett.importScl( mrStrm );             break;
-                        case BIFF_ID_SHEETEXT:          rWorksheetSett.importSheetExt( mrStrm );        break;
-                        case BIFF_ID_SHEETPR:           rWorksheetSett.importSheetPr( mrStrm );         break;
-                        case BIFF_ID_SHAREDFEATHEAD:    importSharedFeatHead();                         break;
-                        case BIFF_ID_STANDARDWIDTH:     importStandardWidth();                          break;
-                        case BIFF_ID_UNCALCED:          rWorkbookSett.importUncalced( mrStrm );         break;
-                        case BIFF_ID_VCENTER:           rPageSett.importVerCenter( mrStrm );            break;
-                        case BIFF3_ID_WINDOW2:          rSheetViewSett.importWindow2( mrStrm );         break;
+                        case BIFF_ID_CFHEADER:          rCondFormats.importCfHeader( rStrm );           break;
+                        case BIFF_ID_CODENAME:          rWorksheetSett.importCodeName( rStrm );         break;
+                        case BIFF_ID_COLINFO:           importColInfo( rStrm );                         break;
+                        case BIFF_ID_DATAVALIDATION:    importDataValidation( rStrm );                  break;
+                        case BIFF_ID_DATAVALIDATIONS:   importDataValidations( rStrm );                 break;
+                        case BIFF3_ID_DEFROWHEIGHT:     importDefRowHeight( rStrm );                    break;
+                        case BIFF_ID_HCENTER:           rPageSett.importHorCenter( rStrm );             break;
+                        case BIFF_ID_HYPERLINK:         importHyperlink( rStrm );                       break;
+                        case BIFF_ID_LABELRANGES:       importLabelRanges( rStrm );                     break;
+                        case BIFF_ID_MERGEDCELLS:       importMergedCells( rStrm );                     break;
+                        case BIFF_ID_OBJECTPROTECT:     rWorksheetSett.importObjectProtect( rStrm );    break;
+                        case BIFF_ID_PAGESETUP:         rPageSett.importPageSetup( rStrm );             break;
+                        case BIFF_ID_PHONETICPR:        rWorksheetSett.importPhoneticPr( rStrm );       break;
+                        case BIFF_ID_PICTURE:           rPageSett.importPicture( rStrm );               break;
+                        case BIFF_ID_PTDEFINITION:      importPTDefinition( rStrm );                    break;
+                        case BIFF_ID_QUERYTABLE:        importQueryTable( rStrm );                      break;
+                        case BIFF_ID_SAVERECALC:        rWorkbookSett.importSaveRecalc( rStrm );        break;
+                        case BIFF_ID_SCENARIOS:         importScenarios( rStrm );                       break;
+                        case BIFF_ID_SCENPROTECT:       rWorksheetSett.importScenProtect( rStrm );      break;
+                        case BIFF_ID_SCL:               rSheetViewSett.importScl( rStrm );              break;
+                        case BIFF_ID_SHEETEXT:          rWorksheetSett.importSheetExt( rStrm );         break;
+                        case BIFF_ID_SHEETPR:           rWorksheetSett.importSheetPr( rStrm );          break;
+                        case BIFF_ID_SHAREDFEATHEAD:    importSharedFeatHead( rStrm );                  break;
+                        case BIFF_ID_STANDARDWIDTH:     importStandardWidth( rStrm );                   break;
+                        case BIFF_ID_UNCALCED:          rWorkbookSett.importUncalced( rStrm );          break;
+                        case BIFF_ID_VCENTER:           rPageSett.importVerCenter( rStrm );             break;
+                        case BIFF3_ID_WINDOW2:          rSheetViewSett.importWindow2( rStrm );          break;
                     }
                     break;
 
@@ -918,26 +916,35 @@ bool BiffWorksheetFragment::importFragment()
                 }
             }
 
-            // record not processed, try cell records
-            if( mrStrm.tellBase() == nStrmPos )
-                aSheetData.importRecord();
-            // record still not processed, try pivot table records
-            if( mxPTContext.get() && (mrStrm.tellBase() == nStrmPos) )
-                mxPTContext->importRecord();
+            // record not processed, try record context objects
+            if( rStrm.tellBase() == nStrmPos )
+            {
+                // first, try cell table records
+                aSheetData.importRecord( rStrm );
+                // handle another open record context
+                if( mxContext.get() )
+                {
+                    // if it was a cell table record, forget the other record context
+                    if( rStrm.tellBase() == nStrmPos )
+                        mxContext->importRecord( rStrm );
+                    else
+                        mxContext.reset();
+                }
+            }
         }
     }
 
     // final processing in base class WorksheetHelper
     finalizeWorksheetImport();
-    return mrStrm.getRecId() == BIFF_ID_EOF;
+    return rStrm.getRecId() == BIFF_ID_EOF;
 }
 
 // private --------------------------------------------------------------------
 
-void BiffWorksheetFragment::importColInfo()
+void BiffWorksheetFragment::importColInfo( BiffInputStream& rStrm )
 {
     sal_uInt16 nFirstCol, nLastCol, nWidth, nXfId, nFlags;
-    mrStrm >> nFirstCol >> nLastCol >> nWidth >> nXfId >> nFlags;
+    rStrm >> nFirstCol >> nLastCol >> nWidth >> nXfId >> nFlags;
 
     ColumnModel aModel;
     // column indexes are 0-based in BIFF, but ColumnModel expects 1-based
@@ -954,18 +961,18 @@ void BiffWorksheetFragment::importColInfo()
     setColumnModel( aModel );
 }
 
-void BiffWorksheetFragment::importColumnDefault()
+void BiffWorksheetFragment::importColumnDefault( BiffInputStream& rStrm )
 {
     sal_uInt16 nFirstCol, nLastCol, nXfId;
-    mrStrm >> nFirstCol >> nLastCol >> nXfId;
+    rStrm >> nFirstCol >> nLastCol >> nXfId;
     setDefaultColumnFormat( nFirstCol, nLastCol, nXfId );
 }
 
-void BiffWorksheetFragment::importColWidth()
+void BiffWorksheetFragment::importColWidth( BiffInputStream& rStrm )
 {
     sal_uInt8 nFirstCol, nLastCol;
     sal_uInt16 nWidth;
-    mrStrm >> nFirstCol >> nLastCol >> nWidth;
+    rStrm >> nFirstCol >> nLastCol >> nWidth;
 
     ColumnModel aModel;
     // column indexes are 0-based in BIFF, but ColumnModel expects 1-based
@@ -977,20 +984,20 @@ void BiffWorksheetFragment::importColWidth()
     setColumnModel( aModel );
 }
 
-void BiffWorksheetFragment::importDefColWidth()
+void BiffWorksheetFragment::importDefColWidth( BiffInputStream& rStrm )
 {
     /*  Stored as entire number of characters without padding pixels, which
         will be added in setBaseColumnWidth(). Call has no effect, if a
         width has already been set from the STANDARDWIDTH record. */
-    setBaseColumnWidth( mrStrm.readuInt16() );
+    setBaseColumnWidth( rStrm.readuInt16() );
 }
 
-void BiffWorksheetFragment::importDefRowHeight()
+void BiffWorksheetFragment::importDefRowHeight( BiffInputStream& rStrm )
 {
     sal_uInt16 nFlags = BIFF_DEFROW_CUSTOMHEIGHT, nHeight;
     if( getBiff() != BIFF2 )
-        mrStrm >> nFlags;
-    mrStrm >> nHeight;
+        rStrm >> nFlags;
+    rStrm >> nHeight;
     if( getBiff() == BIFF2 )
         nHeight &= BIFF2_DEFROW_MASK;
     // row height is in twips in BIFF, convert to points
@@ -1002,11 +1009,11 @@ void BiffWorksheetFragment::importDefRowHeight()
         getFlag( nFlags, BIFF_DEFROW_THICKBOTTOM ) );
 }
 
-void BiffWorksheetFragment::importDataValidations()
+void BiffWorksheetFragment::importDataValidations( BiffInputStream& rStrm )
 {
     sal_Int32 nObjId;
-    mrStrm.skip( 10 );
-    mrStrm >> nObjId;
+    rStrm.skip( 10 );
+    rStrm >> nObjId;
     //! TODO: invalidate object id in drawing object manager
 }
 
@@ -1033,50 +1040,50 @@ ApiTokenSequence lclReadDataValFormula( BiffInputStream& rStrm, FormulaParser& r
 
 } // namespace
 
-void BiffWorksheetFragment::importDataValidation()
+void BiffWorksheetFragment::importDataValidation( BiffInputStream& rStrm )
 {
     ValidationModel aModel;
 
     // flags
     sal_uInt32 nFlags;
-    mrStrm >> nFlags;
-    aModel.setBinType( extractValue< sal_uInt8 >( nFlags, 0, 4 ) );
-    aModel.setBinOperator( extractValue< sal_uInt8 >( nFlags, 20, 4 ) );
-    aModel.setBinErrorStyle( extractValue< sal_uInt8 >( nFlags, 4, 3 ) );
+    rStrm >> nFlags;
+    aModel.setBiffType( extractValue< sal_uInt8 >( nFlags, 0, 4 ) );
+    aModel.setBiffOperator( extractValue< sal_uInt8 >( nFlags, 20, 4 ) );
+    aModel.setBiffErrorStyle( extractValue< sal_uInt8 >( nFlags, 4, 3 ) );
     aModel.mbAllowBlank   = getFlag( nFlags, BIFF_DATAVAL_ALLOWBLANK );
     aModel.mbNoDropDown   = getFlag( nFlags, BIFF_DATAVAL_NODROPDOWN );
     aModel.mbShowInputMsg = getFlag( nFlags, BIFF_DATAVAL_SHOWINPUT );
     aModel.mbShowErrorMsg = getFlag( nFlags, BIFF_DATAVAL_SHOWERROR );
 
     // message strings
-    aModel.maInputTitle   = lclReadDataValMessage( mrStrm );
-    aModel.maErrorTitle   = lclReadDataValMessage( mrStrm );
-    aModel.maInputMessage = lclReadDataValMessage( mrStrm );
-    aModel.maErrorMessage = lclReadDataValMessage( mrStrm );
+    aModel.maInputTitle   = lclReadDataValMessage( rStrm );
+    aModel.maErrorTitle   = lclReadDataValMessage( rStrm );
+    aModel.maInputMessage = lclReadDataValMessage( rStrm );
+    aModel.maErrorMessage = lclReadDataValMessage( rStrm );
 
     // condition formula(s)
     FormulaParser& rParser = getFormulaParser();
-    aModel.maTokens1 = lclReadDataValFormula( mrStrm, rParser );
-    aModel.maTokens2 = lclReadDataValFormula( mrStrm, rParser );
+    aModel.maTokens1 = lclReadDataValFormula( rStrm, rParser );
+    aModel.maTokens2 = lclReadDataValFormula( rStrm, rParser );
     // process string list of a list validation (convert to list of string tokens)
     if( (aModel.mnType == XML_list) && getFlag( nFlags, BIFF_DATAVAL_STRINGLIST ) )
         rParser.convertStringToStringList( aModel.maTokens1, '\0', true );
 
     // cell range list
     BinRangeList aRanges;
-    mrStrm >> aRanges;
+    rStrm >> aRanges;
     getAddressConverter().convertToCellRangeList( aModel.maRanges, aRanges, getSheetIndex(), true );
 
     // set validation data
     setValidation( aModel );
 }
 
-void BiffWorksheetFragment::importDimension()
+void BiffWorksheetFragment::importDimension( BiffInputStream& rStrm )
 {
     // 32-bit row indexes in BIFF8
-    bool bInt32Rows = (mrStrm.getRecId() == BIFF3_ID_DIMENSION) && (getBiff() == BIFF8);
+    bool bInt32Rows = (rStrm.getRecId() == BIFF3_ID_DIMENSION) && (getBiff() == BIFF8);
     BinRange aBinRange;
-    aBinRange.read( mrStrm, true, bInt32Rows );
+    aBinRange.read( rStrm, true, bInt32Rows );
     /*  BIFF stores the used area with end column and end row increased by 1
         (first unused column and row). */
     if( (aBinRange.maFirst.mnCol < aBinRange.maLast.mnCol) && (aBinRange.maFirst.mnRow < aBinRange.maLast.mnRow) )
@@ -1090,13 +1097,13 @@ void BiffWorksheetFragment::importDimension()
     }
 }
 
-void BiffWorksheetFragment::importHyperlink()
+void BiffWorksheetFragment::importHyperlink( BiffInputStream& rStrm )
 {
     HyperlinkModel aModel;
 
     // read cell range for the hyperlink
     BinRange aBiffRange;
-    mrStrm >> aBiffRange;
+    rStrm >> aBiffRange;
     // #i80006# Excel silently ignores invalid hi-byte of column index (TODO: everywhere?)
     aBiffRange.maFirst.mnCol &= 0xFF;
     aBiffRange.maLast.mnCol &= 0xFF;
@@ -1104,15 +1111,15 @@ void BiffWorksheetFragment::importHyperlink()
         return;
 
     // try to read the StdHlink data
-    if( !::oox::ole::OleHelper::importStdHlink( aModel, mrStrm, true ) )
+    if( !::oox::ole::OleHelper::importStdHlink( aModel, rStrm, true ) )
         return;
 
     // try to read the optional following SCREENTIP record
-    if( (mrStrm.getNextRecId() == BIFF_ID_SCREENTIP) && mrStrm.startNextRecord() )
+    if( (rStrm.getNextRecId() == BIFF_ID_SCREENTIP) && rStrm.startNextRecord() )
     {
-        mrStrm.skip( 2 );      // repeated record id
+        rStrm.skip( 2 );      // repeated record id
         // the cell range, again
-        mrStrm >> aBiffRange;
+        rStrm >> aBiffRange;
         CellRangeAddress aRange;
         if( getAddressConverter().convertToCellRange( aRange, aBiffRange, getSheetIndex(), true, true ) &&
             (aRange.StartColumn == aModel.maRange.StartColumn) &&
@@ -1122,7 +1129,7 @@ void BiffWorksheetFragment::importHyperlink()
         {
             /*  This time, we have no string length, no flag field, and a
                 null-terminated 16-bit character array. */
-            aModel.maTooltip = mrStrm.readNulUnicodeArray();
+            aModel.maTooltip = rStrm.readNulUnicodeArray();
         }
     }
 
@@ -1130,72 +1137,78 @@ void BiffWorksheetFragment::importHyperlink()
     setHyperlink( aModel );
 }
 
-void BiffWorksheetFragment::importLabelRanges()
+void BiffWorksheetFragment::importLabelRanges( BiffInputStream& rStrm )
 {
     BinRangeList aBiffRowRanges, aBiffColRanges;
-    mrStrm >> aBiffRowRanges >> aBiffColRanges;
+    rStrm >> aBiffRowRanges >> aBiffColRanges;
     ApiCellRangeList aColRanges, aRowRanges;
     getAddressConverter().convertToCellRangeList( aColRanges, aBiffColRanges, getSheetIndex(), true );
     getAddressConverter().convertToCellRangeList( aRowRanges, aBiffRowRanges, getSheetIndex(), true );
     setLabelRanges( aColRanges, aRowRanges );
 }
 
-void BiffWorksheetFragment::importMergedCells()
+void BiffWorksheetFragment::importMergedCells( BiffInputStream& rStrm )
 {
     BinRangeList aBiffRanges;
-    mrStrm >> aBiffRanges;
+    rStrm >> aBiffRanges;
     ApiCellRangeList aRanges;
     getAddressConverter().convertToCellRangeList( aRanges, aBiffRanges, getSheetIndex(), true );
     for( ApiCellRangeList::const_iterator aIt = aRanges.begin(), aEnd = aRanges.end(); aIt != aEnd; ++aIt )
         setMergedRange( *aIt );
 }
 
-void BiffWorksheetFragment::importPageBreaks( bool bRowBreak )
+void BiffWorksheetFragment::importPageBreaks( BiffInputStream& rStrm, bool bRowBreak )
 {
     PageBreakModel aModel;
     aModel.mbManual = true;             // only manual breaks stored in BIFF
     bool bBiff8 = getBiff() == BIFF8;   // skip start/end columns or rows in BIFF8
 
     sal_uInt16 nCount;
-    mrStrm >> nCount;
-    for( sal_uInt16 nIndex = 0; !mrStrm.isEof() && (nIndex < nCount); ++nIndex )
+    rStrm >> nCount;
+    for( sal_uInt16 nIndex = 0; !rStrm.isEof() && (nIndex < nCount); ++nIndex )
     {
-        aModel.mnColRow = mrStrm.readuInt16();
+        aModel.mnColRow = rStrm.readuInt16();
         setPageBreak( aModel, bRowBreak );
         if( bBiff8 )
-            mrStrm.skip( 4 );
+            rStrm.skip( 4 );
     }
 }
 
-void BiffWorksheetFragment::importPTDefinition()
+void BiffWorksheetFragment::importPTDefinition( BiffInputStream& rStrm )
 {
-    mxPTContext.reset( new BiffPivotTableContext( *this, getPivotTables().createPivotTable() ) );
-    mxPTContext->importRecord();
+    mxContext.reset( new BiffPivotTableContext( *this ) );
+    mxContext->importRecord( rStrm );
 }
 
-void BiffWorksheetFragment::importScenarios()
+void BiffWorksheetFragment::importQueryTable( BiffInputStream& rStrm )
 {
-    getScenarios().createSheetScenarios( getSheetIndex() ).importScenarios( mrStrm );
+    mxContext.reset( new BiffQueryTableContext( *this ) );
+    mxContext->importRecord( rStrm );
 }
 
-void BiffWorksheetFragment::importSharedFeatHead()
+void BiffWorksheetFragment::importScenarios( BiffInputStream& rStrm )
 {
-    mrStrm.skip( 12 );
-    sal_uInt16 nType = mrStrm.readuInt16();
-    mrStrm.skip( 5 );
+    getScenarios().createSheetScenarios( getSheetIndex() ).importScenarios( rStrm );
+}
+
+void BiffWorksheetFragment::importSharedFeatHead( BiffInputStream& rStrm )
+{
+    rStrm.skip( 12 );
+    sal_uInt16 nType = rStrm.readuInt16();
+    rStrm.skip( 5 );
     switch( nType )
     {
         case BIFF_SHRFEATHEAD_SHEETPROT:
-            if( mrStrm.getRemaining() >= 4 )
-                getWorksheetSettings().importSheetProtection( mrStrm );
+            if( rStrm.getRemaining() >= 4 )
+                getWorksheetSettings().importSheetProtection( rStrm );
         break;
     }
 }
 
-void BiffWorksheetFragment::importStandardWidth()
+void BiffWorksheetFragment::importStandardWidth( BiffInputStream& rStrm )
 {
     sal_uInt16 nWidth;
-    mrStrm >> nWidth;
+    rStrm >> nWidth;
     // width is stored as 1/256th of a character in BIFF, convert to entire character
     double fWidth = static_cast< double >( nWidth ) / 256.0;
     // set as default width, will override the width from DEFCOLWIDTH record
@@ -1206,4 +1219,3 @@ void BiffWorksheetFragment::importStandardWidth()
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx
index 99c2d844f4b5..e2b6784fd8e9 100644
--- a/oox/source/xls/worksheethelper.cxx
+++ b/oox/source/xls/worksheethelper.cxx
@@ -26,10 +26,10 @@
  ************************************************************************/
 
 #include "oox/xls/worksheethelper.hxx"
+
 #include 
-#include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -37,33 +37,33 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
-#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
-#include "properties.hxx"
-#include "tokens.hxx"
+#include 
+#include 
+#include "oox/core/filterbase.hxx"
 #include "oox/helper/containerhelper.hxx"
 #include "oox/helper/propertyset.hxx"
-#include "oox/core/filterbase.hxx"
 #include "oox/xls/addressconverter.hxx"
 #include "oox/xls/commentsbuffer.hxx"
 #include "oox/xls/condformatbuffer.hxx"
 #include "oox/xls/drawingfragment.hxx"
 #include "oox/xls/formulaparser.hxx"
 #include "oox/xls/pagesettings.hxx"
+#include "oox/xls/querytablebuffer.hxx"
 #include "oox/xls/sharedformulabuffer.hxx"
 #include "oox/xls/sharedstringsbuffer.hxx"
 #include "oox/xls/stylesbuffer.hxx"
@@ -72,73 +72,45 @@
 #include "oox/xls/workbooksettings.hxx"
 #include "oox/xls/worksheetbuffer.hxx"
 #include "oox/xls/worksheetsettings.hxx"
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::drawing::XDrawPage;
-using ::com::sun::star::drawing::XDrawPageSupplier;
-using ::com::sun::star::lang::Locale;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::sheet::ConditionOperator;
-using ::com::sun::star::sheet::ValidationType;
-using ::com::sun::star::sheet::ValidationAlertStyle;
-using ::com::sun::star::sheet::XCellAddressable;
-using ::com::sun::star::sheet::XCellRangeAddressable;
-using ::com::sun::star::sheet::XFormulaTokens;
-using ::com::sun::star::sheet::XLabelRanges;
-using ::com::sun::star::sheet::XMultiFormulaTokens;
-using ::com::sun::star::sheet::XMultipleOperation;
-using ::com::sun::star::sheet::XSheetCellRangeContainer;
-using ::com::sun::star::sheet::XSheetCellRanges;
-using ::com::sun::star::sheet::XSheetCondition;
-using ::com::sun::star::sheet::XSheetOutline;
-using ::com::sun::star::sheet::XSpreadsheet;
-using ::com::sun::star::table::BorderLine;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::table::XColumnRowRange;
-using ::com::sun::star::table::XTableColumns;
-using ::com::sun::star::table::XTableRows;
-using ::com::sun::star::text::XText;
-using ::com::sun::star::text::XTextContent;
-using ::com::sun::star::text::XTextRange;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::util::XMergeable;
-using ::com::sun::star::util::XNumberFormatsSupplier;
-using ::com::sun::star::util::XNumberFormatTypes;
+#include "properties.hxx"
+#include "tokens.hxx"
 
 namespace oox {
 namespace xls {
 
 // ============================================================================
 
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
 namespace {
 
-void lclUpdateProgressBar( ISegmentProgressBarRef xProgressBar, const CellRangeAddress& rUsedArea, sal_Int32 nRow )
+void lclUpdateProgressBar( const ISegmentProgressBarRef& rxProgressBar, const CellRangeAddress& rUsedArea, sal_Int32 nRow )
 {
-    if( xProgressBar.get() && (rUsedArea.StartRow <= nRow) && (nRow <= rUsedArea.EndRow) )
+    if( rxProgressBar.get() && (rUsedArea.StartRow <= nRow) && (nRow <= rUsedArea.EndRow) )
     {
         double fPosition = static_cast< double >( nRow - rUsedArea.StartRow + 1 ) / (rUsedArea.EndRow - rUsedArea.StartRow + 1);
-        if( xProgressBar->getPosition() < fPosition )
-            xProgressBar->setPosition( fPosition );
+        if( rxProgressBar->getPosition() < fPosition )
+            rxProgressBar->setPosition( fPosition );
     }
 }
 
-void lclUpdateProgressBar( ISegmentProgressBarRef xProgressBar, double fPosition )
+void lclUpdateProgressBar( const ISegmentProgressBarRef& rxProgressBar, double fPosition )
 {
-    if( xProgressBar.get() )
-        xProgressBar->setPosition( fPosition );
+    if( rxProgressBar.get() )
+        rxProgressBar->setPosition( fPosition );
 }
 
 // ----------------------------------------------------------------------------
@@ -329,14 +301,14 @@ ValidationModel::ValidationModel() :
 {
 }
 
-void ValidationModel::setBinType( sal_uInt8 nType )
+void ValidationModel::setBiffType( sal_uInt8 nType )
 {
     static const sal_Int32 spnTypeIds[] = {
         XML_none, XML_whole, XML_decimal, XML_list, XML_date, XML_time, XML_textLength, XML_custom };
     mnType = STATIC_ARRAY_SELECT( spnTypeIds, nType, XML_none );
 }
 
-void ValidationModel::setBinOperator( sal_uInt8 nOperator )
+void ValidationModel::setBiffOperator( sal_uInt8 nOperator )
 {
     static const sal_Int32 spnOperators[] = {
         XML_between, XML_notBetween, XML_equal, XML_notEqual,
@@ -344,7 +316,7 @@ void ValidationModel::setBinOperator( sal_uInt8 nOperator )
     mnOperator = STATIC_ARRAY_SELECT( spnOperators, nOperator, XML_TOKEN_INVALID );
 }
 
-void ValidationModel::setBinErrorStyle( sal_uInt8 nErrorStyle )
+void ValidationModel::setBiffErrorStyle( sal_uInt8 nErrorStyle )
 {
     static const sal_Int32 spnErrorStyles[] = { XML_stop, XML_warning, XML_information };
     mnErrorStyle = STATIC_ARRAY_SELECT( spnErrorStyles, nErrorStyle, XML_stop );
@@ -358,7 +330,7 @@ class WorksheetData : public WorkbookHelper
 public:
     explicit            WorksheetData(
                             const WorkbookHelper& rHelper,
-                            ISegmentProgressBarRef xProgressBar,
+                            const ISegmentProgressBarRef& rxProgressBar,
                             WorksheetType eSheetType,
                             sal_Int16 nSheet );
 
@@ -416,11 +388,13 @@ public:
     inline CondFormatBuffer& getCondFormats() { return maCondFormats; }
     /** Returns the buffer for all cell comments in this sheet. */
     inline CommentsBuffer& getComments() { return maComments; }
+    /** Returns the buffer for all web query tables in this sheet. */
+    inline QueryTableBuffer& getQueryTables() { return maQueryTables; }
     /** Returns the page/print settings for this sheet. */
     inline PageSettings& getPageSettings() { return maPageSett; }
     /** Returns the view settings for this sheet. */
     inline SheetViewSettings& getSheetViewSettings() { return maSheetViewSett; }
-    /** Returns the VML drawing page for this sheet (OOX only!). */
+    /** Returns the VML drawing page for this sheet (OOXML/BIFF12 only!). */
     inline VmlDrawing&  getVmlDrawing() { return *mxVmlDrawing; }
 
     /** Changes the current sheet type. */
@@ -589,6 +563,7 @@ private:
     SharedFormulaBuffer maSharedFmlas;      /// Buffer for shared formulas in this sheet.
     CondFormatBuffer    maCondFormats;      /// Buffer for conditional formattings.
     CommentsBuffer      maComments;         /// Buffer for all cell comments in this sheet.
+    QueryTableBuffer    maQueryTables;      /// Buffer for all web query tables in this sheet.
     PageSettings        maPageSett;         /// Page/print settings for this sheet.
     SheetViewSettings   maSheetViewSett;    /// View settings for this sheet.
     VmlDrawingPtr       mxVmlDrawing;       /// Collection of all VML shapes.
@@ -605,7 +580,7 @@ private:
 
 // ----------------------------------------------------------------------------
 
-WorksheetData::WorksheetData( const WorkbookHelper& rHelper, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+WorksheetData::WorksheetData( const WorkbookHelper& rHelper, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
     WorkbookHelper( rHelper ),
     maTrueFormula( CREATE_OUSTRING( "=TRUE()" ) ),
     maFalseFormula( CREATE_OUSTRING( "=FALSE()" ) ),
@@ -617,9 +592,10 @@ WorksheetData::WorksheetData( const WorkbookHelper& rHelper, ISegmentProgressBar
     maSharedFmlas( *this ),
     maCondFormats( *this ),
     maComments( *this ),
+    maQueryTables( *this ),
     maPageSett( *this ),
     maSheetViewSett( *this ),
-    mxProgressBar( xProgressBar ),
+    mxProgressBar( rxProgressBar ),
     meSheetType( eSheetType ),
     mbHasDefWidth( false )
 {
@@ -645,7 +621,7 @@ WorksheetData::WorksheetData( const WorkbookHelper& rHelper, ISegmentProgressBar
     maDefRowModel.mbCollapsed = false;
 
     // buffers
-    if( getFilterType() == FILTER_OOX )
+    if( getFilterType() == FILTER_OOXML )
         mxVmlDrawing.reset( new VmlDrawing( *this ) );
 
     // prepare progress bars
@@ -985,7 +961,7 @@ void WorksheetData::setDefaultColumnWidth( double fWidth )
 
 void WorksheetData::setColumnModel( const ColumnModel& rModel )
 {
-    // convert 1-based OOX column indexes to 0-based API column indexes
+    // convert 1-based OOXML column indexes to 0-based API column indexes
     sal_Int32 nFirstCol = rModel.mnFirstCol - 1;
     sal_Int32 nLastCol = rModel.mnLastCol - 1;
     if( (0 <= nFirstCol) && (nFirstCol <= mrMaxApiPos.Column) )
@@ -1009,7 +985,7 @@ void WorksheetData::setDefaultRowSettings( double fHeight, bool bCustomHeight, b
 
 void WorksheetData::setRowModel( const RowModel& rModel )
 {
-    // convert 1-based OOX row indexes to 0-based API row indexes
+    // convert 1-based OOXML row indexes to 0-based API row indexes
     sal_Int32 nFirstRow = rModel.mnFirstRow - 1;
     sal_Int32 nLastRow = rModel.mnLastRow - 1;
     if( (0 <= nFirstRow) && (nFirstRow <= mrMaxApiPos.Row) )
@@ -1079,6 +1055,7 @@ void WorksheetData::finalizeWorksheetImport()
     finalizeMergedRanges();
     maSheetSett.finalizeImport();
     maCondFormats.finalizeImport();
+    maQueryTables.finalizeImport();
     maPageSett.finalizeImport();
     maSheetViewSett.finalizeImport();
     maSheetSett.finalizeImport();
@@ -1348,8 +1325,8 @@ void WorksheetData::finalizeValidationRanges() const
     {
         PropertySet aPropSet( getCellRangeList( aIt->maRanges ) );
 
-        Reference< XPropertySet > xValidation;
-        if( aPropSet.getProperty( xValidation, PROP_Validation ) && xValidation.is() )
+        Reference< XPropertySet > xValidation( aPropSet.getAnyProperty( PROP_Validation ), UNO_QUERY );
+        if( xValidation.is() )
         {
             PropertySet aValProps( xValidation );
             namespace csss = ::com::sun::star::sheet;
@@ -1479,18 +1456,18 @@ void WorksheetData::finalizeMergedRange( const CellRangeAddress& rRange )
 
 void WorksheetData::finalizeDrawing()
 {
-    OSL_ENSURE( (getFilterType() == FILTER_OOX) || (maDrawingPath.getLength() == 0),
+    OSL_ENSURE( (getFilterType() == FILTER_OOXML) || (maDrawingPath.getLength() == 0),
         "WorksheetData::finalizeDrawing - unexpected DrawingML path" );
-    if( (getFilterType() == FILTER_OOX) && (maDrawingPath.getLength() > 0) )
-        importOoxFragment( new OoxDrawingFragment( *this, maDrawingPath ) );
+    if( (getFilterType() == FILTER_OOXML) && (maDrawingPath.getLength() > 0) )
+        importOoxFragment( new DrawingFragment( *this, maDrawingPath ) );
 }
 
 void WorksheetData::finalizeVmlDrawing()
 {
-    OSL_ENSURE( (getFilterType() == FILTER_OOX) || (maVmlDrawingPath.getLength() == 0),
+    OSL_ENSURE( (getFilterType() == FILTER_OOXML) || (maVmlDrawingPath.getLength() == 0),
         "WorksheetData::finalizeVmlDrawing - unexpected VML path" );
-    if( (getFilterType() == FILTER_OOX) && (maVmlDrawingPath.getLength() > 0) )
-        importOoxFragment( new OoxVmlDrawingFragment( *this, maVmlDrawingPath ) );
+    if( (getFilterType() == FILTER_OOXML) && (maVmlDrawingPath.getLength() > 0) )
+        importOoxFragment( new VmlDrawingFragment( *this, maVmlDrawingPath ) );
 }
 
 void WorksheetData::finalizeUsedArea()
@@ -1522,7 +1499,7 @@ void WorksheetData::convertColumns()
 
     for( ColumnModelMap::const_iterator aIt = maColModels.begin(), aEnd = maColModels.end(); aIt != aEnd; ++aIt )
     {
-        // convert 1-based OOX column indexes to 0-based API column indexes
+        // convert 1-based OOXML column indexes to 0-based API column indexes
         sal_Int32 nFirstCol = ::std::max( aIt->second.mnFirstCol - 1, nNextCol );
         sal_Int32 nLastCol = ::std::min( aIt->second.mnLastCol - 1, nMaxCol );
 
@@ -1572,7 +1549,7 @@ void WorksheetData::convertRows()
 
     for( RowModelMap::const_iterator aIt = maRowModels.begin(), aEnd = maRowModels.end(); aIt != aEnd; ++aIt )
     {
-        // convert 1-based OOX row indexes to 0-based API row indexes
+        // convert 1-based OOXML row indexes to 0-based API row indexes
         sal_Int32 nFirstRow = ::std::max( aIt->second.mnFirstRow - 1, nNextRow );
         sal_Int32 nLastRow = ::std::min( aIt->second.mnLastRow - 1, nMaxRow );
 
@@ -1858,6 +1835,11 @@ CommentsBuffer& WorksheetHelper::getComments() const
     return mrSheetData.getComments();
 }
 
+QueryTableBuffer& WorksheetHelper::getQueryTables() const
+{
+    return mrSheetData.getQueryTables();
+}
+
 PageSettings& WorksheetHelper::getPageSettings() const
 {
     return mrSheetData.getPageSettings();
@@ -2056,44 +2038,51 @@ void WorksheetHelper::setTableOperation( const CellRangeAddress& rRange, const D
 void WorksheetHelper::setLabelRanges( const ApiCellRangeList& rColRanges, const ApiCellRangeList& rRowRanges )
 {
     const CellAddress& rMaxPos = getAddressConverter().getMaxApiAddress();
-    Reference< XLabelRanges > xLabelRanges;
     PropertySet aPropSet( getSheet() );
 
-    if( !rColRanges.empty() && aPropSet.getProperty( xLabelRanges, PROP_ColumnLabelRanges ) && xLabelRanges.is() )
+    if( !rColRanges.empty() )
     {
-        for( ApiCellRangeList::const_iterator aIt = rColRanges.begin(), aEnd = rColRanges.end(); aIt != aEnd; ++aIt )
+        Reference< XLabelRanges > xLabelRanges( aPropSet.getAnyProperty( PROP_ColumnLabelRanges ), UNO_QUERY );
+        if( xLabelRanges.is() )
         {
-            CellRangeAddress aDataRange = *aIt;
-            if( aDataRange.EndRow < rMaxPos.Row )
-            {
-                aDataRange.StartRow = aDataRange.EndRow + 1;
-                aDataRange.EndRow = rMaxPos.Row;
-            }
-            else if( aDataRange.StartRow > 0 )
+            for( ApiCellRangeList::const_iterator aIt = rColRanges.begin(), aEnd = rColRanges.end(); aIt != aEnd; ++aIt )
             {
-                aDataRange.EndRow = aDataRange.StartRow - 1;
-                aDataRange.StartRow = 0;
+                CellRangeAddress aDataRange = *aIt;
+                if( aDataRange.EndRow < rMaxPos.Row )
+                {
+                    aDataRange.StartRow = aDataRange.EndRow + 1;
+                    aDataRange.EndRow = rMaxPos.Row;
+                }
+                else if( aDataRange.StartRow > 0 )
+                {
+                    aDataRange.EndRow = aDataRange.StartRow - 1;
+                    aDataRange.StartRow = 0;
+                }
+                xLabelRanges->addNew( *aIt, aDataRange );
             }
-            xLabelRanges->addNew( *aIt, aDataRange );
         }
     }
 
-    if( !rRowRanges.empty() && aPropSet.getProperty( xLabelRanges, PROP_RowLabelRanges ) && xLabelRanges.is() )
+    if( !rRowRanges.empty() )
     {
-        for( ApiCellRangeList::const_iterator aIt = rRowRanges.begin(), aEnd = rRowRanges.end(); aIt != aEnd; ++aIt )
+        Reference< XLabelRanges > xLabelRanges( aPropSet.getAnyProperty( PROP_RowLabelRanges ), UNO_QUERY );
+        if( xLabelRanges.is() )
         {
-            CellRangeAddress aDataRange = *aIt;
-            if( aDataRange.EndColumn < rMaxPos.Column )
-            {
-                aDataRange.StartColumn = aDataRange.EndColumn + 1;
-                aDataRange.EndColumn = rMaxPos.Column;
-            }
-            else if( aDataRange.StartColumn > 0 )
+            for( ApiCellRangeList::const_iterator aIt = rRowRanges.begin(), aEnd = rRowRanges.end(); aIt != aEnd; ++aIt )
             {
-                aDataRange.EndColumn = aDataRange.StartColumn - 1;
-                aDataRange.StartColumn = 0;
+                CellRangeAddress aDataRange = *aIt;
+                if( aDataRange.EndColumn < rMaxPos.Column )
+                {
+                    aDataRange.StartColumn = aDataRange.EndColumn + 1;
+                    aDataRange.EndColumn = rMaxPos.Column;
+                }
+                else if( aDataRange.StartColumn > 0 )
+                {
+                    aDataRange.EndColumn = aDataRange.StartColumn - 1;
+                    aDataRange.StartColumn = 0;
+                }
+                xLabelRanges->addNew( *aIt, aDataRange );
             }
-            xLabelRanges->addNew( *aIt, aDataRange );
         }
     }
 }
@@ -2180,8 +2169,8 @@ WorksheetDataOwner::~WorksheetDataOwner()
 
 // ----------------------------------------------------------------------------
 
-WorksheetHelperRoot::WorksheetHelperRoot( const WorkbookHelper& rHelper, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
-    prv::WorksheetDataOwner( prv::WorksheetDataRef( new WorksheetData( rHelper, xProgressBar, eSheetType, nSheet ) ) ),
+WorksheetHelperRoot::WorksheetHelperRoot( const WorkbookHelper& rHelper, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+    prv::WorksheetDataOwner( prv::WorksheetDataRef( new WorksheetData( rHelper, rxProgressBar, eSheetType, nSheet ) ) ),
     WorksheetHelper( *mxSheetData )
 {
 }
@@ -2208,4 +2197,3 @@ bool WorksheetHelperRoot::isValidSheet() const
 
 } // namespace xls
 } // namespace oox
-
diff --git a/oox/source/xls/worksheetsettings.cxx b/oox/source/xls/worksheetsettings.cxx
index 712a57803349..7a4dc07d7b5e 100644
--- a/oox/source/xls/worksheetsettings.cxx
+++ b/oox/source/xls/worksheetsettings.cxx
@@ -26,31 +26,34 @@
  ************************************************************************/
 
 #include "oox/xls/worksheetsettings.hxx"
+
 #include 
+#include "oox/core/filterbase.hxx"
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
 #include "oox/xls/biffinputstream.hxx"
 #include "oox/xls/pagesettings.hxx"
 #include "oox/xls/workbooksettings.hxx"
 #include "properties.hxx"
 
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::util;
 
-using ::rtl::OUString;
 using ::oox::core::CodecHelper;
-
-namespace oox {
-namespace xls {
+using ::rtl::OUString;
 
 // ============================================================================
 
 namespace {
 
-const sal_uInt8 OOBIN_SHEETPR_FILTERMODE        = 0x01;
-const sal_uInt8 OOBIN_SHEETPR_EVAL_CF           = 0x02;
+const sal_uInt8 BIFF12_SHEETPR_FILTERMODE       = 0x01;
+const sal_uInt8 BIFF12_SHEETPR_EVAL_CF          = 0x02;
 
 const sal_uInt32 BIFF_SHEETEXT_NOTABCOLOR       = 0x7F;
 
@@ -184,8 +187,8 @@ void WorksheetSettings::importSheetPr( RecordInputStream& rStrm )
     rStrm.skip( 8 );    // sync anchor cell
     rStrm >> maSheetSettings.maCodeName;
     // sheet settings
-    maSheetSettings.mbFilterMode = getFlag( nFlags2, OOBIN_SHEETPR_FILTERMODE );
-    // outline settings, equal flags in BIFF and OOBIN
+    maSheetSettings.mbFilterMode = getFlag( nFlags2, BIFF12_SHEETPR_FILTERMODE );
+    // outline settings, equal flags in all BIFFs
     maSheetSettings.mbApplyStyles  = getFlag( nFlags1, BIFF_SHEETPR_APPLYSTYLES );
     maSheetSettings.mbSummaryRight = getFlag( nFlags1, BIFF_SHEETPR_SYMBOLSRIGHT );
     maSheetSettings.mbSummaryBelow = getFlag( nFlags1, BIFF_SHEETPR_SYMBOLSBELOW );
-- 
cgit 


From 7319d6c51702d312e62a39d71805f44b2ac82ee3 Mon Sep 17 00:00:00 2001
From: Niklas Nebel 
Date: Wed, 20 Oct 2010 14:15:04 +0200
Subject: dr77: #i115067# don't calculate with negative positions in
 ScTabView::AlignToCursor

---
 sc/source/ui/view/tabview3.cxx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 90bfe0c24e5c..97d03c791597 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -767,11 +767,13 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
                 if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX )
                 {
                     nNewDeltaX = nDeltaX + nCurX - aViewData.GetCurX();
+                    if (nNewDeltaX < 0) nNewDeltaX = 0;
                     nSizeX = (SCsCOL) aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
                 }
                 if ( nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY )
                 {
                     nNewDeltaY = nDeltaY + nCurY - aViewData.GetCurY();
+                    if (nNewDeltaY < 0) nNewDeltaY = 0;
                     nSizeY = (SCsROW) aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
                 }
 
@@ -780,7 +782,7 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
                 if ( nCurX < nNewDeltaX || nCurX >= nNewDeltaX+nSizeX )
                 {
                     nNewDeltaX = nCurX - (nSizeX / 2);
-                    if (nNewDeltaX < 0) nNewDeltaY = 0;
+                    if (nNewDeltaX < 0) nNewDeltaX = 0;
                     nSizeX = (SCsCOL) aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
                 }
                 if ( nCurY < nNewDeltaY || nCurY >= nNewDeltaY+nSizeY )
-- 
cgit 


From a7f8ec5c50b16afcaa616baf28f6edb74b535285 Mon Sep 17 00:00:00 2001
From: "Daniel Rentz [dr]" 
Date: Thu, 21 Oct 2010 14:40:11 +0200
Subject: dr77: #i103686# improve import of shapes in right-to-left sheets

---
 oox/inc/oox/xls/viewsettings.hxx   |   3 ++
 oox/source/xls/viewsettings.cxx    |  13 ++---
 oox/source/xls/worksheethelper.cxx | 101 ++++++++++++++++++++-----------------
 3 files changed, 62 insertions(+), 55 deletions(-)

diff --git a/oox/inc/oox/xls/viewsettings.hxx b/oox/inc/oox/xls/viewsettings.hxx
index 30adfcbf6a07..c9c751b5066b 100644
--- a/oox/inc/oox/xls/viewsettings.hxx
+++ b/oox/inc/oox/xls/viewsettings.hxx
@@ -139,6 +139,9 @@ public:
     /** Converts all imported sheet view settings. */
     void                finalizeImport();
 
+    /** Returns true, if the sheet layout is set to right-to-left. */
+    bool                isSheetRightToLeft() const;
+
 private:
     SheetViewModelRef   createSheetView();
 
diff --git a/oox/source/xls/viewsettings.cxx b/oox/source/xls/viewsettings.cxx
index 0fed205c8010..6d6ae85055df 100644
--- a/oox/source/xls/viewsettings.cxx
+++ b/oox/source/xls/viewsettings.cxx
@@ -33,7 +33,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include "oox/core/filterbase.hxx"
 #include "oox/helper/attributelist.hxx"
@@ -498,13 +497,6 @@ void SheetViewSettings::finalizeImport()
         xModel->mbShowOutline = true;
     }
 
-    // mirrored sheet (this is not a view setting in Calc)
-    if( xModel->mbRightToLeft )
-    {
-        PropertySet aPropSet( getSheet() );
-        aPropSet.setProperty( PROP_TableLayout, ::com::sun::star::text::WritingMode2::RL_TB );
-    }
-
     // sheet selected (active sheet must be selected)
     bool bSelected = xModel->mbSelected || (getSheetIndex() == getViewSettings().getActiveCalcSheet());
 
@@ -595,6 +587,11 @@ void SheetViewSettings::finalizeImport()
     getViewSettings().setSheetViewSettings( getSheetIndex(), xModel, Any( aPropMap.makePropertyValueSequence() ) );
 }
 
+bool SheetViewSettings::isSheetRightToLeft() const
+{
+    return !maSheetViews.empty() && maSheetViews.front()->mbRightToLeft;
+}
+
 // private --------------------------------------------------------------------
 
 SheetViewModelRef SheetViewSettings::createSheetView()
diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx
index e2b6784fd8e9..48a83ab07f11 100644
--- a/oox/source/xls/worksheethelper.cxx
+++ b/oox/source/xls/worksheethelper.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -517,13 +518,6 @@ private:
     /** Merges the passed merged range and updates right/bottom cell borders. */
     void                finalizeMergedRange( const CellRangeAddress& rRange );
 
-    /** Imports the drawing layer of the sheet (DrawingML part). */
-    void                finalizeDrawing();
-    /** Imports the drawing layer of the sheet (VML part). */
-    void                finalizeVmlDrawing();
-    /** Extends the used cell area with the area used by drawing objects. */
-    void                finalizeUsedArea();
-
     /** Converts column properties for all columns in the sheet. */
     void                convertColumns();
     /** Converts column properties. */
@@ -539,6 +533,9 @@ private:
     /** Groups columns or rows for the given range. */
     void                groupColumnsOrRows( sal_Int32 nFirstColRow, sal_Int32 nLastColRow, bool bCollapsed, bool bRows );
 
+    /** Imports the drawings of the sheet (DML, VML), and updates the used area. */
+    void                finalizeDrawings();
+
 private:
     typedef ::std::auto_ptr< VmlDrawing > VmlDrawingPtr;
 
@@ -1064,10 +1061,7 @@ void WorksheetData::finalizeWorksheetImport()
     convertColumns();
     convertRows();
     lclUpdateProgressBar( mxFinalProgress, 0.75 );
-    finalizeDrawing();
-    finalizeVmlDrawing();
-    maComments.finalizeImport();    // after VML drawing
-    finalizeUsedArea();             // after DML and VML drawing
+    finalizeDrawings();
     lclUpdateProgressBar( mxFinalProgress, 1.0 );
 
     // reset current sheet index in global data
@@ -1454,42 +1448,6 @@ void WorksheetData::finalizeMergedRange( const CellRangeAddress& rRange )
     }
 }
 
-void WorksheetData::finalizeDrawing()
-{
-    OSL_ENSURE( (getFilterType() == FILTER_OOXML) || (maDrawingPath.getLength() == 0),
-        "WorksheetData::finalizeDrawing - unexpected DrawingML path" );
-    if( (getFilterType() == FILTER_OOXML) && (maDrawingPath.getLength() > 0) )
-        importOoxFragment( new DrawingFragment( *this, maDrawingPath ) );
-}
-
-void WorksheetData::finalizeVmlDrawing()
-{
-    OSL_ENSURE( (getFilterType() == FILTER_OOXML) || (maVmlDrawingPath.getLength() == 0),
-        "WorksheetData::finalizeVmlDrawing - unexpected VML path" );
-    if( (getFilterType() == FILTER_OOXML) && (maVmlDrawingPath.getLength() > 0) )
-        importOoxFragment( new VmlDrawingFragment( *this, maVmlDrawingPath ) );
-}
-
-void WorksheetData::finalizeUsedArea()
-{
-    /*  Extend used area of the sheet by cells covered with drawing objects.
-        Needed if the imported document is inserted as "OLE object from file"
-        and thus does not provide an OLE size property by itself. */
-    if( (maShapeBoundingBox.Width > 0) || (maShapeBoundingBox.Height > 0) )
-        extendUsedArea( getCellRangeFromRectangle( maShapeBoundingBox ) );
-
-    // if no used area is set, default to A1
-    if( maUsedArea.StartColumn > maUsedArea.EndColumn )
-        maUsedArea.StartColumn = maUsedArea.EndColumn = 0;
-    if( maUsedArea.StartRow > maUsedArea.EndRow )
-        maUsedArea.StartRow = maUsedArea.EndRow = 0;
-
-    /*  Register the used area of this sheet in global view settings. The
-        global view settings will set the visible area if this document is an
-        embedded OLE object. */
-    getViewSettings().setSheetUsedArea( maUsedArea );
-}
-
 void WorksheetData::convertColumns()
 {
     sal_Int32 nNextCol = 0;
@@ -1654,6 +1612,55 @@ void WorksheetData::groupColumnsOrRows( sal_Int32 nFirstColRow, sal_Int32 nLastC
     }
 }
 
+void WorksheetData::finalizeDrawings()
+{
+    switch( getFilterType() )
+    {
+        case FILTER_OOXML:
+            // import DML and VML
+            if( maDrawingPath.getLength() > 0 )
+                importOoxFragment( new DrawingFragment( *this, maDrawingPath ) );
+            if( maVmlDrawingPath.getLength() > 0 )
+                importOoxFragment( new VmlDrawingFragment( *this, maVmlDrawingPath ) );
+        break;
+
+        case FILTER_BIFF:
+            // TODO: import DFF shapes
+        break;
+
+        case FILTER_UNKNOWN:
+        break;
+    }
+
+    // comments (after callout shapes have been imported from VML/DFF)
+    maComments.finalizeImport();
+
+    /*  Extend used area of the sheet by cells covered with drawing objects.
+        Needed if the imported document is inserted as "OLE object from file"
+        and thus does not provide an OLE size property by itself. */
+    if( (maShapeBoundingBox.Width > 0) || (maShapeBoundingBox.Height > 0) )
+        extendUsedArea( getCellRangeFromRectangle( maShapeBoundingBox ) );
+
+    // if no used area is set, default to A1
+    if( maUsedArea.StartColumn > maUsedArea.EndColumn )
+        maUsedArea.StartColumn = maUsedArea.EndColumn = 0;
+    if( maUsedArea.StartRow > maUsedArea.EndRow )
+        maUsedArea.StartRow = maUsedArea.EndRow = 0;
+
+    /*  Register the used area of this sheet in global view settings. The
+        global view settings will set the visible area if this document is an
+        embedded OLE object. */
+    getViewSettings().setSheetUsedArea( maUsedArea );
+
+    /*  #i103686# Set right-to-left sheet layout. Must be done after all
+        drawing shapes to simplify calculation of shape coordinates. */
+    if( maSheetViewSett.isSheetRightToLeft() )
+    {
+        PropertySet aPropSet( mxSheet );
+        aPropSet.setProperty( PROP_TableLayout, ::com::sun::star::text::WritingMode2::RL_TB );
+    }
+}
+
 // ============================================================================
 // ============================================================================
 
-- 
cgit 


From 1f77e4b60e27cf20837579d512d1df7b40d65db7 Mon Sep 17 00:00:00 2001
From: "Daniel Rentz [dr]" 
Date: Thu, 21 Oct 2010 15:42:15 +0200
Subject: dr77: fix broken import of charts and group shapes

---
 oox/inc/oox/xls/drawingfragment.hxx |  2 ++
 oox/source/drawingml/shape.cxx      |  2 +-
 oox/source/xls/drawingfragment.cxx  | 21 +++++++++++----------
 3 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/oox/inc/oox/xls/drawingfragment.hxx b/oox/inc/oox/xls/drawingfragment.hxx
index 3d14b78349c7..0d3360323a94 100644
--- a/oox/inc/oox/xls/drawingfragment.hxx
+++ b/oox/inc/oox/xls/drawingfragment.hxx
@@ -184,6 +184,7 @@ public:
     explicit            GroupShapeContext(
                             ::oox::core::ContextHandler& rParent,
                             const WorksheetHelper& rHelper,
+                            const ::oox::drawingml::ShapePtr& rxParentShape,
                             const ::oox::drawingml::ShapePtr& rxShape );
 
     static ::oox::core::ContextHandlerRef
@@ -192,6 +193,7 @@ public:
                             const WorksheetHelper& rHelper,
                             sal_Int32 nElement,
                             const AttributeList& rAttribs,
+                            const ::oox::drawingml::ShapePtr& rxParentShape,
                             ::oox::drawingml::ShapePtr* pxShape = 0 );
 
 protected:
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index d3a6afb0d4ad..4d98de51a002 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -125,7 +125,7 @@ ChartShapeInfo& Shape::setChartType( bool bEmbedShapes )
 {
     OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setChartType - multiple frame types" );
     meFrameType = FRAMETYPE_CHART;
-    msServiceName = CREATE_OUSTRING( "com.sun.star.drawing.OLE2Object" );
+    msServiceName = CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" );
     mxChartShapeInfo.reset( new ChartShapeInfo( bEmbedShapes ) );
     return *mxChartShapeInfo;
 }
diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx
index b9e3e3637bd7..ce99f1f7060f 100644
--- a/oox/source/xls/drawingfragment.cxx
+++ b/oox/source/xls/drawingfragment.cxx
@@ -459,14 +459,15 @@ void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >&
 // ============================================================================
 
 GroupShapeContext::GroupShapeContext( ContextHandler& rParent,
-        const WorksheetHelper& rHelper, const ShapePtr& rxShape ) :
-    ShapeGroupContext( rParent, ShapePtr(), rxShape ),
+        const WorksheetHelper& rHelper, const ShapePtr& rxParentShape, const ShapePtr& rxShape ) :
+    ShapeGroupContext( rParent, rxParentShape, rxShape ),
     WorksheetHelper( rHelper )
 {
 }
 
 /*static*/ ContextHandlerRef GroupShapeContext::createShapeContext( ContextHandler& rParent,
-        const WorksheetHelper& rHelper, sal_Int32 nElement, const AttributeList& rAttribs, ShapePtr* pxShape )
+        const WorksheetHelper& rHelper, sal_Int32 nElement, const AttributeList& rAttribs,
+        const ShapePtr& rxParentShape, ShapePtr* pxShape )
 {
     switch( nElement )
     {
@@ -474,31 +475,31 @@ GroupShapeContext::GroupShapeContext( ContextHandler& rParent,
         {
             ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.CustomShape" ) );
             if( pxShape ) *pxShape = xShape;
-            return new ShapeContext( rParent, ShapePtr(), xShape );
+            return new ShapeContext( rParent, rxParentShape, xShape );
         }
         case XDR_TOKEN( cxnSp ):
         {
             ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.ConnectorShape" ) );
             if( pxShape ) *pxShape = xShape;
-            return new ConnectorShapeContext( rParent, ShapePtr(), xShape );
+            return new ConnectorShapeContext( rParent, rxParentShape, xShape );
         }
         case XDR_TOKEN( pic ):
         {
             ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" ) );
             if( pxShape ) *pxShape = xShape;
-            return new GraphicShapeContext( rParent, ShapePtr(), xShape );
+            return new GraphicShapeContext( rParent, rxParentShape, xShape );
         }
         case XDR_TOKEN( graphicFrame ):
         {
             ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" ) );
             if( pxShape ) *pxShape = xShape;
-            return new GraphicalObjectFrameContext( rParent, ShapePtr(), xShape, rHelper.getSheetType() != SHEETTYPE_CHARTSHEET );
+            return new GraphicalObjectFrameContext( rParent, rxParentShape, xShape, rHelper.getSheetType() != SHEETTYPE_CHARTSHEET );
         }
         case XDR_TOKEN( grpSp ):
         {
             ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GroupShape" ) );
             if( pxShape ) *pxShape = xShape;
-            return new GroupShapeContext( rParent, rHelper, xShape );
+            return new GroupShapeContext( rParent, rHelper, rxParentShape, xShape );
         }
     }
     return 0;
@@ -507,7 +508,7 @@ GroupShapeContext::GroupShapeContext( ContextHandler& rParent,
 Reference< XFastContextHandler > SAL_CALL GroupShapeContext::createFastChildContext(
         sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) throw (SAXException, RuntimeException)
 {
-    ContextHandlerRef xContext = createShapeContext( *this, *this, nElement, AttributeList( rxAttribs ) );
+    ContextHandlerRef xContext = createShapeContext( *this, *this, nElement, AttributeList( rxAttribs ), mpGroupShapePtr );
     return xContext.get() ? xContext.get() : ShapeGroupContext::createFastChildContext( nElement, rxAttribs );
 }
 
@@ -556,7 +557,7 @@ ContextHandlerRef DrawingFragment::onCreateContext( sal_Int32 nElement, const At
                 case XDR_TOKEN( ext ):          if( mxAnchor.get() ) mxAnchor->importExt( rAttribs );           break;
                 case XDR_TOKEN( clientData ):   if( mxAnchor.get() ) mxAnchor->importClientData( rAttribs );    break;
 
-                default:                        return GroupShapeContext::createShapeContext( *this, *this, nElement, rAttribs, &mxShape );
+                default:                        return GroupShapeContext::createShapeContext( *this, *this, nElement, rAttribs, ShapePtr(), &mxShape );
             }
         }
         break;
-- 
cgit 


From 2cf7e9d5fa0f17b95b64f885788559781e98be98 Mon Sep 17 00:00:00 2001
From: "Daniel Rentz [dr]" 
Date: Thu, 21 Oct 2010 19:35:45 +0200
Subject: dr77: #i108420# store required hidden parameter for EXTERN.CALL
 functions without visible parameters

---
 sc/source/filter/excel/xeformula.cxx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index 34e48671a3bc..92b48f9633de 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -1759,7 +1759,11 @@ void XclExpFmlaCompImpl::AppendTrailingParam( XclExpFuncData& rFuncData )
 
         break;
 
-        default:;
+        default:
+            // #i108420# function without parameters stored as macro call needs the external name reference
+            if( (nParamCount == 0) && rFuncData.IsMacroFunc() )
+                AppendDefaultParam( rFuncData );
+
     }
 }
 
-- 
cgit 

-- 
cgit 


From 09e3535aaaa0b2c889f75974e6a29878254e26d8 Mon Sep 17 00:00:00 2001
From: Niklas Nebel 
Date: Fri, 22 Oct 2010 15:55:40 +0200
Subject: dr77: #i106108# SetDocumentModified in ScDocFunc::SetWidthOrHeight

---
 sc/source/ui/docshell/docfunc.cxx | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 4677eecbf20c..915c846b663b 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3121,6 +3121,8 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
                                         ScSizeMode eMode, USHORT nSizeTwips,
                                         BOOL bRecord, BOOL bApi )
 {
+    ScDocShellModificator aModificator( rDocShell );
+
     if (!nRangeCnt)
         return TRUE;
 
@@ -3282,6 +3284,7 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
     pDoc->UpdatePageBreaks( nTab );
 
     rDocShell.PostPaint(0,0,nTab,MAXCOL,MAXROW,nTab,PAINT_ALL);
+    aModificator.SetDocumentModified();
 
     return bSuccess;
 }
-- 
cgit 


From c0b1151e425c4467ee8a9defae042497265523c3 Mon Sep 17 00:00:00 2001
From: Niklas Nebel 
Date: Wed, 27 Oct 2010 12:49:41 +0200
Subject: dr77: #i105279# InvalidateTableArea in SetDocumentModified with
 locked repaint

---
 sc/source/ui/docshell/docsh.cxx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index d5d7f6e09292..40702793e770 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2618,6 +2618,7 @@ void ScDocShell::SetDocumentModified( BOOL bIsModified /* = TRUE */ )
     if ( pPaintLockData && bIsModified )
     {
         //! BCA_BRDCST_ALWAYS etc. also needed here?
+        aDocument.InvalidateTableArea();    // #i105279# needed here
         aDocument.BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
 
         pPaintLockData->SetModified();          // spaeter...
-- 
cgit 


From 7f2d39227eb926f571bbcc74a75d71aef6e2f949 Mon Sep 17 00:00:00 2001
From: Joachim Lingner 
Date: Thu, 28 Oct 2010 12:57:47 +0200
Subject: jl160 #i114794 adapting admin.pl to use unopg sync without further
 parameter

---
 setup_native/scripts/admin.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl
index 3e058af172f6..ba6d94261049 100644
--- a/setup_native/scripts/admin.pl
+++ b/setup_native/scripts/admin.pl
@@ -1128,7 +1128,7 @@ sub register_extensions_sync
 
     $preregdir =~ s/\/\s*$//g;
 
-    my $systemcall = $executable . " sync --verbose -env:BUNDLED_EXTENSIONS_USER=\"file:///" . $preregdir . "\"" . " -env:UserInstallation=file:///" . $localtemppath . " 2\>\&1 |";
+    my $systemcall = $executable . " sync --verbose 2\>\&1 |";
 
     print "... $systemcall\n";
 
-- 
cgit 


From 918911ae91a8b361b645d2f147fc855cf1bc5945 Mon Sep 17 00:00:00 2001
From: "Daniel Rentz [dr]" 
Date: Thu, 28 Oct 2010 16:28:05 +0200
Subject: dr77: #i115296# add constants for SpreadsheetViewSettings::Show...
 properties

---
 .../sun/star/sheet/SpreadsheetViewObjectsMode.idl  | 61 ++++++++++++++++++++++
 .../com/sun/star/sheet/SpreadsheetViewSettings.idl | 10 +++-
 offapi/com/sun/star/sheet/makefile.mk              |  1 +
 3 files changed, 70 insertions(+), 2 deletions(-)
 create mode 100755 offapi/com/sun/star/sheet/SpreadsheetViewObjectsMode.idl

diff --git a/offapi/com/sun/star/sheet/SpreadsheetViewObjectsMode.idl b/offapi/com/sun/star/sheet/SpreadsheetViewObjectsMode.idl
new file mode 100755
index 000000000000..d672dd8931e9
--- /dev/null
+++ b/offapi/com/sun/star/sheet/SpreadsheetViewObjectsMode.idl
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * 
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_sheet_SpreadsheetViewObjectsMode_idl__
+#define __com_sun_star_sheet_SpreadsheetViewObjectsMode_idl__
+
+//=============================================================================
+
+module com {  module sun {  module star {  module sheet {
+
+//=============================================================================
+
+/** Constants that control how embedded objects are shown in the view.
+ */
+published constants SpreadsheetViewObjectsMode
+{
+    //-------------------------------------------------------------------------
+
+    /** Specifies to display a specific set of objects in the spreadsheet view.
+     */
+    const short SHOW = 0;
+
+    //-------------------------------------------------------------------------
+
+    /** Specifies to hide a specific set of objects from the spreadsheet view.
+     */
+    const short HIDE = 1;
+
+    //-------------------------------------------------------------------------
+};
+
+//=============================================================================
+
+}; }; }; };
+
+#endif
+
diff --git a/offapi/com/sun/star/sheet/SpreadsheetViewSettings.idl b/offapi/com/sun/star/sheet/SpreadsheetViewSettings.idl
index e40ea1dd8fe4..c1b56ff7ffc6 100644
--- a/offapi/com/sun/star/sheet/SpreadsheetViewSettings.idl
+++ b/offapi/com/sun/star/sheet/SpreadsheetViewSettings.idl
@@ -149,18 +149,24 @@ published service SpreadsheetViewSettings
     //-------------------------------------------------------------------------
 
     /** enables display of embedded objects in the view.
+
+        @see SpreadsheetViewObjectsMode
      */
     [property] short ShowObjects;
 
     //-------------------------------------------------------------------------
 
     /** enables the display of charts in the view.
+
+        @see SpreadsheetViewObjectsMode
      */
     [property] short ShowCharts;
 
     //-------------------------------------------------------------------------
 
     /** enables the display of drawing objects in the view.
+
+        @see SpreadsheetViewObjectsMode
      */
     [property] short ShowDrawing;
 
@@ -175,14 +181,14 @@ published service SpreadsheetViewSettings
 
         @see com::sun::star::view::DocumentZoomType
     */
-        [property] short ZoomType;
+    [property] short ZoomType;
 
         //-------------------------------------------------------------------------
         /** Defines the zoom value to use.
             Valid only if the ZoomType is set to
             BY_VALUE.
     */
-        [property] short ZoomValue;
+    [property] short ZoomValue;
 };
 
 //=============================================================================
diff --git a/offapi/com/sun/star/sheet/makefile.mk b/offapi/com/sun/star/sheet/makefile.mk
index 65e8d5c40491..c5b15a5b07af 100644
--- a/offapi/com/sun/star/sheet/makefile.mk
+++ b/offapi/com/sun/star/sheet/makefile.mk
@@ -198,6 +198,7 @@ IDLFILES=\
     SpreadsheetDocumentSettings.idl\
     SpreadsheetDrawPage.idl\
     SpreadsheetView.idl\
+    SpreadsheetViewObjectsMode.idl\
     SpreadsheetViewPane.idl\
     SpreadsheetViewPanesEnumeration.idl\
     SpreadsheetViewSettings.idl\
-- 
cgit 


From d8138bfc18fcc2732d3ea7304b24b319268995af Mon Sep 17 00:00:00 2001
From: "Philipp Lohmann [pl]" 
Date: Tue, 2 Nov 2010 17:03:34 +0100
Subject: vcl117: #i115056# change direct help texts to help ids to allow for
 proper help content

---
 vcl/inc/vcl/print.hxx          |  20 ++++---
 vcl/source/gdi/print3.cxx      |  74 ++++++++++++------------
 vcl/source/src/print.src       |  83 ++++++++++----------------
 vcl/source/window/printdlg.cxx | 128 ++++++++++-------------------------------
 4 files changed, 109 insertions(+), 196 deletions(-)

diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx
index c389034d918f..c335e4853702 100644
--- a/vcl/inc/vcl/print.hxx
+++ b/vcl/inc/vcl/print.hxx
@@ -620,28 +620,34 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
         , mbEnabled( i_bEnabled ) {}
     };
 
+    // note: in the following helper functions HelpIds are expected as an rtl::OUString
+    // the normal HelpId form is rtl::OString (byte string instead of UTF16 string)
+    // this is because the whole interface is base on UNO properties; in fact the structures
+    // are passed over UNO interfaces. UNO does not know a byte string, hence the string is
+    // transported via UTF16 strings.
+
     // general control
     static com::sun::star::uno::Any getUIControlOpt( const rtl::OUString& i_rTitle,
-                                                     const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpText,
+                                                     const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpId,
                                                      const rtl::OUString& i_rType,
                                                      const com::sun::star::beans::PropertyValue* i_pValue = NULL,
                                                      const UIControlOptions& i_rControlOptions = UIControlOptions()
                                                      );
     // create a group (e.g. a TabPage); following controls will be grouped in it until the next
     // group begins
-    static com::sun::star::uno::Any getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpText );
+    static com::sun::star::uno::Any getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpId );
 
     // create a subgroup (e.g. a FixedLine); following controls will be grouped in it until the next
     // subgroup or group begins
     // setting bJobPage = true will make the subgroup appear on the first page of the print dialog
     static com::sun::star::uno::Any getSubgroupControlOpt( const rtl::OUString& i_rTitle,
-                                                           const rtl::OUString& i_rHelpText,
+                                                           const rtl::OUString& i_rHelpId,
                                                            const UIControlOptions& i_rControlOptions = UIControlOptions()
                                                            );
 
     // create a bool option (usually a checkbox)
     static com::sun::star::uno::Any getBoolControlOpt( const rtl::OUString& i_rTitle,
-                                                       const rtl::OUString& i_rHelpText,
+                                                       const rtl::OUString& i_rHelpId,
                                                        const rtl::OUString& i_rProperty,
                                                        sal_Bool i_bValue,
                                                        const UIControlOptions& i_rControlOptions = UIControlOptions()
@@ -649,7 +655,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
 
     // create a set of choices (either a radio button group or a list box)
     static com::sun::star::uno::Any getChoiceControlOpt( const rtl::OUString& i_rTitle,
-                                                         const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpText,
+                                                         const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpId,
                                                          const rtl::OUString& i_rProperty,
                                                          const com::sun::star::uno::Sequence< rtl::OUString >& i_rChoices,
                                                          sal_Int32 i_nValue,
@@ -661,7 +667,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
     // create an integer range (e.g. a spin field)
     // note: max value < min value means do not apply min/max values
     static com::sun::star::uno::Any getRangeControlOpt( const rtl::OUString& i_rTitle,
-                                                        const rtl::OUString& i_rHelpText,
+                                                        const rtl::OUString& i_rHelpId,
                                                         const rtl::OUString& i_rProperty,
                                                         sal_Int32 i_nValue,
                                                         sal_Int32 i_nMinValue = -1,
@@ -672,7 +678,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
     // create a string field
     // note: max value < min value means do not apply min/max values
     static com::sun::star::uno::Any getEditControlOpt( const rtl::OUString& i_rTitle,
-                                                       const rtl::OUString& i_rHelpText,
+                                                       const rtl::OUString& i_rHelpId,
                                                        const rtl::OUString& i_rProperty,
                                                        const rtl::OUString& i_rValue,
                                                        const UIControlOptions& i_rControlOptions = UIControlOptions()
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 9d8f3bf2f9a0..e557a8427704 100755
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -1721,7 +1721,7 @@ void PrinterOptionsHelper::appendPrintUIOptions( uno::Sequence< beans::PropertyV
 }
 
 Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
-                                           const Sequence< rtl::OUString >& i_rHelpTexts,
+                                           const Sequence< rtl::OUString >& i_rHelpIds,
                                            const rtl::OUString& i_rType,
                                            const PropertyValue* i_pVal,
                                            const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
@@ -1730,7 +1730,7 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
     sal_Int32 nElements =
         1                                                               // ControlType
         + (i_rTitle.getLength() ? 1 : 0)                                // Text
-        + (i_rHelpTexts.getLength() ? 1 : 0)                            // HelpText
+        + (i_rHelpIds.getLength() ? 1 : 0)                              // HelpId
         + (i_pVal ? 1 : 0)                                              // Property
         + i_rControlOptions.maAddProps.getLength()                      // additional props
         + (i_rControlOptions.maGroupHint.getLength() ? 1 : 0)           // grouping
@@ -1753,10 +1753,10 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
         aCtrl[nUsed  ].Name  = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) );
         aCtrl[nUsed++].Value = makeAny( i_rTitle );
     }
-    if( i_rHelpTexts.getLength() )
+    if( i_rHelpIds.getLength() )
     {
-        aCtrl[nUsed  ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) );
-        aCtrl[nUsed++].Value = makeAny( i_rHelpTexts );
+        aCtrl[nUsed  ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpId" ) );
+        aCtrl[nUsed++].Value = makeAny( i_rHelpIds );
     }
     aCtrl[nUsed  ].Name  = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlType" ) );
     aCtrl[nUsed++].Value = makeAny( i_rType );
@@ -1805,53 +1805,53 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
     return makeAny( aCtrl );
 }
 
-Any PrinterOptionsHelper::getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpText )
+Any PrinterOptionsHelper::getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpId )
 {
-    Sequence< rtl::OUString > aHelpText;
-    if( i_rHelpText.getLength() > 0 )
+    Sequence< rtl::OUString > aHelpId;
+    if( i_rHelpId.getLength() > 0 )
     {
-        aHelpText.realloc( 1 );
-        *aHelpText.getArray() = i_rHelpText;
+        aHelpId.realloc( 1 );
+        *aHelpId.getArray() = i_rHelpId;
     }
-    return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) );
+    return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) );
 }
 
 Any PrinterOptionsHelper::getSubgroupControlOpt( const rtl::OUString& i_rTitle,
-                                                 const rtl::OUString& i_rHelpText,
+                                                 const rtl::OUString& i_rHelpId,
                                                  const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
                                                  )
 {
-    Sequence< rtl::OUString > aHelpText;
-    if( i_rHelpText.getLength() > 0 )
+    Sequence< rtl::OUString > aHelpId;
+    if( i_rHelpId.getLength() > 0 )
     {
-        aHelpText.realloc( 1 );
-        *aHelpText.getArray() = i_rHelpText;
+        aHelpId.realloc( 1 );
+        *aHelpId.getArray() = i_rHelpId;
     }
-    return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ),
+    return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ),
                             NULL, i_rControlOptions );
 }
 
 Any PrinterOptionsHelper::getBoolControlOpt( const rtl::OUString& i_rTitle,
-                                             const rtl::OUString& i_rHelpText,
+                                             const rtl::OUString& i_rHelpId,
                                              const rtl::OUString& i_rProperty,
                                              sal_Bool i_bValue,
                                              const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
                                              )
 {
-    Sequence< rtl::OUString > aHelpText;
-    if( i_rHelpText.getLength() > 0 )
+    Sequence< rtl::OUString > aHelpId;
+    if( i_rHelpId.getLength() > 0 )
     {
-        aHelpText.realloc( 1 );
-        *aHelpText.getArray() = i_rHelpText;
+        aHelpId.realloc( 1 );
+        *aHelpId.getArray() = i_rHelpId;
     }
     PropertyValue aVal;
     aVal.Name = i_rProperty;
     aVal.Value = makeAny( i_bValue );
-    return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bool" ) ), &aVal, i_rControlOptions );
+    return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bool" ) ), &aVal, i_rControlOptions );
 }
 
 Any PrinterOptionsHelper::getChoiceControlOpt( const rtl::OUString& i_rTitle,
-                                               const Sequence< rtl::OUString >& i_rHelpText,
+                                               const Sequence< rtl::OUString >& i_rHelpId,
                                                const rtl::OUString& i_rProperty,
                                                const Sequence< rtl::OUString >& i_rChoices,
                                                sal_Int32 i_nValue,
@@ -1874,11 +1874,11 @@ Any PrinterOptionsHelper::getChoiceControlOpt( const rtl::OUString& i_rTitle,
     PropertyValue aVal;
     aVal.Name = i_rProperty;
     aVal.Value = makeAny( i_nValue );
-    return getUIControlOpt( i_rTitle, i_rHelpText, i_rType, &aVal, aOpt );
+    return getUIControlOpt( i_rTitle, i_rHelpId, i_rType, &aVal, aOpt );
 }
 
 Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
-                                              const rtl::OUString& i_rHelpText,
+                                              const rtl::OUString& i_rHelpId,
                                               const rtl::OUString& i_rProperty,
                                               sal_Int32 i_nValue,
                                               sal_Int32 i_nMinValue,
@@ -1897,17 +1897,17 @@ Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
         aOpt.maAddProps[nUsed++].Value = makeAny( i_nMaxValue );
     }
 
-    Sequence< rtl::OUString > aHelpText;
-    if( i_rHelpText.getLength() > 0 )
+    Sequence< rtl::OUString > aHelpId;
+    if( i_rHelpId.getLength() > 0 )
     {
-        aHelpText.realloc( 1 );
-        *aHelpText.getArray() = i_rHelpText;
+        aHelpId.realloc( 1 );
+        *aHelpId.getArray() = i_rHelpId;
     }
     PropertyValue aVal;
     aVal.Name = i_rProperty;
     aVal.Value = makeAny( i_nValue );
     return getUIControlOpt( i_rTitle,
-                            aHelpText,
+                            aHelpId,
                             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Range" ) ),
                             &aVal,
                             aOpt
@@ -1915,23 +1915,23 @@ Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
 }
 
 Any PrinterOptionsHelper::getEditControlOpt( const rtl::OUString& i_rTitle,
-                                             const rtl::OUString& i_rHelpText,
+                                             const rtl::OUString& i_rHelpId,
                                              const rtl::OUString& i_rProperty,
                                              const rtl::OUString& i_rValue,
                                              const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
                                            )
 {
-    Sequence< rtl::OUString > aHelpText;
-    if( i_rHelpText.getLength() > 0 )
+    Sequence< rtl::OUString > aHelpId;
+    if( i_rHelpId.getLength() > 0 )
     {
-        aHelpText.realloc( 1 );
-        *aHelpText.getArray() = i_rHelpText;
+        aHelpId.realloc( 1 );
+        *aHelpId.getArray() = i_rHelpId;
     }
     PropertyValue aVal;
     aVal.Name = i_rProperty;
     aVal.Value = makeAny( i_rValue );
     return getUIControlOpt( i_rTitle,
-                            aHelpText,
+                            aHelpId,
                             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Edit" ) ),
                             &aVal,
                             i_rControlOptions
diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src
index 13ae6b0ead76..bafa13fdbeba 100644
--- a/vcl/source/src/print.src
+++ b/vcl/source/src/print.src
@@ -45,16 +45,19 @@ ModalDialog SV_DLG_PRINT
         Pos = MAP_APPFONT( 240, 195 );
         Size = MAP_APPFONT( 50, 15 );
         Text [en-US] = "~Print";
+        HelpID = ".HelpID:vcl:PrintDialog:OK";
     };
     CancelButton SV_PRINT_CANCEL
     {
         Pos = MAP_APPFONT( 295, 195 );
         Size = MAP_APPFONT( 50, 15 );
+        HelpID = ".HelpID:vcl:PrintDialog:Cancel";
     };
     HelpButton SV_PRINT_HELP
     {
         Pos = MAP_APPFONT( 5, 5 );
         Size = MAP_APPFONT( 50, 15 );
+        HelpID = ".HelpID:vcl:PrintDialog:Help";
     };
 
     Window SV_PRINT_PAGE_PREVIEW
@@ -62,16 +65,16 @@ ModalDialog SV_DLG_PRINT
         Pos = MAP_APPFONT( 5, 5 );
         Size = MAP_APPFONT( 130, 130 );
         Border = FALSE;
+        HelpID = ".HelpID:vcl:PrintDialog:Preview";
     };
     NumericField SV_PRINT_PAGE_EDIT
     {
-        HelpID = "vcl:NumericField:SV_DLG_PRINT:SV_PRINT_PAGE_EDIT";
         Pos = MAP_APPFONT( 5, 140 );
         Size = MAP_APPFONT( 30, 12 );
         SVLook = TRUE;
         Spin = FALSE;
         Border = TRUE;
-        HelpText [en-US] = "Select page to display in preview.";
+        HelpID = ".HelpID:vcl:PrintDialog:PageEdit";
     };
     FixedText SV_PRINT_PAGE_TXT
     {
@@ -79,26 +82,25 @@ ModalDialog SV_DLG_PRINT
         Size = MAP_APPFONT( 30, 12 );
         Text [ en-US ] = "/ %n";
         VCenter = TRUE;
+        HelpID = ".HelpID:vcl:PrintDialog:NumPagesText";
     };
     PushButton SV_PRINT_PAGE_FORWARD
     {
-        HelpID = "vcl:PushButton:SV_DLG_PRINT:SV_PRINT_PAGE_FORWARD";
         Pos = MAP_APPFONT( 95, 140 );
         Size = MAP_APPFONT( 15, 12 );
-        HelpText [en-US] = "Scroll one page forward.";
+        HelpID = ".HelpID:vcl:PrintDialog:ForwardBtn";
     };
     PushButton SV_PRINT_PAGE_BACKWARD
     {
-        HelpID = "vcl:PushButton:SV_DLG_PRINT:SV_PRINT_PAGE_BACKWARD";
         Pos = MAP_APPFONT( 80, 140 );
         Size = MAP_APPFONT( 15, 12 );
-        HelpText [en-US] = "Scroll one page backward.";
+        HelpID = ".HelpID:vcl:PrintDialog:BackwardBtn";
     };
     TabControl SV_PRINT_TABCTRL
     {
-        HelpID = "vcl:TabControl:SV_DLG_PRINT:SV_PRINT_TABCTRL";
         Pos = MAP_APPFONT( 140, 5 );
         Size = MAP_APPFONT( 205, 175 );
+        HelpID = ".HelpID:vcl:PrintDialog:TabPages";
     };
     FixedLine SV_PRINT_BUTTONLINE
     {
@@ -128,7 +130,7 @@ ModalDialog SV_DLG_PRINT
 
     TabPage SV_PRINT_TAB_NUP
     {
-        HelpID = "vcl:TabPage:SV_PRINT_TAB_NUP";
+        HelpID = ".HelpID:vcl:PrintDialog:TabNUp";
         Text [en-US] = "Page Layout";
         Hide = TRUE;
 
@@ -138,38 +140,28 @@ ModalDialog SV_DLG_PRINT
             Size = MAP_APPFONT( 150, 10 );
             Text [en-US] = "Layout";
         };
-        RadioButton SV_PRINT_PRT_NUP_DEFAULT_BTN
-        {
-            HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_DEFAULT_BTN";
-            Pos = MAP_APPFONT( 0, 0 );
-            Size = MAP_APPFONT( 10, 10 );
-            Text [en-US] = "~Default";
-            HelpText [en-US] = "Print one page per sheet of paper.";
-        };
         RadioButton SV_PRINT_PRT_NUP_BROCHURE_BTN
         {
-            HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_BROCHURE_BTN";
+            HelpID = ".HelpID:vcl:PrintDialog:NUpPage:Brochure";
             Pos = MAP_APPFONT( 0, 0 );
             Size = MAP_APPFONT( 10, 10 );
             Text = "";
         };
         RadioButton SV_PRINT_PRT_NUP_PAGES_BTN
         {
-            HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_PAGES_BTN";
+            HelpID = ".HelpID:vcl:PrintDialog:NUpPage:PagesPerSheet";
             Pos = MAP_APPFONT( 0, 0 );
             Size = MAP_APPFONT( 10, 10 );
             Text [en-US] = "Pa~ges per sheet";
-            HelpText [en-US] = "Print multiple pages per sheet of paper.";
         };
         ListBox SV_PRINT_PRT_NUP_PAGES_BOX
         {
-            HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_PAGES_BOX";
+            HelpID = ".HelpID:vcl:PrintDialog:NUpPage:PagesPerSheetBox";
             Pos = MAP_APPFONT( 0, 0 );
             Size = MAP_APPFONT( 10, 80 );
             Border = TRUE;
             DropDown = TRUE;
             CurPos = 0;
-            HelpText [en-US] = "Select how many pages to print per sheet of paper.";
             StringList [en-US] =
             {
                 < "1"; 1; >;
@@ -190,7 +182,7 @@ ModalDialog SV_DLG_PRINT
         };
         NumericField SV_PRINT_PRT_NUP_COLS_EDT
         {
-            HelpID = "vcl:NumericField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_COLS_EDT";
+            HelpID = ".HelpID:vcl:PrintDialog:NUpPage:ColumnsBox";
             Pos = MAP_APPFONT( 55, 20 );
             Size = MAP_APPFONT( 40, 12 );
             Border = TRUE;
@@ -198,7 +190,6 @@ ModalDialog SV_DLG_PRINT
             Minimum = 1;
             Maximum = 32;
             Value = 1;
-            HelpText [en-US] = "Select number of columns.";
         };
         FixedText SV_PRINT_PRT_NUP_TIMES_TXT
         {
@@ -209,7 +200,7 @@ ModalDialog SV_DLG_PRINT
         };
         NumericField SV_PRINT_PRT_NUP_ROWS_EDT
         {
-            HelpID = "vcl:NumericField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ROWS_EDT";
+            HelpID = ".HelpID:vcl:PrintDialog:NUpPage:RowsBox";
             Pos = MAP_APPFONT( 55, 35 );
             Size = MAP_APPFONT( 40, 12 );
             Border = TRUE;
@@ -217,7 +208,6 @@ ModalDialog SV_DLG_PRINT
             Minimum = 1;
             Maximum = 32;
             Value = 1;
-            HelpText [en-US] = "Select number of rows.";
         };
         FixedText SV_PRINT_PRT_NUP_MARGINS_PAGES_1_TXT
         {
@@ -227,14 +217,13 @@ ModalDialog SV_DLG_PRINT
         };
         MetricField SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT
         {
-            HelpID = "vcl:MetricField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT";
+            HelpID = ".HelpID:vcl:PrintDialog:NUpPage:PageMarginBox";
             Pos = MAP_APPFONT( 55, 95 );
             Size = MAP_APPFONT( 40, 12 );
             Spin = TRUE;
             Border = TRUE;
             Value = 0;
             Unit = FUNIT_MM;
-            HelpText [en-US] = "Select margin between individual pages on each sheet of paper.";
         };
         FixedText SV_PRINT_PRT_NUP_MARGINS_PAGES_2_TXT
         {
@@ -250,14 +239,13 @@ ModalDialog SV_DLG_PRINT
         };
         MetricField SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT
         {
-            HelpID = "vcl:MetricField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT";
+            HelpID = ".HelpID:vcl:PrintDialog:NUpPage:SheetMarginBox";
             Pos = MAP_APPFONT( 155, 95 );
             Size = MAP_APPFONT( 40, 12 );
             Spin = TRUE;
             Border = TRUE;
             Value = 0;
             Unit = FUNIT_MM;
-            HelpText [en-US] = "Select margin between the printed pages and paper edge.";
         };
         FixedText SV_PRINT_PRT_NUP_MARGINS_SHEET_2_TXT
         {
@@ -273,7 +261,7 @@ ModalDialog SV_DLG_PRINT
         };
         ListBox SV_PRINT_PRT_NUP_ORIENTATION_BOX
         {
-            HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ORIENTATION_BOX";
+            HelpID = ".HelpID:vcl:PrintDialog:NUpPage:OrientationBox";
             Pos = MAP_APPFONT( 0, 0 );
             Size = MAP_APPFONT( 10, 40 );
             Border = TRUE;
@@ -285,7 +273,6 @@ ModalDialog SV_DLG_PRINT
                 < "Portrait"; SV_PRINT_PRT_NUP_ORIENTATION_PORTRAIT; >;
                 < "Landscape"; SV_PRINT_PRT_NUP_ORIENTATION_LANDSCAPE; >;
             };
-            HelpText [en-US] = "Select the orientation of the paper.";
         };
         FixedText SV_PRINT_PRT_NUP_ORDER_TXT
         {
@@ -295,7 +282,7 @@ ModalDialog SV_DLG_PRINT
         };
         ListBox SV_PRINT_PRT_NUP_ORDER_BOX
         {
-            HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ORDER_BOX";
+            HelpID = ".HelpID:vcl:PrintDialog:NUpPage:OrderBox";
             Pos = MAP_APPFONT( 0, 0 );
             Size = MAP_APPFONT( 10, 20 );
             DropDown = TRUE;
@@ -306,21 +293,19 @@ ModalDialog SV_DLG_PRINT
                 < "left to right, then down"; SV_PRINT_PRT_NUP_ORDER_LRTD; >;
                 < "top to bottom, then right"; SV_PRINT_PRT_NUP_ORDER_TDLR; >;
             };
-            HelpText [en-US] = "Select order in which pages are to be printed.";
         };
         CheckBox SV_PRINT_PRT_NUP_BORDER_CB
         {
-            HelpID = "vcl:CheckBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_BORDER_CB";
+            HelpID = ".HelpID:vcl:PrintDialog:NUpPage:BorderBox";
             Pos = MAP_APPFONT( 10, 65 );
             Size = MAP_APPFONT( 150, 12 );
             Text [en-US] = "Draw a border around each page";
-            HelpText [en-US] = "Check to draw a border around each page.";
         };
     };
 
     TabPage SV_PRINT_TAB_JOB
     {
-        HelpID = "vcl:TabPage:SV_PRINT_TAB_JOB";
+        HelpID = ".HelpID:vcl:PrintDialog:TabJob";
         Text [en-US] = "General";
         Hide = TRUE;
 
@@ -332,20 +317,18 @@ ModalDialog SV_DLG_PRINT
         };
         ListBox SV_PRINT_PRINTERS
         {
-            HelpID = "vcl:ListBox:SV_PRINT_TAB_JOB:SV_PRINT_PRINTERS";
+            HelpID = ".HelpID:vcl:PrintDialog:JobPage:PrinterList";
             Pos = MAP_APPFONT( 5, 5 );
             Size = MAP_APPFONT( 100, 80 );
             Border = TRUE;
             Sort = TRUE;
-            HelpText [en-US] = "Select the printer to print on.";
         };
         CheckBox SV_PRINT_DETAILS_BTN
         {
-            HelpID = "vcl:CheckBox:SV_PRINT_TAB_JOB:SV_PRINT_DETAILS_BTN";
+            HelpID = ".HelpID:vcl:PrintDialog:JobPage:DetailsBtn";
             Pos = MAP_APPFONT( 5, 5 );
             Size = MAP_APPFONT( 5, 5 );
             Text [en-US] = "Details";
-            HelpText [en-US] = "Show/Hide detailed information of the selected printer.";
         };
         FixedText SV_PRINT_STATUS_TXT
         {
@@ -367,11 +350,10 @@ ModalDialog SV_DLG_PRINT
         };
         PushButton SV_PRINT_PRT_SETUP
         {
-            HelpID = "vcl:PushButton:SV_PRINT_TAB_JOB:SV_PRINT_PRT_SETUP";
+            HelpID = ".HelpID:vcl:PrintDialog:JobPage:Properties";
             Pos = MAP_APPFONT( 115, 5 );
             Size = MAP_APPFONT( 50, 15 );
             Text [en-US] = "Properties...";
-            HelpText [en-US] = "Call the setup dialog of the selected printer.";
         };
         FixedLine SV_PRINT_COPIES
         {
@@ -387,7 +369,7 @@ ModalDialog SV_DLG_PRINT
         };
         NumericField SV_PRINT_COPYCOUNT_FIELD
         {
-            HelpID = "vcl:NumericField:SV_PRINT_TAB_JOB:SV_PRINT_COPYCOUNT_FIELD";
+            HelpID = ".HelpID:vcl:PrintDialog:JobPage:Copies";
             Pos = MAP_APPFONT( 10, 56 );
             Size = MAP_APPFONT( 40, 12 );
             Border = TRUE;
@@ -395,7 +377,6 @@ ModalDialog SV_DLG_PRINT
             Minimum = 1;
             Maximum = 16384;
             Value = 1;
-            HelpText [en-US] = "Select the number of copies to be produced.";
         };
         FixedImage SV_PRINT_COLLATE_IMAGE
         {
@@ -404,11 +385,10 @@ ModalDialog SV_DLG_PRINT
         };
         CheckBox SV_PRINT_COLLATE
         {
-            HelpID = "vcl:CheckBox:SV_PRINT_TAB_JOB:SV_PRINT_COLLATE";
+            HelpID = ".HelpID:vcl:PrintDialog:JobPage:Collate";
             Pos = MAP_APPFONT( 95, 45 );
             Size = MAP_APPFONT( 70, 10 );
             Text [en-US] = "Collate";
-            HelpText [en-US] = "Select whether copies should be collated or not.";
         };
 
         Image SV_PRINT_COLLATE_IMG
@@ -434,9 +414,9 @@ ModalDialog SV_DLG_PRINT
 
     TabPage SV_PRINT_TAB_OPT
     {
-        HelpID = "vcl:TabPage:SV_PRINT_TAB_OPT";
         Text [en-US] = "Options";
         Hide = TRUE;
+        HelpID = ".HelpID:vcl:PrintDialog:TabOpt";
 
         FixedLine SV_PRINT_OPT_PRINT_FL
         {
@@ -446,27 +426,24 @@ ModalDialog SV_DLG_PRINT
         };
         CheckBox SV_PRINT_OPT_TOFILE
         {
-            HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_TOFILE";
+            HelpID = ".HelpID:vcl:PrintDialog:OptPage:ToFile";
             Pos = MAP_APPFONT( 10, 20 );
             Size = MAP_APPFONT( 200, 12 );
             Text [en-US] = "Print to ~file";
-            HelpText [en-US] = "Check to send output to a file instead of the actual printer.";
         };
         CheckBox SV_PRINT_OPT_SINGLEJOBS
         {
-            HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_SINGLEJOBS";
+            HelpID = ".HelpID:vcl:PrintDialog:OptPage:SingleJobs";
             Pos = MAP_APPFONT( 10, 35 );
             Size = MAP_APPFONT( 200, 12 );
             Text [en-US] = "~Create single print jobs for collated output";
-            HelpText [en-US] = "Check to not rely on the printer to create collated copies but create a print job for each copy instead.";
         };
         CheckBox SV_PRINT_OPT_REVERSE
         {
-            HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_REVERSE";
+            HelpID = ".HelpID:vcl:PrintDialog:OptPage:ToReverse";
             Pos = MAP_APPFONT( 10, 50 );
             Size = MAP_APPFONT( 200, 12 );
             Text [en-US] = "Print in ~reverse page order";
-            HelpText [en-US] = "Check to print pages in reverse order.";
         };
     };
 };
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index f24ed500b7df..ec80f5628635 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -60,10 +60,6 @@ using namespace com::sun::star::lang;
 using namespace com::sun::star::container;
 using namespace com::sun::star::beans;
 
-#define HELPID_PREFIX ".HelpId:vcl:PrintDialog"
-#define SMHID2( a, b ) SetHelpId( rtl::OString( HELPID_PREFIX ":" a ":" b ) )
-#define SMHID1( a ) SetHelpId( rtl::OString( HELPID_PREFIX  ":" a  ) )
-
 PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent, const ResId& i_rId )
     : Window( i_pParent, i_rId )
     , maOrigSize( 10, 10 )
@@ -429,28 +425,6 @@ PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId )
     maPageMarginEdt.SetDecimalDigits( nDigits );
     maSheetMarginEdt.SetDecimalDigits( nDigits );
 
-    SMHID1( "NUpPage" );
-    maNupLine.SMHID2("NUpPage", "Layout");
-    maBrochureBtn.SMHID2("NUpPage", "Brochure" );
-    maPagesBtn.SMHID2( "NUpPage", "PagesPerSheet" );
-    maPagesBoxTitleTxt.SMHID2( "NUpPage", "PagesPerSheetLabel" );
-    maNupPagesBox.SMHID2( "NUpPage", "PagesPerSheetBox" );
-    maNupNumPagesTxt.SMHID2( "NUpPage", "Columns" );
-    maNupColEdt.SMHID2( "NUpPage", "ColumnsBox" );
-    maNupTimesTxt.SMHID2( "NUpPage", "Rows" );
-    maNupRowsEdt.SMHID2( "NUpPage", "RowsBox" );
-    maPageMarginTxt1.SMHID2( "NUpPage", "PageMargin" );
-    maPageMarginEdt.SMHID2( "NUpPage", "PageMarginBox" );
-    maPageMarginTxt2.SMHID2( "NUpPage", "PageMarginCont" );
-    maSheetMarginTxt1.SMHID2( "NUpPage", "SheetMargin" );
-    maSheetMarginEdt.SMHID2( "NUpPage", "SheetMarginBox" );
-    maSheetMarginTxt2.SMHID2( "NUpPage", "SheetMarginCont" );
-    maNupOrientationTxt.SMHID2( "NUpPage", "Orientation" );
-    maNupOrientationBox.SMHID2( "NUpPage", "OrientationBox" );
-    maNupOrderTxt.SMHID2( "NUpPage", "Order" );
-    maNupOrderBox.SMHID2( "NUpPage", "OrderBox" );
-    maBorderCB.SMHID2( "NUpPage", "BorderBox" );
-
     setupLayout();
 }
 
@@ -605,24 +579,6 @@ PrintDialog::JobTabPage::JobTabPage( Window* i_pParent, const ResId& rResId )
 {
     FreeResource();
 
-    SMHID1( "JobPage" );
-    maPrinterFL.SMHID2( "JobPage", "Printer" );
-    maPrinters.SMHID2( "JobPage", "PrinterList" );
-    maDetailsBtn.SMHID2( "JobPage", "DetailsBtn" );
-    maStatusLabel.SMHID2( "JobPage", "StatusLabel" );
-    maStatusTxt.SMHID2( "JobPage", "StatusText" );
-    maLocationLabel.SMHID2( "JobPage", "LocationLabel" );
-    maLocationTxt.SMHID2( "JobPage", "LocationText" );
-    maCommentLabel.SMHID2( "JobPage", "CommentLabel" );
-    maCommentTxt.SMHID2( "JobPage", "CommentText" );
-    maSetupButton.SMHID2( "JobPage", "Properties" );
-    maCopies.SMHID2( "JobPage", "CopiesLine" );
-    maCopySpacer.SMHID2( "JobPage", "CopySpacer" );
-    maCopyCount.SMHID2( "JobPage", "CopiesText" );
-    maCopyCountField.SMHID2( "JobPage", "Copies" );
-    maCollateBox.SMHID2( "JobPage", "Collate" );
-    maCollateImage.SMHID2( "JobPage", "CollateImage" );
-
     maCopySpacer.Show();
     maStatusTxt.Show();
     maCommentTxt.Show();
@@ -753,11 +709,6 @@ PrintDialog::OutputOptPage::OutputOptPage( Window* i_pParent, const ResId& i_rRe
     , maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) )
 {
     FreeResource();
-    SMHID1( "OptPage" );
-    maOptionsLine.SMHID2( "OptPage", "Options" );
-    maToFileBox.SMHID2( "OptPage", "ToFile" );
-    maCollateSingleJobsBox.SMHID2( "OptPage", "SingleJobs" );
-    maReverseOrderBox.SMHID2( "OptPage", "Reverse" );
 
     setupLayout();
 }
@@ -977,18 +928,6 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr& i_rHelpIds, sal_Int32 i_nIndex )
 {
-    rtl::OStringBuffer aBuf( 256 );
-    aBuf.append( HELPID_PREFIX );
-    if( i_rPropName.getLength() )
-    {
-        aBuf.append( ':' );
-        aBuf.append( rtl::OUStringToOString( i_rPropName, RTL_TEXTENCODING_UTF8 ) );
-    }
-    if( i_pType )
-    {
-        aBuf.append( ':' );
-        aBuf.append( i_pType );
-    }
-    if( i_nId >= 0 )
-    {
-        aBuf.append( ':' );
-        aBuf.append( i_nId );
-    }
-    i_pWindow->SetHelpId( aBuf.makeStringAndClear() );
+    if( i_nIndex >= 0 && i_nIndex < i_rHelpIds.getLength() )
+        i_pWindow->SetHelpId( rtl::OUStringToOString( i_rHelpIds.getConstArray()[i_nIndex], RTL_TEXTENCODING_UTF8 ) );
 }
 
-static void setHelpText( Window* /*i_pWindow*/, const Sequence< rtl::OUString >& /*i_rHelpTexts*/, sal_Int32 /*i_nIndex*/ )
+static void setHelpText( Window* i_pWindow, const Sequence< rtl::OUString >& i_rHelpTexts, sal_Int32 i_nIndex )
 {
     // without a help text set and the correct smartID,
     // help texts will be retrieved from the online help system
-
-    // passed help texts for optional UI is used only for native dialogs which currently
-    // cannot access the same (rather implicit) mechanism
-    #if 0
     if( i_nIndex >= 0 && i_nIndex < i_rHelpTexts.getLength() )
         i_pWindow->SetHelpText( i_rHelpTexts.getConstArray()[i_nIndex] );
-    #endif
 }
 
 void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize )
@@ -1196,6 +1114,7 @@ void PrintDialog::setupOptionalUI()
         Sequence< rtl::OUString > aChoices;
         Sequence< sal_Bool > aChoicesDisabled;
         Sequence< rtl::OUString > aHelpTexts;
+        Sequence< rtl::OUString > aHelpIds;
         sal_Int64 nMinValue = 0, nMaxValue = 0;
         sal_Int32 nCurHelpText = 0;
         rtl::OUString aGroupingHint;
@@ -1270,6 +1189,18 @@ void PrintDialog::setupOptionalUI()
                     }
                 }
             }
+            else if( rEntry.Name.equalsAscii( "HelpId" ) )
+            {
+                if( ! (rEntry.Value >>= aHelpIds ) )
+                {
+                    rtl::OUString aHelpId;
+                    if( (rEntry.Value >>= aHelpId) )
+                    {
+                        aHelpIds.realloc( 1 );
+                        *aHelpIds.getArray() = aHelpId;
+                    }
+                }
+            }
             else if( rEntry.Name.equalsAscii( "HintNoLayoutPage" ) )
             {
                 sal_Bool bNoLayoutPage = sal_False;
@@ -1339,7 +1270,7 @@ void PrintDialog::setupOptionalUI()
             maTabCtrl.SetTabPage( nOptPageId, pNewGroup );
 
             // set help id
-            setSmartId( pNewGroup, "TabPage", nOptPageId );
+            setHelpId( pNewGroup, aHelpIds, 0 );
             // set help text
             setHelpText( pNewGroup, aHelpTexts, 0 );
 
@@ -1371,7 +1302,7 @@ void PrintDialog::setupOptionalUI()
                 pNewSub->Show();
 
                 // set help id
-                setSmartId( pNewSub, "FixedLine", sal_Int32( nCurSubGroup++ ) );
+                setHelpId( pNewSub, aHelpIds, 0 );
                 // set help text
                 setHelpText( pNewSub, aHelpTexts, 0 );
                 // add group to current column
@@ -1451,7 +1382,7 @@ void PrintDialog::setupOptionalUI()
                 maControlToPropertyMap[pNewBox] = aPropertyName;
 
                 // set help id
-                setSmartId( pNewBox, "CheckBox", -1, aPropertyName );
+                setHelpId( pNewBox, aHelpIds, 0 );
                 // set help text
                 setHelpText( pNewBox, aHelpTexts, 0 );
 
@@ -1474,9 +1405,10 @@ void PrintDialog::setupOptionalUI()
                     pHeading->Show();
 
                     // set help id
-                    setSmartId( pHeading, "FixedText", -1, aPropertyName );
+                    setHelpId( pHeading, aHelpIds, nCurHelpText );
                     // set help text
-                    setHelpText( pHeading, aHelpTexts, nCurHelpText++ );
+                    setHelpText( pHeading, aHelpTexts, nCurHelpText );
+                    nCurHelpText++;
                     // add fixed text to current column
                     pCurColumn->addWindow( pHeading );
                     // add an indent to the current column
@@ -1512,9 +1444,10 @@ void PrintDialog::setupOptionalUI()
                     maControlToNumValMap[pBtn] = m;
 
                     // set help id
-                    setSmartId( pBtn, "RadioButton", m, aPropertyName );
+                    setHelpId( pBtn, aHelpIds, nCurHelpText );
                     // set help text
-                    setHelpText( pBtn, aHelpTexts, nCurHelpText++ );
+                    setHelpText( pBtn, aHelpTexts, nCurHelpText );
+                    nCurHelpText++;
                     // add the radio button to the column
                     pLabel->setLabel( pBtn );
                 }
@@ -1538,9 +1471,6 @@ void PrintDialog::setupOptionalUI()
                     pHeading->SetText( aText );
                     pHeading->Show();
 
-                    // set help id
-                    setSmartId( pHeading, "FixedText", -1, aPropertyName );
-
                     // add to row
                     pLabel = new vcl::LabeledElement( pFieldColumn, 2 );
                     pFieldColumn->addChild( pLabel );
@@ -1567,7 +1497,7 @@ void PrintDialog::setupOptionalUI()
                     pList->Show();
 
                     // set help id
-                    setSmartId( pList, "ListBox", -1, aPropertyName );
+                    setHelpId( pList, aHelpIds, 0 );
                     // set help text
                     setHelpText( pList, aHelpTexts, 0 );
 
@@ -1600,7 +1530,7 @@ void PrintDialog::setupOptionalUI()
                     pField->Show();
 
                     // set help id
-                    setSmartId( pField, "NumericField", -1, aPropertyName );
+                    setHelpId( pField, aHelpIds, 0 );
                     // set help text
                     setHelpText( pField, aHelpTexts, 0 );
 
@@ -1627,7 +1557,7 @@ void PrintDialog::setupOptionalUI()
                     pField->Show();
 
                     // set help id
-                    setSmartId( pField, "Edit", -1, aPropertyName );
+                    setHelpId( pField, aHelpIds, 0 );
                     // set help text
                     setHelpText( pField, aHelpTexts, 0 );
 
-- 
cgit 


From 05863b459fe4ba9095ca333f47c35a2d168e2c1d Mon Sep 17 00:00:00 2001
From: "Philipp Lohmann [pl]" 
Date: Tue, 2 Nov 2010 17:03:34 +0100
Subject: vcl117: #i115056# change direct help texts to help ids to allow for
 proper help content

---
 sc/source/ui/src/scstring.src  |  9 -------
 sc/source/ui/unoobj/docuno.cxx | 55 ++++++++++++++++--------------------------
 2 files changed, 21 insertions(+), 43 deletions(-)

diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index 9c47a42239cc..d13f3a807ff0 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -749,22 +749,13 @@ StringArray SCSTR_PRINT_OPTIONS
     {
         < "Pages"; >;
         < "~Include output of empty pages"; >;
-        < "If checked empty pages that have no cell contents or draw objects are not printed."; >;
-        < "Sheets"; >;
-        < "Print ~only selected sheets"; >;
-        < "If checked only contents from selected sheets are printed, even if you specify a wider range in the Format - Print Ranges dialog. Content from sheets that are not selected will not be printed."; >;
         < "Print content"; >;
         < "~All sheets"; >;
-        < "The printout will be created from all sheets in the document."; >;
         < "~Selected sheets"; >;
-        < "The printout will be created only from the currently selected sheets."; >;
         < "Selected cells"; >;
-        < "The printout will be created only from the currently selected cells."; >;
         < "Thereof print"; >;
         < "All ~pages"; >;
-        < "Print all pages of the printable content."; >;
         < "Pa~ges"; >;
-        < "Print only some pages of the printable content."; >;
         < "%PRODUCTNAME %s"; >;
     };
 };
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 3d3f0f479601..5745d8a2e815 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -225,15 +225,15 @@ ScPrintUIOptions::ScPrintUIOptions()
     sal_Bool bSuppress = rPrintOpt.GetSkipEmpty();
 
     ResStringArray aStrings( ScResId( SCSTR_PRINT_OPTIONS ) );
-    DBG_ASSERT( aStrings.Count() >= 19, "resource incomplete" );
-    if( aStrings.Count() < 19 ) // bad resource ?
+    DBG_ASSERT( aStrings.Count() >= 10, "resource incomplete" );
+    if( aStrings.Count() < 10 ) // bad resource ?
         return;
 
     m_aUIProperties.realloc( 8 );
 
     // create Section for spreadsheet (results in an extra tab page in dialog)
     SvtModuleOptions aOpt;
-    String aAppGroupname( aStrings.GetString( 18 ) );
+    String aAppGroupname( aStrings.GetString( 9 ) );
     aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ),
                                     aOpt.GetModuleName( SvtModuleOptions::E_SCALC ) );
     m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() );
@@ -243,35 +243,35 @@ ScPrintUIOptions::ScPrintUIOptions()
 
     // create a bool option for empty pages
     m_aUIProperties[2].Value = getBoolControlOpt( rtl::OUString( aStrings.GetString( 1 ) ),
-                                                  rtl::OUString( aStrings.GetString( 2 ) ),
+                                                  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox" ) ),
                                                   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsIncludeEmptyPages" ) ),
                                                   ! bSuppress
                                                   );
     // create Subgroup for print content
     vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
     aPrintRangeOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) );
-    m_aUIProperties[3].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 6 ) ),
+    m_aUIProperties[3].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 2 ) ),
                                                       rtl::OUString(),
                                                       aPrintRangeOpt
                                                       );
 
     // create a choice for the content to create
-    uno::Sequence< rtl::OUString > aChoices( 3 ), aHelpTexts( 3 );
-    aChoices[0] = aStrings.GetString( 7 );
-    aHelpTexts[0] = aStrings.GetString( 8 );
-    aChoices[1] = aStrings.GetString( 9 );
-    aHelpTexts[1] = aStrings.GetString( 10 );
-    aChoices[2] = aStrings.GetString( 11 );
-    aHelpTexts[2] = aStrings.GetString( 12 );
+    uno::Sequence< rtl::OUString > aChoices( 3 ), aHelpIds( 3 );
+    aChoices[0] = aStrings.GetString( 3 );
+    aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) );
+    aChoices[1] = aStrings.GetString( 4 );
+    aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) );
+    aChoices[2] = aStrings.GetString( 5 );
+    aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ) );
     m_aUIProperties[4].Value = getChoiceControlOpt( rtl::OUString(),
-                                                    aHelpTexts,
+                                                    aHelpIds,
                                                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ),
                                                     aChoices,
                                                     nContent );
 
     // create Subgroup for print range
     aPrintRangeOpt.mbInternalOnly = sal_True;
-    m_aUIProperties[5].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 13 ) ),
+    m_aUIProperties[5].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 6 ) ),
                                                       rtl::OUString(),
                                                       aPrintRangeOpt
                                                       );
@@ -279,13 +279,13 @@ ScPrintUIOptions::ScPrintUIOptions()
     // create a choice for the range to print
     rtl::OUString aPrintRangeName( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) );
     aChoices.realloc( 2 );
-    aHelpTexts.realloc( 2 );
-    aChoices[0] = aStrings.GetString( 14 );
-    aHelpTexts[0] = aStrings.GetString( 15 );
-    aChoices[1] = aStrings.GetString( 16 );
-    aHelpTexts[1] = aStrings.GetString( 17 );
+    aHelpIds.realloc( 2 );
+    aChoices[0] = aStrings.GetString( 7 );
+    aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:0" ) );
+    aChoices[1] = aStrings.GetString( 8 );
+    aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:1" ) );
     m_aUIProperties[6].Value = getChoiceControlOpt( rtl::OUString(),
-                                                    aHelpTexts,
+                                                    aHelpIds,
                                                     aPrintRangeName,
                                                     aChoices,
                                                     0 );
@@ -293,24 +293,11 @@ ScPrintUIOptions::ScPrintUIOptions()
     // create a an Edit dependent on "Pages" selected
     vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True );
     m_aUIProperties[7].Value = getEditControlOpt( rtl::OUString(),
-                                                  rtl::OUString(),
+                                                  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageRange:Edit" ) ),
                                                   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ),
                                                   rtl::OUString(),
                                                   aPageRangeOpt
                                                   );
-
-    // "Print only selected sheets" isn't needed because of the "Selected Sheets" choice in "Print content"
-#if 0
-    // create subgroup for sheets
-    m_aUIProperties[8].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 3 ) ), rtl::OUString() );
-
-    // create a bool option for selected pages only
-    m_aUIProperties[9].Value = getBoolControlOpt( rtl::OUString( aStrings.GetString( 4 ) ),
-                                                  rtl::OUString( aStrings.GetString( 5 ) ),
-                                                  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsOnlySelectedSheets" ) ),
-                                                  i_bSelectedOnly
-                                                  );
-#endif
 }
 
 void ScPrintUIOptions::SetDefaults()
-- 
cgit 


From 1b55e3ea5557b7540183c6cd07a4b73b75c107cd Mon Sep 17 00:00:00 2001
From: "Philipp Lohmann [pl]" 
Date: Tue, 2 Nov 2010 17:03:34 +0100
Subject: vcl117: #i115056# change direct help texts to help ids to allow for
 proper help content

---
 starmath/source/smres.src         |   9 ---
 starmath/source/unomodel.cxx      |  34 ++++----
 sw/source/core/view/printdata.cxx | 160 +++++++++++++++++++-------------------
 sw/source/ui/config/optdlg.src    |  15 ----
 4 files changed, 98 insertions(+), 120 deletions(-)

diff --git a/starmath/source/smres.src b/starmath/source/smres.src
index e608b1c9108d..601472b62f5a 100644
--- a/starmath/source/smres.src
+++ b/starmath/source/smres.src
@@ -1755,21 +1755,12 @@ StringArray RID_PRINTUIOPTIONS
         < "%PRODUCTNAME %s"; >;
         < "Contents"; >;
         < "~Title"; >;
-        < "Specifies whether you want the name of the document to be included in the printout"; >;
         < "~Formula text"; >;
-        < "Specifies whether to include the contents of the 'Commands' window at the bottom of the printout."; >;
         < "B~orders"; >;
-        < "Applies a thin border to the formula area in the printout."; >;
         < "Size"; >;
         < "O~riginal size"; >;
-        < "Prints the formula without adjusting the current font size."; >;
         < "Fit to ~page"; >;
-        < "Adjusts the formula to the page format used in the printout."; >;
         < "~Scaling"; >;
-        < "Reduces or enlarges the size of the printed formula by a specified enlargement factor."; >;
-//        < "Miscellaneous options"; >;
-//        < "Ig~nore ~~ and ` at the end of the line"; >;
-//        < "Specfies that these space wildcards will be removed if they are at the end of a line."; >;
     };
 };
 
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index cd3e4b714469..6858fffcc481 100755
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -81,8 +81,8 @@ using namespace ::com::sun::star::script;
 SmPrintUIOptions::SmPrintUIOptions()
 {
     ResStringArray      aLocalizedStrings( SmResId( RID_PRINTUIOPTIONS ) );
-    DBG_ASSERT( aLocalizedStrings.Count() >= 15, "resource incomplete" );
-    if( aLocalizedStrings.Count() < 15 ) // bad resource ?
+    DBG_ASSERT( aLocalizedStrings.Count() >= 9, "resource incomplete" );
+    if( aLocalizedStrings.Count() < 9 ) // bad resource ?
         return;
 
     SmModule *pp = SM_MOD();
@@ -107,35 +107,35 @@ SmPrintUIOptions::SmPrintUIOptions()
 
     // create a bool option for title row (matches to SID_PRINTTITLE)
     m_aUIProperties[2].Value = getBoolControlOpt( aLocalizedStrings.GetString( 2 ),
-                                                  aLocalizedStrings.GetString( 3 ),
+                                                  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TitleRow:CheckBox" ) ),
                                                   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_TITLE_ROW ) ),
                                                   pConfig->IsPrintTitle() );
     // create a bool option for formula text (matches to SID_PRINTTEXT)
-    m_aUIProperties[3].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ),
-                                                  aLocalizedStrings.GetString( 5 ),
+    m_aUIProperties[3].Value = getBoolControlOpt( aLocalizedStrings.GetString( 3 ),
+                                                  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:FormulaText:CheckBox" ) ),
                                                   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_FORMULA_TEXT ) ),
                                                   pConfig->IsPrintFormulaText() );
     // create a bool option for border (matches to SID_PRINTFRAME)
-    m_aUIProperties[4].Value = getBoolControlOpt( aLocalizedStrings.GetString( 6 ),
-                                                  aLocalizedStrings.GetString( 7 ),
+    m_aUIProperties[4].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ),
+                                                  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:Border:CheckBox" ) ),
                                                   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_BORDER ) ),
                                                   pConfig->IsPrintFrame() );
 
     // create subgroup for print format
-    m_aUIProperties[5].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 8 ), rtl::OUString() );
+    m_aUIProperties[5].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 5 ), rtl::OUString() );
 
     // create a radio button group for print format (matches to SID_PRINTSIZE)
     Sequence< rtl::OUString > aChoices( 3 );
-    aChoices[0] = aLocalizedStrings.GetString( 9 );
-    aChoices[1] = aLocalizedStrings.GetString( 11 );
-    aChoices[2] = aLocalizedStrings.GetString( 13 );
-    Sequence< rtl::OUString > aHelpTexts( 3 );
-    aHelpTexts[0] = aLocalizedStrings.GetString( 10 );
-    aHelpTexts[1] = aLocalizedStrings.GetString( 12 );
-    aHelpTexts[2] = aLocalizedStrings.GetString( 14 );
+    aChoices[0] = aLocalizedStrings.GetString( 6 );
+    aChoices[1] = aLocalizedStrings.GetString( 7 );
+    aChoices[2] = aLocalizedStrings.GetString( 8 );
+    Sequence< rtl::OUString > aHelpIds( 3 );
+    aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintFormat:RadioButton:0" ) );
+    aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintFormat:RadioButton:1" ) );
+    aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintFormat:RadioButton:2" ) );
     OUString aPrintFormatProp( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_PRINT_FORMAT ) );
     m_aUIProperties[6].Value = getChoiceControlOpt( rtl::OUString(),
-                                                    aHelpTexts,
+                                                    aHelpIds,
                                                     aPrintFormatProp,
                                                     aChoices, static_cast< sal_Int32 >(pConfig->GetPrintSize())
                                                     );
@@ -143,7 +143,7 @@ SmPrintUIOptions::SmPrintUIOptions()
     // create a numeric box for scale dependent on PrintFormat = "Scaling" (matches to SID_PRINTZOOM)
     vcl::PrinterOptionsHelper::UIControlOptions aRangeOpt( aPrintFormatProp, 2, sal_True );
     m_aUIProperties[ 7 ].Value = getRangeControlOpt( rtl::OUString(),
-                                                     aLocalizedStrings.GetString( 14 ),
+                                                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintScale:NumericField," ) ),
                                                      rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_PRINT_SCALE ) ),
                                                      pConfig->GetPrintZoomFactor(),    // initial value
                                                      10,     // min value
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index d6cbf11b8731..83f2b38664d5 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -210,8 +210,8 @@ SwPrintUIOptions::SwPrintUIOptions(
 {
     ResStringArray aLocalizedStrings( SW_RES( STR_PRINTOPTUI ) );
 
-    DBG_ASSERT( aLocalizedStrings.Count() >= 44, "resource incomplete" );
-    if( aLocalizedStrings.Count() < 44 ) // bad resource ?
+    DBG_ASSERT( aLocalizedStrings.Count() >= 30, "resource incomplete" );
+    if( aLocalizedStrings.Count() < 30 ) // bad resource ?
         return;
 
     // printing HTML sources does not have any valid UI options.
@@ -246,79 +246,79 @@ SwPrintUIOptions::SwPrintUIOptions(
     // create a bool option for background
     bool bDefaultVal = rDefaultPrintData.IsPrintPageBackground();
     m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 2 ),
-                                                  aLocalizedStrings.GetString( 3 ),
-                                                  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPageBackground" ) ),
-                                                  bDefaultVal );
+                                                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPageBackground:CheckBox" ) ),
+                                                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPageBackground" ) ),
+                                                         bDefaultVal );
 
     // create a bool option for pictures/graphics AND OLE and drawing objects as well
     bDefaultVal = rDefaultPrintData.IsPrintGraphic() || rDefaultPrintData.IsPrintDraw();
-    m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ),
-                                                  aLocalizedStrings.GetString( 5 ),
-                                                  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPicturesAndObjects" ) ),
-                                                  bDefaultVal );
+    m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 3 ),
+                                                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPicturesAndObjects:CheckBox" ) ),
+                                                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPicturesAndObjects" ) ),
+                                                         bDefaultVal );
     if (!bWeb)
     {
         // create a bool option for hidden text
         bDefaultVal = rDefaultPrintData.IsPrintHiddenText();
-        m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 6 ),
-                                                  aLocalizedStrings.GetString( 7 ),
-                                                  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintHiddenText" ) ),
-                                                  bDefaultVal );
+        m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ),
+                                                             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintHiddenText:CheckBox" ) ),
+                                                             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintHiddenText" ) ),
+                                                             bDefaultVal );
 
         // create a bool option for place holder
         bDefaultVal = rDefaultPrintData.IsPrintTextPlaceholder();
-        m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 8 ),
-                                                  aLocalizedStrings.GetString( 9 ),
-                                                  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintTextPlaceholder" ) ),
-                                                  bDefaultVal );
+        m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 5 ),
+                                                             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintTextPlaceholder:CheckBox" ) ),
+                                                             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintTextPlaceholder" ) ),
+                                                             bDefaultVal );
     }
 
     // create a bool option for controls
     bDefaultVal = rDefaultPrintData.IsPrintControl();
-    m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 10 ),
-                                                  aLocalizedStrings.GetString( 11 ),
-                                                  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintControls" ) ),
-                                                  bDefaultVal );
+    m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 6 ),
+                                                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintControls:CheckBox" ) ),
+                                                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintControls" ) ),
+                                                         bDefaultVal );
 
     // create sub section for Color
-    m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 12 ), rtl::OUString() );
+    m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 7 ), rtl::OUString() );
 
     // create a bool option for printing text with black font color
     bDefaultVal = rDefaultPrintData.IsPrintBlackFont();
-    m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 13 ),
-                                                  aLocalizedStrings.GetString( 14 ),
-                                                  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBlackFonts" ) ),
-                                                  bDefaultVal );
+    m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 8 ),
+                                                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintBlackFonts:CheckBox" ) ),
+                                                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBlackFonts" ) ),
+                                                         bDefaultVal );
 
     if (!bWeb)
     {
         // create subgroup for misc options
-        m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 15 ) ), rtl::OUString() );
+        m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 9 ) ), rtl::OUString() );
 
         // create a bool option for printing automatically inserted blank pages
         bDefaultVal = rDefaultPrintData.IsPrintEmptyPages();
-        m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 16 ),
-                                                       aLocalizedStrings.GetString( 17 ),
-                                                       rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintEmptyPages" ) ),
-                                                       bDefaultVal );
+        m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 10 ),
+                                                             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintEmptyPages:CheckBox" ) ),
+                                                             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintEmptyPages" ) ),
+                                                             bDefaultVal );
     }
 
     // create a bool option for paper tray
     bDefaultVal = rDefaultPrintData.IsPaperFromSetup();
     vcl::PrinterOptionsHelper::UIControlOptions aPaperTrayOpt;
     aPaperTrayOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OptionsPageOptGroup" ) );
-    m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 18 ),
-                                                   aLocalizedStrings.GetString( 19 ),
-                                                   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPaperFromSetup" ) ),
-                                                   bDefaultVal,
-                                                   aPaperTrayOpt
-                                                   );
+    m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 11 ),
+                                                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox" ) ),
+                                                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPaperFromSetup" ) ),
+                                                         bDefaultVal,
+                                                         aPaperTrayOpt
+                                                         );
 
     // print range selection
     vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
     aPrintRangeOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) );
     aPrintRangeOpt.mbInternalOnly = sal_True;
-    m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 37 ) ),
+    m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 26 ) ),
                                                            rtl::OUString(),
                                                            aPrintRangeOpt
                                                            );
@@ -327,18 +327,18 @@ SwPrintUIOptions::SwPrintUIOptions(
     rtl::OUString aPrintRangeName( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) );
     uno::Sequence< rtl::OUString > aChoices( 3 );
     uno::Sequence< sal_Bool > aChoicesDisabled( 3 );
-    uno::Sequence< rtl::OUString > aHelpText( 3 );
-    aChoices[0] = aLocalizedStrings.GetString( 38 );
+    uno::Sequence< rtl::OUString > aHelpIds( 3 );
+    aChoices[0] = aLocalizedStrings.GetString( 27 );
     aChoicesDisabled[0] = sal_False;
-    aHelpText[0] = aLocalizedStrings.GetString( 39 );
-    aChoices[1] = aLocalizedStrings.GetString( 40 );
+    aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) );
+    aChoices[1] = aLocalizedStrings.GetString( 28 );
     aChoicesDisabled[1] = sal_False;
-    aHelpText[1] = aLocalizedStrings.GetString( 41 );
-    aChoices[2] = aLocalizedStrings.GetString( 42 );
+    aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) );
+    aChoices[2] = aLocalizedStrings.GetString( 29 );
     aChoicesDisabled[2] = sal_Bool(! bHasSelection);
-    aHelpText[2] = aLocalizedStrings.GetString( 43 );
+    aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ) );
     m_aUIProperties[nIdx++].Value = getChoiceControlOpt( rtl::OUString(),
-                                                         aHelpText,
+                                                         aHelpIds,
                                                          aPrintRangeName,
                                                          aChoices,
                                                          bHasSelection ? 2 /*enable 'Selection' radio button*/ : 0 /* enable 'All pages' */,
@@ -348,7 +348,7 @@ SwPrintUIOptions::SwPrintUIOptions(
     // create a an Edit dependent on "Pages" selected
     vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True );
     m_aUIProperties[nIdx++].Value = getEditControlOpt( rtl::OUString(),
-                                                       rtl::OUString(),
+                                                       rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageRange:Edit" ) ),
                                                        rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ),
                                                        rtl::OUString(),
                                                        aPageRangeOpt
@@ -356,31 +356,31 @@ SwPrintUIOptions::SwPrintUIOptions(
     // print content selection
     vcl::PrinterOptionsHelper::UIControlOptions aContentsOpt;
     aContentsOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobPage" ) );
-    m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 20 ) ),
+    m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 12 ) ),
                                                            rtl::OUString(),
                                                            aContentsOpt
                                                            );
     // create a list box for notes content
     const sal_Int16 nPrintPostIts = rDefaultPrintData.GetPrintPostIts();
     aChoices.realloc( 4 );
-    aChoices[0] = aLocalizedStrings.GetString( 21 );
-    aChoices[1] = aLocalizedStrings.GetString( 22 );
-    aChoices[2] = aLocalizedStrings.GetString( 23 );
-    aChoices[3] = aLocalizedStrings.GetString( 24 );
-    aHelpText.realloc( 2 );
-    aHelpText[0] = aLocalizedStrings.GetString( 25 );
-    aHelpText[1] = aLocalizedStrings.GetString( 25 );
+    aChoices[0] = aLocalizedStrings.GetString( 13 );
+    aChoices[1] = aLocalizedStrings.GetString( 14 );
+    aChoices[2] = aLocalizedStrings.GetString( 15 );
+    aChoices[3] = aLocalizedStrings.GetString( 16 );
+    aHelpIds.realloc( 2 );
+    aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintAnnotationMode:FixedText" ) );
+    aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintAnnotationMode:ListBox" ) );
     vcl::PrinterOptionsHelper::UIControlOptions aAnnotOpt( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) ), 0, sal_False );
     aAnnotOpt.mbEnabled = bHasPostIts;
-    m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 26 ),
-                                                    aHelpText,
-                                                    rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintAnnotationMode" ) ),
-                                                    aChoices,
-                                                    nPrintPostIts,
-                                                    rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ),
-                                                    uno::Sequence< sal_Bool >(),
-                                                    aAnnotOpt
-                                                    );
+    m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 17 ),
+                                                           aHelpIds,
+                                                           rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintAnnotationMode" ) ),
+                                                           aChoices,
+                                                           nPrintPostIts,
+                                                           rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ),
+                                                           uno::Sequence< sal_Bool >(),
+                                                           aAnnotOpt
+                                                           );
 
     // create subsection for Page settings
     vcl::PrinterOptionsHelper::UIControlOptions aPageSetOpt;
@@ -388,16 +388,16 @@ SwPrintUIOptions::SwPrintUIOptions(
 
     if (!bWeb)
     {
-        m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 27 ) ),
+        m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 18 ) ),
                                                                rtl::OUString(),
                                                                aPageSetOpt
                                                                );
         uno::Sequence< rtl::OUString > aRLChoices( 3 );
-        aRLChoices[0] = aLocalizedStrings.GetString( 28 );
-        aRLChoices[1] = aLocalizedStrings.GetString( 29 );
-        aRLChoices[2] = aLocalizedStrings.GetString( 30 );
+        aRLChoices[0] = aLocalizedStrings.GetString( 19 );
+        aRLChoices[1] = aLocalizedStrings.GetString( 20 );
+        aRLChoices[2] = aLocalizedStrings.GetString( 21 );
         uno::Sequence< rtl::OUString > aRLHelp( 1 );
-        aRLHelp[0] = aLocalizedStrings.GetString( 31 );
+        aRLHelp[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintLeftRightPages:ListBox" ) );
         // create a choice option for all/left/right pages
         // 0 : all pages (left & right)
         // 1 : left pages
@@ -409,7 +409,7 @@ SwPrintUIOptions::SwPrintUIOptions(
             nPagesChoice = 1;
         else if (!rDefaultPrintData.IsPrintLeftPage() && rDefaultPrintData.IsPrintRightPage())
             nPagesChoice = 2;
-        m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 32 ),
+        m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 22 ),
                                                    aRLHelp,
                                                    rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintLeftRightPages" ) ),
                                                    aRLChoices,
@@ -421,27 +421,29 @@ SwPrintUIOptions::SwPrintUIOptions(
     // create a bool option for brochure
     bDefaultVal = rDefaultPrintData.IsPrintProspect();
     rtl::OUString aBrochurePropertyName( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) );
-    m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 33 ),
-                                                   aLocalizedStrings.GetString( 34 ),
-                                                   aBrochurePropertyName,
-                                                   bDefaultVal,
-                                                   aPageSetOpt
-                                                   );
+    m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 23 ),
+                                                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintProspect:CheckBox" ) ),
+                                                         aBrochurePropertyName,
+                                                         bDefaultVal,
+                                                         aPageSetOpt
+                                                         );
 
     if (bCTL)
     {
         // create a bool option for brochure RTL dependent on brochure
         uno::Sequence< rtl::OUString > aBRTLChoices( 2 );
-        aBRTLChoices[0] = aLocalizedStrings.GetString( 35 );
-        aBRTLChoices[1] = aLocalizedStrings.GetString( 36 );
+        aBRTLChoices[0] = aLocalizedStrings.GetString( 24 );
+        aBRTLChoices[1] = aLocalizedStrings.GetString( 25 );
         vcl::PrinterOptionsHelper::UIControlOptions aBrochureRTLOpt( aBrochurePropertyName, -1, sal_True );
+        uno::Sequence< rtl::OUString > aBRTLHelpIds( 1 );
+        aBRTLHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintProspectRTL:ListBox" ) );
         aBrochureRTLOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutPage" ) );
         // RTL brochure choices
         //      0 : left-to-right
         //      1 : right-to-left
         const sal_Int16 nBRTLChoice = rDefaultPrintData.IsPrintProspectRTL() ? 1 : 0;
         m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( rtl::OUString(),
-                                                               uno::Sequence< rtl::OUString >(),
+                                                               aBRTLHelpIds,
                                                                rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspectRTL" ) ),
                                                                aBRTLChoices,
                                                                nBRTLChoice,
diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src
index b54cd0d16b4e..1dd3bf56e17f 100644
--- a/sw/source/ui/config/optdlg.src
+++ b/sw/source/ui/config/optdlg.src
@@ -1023,7 +1023,6 @@ TabPage TP_OPTSHDWCRSR
     };
 };
 
-
 StringArray STR_PRINTOPTUI
 {
     ItemList [en-US] =
@@ -1031,47 +1030,33 @@ StringArray STR_PRINTOPTUI
         < "%PRODUCTNAME %s"; >;
         < "Contents"; >;
         < "Page ba~ckground"; >;
-        < "Specifies whether to include colors and objects that are inserted to the background of the page (Format - Page - Background) in the printed document."; >;
         < "P~ictures and other graphic objects"; >;
-        < "Specifies whether the graphics and drawing or OLE objects of your text document are printed"; >;
         < "Hidden te~xt"; >;
-        < "Enable this option to print text that is marked as hidden."; >;
         < "~Text placeholders"; >;
-        < "Enable this option to print text placeholders. Disable this option to leave the text placeholders blank in the printout."; >;
         < "Form control~s"; >;
-        < "Specifies whether the form control fields of the text document are printed"; >;
         < "Color"; >;
         < "Print text in blac~k"; >;
-        < "Specifies whether to always print text in black."; >;
         < "Pages"; >;
         < "Print ~automatically inserted blank pages"; >;
-        < "If this option is enabled automatically inserted blank pages are printed. This is best if you are printing double-sided. For example, in a book, a \"chapter\" paragraph style has been set to always start with an odd numbered page. If the previous chapter ends on an odd page, %PRODUCTNAME inserts an even numbered blank page. This option controls whether to print that even numbered page or not"; >;
         < "~Use only paper tray from printer preferences"; >;
-        < "For printers with multiple trays this option specifies whether the paper tray used is specified by the system settings of the printer."; >;
         < "Print"; >;
         < "None (document only)"; >;
         < "Comments only"; >;
         < "Place at end of document"; >;
         < "Place at end of page"; >;
-        < "Specify where to print comments (if any)."; >;
         < "~Comments"; >;
         < "Page sides";>;
         < "All pages"; >;
         < "Back sides / left pages"; >;
         < "Front sides / right pages"; >;
-        < "Specify which pages to include in the output"; >;
         < "Include"; >;
         < "Broch~ure"; >;
-        < "Select the Brochure option to print the document in brochure format."; >;
         < "Left-to-right script"; >;
         < "Right-to-left script"; >;
         < "Range and copies"; >;
         < "~All pages"; >;
-        < "Print the whole document."; >;
         < "Pa~ges"; >;
-        < "Print a range of pages of the document."; >;
         < "~Selection"; >;
-        < "Print only the selected parts of the document"; >;
     };
 };
 
-- 
cgit 


From e5cc306522942293b823e331a7544b568afba91f Mon Sep 17 00:00:00 2001
From: "Philipp Lohmann [pl]" 
Date: Tue, 2 Nov 2010 17:03:34 +0100
Subject: vcl117: #i115056# change direct help texts to help ids to allow for
 proper help content

---
 sd/source/ui/view/DocumentRenderer.cxx | 48 ++++++++++++-----
 sd/source/ui/view/DocumentRenderer.hrc | 15 ------
 sd/source/ui/view/DocumentRenderer.src | 94 ----------------------------------
 3 files changed, 34 insertions(+), 123 deletions(-)
 mode change 100644 => 100755 sd/source/ui/view/DocumentRenderer.hrc

diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index ddbf5cfc4388..5b47bd699054 100755
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -439,6 +439,7 @@ namespace {
                                 rtl::OUString()
                                 ) );
 
+            uno::Sequence< rtl::OUString > aHelpIds;
             if( mbImpress )
             {
                 vcl::PrinterOptionsHelper::UIControlOptions aPrintOpt;
@@ -449,9 +450,11 @@ namespace {
                                     aPrintOpt )
                                     );
 
+                aHelpIds.realloc( 1 );
+                aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageContentType:ListBox" ) );
                 AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
                                     String( SdResId( _STR_IMPRESS_PRINT_UI_CONTENT ) ),
-                                    CreateChoice(_STR_IMPRESS_PRINT_UI_CONTENT_HELP),
+                                    aHelpIds,
                                     OUString( RTL_CONSTASCII_USTRINGPARAM( "PageContentType" ) ),
                                     CreateChoice(_STR_IMPRESS_PRINT_UI_CONTENT_CHOICES),
                                     0,
@@ -459,11 +462,12 @@ namespace {
                                     )
                                 );
 
+                aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:SlidesPerPage:ListBox" ) );
                 vcl::PrinterOptionsHelper::UIControlOptions
                     aContentOpt( OUString( RTL_CONSTASCII_USTRINGPARAM( "PageContentType" ) ), 1 );
                 AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
                                     String( SdResId( _STR_IMPRESS_PRINT_UI_SLIDESPERPAGE ) ),
-                                    CreateChoice(_STR_IMPRESS_PRINT_UI_SLIDESPERPAGE_CHOICES_HELP),
+                                    aHelpIds,
                                     OUString( RTL_CONSTASCII_USTRINGPARAM( "SlidesPerPage" ) ),
                                     GetSlidesPerPageSequence(),
                                     0,
@@ -473,11 +477,12 @@ namespace {
                                     )
                                 );
 
+                aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:SlidesPerPageOrder:ListBox" ) );
                 vcl::PrinterOptionsHelper::UIControlOptions
                     aSlidesPerPageOpt( OUString( RTL_CONSTASCII_USTRINGPARAM( "SlidesPerPage" ) ), -1, sal_True );
                 AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
                                     String( SdResId( _STR_IMPRESS_PRINT_UI_ORDER ) ),
-                                    CreateChoice(_STR_IMPRESS_PRINT_UI_ORDER_CHOICES_HELP),
+                                    aHelpIds,
                                     OUString( RTL_CONSTASCII_USTRINGPARAM( "SlidesPerPageOrder" ) ),
                                     CreateChoice(_STR_IMPRESS_PRINT_UI_ORDER_CHOICES),
                                     0,
@@ -495,7 +500,7 @@ namespace {
             {
                 AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
                                     String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_NAME) ),
-                                    String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_NAME_HELP) ),
+                                    OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsPrintName:CheckBox" ) ),
                                     OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrintName" ) ),
                                     sal_False
                                     )
@@ -505,7 +510,7 @@ namespace {
             {
                 AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
                                     String( SdResId(_STR_DRAW_PRINT_UI_IS_PRINT_NAME) ),
-                                    String( SdResId(_STR_DRAW_PRINT_UI_IS_PRINT_NAME_HELP) ),
+                                    OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsPrintName:CheckBox" ) ),
                                     OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrintName" ) ),
                                     sal_False
                                     )
@@ -514,7 +519,7 @@ namespace {
 
             AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
                                 String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_DATE) ),
-                                String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_DATE_HELP) ),
+                                OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsPrintDateTime:CheckBox" ) ),
                                 OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrintDateTime" ) ),
                                 sal_False
                                 )
@@ -524,7 +529,7 @@ namespace {
             {
                 AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
                                     String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN) ),
-                                    String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN_HELP) ),
+                                    OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsPrintHidden:CheckBox" ) ),
                                     OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrintHidden" ) ),
                                     sal_False
                                     )
@@ -534,9 +539,13 @@ namespace {
             AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt(
                                String( SdResId(_STR_IMPRESS_PRINT_UI_QUALITY) ), rtl::OUString() ) );
 
+            aHelpIds.realloc( 3 );
+            aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:Quality:RadioButton:0" ) );
+            aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:Quality:RadioButton:1" ) );
+            aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:Quality:RadioButton:2" ) );
             AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
                                 rtl::OUString(),
-                                CreateChoice(_STR_IMPRESS_PRINT_UI_QUALITY_CHOICES_HELP),
+                                aHelpIds,
                                 OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ),
                                 CreateChoice(_STR_IMPRESS_PRINT_UI_QUALITY_CHOICES),
                                 0
@@ -546,6 +555,11 @@ namespace {
             AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt(
                                String( SdResId(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS) ), rtl::OUString() ) );
 
+            aHelpIds.realloc( 4 );
+            aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:0" ) );
+            aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:1" ) );
+            aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:2" ) );
+            aHelpIds[3] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:3" ) );
             if( mbImpress )
             {
                 // FIXME: additional dependency on PrintProspect = false
@@ -553,7 +567,7 @@ namespace {
                     aPageOptionsOpt( OUString( RTL_CONSTASCII_USTRINGPARAM( "PageContentType" ) ), 0 );
                 AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
                                     rtl::OUString(),
-                                    CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_HELP),
+                                    aHelpIds,
                                     OUString( RTL_CONSTASCII_USTRINGPARAM( "PageOptions" ) ),
                                     CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES),
                                     0,
@@ -569,7 +583,7 @@ namespace {
                     aPageOptionsOpt( OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) ), sal_False );
                 AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
                                     rtl::OUString(),
-                                    CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_HELP),
+                                    aHelpIds,
                                     OUString( RTL_CONSTASCII_USTRINGPARAM( "PageOptions" ) ),
                                     CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_DRAW),
                                     0,
@@ -589,7 +603,7 @@ namespace {
             // brochure printing
             AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
                                 String( SdResId(_STR_IMPRESS_PRINT_UI_BROCHURE) ),
-                                String( SdResId(_STR_IMPRESS_PRINT_UI_BROCHURE_HELP) ),
+                                rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintProspect:CheckBox" ) ),
                                 OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) ),
                                 sal_False,
                                 aBrochureOpt
@@ -599,9 +613,11 @@ namespace {
             vcl::PrinterOptionsHelper::UIControlOptions
                 aIncludeOpt( OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) ), -1, sal_False );
             aIncludeOpt.maGroupHint = OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutPage" ) );
+            aHelpIds.realloc( 1 );
+            aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintProspectInclude:ListBox" ) );
             AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
                                 String( SdResId(_STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE) ),
-                                CreateChoice(_STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST_HELP),
+                                aHelpIds,
                                 OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspectInclude" ) ),
                                 CreateChoice(_STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST),
                                 0,
@@ -616,7 +632,7 @@ namespace {
             aPaperTrayOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OptionsPageOptGroup" ) );
             AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
                                 String( SdResId(_STR_IMPRESS_PRINT_UI_PAPER_TRAY) ),
-                                String( SdResId(_STR_IMPRESS_PRINT_UI_PAPER_TRAY_HELP) ),
+                                rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox" ) ),
                                 OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPaperFromSetup" ) ),
                                 sal_False,
                                 aPaperTrayOpt
@@ -634,8 +650,12 @@ namespace {
 
             // create a choice for the content to create
             rtl::OUString aPrintRangeName( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) );
+            aHelpIds.realloc( 3 );
+            aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) );
+            aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) );
+            aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ) );
             AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( rtl::OUString(),
-                                CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE_HELP),
+                                aHelpIds,
                                 aPrintRangeName,
                                 CreateChoice(mbImpress
                                              ? _STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE
diff --git a/sd/source/ui/view/DocumentRenderer.hrc b/sd/source/ui/view/DocumentRenderer.hrc
old mode 100644
new mode 100755
index 3dd57429dd13..aad07d909def
--- a/sd/source/ui/view/DocumentRenderer.hrc
+++ b/sd/source/ui/view/DocumentRenderer.hrc
@@ -30,48 +30,33 @@
 #define _STR_IMPRESS_PRINT_UI_PRINT_CONTENT               2
 #define _STR_IMPRESS_PRINT_UI_PRINT_GROUP                 3
 #define _STR_IMPRESS_PRINT_UI_CONTENT                     4
-#define _STR_IMPRESS_PRINT_UI_CONTENT_HELP                5
 #define _STR_IMPRESS_PRINT_UI_CONTENT_CHOICES             6
 #define _STR_IMPRESS_PRINT_UI_SLIDESPERPAGE               7
 #define _STR_IMPRESS_PRINT_UI_SLIDESPERPAGE_CHOICES       8
-#define _STR_IMPRESS_PRINT_UI_SLIDESPERPAGE_CHOICES_HELP  9
 #define _STR_IMPRESS_PRINT_UI_ORDER                      10
 #define _STR_IMPRESS_PRINT_UI_ORDER_CHOICES              11
-#define _STR_IMPRESS_PRINT_UI_ORDER_CHOICES_HELP         12
 #define _STR_IMPRESS_PRINT_UI_INCLUDE_CONTENT            13
 #define _STR_IMPRESS_PRINT_UI_IS_PRINT_NAME              14
-#define _STR_IMPRESS_PRINT_UI_IS_PRINT_NAME_HELP         15
 #define _STR_IMPRESS_PRINT_UI_IS_PRINT_DATE              16
-#define _STR_IMPRESS_PRINT_UI_IS_PRINT_DATE_HELP         17
 #define _STR_IMPRESS_PRINT_UI_IS_PRINT_TIME              18
-#define _STR_IMPRESS_PRINT_UI_IS_PRINT_TIME_HELP         19
 #define _STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN            20
-#define _STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN_HELP       21
 
 #define _STR_IMPRESS_PRINT_UI_OUTPUT_OPTIONS_GROUP       22
 #define _STR_IMPRESS_PRINT_UI_QUALITY                    23
 #define _STR_IMPRESS_PRINT_UI_QUALITY_CHOICES            24
-#define _STR_IMPRESS_PRINT_UI_QUALITY_CHOICES_HELP       25
 #define _STR_IMPRESS_PRINT_UI_PAGE_OPTIONS               26
 #define _STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES       27
 #define _STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_DRAW  28
-#define _STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_HELP  29
 #define _STR_IMPRESS_PRINT_UI_BROCHURE                   30
-#define _STR_IMPRESS_PRINT_UI_BROCHURE_HELP              31
 #define _STR_IMPRESS_PRINT_UI_PAGE_SIDES                 32
 #define _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE           33
-#define _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_HELP      34
 #define _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST      35
-#define _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST_HELP 36
 #define _STR_IMPRESS_PRINT_UI_PAPER_TRAY_GROUP           37
 #define _STR_IMPRESS_PRINT_UI_PAPER_TRAY                 38
-#define _STR_IMPRESS_PRINT_UI_PAPER_TRAY_HELP            39
 
 #define _STR_IMPRESS_PRINT_UI_PAGE_RANGE                 40
 #define _STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE          41
-#define _STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE_HELP     42
 #define _STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE             43
 
 #define _STR_DRAW_PRINT_UI_IS_PRINT_NAME                 44
-#define _STR_DRAW_PRINT_UI_IS_PRINT_NAME_HELP            45
 
diff --git a/sd/source/ui/view/DocumentRenderer.src b/sd/source/ui/view/DocumentRenderer.src
index abd82ea0d397..df4e2a30de02 100755
--- a/sd/source/ui/view/DocumentRenderer.src
+++ b/sd/source/ui/view/DocumentRenderer.src
@@ -46,14 +46,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
     {
         Text [ en-US ] = "Document";
     };
-    StringArray _STR_IMPRESS_PRINT_UI_CONTENT_HELP
-    {
-        ItemList [ en-US ] =
-        {
-           < "Select which parts of the document should be printed"; >;
-           < "Select which parts of the document should be printed"; >;
-        };
-    };
     StringArray _STR_IMPRESS_PRINT_UI_CONTENT_CHOICES
     {
         ItemList [ en-US ] =
@@ -81,14 +73,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
             < "9" ; > ;
         };
     };
-    StringArray _STR_IMPRESS_PRINT_UI_SLIDESPERPAGE_CHOICES_HELP
-    {
-        ItemList [ en-US ] =
-        {
-            < "Select how many slides to print per page." ; >;
-            < "Select how many slides to print per page." ; >;
-        };
-    };
     String _STR_IMPRESS_PRINT_UI_ORDER
     {
         Text [ en-US ] = "Order" ;
@@ -101,15 +85,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
             < "Top to bottom, then right" ; > ;
         };
     };
-    StringArray _STR_IMPRESS_PRINT_UI_ORDER_CHOICES_HELP
-    {
-        ItemList [ en-US ] =
-        {
-            < "Specify how to arrange slides on the printed page." ; > ;
-            < "Arrange slides horizontally" ; > ;
-            < "Arrange slides vertically" ; > ;
-        };
-    };
     String _STR_IMPRESS_PRINT_UI_INCLUDE_CONTENT
     {
         Text [ en-US ] = "~Contents";
@@ -118,35 +93,18 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
     {
         Text [ en-US ] = "~Slide name";
     };
-    String _STR_IMPRESS_PRINT_UI_IS_PRINT_NAME_HELP
-    {
-        Text [ en-US ] = "Specifies whether to print the page name of a document.";
-    };
     String _STR_DRAW_PRINT_UI_IS_PRINT_NAME
     {
         Text [ en-US ] = "P~age name";
     };
-    String _STR_DRAW_PRINT_UI_IS_PRINT_NAME_HELP
-    {
-        Text [ en-US ] = "Specifies whether to print the page name of a document.";
-    };
     String _STR_IMPRESS_PRINT_UI_IS_PRINT_DATE
     {
         Text [ en-US ] = "~Date and time";
     };
-    String _STR_IMPRESS_PRINT_UI_IS_PRINT_DATE_HELP
-    {
-        Text [ en-US ] = "Specifies whether to print the current date and time.";
-    };
     String _STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN
     {
         Text [ en-US ] = "Hidden pages";
     };
-    String _STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN_HELP
-    {
-        Text [ en-US ] = "Specifies whether to print the pages that are currently hidden from the application.";
-    };
-
     String _STR_IMPRESS_PRINT_UI_OUTPUT_OPTIONS_GROUP
     {
         Text [ en-US ] = "Output options";
@@ -164,17 +122,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
             < "Black & white" ; > ;
         };
     };
-    StringArray _STR_IMPRESS_PRINT_UI_QUALITY_CHOICES_HELP
-    {
-        ItemList [ en-US ] =
-        {
-            < "Specify how to treat colors in the printout."; >;
-            < "Specifies that you want to print in original colors." ; > ;
-            < "Specifies that you want to print colors as grayscale." ; > ;
-            < "Specifies that you want to print in black and white." ; > ;
-        };
-    };
-
     String _STR_IMPRESS_PRINT_UI_PAGE_OPTIONS
     {
         Text [ en-US ] = "~Size";
@@ -199,24 +146,10 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
             < "Tile sheet of paper with repeated pages" ; > ;
         };
     };
-    StringArray _STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_HELP
-    {
-        ItemList [ en-US ] =
-        {
-            < "Specify how to scale slides in the printout."; >;
-            < "Specifies that you do not want to further scale pages when printing." ; > ;
-            < "Specifies whether to scale down objects that are beyond the margins of the current printer so they fit on the paper in the printer." ; > ;
-            < "Specifies that pages are to be printed in tiled format. If the pages or slides are smaller than the paper, several pages or slides will be printed on one page of paper." ; > ;
-        };
-    };
     String _STR_IMPRESS_PRINT_UI_BROCHURE
     {
         Text [en-US] = "Brochure";
     };
-    String _STR_IMPRESS_PRINT_UI_BROCHURE_HELP
-    {
-        Text [en-US] = "Select the \"Brochure\" option to print the document in brochure format.";
-    };
     String _STR_IMPRESS_PRINT_UI_PAGE_SIDES
     {
         Text [ en-US ] = "Page sides";
@@ -225,10 +158,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
     {
         Text [ en-US ] = "Include";
     };
-    String _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_HELP
-    {
-        Text [ en-US ] = "Select which pages of a brochure to print.";
-    };
     StringArray _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST
     {
         ItemList [ en-US ] =
@@ -238,15 +167,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
             < "Back sides / left pages" ; > ;
         };
     };
-    StringArray _STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST_HELP
-    {
-        ItemList [ en-US ] =
-        {
-            < "Print all pages of a brochure." ; > ;
-            < "Print only front pages of a brochure." ; > ;
-            < "Print only back pages of a brochure." ; > ;
-        };
-    };
 
     String _STR_IMPRESS_PRINT_UI_PAPER_TRAY_GROUP
     {
@@ -256,10 +176,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
     {
         Text [ en-US ] = "~Use only paper tray from printer preferences";
     };
-    String _STR_IMPRESS_PRINT_UI_PAPER_TRAY_HELP
-    {
-        Text [ en-US ] = "Determines that the paper tray to be used is the one defined in the printer setup.";
-    };
     String _STR_IMPRESS_PRINT_UI_PAGE_RANGE
     {
         Text [en-US] = "Print range";
@@ -274,16 +190,6 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS
         };
     };
 
-    StringArray _STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE_HELP
-    {
-        ItemList [ en-US ] =
-        {
-            < "Print the whole document."; >;
-            < "Print a specified range of the document."; >;
-            < "Print only the currently selected content."; >;
-        };
-    };
-
     StringArray _STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE
     {
         ItemList [ en-US ] =
-- 
cgit 


From b691b5bcc42418714f56b2af3bcb2fa085ee9975 Mon Sep 17 00:00:00 2001
From: "Philipp Lohmann [pl]" 
Date: Tue, 2 Nov 2010 17:03:34 +0100
Subject: vcl117: #i115056# change direct help texts to help ids to allow for
 proper help content

---
 basctl/source/basicide/basicprint.src      |  2 --
 basctl/source/basicide/basicrenderable.cxx | 14 +++++++-------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/basctl/source/basicide/basicprint.src b/basctl/source/basicide/basicprint.src
index 1f301d3461a9..06bb6b057150 100644
--- a/basctl/source/basicide/basicprint.src
+++ b/basctl/source/basicide/basicprint.src
@@ -33,8 +33,6 @@ StringArray RID_PRINTDLG_STRLIST
     {
         < "Print range"; >;
         < "All ~Pages"; >;
-        < "Print all pages of the printable content."; >;
         < "Pa~ges"; >;
-        < "Print only some pages of the printable content."; >;
     };
 };
diff --git a/basctl/source/basicide/basicrenderable.cxx b/basctl/source/basicide/basicrenderable.cxx
index e2042d49876c..1f8fe51c21dd 100644
--- a/basctl/source/basicide/basicrenderable.cxx
+++ b/basctl/source/basicide/basicrenderable.cxx
@@ -45,8 +45,8 @@ BasicRenderable::BasicRenderable( IDEBaseWindow* pWin )
 , mpWindow( pWin )
 {
     ResStringArray aStrings( IDEResId( RID_PRINTDLG_STRLIST )  );
-    DBG_ASSERT( aStrings.Count() >= 5, "resource incomplete" );
-    if( aStrings.Count() < 5 ) // bad resource ?
+    DBG_ASSERT( aStrings.Count() >= 3, "resource incomplete" );
+    if( aStrings.Count() < 3 ) // bad resource ?
         return;
 
     m_aUIProperties.realloc( 3 );
@@ -63,13 +63,13 @@ BasicRenderable::BasicRenderable( IDEBaseWindow* pWin )
     // create a choice for the range to print
     rtl::OUString aPrintContentName( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) );
     Sequence< rtl::OUString > aChoices( 2 );
-    Sequence< rtl::OUString > aHelpTexts( 2 );
+    Sequence< rtl::OUString > aHelpIds( 2 );
     aChoices[0] = aStrings.GetString( 1 );
-    aHelpTexts[0] = aStrings.GetString( 2 );
-    aChoices[1] = aStrings.GetString( 3 );
-    aHelpTexts[1] = aStrings.GetString( 4 );
+    aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) );
+    aChoices[1] = aStrings.GetString( 2 );
+    aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) );
     m_aUIProperties[1].Value = getChoiceControlOpt( rtl::OUString(),
-                                                    aHelpTexts,
+                                                    aHelpIds,
                                                     aPrintContentName,
                                                     aChoices,
                                                     0 );
-- 
cgit 


From f8adcdcdfe9a66d1d52c904b2e32cb6bc48509a2 Mon Sep 17 00:00:00 2001
From: "Daniel Rentz [dr]" 
Date: Wed, 3 Nov 2010 09:55:23 +0100
Subject: dr77: #i102872# little cleanup of IDL documentation related to sheet
 filters

---
 .../com/sun/star/sheet/SheetFilterDescriptor.idl   | 25 ++++++++++++----------
 offapi/com/sun/star/sheet/TableFilterField.idl     | 11 +++-------
 offapi/com/sun/star/sheet/TableFilterField2.idl    | 12 +++--------
 offapi/com/sun/star/sheet/XDatabaseRange.idl       | 12 +++++++----
 .../com/sun/star/sheet/XSheetFilterDescriptor.idl  | 14 ++++--------
 .../com/sun/star/sheet/XSheetFilterDescriptor2.idl | 12 +++--------
 6 files changed, 35 insertions(+), 51 deletions(-)

diff --git a/offapi/com/sun/star/sheet/SheetFilterDescriptor.idl b/offapi/com/sun/star/sheet/SheetFilterDescriptor.idl
index 8e94a6b2edcf..e8e12639a244 100644
--- a/offapi/com/sun/star/sheet/SheetFilterDescriptor.idl
+++ b/offapi/com/sun/star/sheet/SheetFilterDescriptor.idl
@@ -28,21 +28,11 @@
 #ifndef __com_sun_star_sheet_SheetFilterDescriptor_idl__
 #define __com_sun_star_sheet_SheetFilterDescriptor_idl__
 
-#ifndef __com_sun_star_sheet_XSheetFilterDescriptor_idl__
 #include 
-#endif
-
-#ifndef __com_sun_star_beans_XPropertySet_idl__
+#include 
 #include 
-#endif
-
-#ifndef __com_sun_star_table_TableOrientation_idl__
 #include 
-#endif
-
-#ifndef __com_sun_star_table_CellAddress_idl__
 #include 
-#endif
 
 //=============================================================================
 
@@ -66,6 +56,19 @@ published service SheetFilterDescriptor
 
     //-------------------------------------------------------------------------
 
+    /** provides access to the collection of filter fields.
+
+        

This interface provides a sequence of TableFilterField2 + structures supporting a wider range of comparison operators, compared + to the TableFilterField structure provided by interface + XSheetFilterDescriptor. + + @since OOo 3.2 + */ + [optional] interface com::sun::star::sheet::XSheetFilterDescriptor2; + + //------------------------------------------------------------------------- + //!published service PropertySet /** provides access to the properties. */ diff --git a/offapi/com/sun/star/sheet/TableFilterField.idl b/offapi/com/sun/star/sheet/TableFilterField.idl index 6000a1c0247e..69d9a5bcc6ee 100644 --- a/offapi/com/sun/star/sheet/TableFilterField.idl +++ b/offapi/com/sun/star/sheet/TableFilterField.idl @@ -28,13 +28,8 @@ #ifndef __com_sun_star_sheet_TableFilterField_idl__ #define __com_sun_star_sheet_TableFilterField_idl__ -#ifndef __com_sun_star_sheet_FilterConnection_idl__ #include -#endif - -#ifndef __com_sun_star_sheet_FilterOperator_idl__ #include -#endif //============================================================================= @@ -44,7 +39,7 @@ module com { module sun { module star { module sheet { /** describes a single condition in a filter descriptor. - @see com::sun::star::sheet::SheetFilterDescriptor + @see SheetFilterDescriptor */ published struct TableFilterField { @@ -52,7 +47,7 @@ published struct TableFilterField /** specifies how the condition is connected to the previous condition. */ - com::sun::star::sheet::FilterConnection Connection; + FilterConnection Connection; //------------------------------------------------------------------------- @@ -64,7 +59,7 @@ published struct TableFilterField /** specifies the type of the condition. */ - com::sun::star::sheet::FilterOperator Operator; + FilterOperator Operator; //------------------------------------------------------------------------- diff --git a/offapi/com/sun/star/sheet/TableFilterField2.idl b/offapi/com/sun/star/sheet/TableFilterField2.idl index cfbcfa4d143c..d7383f477bdc 100644 --- a/offapi/com/sun/star/sheet/TableFilterField2.idl +++ b/offapi/com/sun/star/sheet/TableFilterField2.idl @@ -28,14 +28,8 @@ #ifndef __com_sun_star_sheet_TableFilterField2_idl__ #define __com_sun_star_sheet_TableFilterField2_idl__ - -#ifndef __com_sun_star_sheet_FilterConnection_idl__ #include -#endif - -#ifndef __com_sun_star_sheet_FilterOperator2_idl__ #include -#endif //============================================================================= @@ -49,7 +43,7 @@ module com { module sun { module star { module sheet { member, whereas the TableFilterField struct uses the FilterOperator enum.

- @see com::sun::star::sheet::SheetFilterDescriptor + @see SheetFilterDescriptor @since OOo 3.2 */ published struct TableFilterField2 @@ -58,7 +52,7 @@ published struct TableFilterField2 /** specifies how the condition is connected to the previous condition. */ - com::sun::star::sheet::FilterConnection Connection; + FilterConnection Connection; //------------------------------------------------------------------------- @@ -69,7 +63,7 @@ published struct TableFilterField2 //------------------------------------------------------------------------- /** specifies the type of the condition as defined in - FilterOperator2. + FilterOperator2. */ long Operator; diff --git a/offapi/com/sun/star/sheet/XDatabaseRange.idl b/offapi/com/sun/star/sheet/XDatabaseRange.idl index 573578f0c355..9826ab8278e6 100644 --- a/offapi/com/sun/star/sheet/XDatabaseRange.idl +++ b/offapi/com/sun/star/sheet/XDatabaseRange.idl @@ -77,7 +77,7 @@ published interface XDatabaseRange: com::sun::star::uno::XInterface /** returns the sort descriptor stored with the database range. - @see com::sun::star::sheet::SheetSortDescriptor2 + @see SheetSortDescriptor2 */ sequence< com::sun::star::beans::PropertyValue > getSortDescriptor(); @@ -88,8 +88,10 @@ published interface XDatabaseRange: com::sun::star::uno::XInterface

If the filter descriptor is modified, the new filtering is carried out when XDatabaseRange::refresh() is called.

+ + @see SheetFilterDescriptor */ - com::sun::star::sheet::XSheetFilterDescriptor getFilterDescriptor(); + XSheetFilterDescriptor getFilterDescriptor(); //------------------------------------------------------------------------- @@ -98,15 +100,17 @@ published interface XDatabaseRange: com::sun::star::uno::XInterface

If the subtotal descriptor is modified, the new subtotals are inserted when XDatabaseRange::refresh() is called.

+ + @see SubTotalDescriptor */ - com::sun::star::sheet::XSubTotalDescriptor getSubTotalDescriptor(); + XSubTotalDescriptor getSubTotalDescriptor(); //------------------------------------------------------------------------- /** returns the database import descriptor stored with this database range. - @see com::sun::star::sheet::DatabaseImportDescriptor + @see DatabaseImportDescriptor */ sequence< com::sun::star::beans::PropertyValue > getImportDescriptor(); diff --git a/offapi/com/sun/star/sheet/XSheetFilterDescriptor.idl b/offapi/com/sun/star/sheet/XSheetFilterDescriptor.idl index 49f44fd534d8..b3864f373c8a 100644 --- a/offapi/com/sun/star/sheet/XSheetFilterDescriptor.idl +++ b/offapi/com/sun/star/sheet/XSheetFilterDescriptor.idl @@ -28,13 +28,8 @@ #ifndef __com_sun_star_sheet_XSheetFilterDescriptor_idl__ #define __com_sun_star_sheet_XSheetFilterDescriptor_idl__ -#ifndef __com_sun_star_uno_XInterface_idl__ -#include -#endif - -#ifndef __com_sun_star_sheet_TableFilterField_idl__ #include -#endif +#include //============================================================================= @@ -44,7 +39,7 @@ module com { module sun { module star { module sheet { /** provides access to a collection of filter conditions (filter fields). - @see com::sun::star::sheet::SheetFilterDescriptor + @see SheetFilterDescriptor */ published interface XSheetFilterDescriptor: com::sun::star::uno::XInterface { @@ -52,14 +47,13 @@ published interface XSheetFilterDescriptor: com::sun::star::uno::XInterface /** returns the collection of filter fields. */ - sequence< com::sun::star::sheet::TableFilterField > getFilterFields(); + sequence< TableFilterField > getFilterFields(); //------------------------------------------------------------------------- /** sets a new collection of filter fields. */ - void setFilterFields( - [in] sequence< com::sun::star::sheet::TableFilterField > aFilterFields ); + void setFilterFields( [in] sequence< TableFilterField > aFilterFields ); }; diff --git a/offapi/com/sun/star/sheet/XSheetFilterDescriptor2.idl b/offapi/com/sun/star/sheet/XSheetFilterDescriptor2.idl index 8f94ee65fc8e..ba8b7904366e 100644 --- a/offapi/com/sun/star/sheet/XSheetFilterDescriptor2.idl +++ b/offapi/com/sun/star/sheet/XSheetFilterDescriptor2.idl @@ -28,13 +28,8 @@ #ifndef __com_sun_star_sheet_XSheetFilterDescriptor2_idl__ #define __com_sun_star_sheet_XSheetFilterDescriptor2_idl__ -#ifndef __com_sun_star_sheet_TableFilterField2_idl__ #include -#endif - -#ifndef __com_sun_star_uno_XInterface_idl__ #include -#endif //============================================================================= @@ -48,7 +43,7 @@ module com { module sun { module star { module sheet { whereas the XSheetFilterDescriptor interface uses the TableFilterField struct.

- @see com::sun::star::sheet::SheetFilterDescriptor + @see SheetFilterDescriptor @since OOo 3.2 */ published interface XSheetFilterDescriptor2: com::sun::star::uno::XInterface @@ -57,14 +52,13 @@ published interface XSheetFilterDescriptor2: com::sun::star::uno::XInterface /** returns the collection of filter fields. */ - sequence< com::sun::star::sheet::TableFilterField2 > getFilterFields2(); + sequence< TableFilterField2 > getFilterFields2(); //------------------------------------------------------------------------- /** sets a new collection of filter fields. */ - void setFilterFields2( - [in] sequence< com::sun::star::sheet::TableFilterField2 > aFilterFields ); + void setFilterFields2( [in] sequence< TableFilterField2 > aFilterFields ); }; -- cgit From 771b51557acb2f789ee82080ecfdc39c1f8c3a27 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Wed, 3 Nov 2010 10:02:35 +0100 Subject: dr77: #i102872# little cleanup of IDL documentation related to sheet filters --- offapi/com/sun/star/sheet/SheetFilterDescriptor.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/offapi/com/sun/star/sheet/SheetFilterDescriptor.idl b/offapi/com/sun/star/sheet/SheetFilterDescriptor.idl index e8e12639a244..cd4a12abde76 100644 --- a/offapi/com/sun/star/sheet/SheetFilterDescriptor.idl +++ b/offapi/com/sun/star/sheet/SheetFilterDescriptor.idl @@ -52,7 +52,7 @@ published service SheetFilterDescriptor /** provides access to the collection of filter fields. */ - interface com::sun::star::sheet::XSheetFilterDescriptor; + interface XSheetFilterDescriptor; //------------------------------------------------------------------------- @@ -65,7 +65,7 @@ published service SheetFilterDescriptor @since OOo 3.2 */ - [optional] interface com::sun::star::sheet::XSheetFilterDescriptor2; + [optional] interface XSheetFilterDescriptor2; //------------------------------------------------------------------------- -- cgit From c7bb1a78a3db5a521d9ff225eb134377b1e9f5b2 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Wed, 3 Nov 2010 12:37:26 +0100 Subject: dr77: #i113491# repaint in ScStyleSheet::SetParent --- sc/inc/document.hxx | 2 ++ sc/inc/docuno.hxx | 2 ++ sc/source/core/data/conditio.cxx | 2 +- sc/source/core/data/documen3.cxx | 3 +-- sc/source/core/data/documen8.cxx | 11 +++++++++++ sc/source/core/data/stlsheet.cxx | 7 +++++++ sc/source/core/data/table1.cxx | 6 +----- sc/source/ui/inc/viewfunc.hxx | 5 +++-- sc/source/ui/unoobj/docuno.cxx | 6 ++++++ sc/source/ui/view/formatsh.cxx | 8 ++++---- sc/source/ui/view/viewfunc.cxx | 4 ++-- 11 files changed, 40 insertions(+), 16 deletions(-) diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 3b01edc59846..5af1561c6b83 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1512,6 +1512,8 @@ public: BOOL ContinueOnlineSpelling(); // TRUE = etwas gefunden + void RepaintRange( const ScRange& rRange ); + BOOL IsIdleDisabled() const { return bIdleDisabled; } void DisableIdle(BOOL bDo) { bIdleDisabled = bDo; } diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 14c9515dfacb..0c69950083cc 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -134,6 +134,8 @@ public: void AfterXMLLoading(sal_Bool bRet); ScSheetSaveData* GetSheetSaveData(); + void RepaintRange( const ScRange& rRange ); + bool HasChangesListeners() const; void NotifyChanges( const ::rtl::OUString& rOperation, const ScRangeList& rRanges, diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index b08838198477..3fff9faf2105 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1432,7 +1432,7 @@ void ScConditionalFormat::DoRepaint( const ScRange* pModified ) } } - pSh->Broadcast( ScPaintHint( aRange, PAINT_GRID ) ); + pDoc->RepaintRange( aRange ); } } } diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 8fea4b8af2b9..7dbdee417165 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -169,8 +169,7 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, BOOL bRemove RemoveFlagsTab( aOldRange.aStart.Col(), aOldRange.aStart.Row(), aOldRange.aEnd.Col(), aOldRange.aEnd.Row(), aOldRange.aStart.Tab(), SC_MF_AUTO ); - if (pShell) - pShell->Broadcast( ScPaintHint( aOldRange, PAINT_GRID ) ); + RepaintRange( aOldRange ); } } } diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index e3c9d251fab7..9eb4bad7466d 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -94,6 +94,7 @@ #include "sc.hrc" #include "charthelper.hxx" #include "dpobject.hxx" +#include "docuno.hxx" #define GET_SCALEVALUE(set,id) ((const SfxUInt16Item&)(set.Get( id ))).GetValue() @@ -902,6 +903,16 @@ void ScDocument::RemoveAutoSpellObj() pTab[nTab]->RemoveAutoSpellObj(); } +void ScDocument::RepaintRange( const ScRange& rRange ) +{ + if ( bIsVisible && pShell ) + { + ScModelObj* pModel = ScModelObj::getImplementation( pShell->GetModel() ); + if ( pModel ) + pModel->RepaintRange( rRange ); // locked repaints are checked there + } +} + //------------------------------------------------------------------------ BOOL ScDocument::IdleCheckLinks() // TRUE = demnaechst wieder versuchen diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx index a3319eafd3fd..bfe3fa04a398 100644 --- a/sc/source/core/data/stlsheet.cxx +++ b/sc/source/core/data/stlsheet.cxx @@ -136,6 +136,13 @@ BOOL __EXPORT ScStyleSheet::SetParent( const String& rParentName ) { SfxItemSet& rParentSet = pStyle->GetItemSet(); GetItemSet().SetParent( &rParentSet ); + + // #i113491# Drag&Drop in the stylist's hierarchical view doesn't execute a slot, + // so the repaint has to come from here (after modifying the ItemSet). + // RepaintRange checks the document's IsVisible flag and locked repaints. + ScDocument* pDoc = static_cast(GetPool()).GetDocument(); + if (pDoc) + pDoc->RepaintRange( ScRange( 0,0,0, MAXCOL,MAXROW,MAXTAB ) ); } } diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index e534bb9dfb78..151478324ef7 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1267,11 +1267,7 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW { UpdatePageBreaks(NULL); - SfxObjectShell* pDocSh = pDocument->GetDocumentShell(); - if (pDocSh) - pDocSh->Broadcast( ScPaintHint( - ScRange(0,0,nTab,MAXCOL,MAXROW,nTab), - PAINT_GRID ) ); + pDocument->RepaintRange( ScRange(0,0,nTab,MAXCOL,MAXROW,nTab) ); } } } diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index 59da2966cc60..60dc1bc7b115 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -53,6 +53,7 @@ class SfxItemSet; class SvxBorderLine; class SvxBoxItem; class SvxBoxInfoItem; +class SfxStyleSheetBase; class SfxStyleSheet; class SfxPoolItem; class EditTextObject; @@ -187,8 +188,8 @@ public: const SfxStyleSheet* GetStyleSheetFromMarked(); void SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet, BOOL bRecord = TRUE ); - void RemoveStyleSheetInUse( SfxStyleSheet* pStyleSheet ); - void UpdateStyleSheetInUse( SfxStyleSheet* pStyleSheet ); + void RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ); + void UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ); void SetNumberFormat( short nFormatType, ULONG nAdd = 0 ); void SetNumFmtByStr( const String& rCode ); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 3d3f0f479601..d08e2cdc4bf5 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -449,6 +449,12 @@ ScSheetSaveData* ScModelObj::GetSheetSaveData() return NULL; } +void ScModelObj::RepaintRange( const ScRange& rRange ) +{ + if (pDocShell) + pDocShell->PostPaint( rRange, PAINT_GRID ); +} + uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException) { diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 12a1bb87211b..3ff7222178f3 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -453,7 +453,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq ) { if ( pStyleSheet ) { - pTabViewShell->RemoveStyleSheetInUse( (SfxStyleSheet*)pStyleSheet ); + pTabViewShell->RemoveStyleSheetInUse( pStyleSheet ); pStylePool->Remove( pStyleSheet ); pTabViewShell->InvalidateAttribs(); nRetMask = TRUE; @@ -556,7 +556,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq ) // Attribute uebernehmen und Style anwenden pStyleSheet->GetItemSet().Put( aAttrSet ); - pTabViewShell->UpdateStyleSheetInUse( (SfxStyleSheet*)pStyleSheet ); + pTabViewShell->UpdateStyleSheetInUse( pStyleSheet ); // call SetStyleSheetToMarked after adding the ScUndoModifyStyle // (pStyleSheet pointer is used!) @@ -578,7 +578,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq ) } pStyleSheet->GetItemSet().Put( aAttrSet ); - pTabViewShell->UpdateStyleSheetInUse( (SfxStyleSheet*)pStyleSheet ); + pTabViewShell->UpdateStyleSheetInUse( pStyleSheet ); // call SetStyleSheetToMarked after adding the ScUndoModifyStyle // (pStyleSheet pointer is used!) @@ -868,7 +868,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq ) (const SvxNumberInfoItem&) *(pDocSh->GetItem(SID_ATTR_NUMBERFORMAT_INFO)) ); - pTabViewShell->UpdateStyleSheetInUse( (SfxStyleSheet*)pStyleSheet ); + pTabViewShell->UpdateStyleSheetInUse( pStyleSheet ); pTabViewShell->InvalidateAttribs(); } diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 231eb4e67562..e0ebb8f3024f 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1545,7 +1545,7 @@ void ScViewFunc::SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet, BOOL bRecord } -void ScViewFunc::RemoveStyleSheetInUse( SfxStyleSheet* pStyleSheet ) +void ScViewFunc::RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ) { if ( !pStyleSheet) return; // ------------------------------------------------------------------- @@ -1572,7 +1572,7 @@ void ScViewFunc::RemoveStyleSheetInUse( SfxStyleSheet* pStyleSheet ) pHdl->ForgetLastPattern(); } -void ScViewFunc::UpdateStyleSheetInUse( SfxStyleSheet* pStyleSheet ) +void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ) { if ( !pStyleSheet) return; // ------------------------------------------------------------------- -- cgit From e8ffa7cfebb3dd1ad41f333901286a13eb450232 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 3 Nov 2010 17:10:14 +0100 Subject: vcl117: #i115304# read printer options from configuration --- vcl/aqua/source/gdi/aquaprintaccessoryview.mm | 3 + vcl/inc/vcl/print.hxx | 6 ++ vcl/inc/vcl/prndlg.hxx | 4 +- vcl/source/gdi/print.cxx | 100 ++++++++++++++++++++++++++ vcl/source/gdi/print3.cxx | 8 +++ vcl/source/window/printdlg.cxx | 31 ++++++-- 6 files changed, 146 insertions(+), 6 deletions(-) diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm index d19290d8320a..93945570dc96 100644 --- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm +++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm @@ -322,6 +322,9 @@ class ControllerProperties GDIMetaFile aMtf; PrinterController::PageSize aPageSize( mpController->getFilteredPageFile( i_nPage, aMtf, false ) ); VirtualDevice aDev; + if( mpController->getPrinter()->GetPrinterOptions().IsConvertToGreyscales() ) + aDev.SetDrawMode( aDev.GetDrawMode() | ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT | + DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) ); // see salprn.cxx, currently we pretend to be a 720dpi device on printers aDev.SetReferenceDevice( 720, 720 ); aDev.EnableOutput( TRUE ); diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index c335e4853702..04f47d16bba8 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -208,6 +208,11 @@ public: BOOL IsConvertToGreyscales() const { return mbConvertToGreyscales; } void SetConvertToGreyscales( BOOL bSet ) { mbConvertToGreyscales = bSet; } + + // read printer options from configuration, parameter decides whether the set for + // print "to printer" or "to file" should be read. + // returns true if config was read, false if an error occured + bool ReadFromConfig( bool bFile ); }; // ----------- @@ -538,6 +543,7 @@ public: SAL_DLLPRIVATE com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getPageParametersProtected( int i_nPage ) const; SAL_DLLPRIVATE ULONG removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut ); + SAL_DLLPRIVATE void resetPrinterOptions( bool i_bFileOutput ); }; class VCL_DLLPUBLIC PrinterOptionsHelper diff --git a/vcl/inc/vcl/prndlg.hxx b/vcl/inc/vcl/prndlg.hxx index fdaf06c9854e..7c6975eafa4f 100644 --- a/vcl/inc/vcl/prndlg.hxx +++ b/vcl/inc/vcl/prndlg.hxx @@ -59,6 +59,7 @@ namespace vcl VirtualDevice maPageVDev; rtl::OUString maReplacementString; rtl::OUString maToolTipString; + bool mbGreyscale; bool useHCColorReplacement() const; public: @@ -71,7 +72,8 @@ namespace vcl virtual void DataChanged( const DataChangedEvent& ); void setPreview( const GDIMetaFile&, const Size&, const rtl::OUString&, - sal_Int32 i_nDPIX, sal_Int32 i_nDPIY + sal_Int32 i_nDPIX, sal_Int32 i_nDPIY, + bool i_bGreyscale ); }; diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 2ea9bfcc4c11..cafaf5cad6eb 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -57,8 +57,14 @@ #include +#include "com/sun/star/beans/XPropertySet.hpp" +#include "com/sun/star/container/XNameAccess.hpp" +#include "com/sun/star/lang/XMultiServiceFactory.hpp" + using namespace com::sun::star::uno; using namespace com::sun::star::lang; +using namespace com::sun::star::beans; +using namespace com::sun::star::container; int nImplSysDialog = 0; @@ -130,6 +136,100 @@ PrinterOptions::~PrinterOptions() { } +#define PROPERTYNAME_REDUCETRANSPARENCY rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceTransparency")) +#define PROPERTYNAME_REDUCEDTRANSPARENCYMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedTransparencyMode")) +#define PROPERTYNAME_REDUCEGRADIENTS rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceGradients")) +#define PROPERTYNAME_REDUCEDGRADIENTMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedGradientMode")) +#define PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedGradientStepCount")) +#define PROPERTYNAME_REDUCEBITMAPS rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceBitmaps")) +#define PROPERTYNAME_REDUCEDBITMAPMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapMode")) +#define PROPERTYNAME_REDUCEDBITMAPRESOLUTION rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapResolution")) +#define PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapIncludesTransparency")) +#define PROPERTYNAME_CONVERTTOGREYSCALES rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ConvertToGreyscales")) + +bool PrinterOptions::ReadFromConfig( bool i_bFile ) +{ + bool bSuccess = false; + // save old state in case something goes wrong + PrinterOptions aOldValues( *this ); + + // get the configuration service + Reference< XMultiServiceFactory > xConfigProvider; + Reference< XNameAccess > xConfigAccess; + try + { + // get service provider + Reference< XMultiServiceFactory > xSMgr( comphelper::getProcessServiceFactory() ); + // create configuration hierachical access name + if( xSMgr.is() ) + { + try + { + xConfigProvider = Reference< XMultiServiceFactory >( + xSMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.ConfigurationProvider" ))), + UNO_QUERY ); + if( xConfigProvider.is() ) + { + Sequence< Any > aArgs(1); + PropertyValue aVal; + aVal.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) ); + if( i_bFile ) + aVal.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Print/Option/File" ) ); + else + aVal.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Print/Option/Printer" ) ); + aArgs.getArray()[0] <<= aVal; + xConfigAccess = Reference< XNameAccess >( + xConfigProvider->createInstanceWithArguments( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" )), aArgs ), + UNO_QUERY ); + if( xConfigAccess.is() ) + { + Reference< XPropertySet > xSet( xConfigAccess, UNO_QUERY ); + if( xSet.is() ) + { + sal_Int32 nValue = 0; + sal_Bool bValue = 0; + if( xSet->getPropertyValue(PROPERTYNAME_REDUCETRANSPARENCY) >>= bValue ) + SetReduceTransparency( bValue ); + if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDTRANSPARENCYMODE) >>= nValue ) + SetReducedTransparencyMode( (PrinterTransparencyMode)nValue ); + if( xSet->getPropertyValue(PROPERTYNAME_REDUCEGRADIENTS) >>= bValue ) + SetReduceGradients( bValue ); + if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDGRADIENTMODE) >>= nValue ) + SetReducedGradientMode( (PrinterGradientMode)nValue ); + if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT) >>= nValue ) + SetReducedGradientStepCount( (USHORT)nValue ); + if( xSet->getPropertyValue(PROPERTYNAME_REDUCEBITMAPS) >>= bValue ) + SetReduceBitmaps( bValue ); + if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPMODE) >>= nValue ) + SetReducedBitmapMode( (PrinterBitmapMode)nValue ); + if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPRESOLUTION) >>= nValue ) + SetReducedBitmapResolution( (USHORT)nValue ); + if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY) >>= bValue ) + SetReducedBitmapIncludesTransparency( bValue ); + if( xSet->getPropertyValue(PROPERTYNAME_CONVERTTOGREYSCALES) >>= bValue ) + SetConvertToGreyscales( bValue ); + + bSuccess = true; + } + } + } + } + catch( Exception& ) + { + } + } + } + catch( WrappedTargetException& ) + { + } + + if( ! bSuccess ) + *this = aOldValues; + return bSuccess; +} + // ------------- // - QueueInfo - // ------------- diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index e557a8427704..afb510b05a17 100755 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -553,6 +553,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptrReadFromConfig( mbPrintFile ); maJobName = i_rJobName; mnCurPage = 1; @@ -733,6 +734,13 @@ void PrinterController::setPrinter( const boost::shared_ptr& i_rPrinter mpImplData->mnFixedPaperBin = -1; } +void PrinterController:: resetPrinterOptions( bool i_bFileOutput ) +{ + PrinterOptions aOpt; + aOpt.ReadFromConfig( i_bFileOutput ); + mpImplData->mpPrinter->SetPrinterOptions( aOpt ); +} + bool PrinterController::setupPrinter( Window* i_pParent ) { bool bRet = false; diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index ec80f5628635..0641c49c27f0 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -65,6 +65,7 @@ PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent, const Re , maOrigSize( 10, 10 ) , maPageVDev( *this ) , maToolTipString( String( VclResId( SV_PRINT_PRINTPREVIEW_TXT ) ) ) + , mbGreyscale( false ) { SetPaintTransparent( TRUE ); SetBackground(); @@ -245,6 +246,11 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& ) maPageVDev.Erase(); maPageVDev.Push(); maPageVDev.SetMapMode( MAP_100TH_MM ); + ULONG nOldDrawMode = maPageVDev.GetDrawMode(); + if( mbGreyscale ) + maPageVDev.SetDrawMode( maPageVDev.GetDrawMode() | + ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT | + DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) ); aMtf.WindStart(); aMtf.Scale( fScale, fScale ); aMtf.WindStart(); @@ -254,6 +260,7 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& ) SetMapMode( MAP_PIXEL ); maPageVDev.SetMapMode( MAP_PIXEL ); DrawOutDev( aOffset, maPreviewSize, Point( 0, 0 ), aVDevSize, maPageVDev ); + maPageVDev.SetDrawMode( nOldDrawMode ); DecorationView aVw( this ); Rectangle aFrame( aOffset + Point( -1, -1 ), Size( maPreviewSize.Width() + 2, maPreviewSize.Height() + 2 ) ); @@ -285,7 +292,8 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi const Size& i_rOrigSize, const rtl::OUString& i_rReplacement, sal_Int32 i_nDPIX, - sal_Int32 i_nDPIY + sal_Int32 i_nDPIY, + bool i_bGreyscale ) { rtl::OUStringBuffer aBuf( 256 ); @@ -306,6 +314,7 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi maOrigSize = i_rOrigSize; maReplacementString = i_rReplacement; + mbGreyscale = i_bGreyscale; maPageVDev.SetReferenceDevice( i_nDPIX, i_nDPIY ); maPageVDev.EnableOutput( TRUE ); Resize(); @@ -808,9 +817,6 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptrgetReversePrint() ); - // get the first page - preparePreview( true, true ); - // fill printer listbox const std::vector< rtl::OUString >& rQueues( Printer::GetPrinterQueues() ); for( std::vector< rtl::OUString >::const_iterator it = rQueues.begin(); @@ -841,6 +847,12 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptrsetPrinter( boost::shared_ptr( new Printer( Printer::GetDefaultPrinterName() ) ) ); } } + // not printing to file + maPController->resetPrinterOptions( false ); + + // get the first page + preparePreview( true, true ); + // update the text fields for the printer updatePrinterText(); @@ -1024,6 +1036,11 @@ void PrintDialog::readFromSettings() } } maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText ); + if( maOptionsPage.maToFileBox.IsChecked() ) + { + maPController->resetPrinterOptions( true ); + preparePreview( true, true ); + } } void PrintDialog::storeToSettings() @@ -1859,7 +1876,8 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache ) Size aCurPageSize = aPrt->PixelToLogic( aPrt->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ); maPreviewWindow.setPreview( aMtf, aCurPageSize, nPages > 0 ? rtl::OUString() : maNoPageStr, - aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY() + aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY(), + aPrt->GetPrinterOptions().IsConvertToGreyscales() ); maForwardBtn.Enable( mnCurPage < nPages-1 ); @@ -2046,6 +2064,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox ) String aNewPrinter( pBox->GetSelectEntry() ); // set new printer maPController->setPrinter( boost::shared_ptr( new Printer( aNewPrinter ) ) ); + maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() ); // update text fields updatePrinterText(); } @@ -2091,7 +2110,9 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton ) else if( pButton == &maOptionsPage.maToFileBox ) { maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText ); + maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() ); maLayout.resize(); + preparePreview( true, true ); } else if( pButton == &maNUpPage.maBrochureBtn ) { -- cgit From 82cdefeb20ce8ccb1ae39b03364e8b79988c0db9 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Wed, 3 Nov 2010 20:04:05 +0100 Subject: dr77: typos in IDL --- offapi/com/sun/star/sheet/FormulaMapGroupSpecialOffset.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/offapi/com/sun/star/sheet/FormulaMapGroupSpecialOffset.idl b/offapi/com/sun/star/sheet/FormulaMapGroupSpecialOffset.idl index 06008bbc059d..90edc6b22200 100644 --- a/offapi/com/sun/star/sheet/FormulaMapGroupSpecialOffset.idl +++ b/offapi/com/sun/star/sheet/FormulaMapGroupSpecialOffset.idl @@ -56,7 +56,7 @@ constants FormulaMapGroupSpecialOffset constants.
  • A string for literal text.
  • A any for a literal array. The contained - values shall be of type double or atom>string. + values shall be of type double or string. Floating-point values and strings may occur together in an array.
  • A struct of type SingleReference for a reference to a single cell in the own document.
  • @@ -142,7 +142,7 @@ constants FormulaMapGroupSpecialOffset able to parse.

    The FormulaToken::Data member shall contain a - string with the bad data. This string will be displayed + string with the bad data. This string will be displayed literally in the formula.

    */ const long BAD = 7; -- cgit From 0b66e33ee50cd1c77bd9b1073ab298bac03bcfb7 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Thu, 4 Nov 2010 11:03:35 +0100 Subject: dr77: #i102872# handle new filter operators from css.sheet.FilterOperator2, rewrite OOXML autofilter import, add BIFF5/8/12 support --- oox/inc/oox/dump/biffdumper.hxx | 2 + oox/inc/oox/xls/autofilterbuffer.hxx | 278 +++++++++++ oox/inc/oox/xls/autofiltercontext.hxx | 128 ++--- oox/inc/oox/xls/biffhelper.hxx | 10 + oox/inc/oox/xls/connectionsbuffer.hxx | 24 +- oox/inc/oox/xls/connectionsfragment.hxx | 15 +- oox/inc/oox/xls/defnamesbuffer.hxx | 47 +- oox/inc/oox/xls/pivotcachefragment.hxx | 2 +- oox/inc/oox/xls/pivottablefragment.hxx | 2 +- oox/inc/oox/xls/querytablefragment.hxx | 2 +- oox/inc/oox/xls/sheetdatacontext.hxx | 2 +- oox/inc/oox/xls/tablebuffer.hxx | 18 +- oox/inc/oox/xls/tablefragment.hxx | 5 +- oox/inc/oox/xls/workbookhelper.hxx | 20 +- oox/inc/oox/xls/worksheetfragment.hxx | 2 + oox/inc/oox/xls/worksheethelper.hxx | 3 + oox/source/dump/biffdumper.cxx | 49 +- oox/source/dump/biffdumper.ini | 31 +- oox/source/dump/xlsbdumper.cxx | 32 ++ oox/source/dump/xlsbdumper.ini | 32 +- oox/source/token/properties.txt | 7 + oox/source/xls/autofilterbuffer.cxx | 856 ++++++++++++++++++++++++++++++++ oox/source/xls/autofiltercontext.cxx | 731 +++------------------------ oox/source/xls/connectionsbuffer.cxx | 55 +- oox/source/xls/connectionsfragment.cxx | 51 +- oox/source/xls/defnamesbuffer.cxx | 158 +++--- oox/source/xls/makefile.mk | 3 +- oox/source/xls/pivotcachefragment.cxx | 5 +- oox/source/xls/pivottablefragment.cxx | 4 +- oox/source/xls/querytablebuffer.cxx | 20 +- oox/source/xls/querytablefragment.cxx | 4 +- oox/source/xls/sheetdatacontext.cxx | 7 +- oox/source/xls/tablebuffer.cxx | 50 +- oox/source/xls/tablefragment.cxx | 33 +- oox/source/xls/workbookhelper.cxx | 50 +- oox/source/xls/worksheetfragment.cxx | 19 +- oox/source/xls/worksheethelper.cxx | 11 + 37 files changed, 1773 insertions(+), 995 deletions(-) create mode 100755 oox/inc/oox/xls/autofilterbuffer.hxx create mode 100755 oox/source/xls/autofilterbuffer.cxx diff --git a/oox/inc/oox/dump/biffdumper.hxx b/oox/inc/oox/dump/biffdumper.hxx index 078330cb8dbe..a3bdc4a87c73 100644 --- a/oox/inc/oox/dump/biffdumper.hxx +++ b/oox/inc/oox/dump/biffdumper.hxx @@ -443,6 +443,8 @@ private: void dumpExtCfColor( const String& rName = EMPTY_STRING ); void dumpExtGradientHead(); + sal_uInt8 dumpFilterColumnOperator( const String& rName ); + ::rtl::OUString dumpPivotString( const String& rName, sal_uInt16 nStrLen ); ::rtl::OUString dumpPivotString( const String& rName ); diff --git a/oox/inc/oox/xls/autofilterbuffer.hxx b/oox/inc/oox/xls/autofilterbuffer.hxx new file mode 100755 index 000000000000..105afa606f47 --- /dev/null +++ b/oox/inc/oox/xls/autofilterbuffer.hxx @@ -0,0 +1,278 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_XLS_AUTOFILTERBUFFER_HXX +#define OOX_XLS_AUTOFILTERBUFFER_HXX + +#include +#include "oox/xls/workbookhelper.hxx" + +namespace com { namespace sun { namespace star { + namespace sheet { struct TableFilterField2; } + namespace sheet { class XDatabaseRange; } + namespace sheet { class XSheetFilterDescriptor2; } +} } } + +namespace oox { +namespace xls { + +// ============================================================================ + +/** Contains UNO API filter settings for a column in a filtered range. */ +struct ApiFilterSettings +{ + typedef ::std::vector< ::com::sun::star::sheet::TableFilterField2 > FilterFieldVector; + + FilterFieldVector maFilterFields; /// List of UNO API filter settings. + OptValue< bool > mobNeedsRegExp; /// If set, requires regular expressions to be enabled/disabled. + + explicit ApiFilterSettings(); + + void appendField( bool bAnd, sal_Int32 nOperator, double fValue ); + void appendField( bool bAnd, sal_Int32 nOperator, const ::rtl::OUString& rValue ); +}; + +// ============================================================================ + +/** Base class for specific filter settings for a column in a filtered range. + */ +class FilterSettingsBase : public WorkbookHelper +{ +public: + explicit FilterSettingsBase( const WorkbookHelper& rHelper ); + + /** Derived classes import filter settings from the passed attribute list. */ + virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); + /** Derived classes import filter settings from the passed record. */ + virtual void importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + /** Derived classes import filter settings from the FILTERCOLUMN record. */ + virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ); + + /** Derived classes return converted UNO API filter settings representing all filter settings. */ + virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount ); +}; + +typedef ::boost::shared_ptr< FilterSettingsBase > FilterSettingsRef; + +// ============================================================================ + +/** Settings for a discrete filter, specifying a list of values to be shown in + the filtered range. + */ +class DiscreteFilter : public FilterSettingsBase +{ +public: + explicit DiscreteFilter( const WorkbookHelper& rHelper ); + + /** Imports filter settings from the filters and filter elements. */ + virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); + /** Imports filter settings from the FILTERS and FILTER records. */ + virtual void importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + + /** Returns converted UNO API filter settings representing all filter settings. */ + virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount ); + +private: + typedef ::std::vector< ::rtl::OUString > FilterValueVector; + + FilterValueVector maValues; + sal_Int32 mnCalendarType; + bool mbShowBlank; +}; + +// ============================================================================ + +/** Settings for a top-10 filter. */ +class Top10Filter : public FilterSettingsBase +{ +public: + explicit Top10Filter( const WorkbookHelper& rHelper ); + + /** Imports filter settings from the filters and filter elements. */ + virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); + /** Imports filter settings from the FILTERS and FILTER records. */ + virtual void importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + /** Imports filter settings from the FILTERCOLUMN record. */ + virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ); + + /** Returns converted UNO API filter settings representing all filter settings. */ + virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount ); + +private: + double mfValue; /// Number of items or percentage. + bool mbTop; /// True = show top (greatest) items/percentage. + bool mbPercent; /// True = percentage, false = number of items. +}; + +// ============================================================================ + +/** A filter criterion for a custom filter. */ +struct FilterCriterionModel +{ + ::com::sun::star::uno::Any maValue; /// The comparison operator. + sal_Int32 mnOperator; /// Comparison operator. + sal_uInt8 mnDataType; /// Operator data type (BIFF only). + sal_uInt8 mnStrLen; /// Length of string operator (BIFF5-BIFF8 only). + + explicit FilterCriterionModel(); + + /** Sets the passed BIFF operator constant. */ + void setBiffOperator( sal_uInt8 nOperator ); + + /** Imports the criterion model from the passed BIFF12 stream. */ + void readBiffData( RecordInputStream& rStrm ); + /** Imports the initial criterion data from the passed BIFF5/BIFF8 stream. */ + void readBiffData( BiffInputStream& rStrm ); + /** Imports the trailing string data from the passed BIFF5/BIFF8 stream. */ + void readString( BiffInputStream& rStrm, BiffType eBiff, rtl_TextEncoding eTextEnc ); +}; + +// ---------------------------------------------------------------------------- + +/** Settings for a custom filter, specifying one or two comparison operators + associated with some values. + */ +class CustomFilter : public FilterSettingsBase +{ +public: + explicit CustomFilter( const WorkbookHelper& rHelper ); + + /** Imports filter settings from the filters and filter elements. */ + virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); + /** Imports filter settings from the FILTERS and FILTER records. */ + virtual void importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + /** Imports filter settings from the FILTERCOLUMN record. */ + virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ); + + /** Returns converted UNO API filter settings representing all filter settings. */ + virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount ); + +private: + /** Apeends the passed filter criteriom, if it contains valid settings. */ + void appendCriterion( const FilterCriterionModel& rCriterion ); + +private: + typedef ::std::vector< FilterCriterionModel > FilterCriterionVector; + + FilterCriterionVector maCriteria; + bool mbAnd; +}; + +// ============================================================================ + +/** A column in a filtered range. Contains an object with specific filter + settings for the cells in the column. + */ +class FilterColumn : public WorkbookHelper +{ +public: + explicit FilterColumn( const WorkbookHelper& rHelper ); + + /** Imports auto filter column settings from the filterColumn element. */ + void importFilterColumn( const AttributeList& rAttribs ); + /** Imports auto filter column settings from the FILTERCOLUMN record. */ + void importFilterColumn( RecordInputStream& rStrm ); + /** Imports auto filter column settings from the FILTERCOLUMN record. */ + void importFilterColumn( BiffInputStream& rStrm ); + + /** Creates and returns the specified filter settings object. */ + template< typename FilterSettingsType > + inline FilterSettingsBase& createFilterSettings() + { mxSettings.reset( new FilterSettingsType( *this ) ); return *mxSettings; } + + /** Returns the index of the column in the filtered range this object is related to. */ + inline sal_Int32 getColumnId() const { return mnColId; } + + /** Returns converted UNO API filter settings representing all filter + settings of this column. */ + ApiFilterSettings finalizeImport( sal_Int32 nMaxCount ); + +private: + FilterSettingsRef mxSettings; + sal_Int32 mnColId; + bool mbHiddenButton; + bool mbShowButton; +}; + +// ============================================================================ + +class AutoFilter : public WorkbookHelper +{ +public: + explicit AutoFilter( const WorkbookHelper& rHelper ); + + /** Imports auto filter settings from the autoFilter element. */ + void importAutoFilter( const AttributeList& rAttribs, sal_Int16 nSheet ); + /** Imports auto filter settings from the AUTOFILTER record. */ + void importAutoFilter( RecordInputStream& rStrm, sal_Int16 nSheet ); + + /** Creates a new auto filter column and stores it internally. */ + FilterColumn& createFilterColumn(); + + /** Applies the filter to the passed filter descriptor. */ + void finalizeImport( const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor2 >& rxFilterDesc ); + +private: + typedef RefVector< FilterColumn > FilterColumnVector; + + FilterColumnVector maFilterColumns; + ::com::sun::star::table::CellRangeAddress maRange; +}; + +// ============================================================================ + +class AutoFilterBuffer : public WorkbookHelper +{ +public: + explicit AutoFilterBuffer( const WorkbookHelper& rHelper ); + + /** Creates a new auto filter and stores it internally. */ + AutoFilter& createAutoFilter(); + + /** Applies filter settings to a new database range object (used for sheet + autofilter or advanced filter as specified by built-in defined names). */ + void finalizeImport( sal_Int16 nSheet ); + + /** Applies the filters to the passed database range object. + @return True = this buffer contains valid auto filter settings. */ + bool finalizeImport( const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDatabaseRange >& rxDatabaseRange ); + +private: + /** Returns the auto filter object used to perform auto filtering. */ + AutoFilter* getActiveAutoFilter(); + +private: + typedef RefVector< AutoFilter > AutoFilterVector; + AutoFilterVector maAutoFilters; +}; + +// ============================================================================ + +} // namespace xls +} // namespace oox + +#endif diff --git a/oox/inc/oox/xls/autofiltercontext.hxx b/oox/inc/oox/xls/autofiltercontext.hxx index 5efe0da2a9e8..6deb40bedd9c 100644 --- a/oox/inc/oox/xls/autofiltercontext.hxx +++ b/oox/inc/oox/xls/autofiltercontext.hxx @@ -28,124 +28,82 @@ #ifndef OOX_XLS_AUTOFILTERCONTEXT_HXX #define OOX_XLS_AUTOFILTERCONTEXT_HXX -#define USE_SC_MULTI_STRING_FILTER_PATCH 0 - #include "oox/xls/excelhandlers.hxx" -#include - -#if USE_SC_MULTI_STRING_FILTER_PATCH -#include -#else -#include -#endif - -#include -#include - -namespace com { namespace sun { namespace star { namespace sheet { -#if USE_SC_MULTI_STRING_FILTER_PATCH - struct TableFilterFieldBase; -#else - struct TableFilterField; -#endif - struct TableFilterFieldMultiString; -}}}} namespace oox { namespace xls { +class AutoFilter; +class FilterColumn; +class FilterSettingsBase; + // ============================================================================ -struct FilterFieldItem +class FilterSettingsContext : public WorksheetContextBase { -#if USE_SC_MULTI_STRING_FILTER_PATCH - typedef ::boost::shared_ptr< ::com::sun::star::sheet::TableFilterFieldBase > TableFilterFieldRef; -#else - typedef ::boost::shared_ptr< ::com::sun::star::sheet::TableFilterField > TableFilterFieldRef; -#endif +public: + explicit FilterSettingsContext( WorksheetContextBase& rParent, FilterSettingsBase& rFilterSettings ); - enum Type { NORMAL, MULTI_STRING }; +protected: + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); + virtual void onStartElement( const AttributeList& rAttribs ); - TableFilterFieldRef mpField; - Type meType; + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual void onStartRecord( RecordInputStream& rStrm ); - FilterFieldItem(); - FilterFieldItem(Type eType); +private: + FilterSettingsBase& mrFilterSettings; }; // ============================================================================ -class AutoFilterContext : public WorksheetContextBase +class FilterColumnContext : public WorksheetContextBase { public: - explicit AutoFilterContext( WorksheetFragmentBase& rFragment ); + explicit FilterColumnContext( WorksheetContextBase& rParent, FilterColumn& rFilterColumn ); protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual void onEndElement(); - -private: - /** Initializes data members to prepare for autofilter parsing. Call this - method when a new autofilter context starts. */ - void initialize(); - - /** Commits the imported autofilter data to Calc. */ - void setAutoFilter(); - - /** Check if the shown blank bit is on, if so, add show blank filter to the - list. */ - void maybeShowBlank(); - - /** Packs the collected filter names into a single regex string. */ - void setFilterNames(); - void importAutoFilter( const AttributeList& rAttribs ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual void onStartRecord( RecordInputStream& rStrm ); - void importFilterColumn( const AttributeList& rAttribs ); - - void importTop10( const AttributeList& rAttribs ); - - /** Be sure to check for its 'and' attribute when there are two - customFilter's. If the attribute is not given, assume OR. */ - void importCustomFilters( const AttributeList& rAttribs ); +private: + FilterColumn& mrFilterColumn; +}; - /** Imports custumFilter element. Note that the standard specifies there - can be at most two custom filters specified, but no more than two. When - there are two custom filters, then their relationship (AND or OR) must - be specified by the parent element . */ - void importCustomFilter( const AttributeList& rAttribs ); +// ============================================================================ - void importFilters( const AttributeList& rAttribs ); +class AutoFilterContext : public WorksheetContextBase +{ +public: + explicit AutoFilterContext( WorksheetFragmentBase& rFragment, AutoFilter& rAutoFilter ); - void importFilter( const AttributeList& rAttribs ); +protected: + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); + virtual void onStartElement( const AttributeList& rAttribs ); - void importDynamicFilter( const AttributeList& rAttribs ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual void onStartRecord( RecordInputStream& rStrm ); private: - typedef ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > XCellRef; - - ::std::list< FilterFieldItem > maFields; - - ::std::list< ::rtl::OUString > maFilterNames; - ::com::sun::star::table::CellRangeAddress maAutoFilterRange; - sal_Int32 mnCurColID; + AutoFilter& mrAutoFilter; +}; - /** If this is false (i.e. the given cell range address is not valid), then - don't do anything. */ - bool mbValidAddress:1; +// ============================================================================ - /** We use regex to compensate for Calc's lack of filtering by individual - names (i.e. tag). */ - bool mbUseRegex:1; +class BiffAutoFilterContext : public BiffWorksheetContextBase +{ +public: + explicit BiffAutoFilterContext( const WorksheetHelper& rHelper, AutoFilter& rAutoFilter ); - /** The tag may have a 'blank' attribute when the blank values - need to be shown. This flag stores that information. */ - bool mbShowBlank:1; +protected: + /** Imports all records related to the current auto filter. */ + virtual void importRecord( BiffInputStream& rStrm ); - /** true if FilterConnection_AND, or false if FilterConnection_OR. This - flag is used to store the relationship of paired customFilter's. */ - bool mbConnectionAnd:1; +private: + AutoFilter& mrAutoFilter; }; // ============================================================================ diff --git a/oox/inc/oox/xls/biffhelper.hxx b/oox/inc/oox/xls/biffhelper.hxx index ba0228b761bb..dd93621ba130 100644 --- a/oox/inc/oox/xls/biffhelper.hxx +++ b/oox/inc/oox/xls/biffhelper.hxx @@ -85,6 +85,8 @@ const sal_Int32 BIFF12_ID_CONTROL = 0x0284; const sal_Int32 BIFF12_ID_CONTROLS = 0x0283; const sal_Int32 BIFF12_ID_CUSTOMCHARTVIEW = 0x028F; const sal_Int32 BIFF12_ID_CUSTOMCHARTVIEWS = 0x028D; +const sal_Int32 BIFF12_ID_CUSTOMFILTER = 0x00AE; +const sal_Int32 BIFF12_ID_CUSTOMFILTERS = 0x00AC; const sal_Int32 BIFF12_ID_CUSTOMSHEETVIEW = 0x01A7; const sal_Int32 BIFF12_ID_CUSTOMSHEETVIEWS = 0x01A6; const sal_Int32 BIFF12_ID_CUSTOMWORKBOOKVIEW= 0x018D; @@ -99,6 +101,8 @@ const sal_Int32 BIFF12_ID_DDEITEM_ERROR = 0x0245; const sal_Int32 BIFF12_ID_DDEITEM_STRING = 0x0246; const sal_Int32 BIFF12_ID_DEFINEDNAME = 0x0027; const sal_Int32 BIFF12_ID_DIMENSION = 0x0094; +const sal_Int32 BIFF12_ID_DISCRETEFILTER = 0x00A7; +const sal_Int32 BIFF12_ID_DISCRETEFILTERS = 0x00A5; const sal_Int32 BIFF12_ID_DRAWING = 0x0226; const sal_Int32 BIFF12_ID_DXF = 0x01FB; const sal_Int32 BIFF12_ID_DXFS = 0x01F9; @@ -266,6 +270,7 @@ const sal_uInt16 BIFF8_MAXRECSIZE = 8224; const sal_uInt16 BIFF2_ID_ARRAY = 0x0021; const sal_uInt16 BIFF3_ID_ARRAY = 0x0221; +const sal_uInt16 BIFF_ID_AUTOFILTER = 0x009D; const sal_uInt16 BIFF2_ID_BLANK = 0x0001; const sal_uInt16 BIFF3_ID_BLANK = 0x0201; const sal_uInt16 BIFF2_ID_BOF = 0x0009; @@ -393,6 +398,8 @@ const sal_uInt16 BIFF_ID_EXTERNSHEET = 0x0017; const sal_uInt16 BIFF_ID_EXTSST = 0x00FF; const sal_uInt16 BIFF_ID_FILEPASS = 0x002F; const sal_uInt16 BIFF_ID_FILESHARING = 0x005B; +const sal_uInt16 BIFF_ID_FILTERCOLUMN = 0x009E; +const sal_uInt16 BIFF_ID_FILTERMODE = 0x009B; const sal_uInt16 BIFF2_ID_FONT = 0x0031; const sal_uInt16 BIFF3_ID_FONT = 0x0231; const sal_uInt16 BIFF5_ID_FONT = 0x0031; @@ -576,6 +583,9 @@ const sal_uInt8 BIFF_DATATYPE_STRING = 2; const sal_uInt8 BIFF_DATATYPE_BOOL = 4; const sal_uInt8 BIFF_DATATYPE_ERROR = 16; +const sal_uInt8 BIFF_BOOLERR_BOOL = 0; +const sal_uInt8 BIFF_BOOLERR_ERROR = 1; + // BIFF8 unicode strings ------------------------------------------------------ const sal_uInt8 BIFF_STRF_16BIT = 0x01; diff --git a/oox/inc/oox/xls/connectionsbuffer.hxx b/oox/inc/oox/xls/connectionsbuffer.hxx index bfab732fa7fc..69d609993864 100755 --- a/oox/inc/oox/xls/connectionsbuffer.hxx +++ b/oox/inc/oox/xls/connectionsbuffer.hxx @@ -86,6 +86,7 @@ struct ConnectionModel sal_Int32 mnId; /// Unique connection identifier. sal_Int32 mnType; /// Data source type. sal_Int32 mnReconnectMethod; /// Reconnection method. + sal_Int32 mnCredentials; /// Credentials method. sal_Int32 mnInterval; /// Refresh interval in minutes. bool mbKeepAlive; /// True = keep connection open after import. bool mbNew; /// True = new connection, never updated. @@ -94,6 +95,7 @@ struct ConnectionModel bool mbBackground; /// True = background refresh enabled. bool mbRefreshOnLoad; /// True = refresh connection on import. bool mbSaveData; /// True = save cached data with connection. + bool mbSavePassword; /// True = save password in connection string. explicit ConnectionModel(); @@ -151,23 +153,27 @@ class ConnectionsBuffer : public WorkbookHelper public: explicit ConnectionsBuffer( const WorkbookHelper& rHelper ); - /** Imports connection settings from the connection element. */ - ConnectionRef importConnection( const AttributeList& rAttribs ); - /** Imports connection settings from the CONNECTION record. */ - ConnectionRef importConnection( RecordInputStream& rStrm ); - /** Creates a new empty connection with an unused identifier. */ - ConnectionRef createConnection(); + /** Creates a new empty connection. */ + Connection& createConnection(); + /** Creates a new empty connection with a valid but unused identifier. */ + Connection& createConnectionWithId(); + + /** Maps all connections by their identifier. */ + void finalizeImport(); /** Returns a data connection by its unique identifier. */ ConnectionRef getConnection( sal_Int32 nConnId ) const; private: - /** Inserts the passed connection object. */ - void insertConnection( const ConnectionRef& rxConnection ); + /** Inserts the passed connection into the map according to its identifier. */ + void insertConnectionToMap( const ConnectionRef& rxConnection ); private: + typedef RefVector< Connection > ConnectionVector; typedef RefMap< sal_Int32, Connection > ConnectionMap; - ConnectionMap maConnections; + + ConnectionVector maConnections; + ConnectionMap maConnectionsById; sal_Int32 mnUnusedId; }; diff --git a/oox/inc/oox/xls/connectionsfragment.hxx b/oox/inc/oox/xls/connectionsfragment.hxx index a104daf050d5..8c4a608de7d1 100644 --- a/oox/inc/oox/xls/connectionsfragment.hxx +++ b/oox/inc/oox/xls/connectionsfragment.hxx @@ -29,24 +29,28 @@ #define OOX_XLS_CONNECTIONSFRAGMENT_HXX #include "oox/xls/excelhandlers.hxx" -#include "oox/xls/connectionsbuffer.hxx" namespace oox { namespace xls { +class Connection; + // ============================================================================ class ConnectionContext : public WorkbookContextBase { public: - explicit ConnectionContext( WorkbookFragmentBase& rParent, const ConnectionRef& rxConnection ); + explicit ConnectionContext( WorkbookFragmentBase& rParent, Connection& rConnection ); protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); + virtual void onStartElement( const AttributeList& rAttribs ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual void onStartRecord( RecordInputStream& rStrm ); private: - ConnectionRef mxConnection; + Connection& mrConnection; }; // ============================================================================ @@ -63,10 +67,7 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; - -private: - void importConnection( const AttributeList& rAttribs ); - void importWebPr( const AttributeList& rAttribs ); + virtual void finalizeImport(); }; // ============================================================================ diff --git a/oox/inc/oox/xls/defnamesbuffer.hxx b/oox/inc/oox/xls/defnamesbuffer.hxx index 2aca217fc28d..15d7db41832d 100644 --- a/oox/inc/oox/xls/defnamesbuffer.hxx +++ b/oox/inc/oox/xls/defnamesbuffer.hxx @@ -46,19 +46,19 @@ class BiffInputStreamPos; // codes for built-in names const sal_Unicode BIFF_DEFNAME_CONSOLIDATEAREA = '\x00'; -const sal_Unicode BIFF_DEFNAME_AUTOOPEN = '\x01'; -const sal_Unicode BIFF_DEFNAME_AUTOCLOSE = '\x02'; -const sal_Unicode BIFF_DEFNAME_EXTRACT = '\x03'; +const sal_Unicode BIFF_DEFNAME_AUTOOPEN = '\x01'; // Sheet macro executed when workbook is opened. +const sal_Unicode BIFF_DEFNAME_AUTOCLOSE = '\x02'; // Sheet macro executed when workbook is closed. +const sal_Unicode BIFF_DEFNAME_EXTRACT = '\x03'; // Filter output destination for advanced filter. const sal_Unicode BIFF_DEFNAME_DATABASE = '\x04'; -const sal_Unicode BIFF_DEFNAME_CRITERIA = '\x05'; -const sal_Unicode BIFF_DEFNAME_PRINTAREA = '\x06'; -const sal_Unicode BIFF_DEFNAME_PRINTTITLES = '\x07'; +const sal_Unicode BIFF_DEFNAME_CRITERIA = '\x05'; // Filter criteria source range for advanced filter. +const sal_Unicode BIFF_DEFNAME_PRINTAREA = '\x06'; // Print ranges. +const sal_Unicode BIFF_DEFNAME_PRINTTITLES = '\x07'; // Rows/columns repeated on each page when printing. const sal_Unicode BIFF_DEFNAME_RECORDER = '\x08'; const sal_Unicode BIFF_DEFNAME_DATAFORM = '\x09'; -const sal_Unicode BIFF_DEFNAME_AUTOACTIVATE = '\x0A'; -const sal_Unicode BIFF_DEFNAME_AUTODEACTIVATE = '\x0B'; +const sal_Unicode BIFF_DEFNAME_AUTOACTIVATE = '\x0A'; // Sheet macro executed when workbook is activated. +const sal_Unicode BIFF_DEFNAME_AUTODEACTIVATE = '\x0B'; // Sheet macro executed when workbook is deactivated. const sal_Unicode BIFF_DEFNAME_SHEETTITLE = '\x0C'; -const sal_Unicode BIFF_DEFNAME_FILTERDATABASE = '\x0D'; +const sal_Unicode BIFF_DEFNAME_FILTERDATABASE = '\x0D'; // Sheet range autofilter or advanced filter works on. const sal_Unicode BIFF_DEFNAME_UNKNOWN = '\x0E'; // ============================================================================ @@ -69,9 +69,9 @@ struct DefinedNameModel ::rtl::OUString maFormula; /// The formula string. sal_Int32 mnSheet; /// Sheet index for local names. sal_Int32 mnFuncGroupId; /// Function group identifier. - bool mbMacro; /// True = Macro name (VBasic or sheet macro). + bool mbMacro; /// True = Macro name (VBA or sheet macro). bool mbFunction; /// True = function, false = command. - bool mbVBName; /// True = VBasic macro, false = sheet macro. + bool mbVBName; /// True = VBA macro, false = sheet macro. bool mbHidden; /// True = name hidden in UI. explicit DefinedNameModel(); @@ -134,19 +134,21 @@ public: /** Converts the formula string or BIFF token array for this defined name. */ void convertFormula(); + /** Returns true, if this defined name is global in the document. */ + inline bool isGlobalName() const { return mnCalcSheet < 0; } /** Returns true, if this defined name is a special builtin name. */ inline bool isBuiltinName() const { return mcBuiltinId != BIFF_DEFNAME_UNKNOWN; } /** Returns true, if this defined name is a macro function call. */ inline bool isMacroFunction() const { return maModel.mbMacro && maModel.mbFunction; } /** Returns true, if this defined name is a reference to a VBA macro. */ inline bool isVBName() const { return maModel.mbMacro && maModel.mbVBName; } - /** Returns true, if this defined name is global in the document. */ - inline bool isGlobalName() const { return mnCalcSheet < 0; } - /** Returns the token index used in API token arrays (com.sun.star.sheet.FormulaToken). */ - inline sal_Int32 getTokenIndex() const { return mnTokenIndex; } /** Returns the 0-based sheet index for local names, or -1 for global names. */ inline sal_Int16 getLocalCalcSheet() const { return mnCalcSheet; } + /** Returns the built-in identifier of the defined name. */ + inline sal_Unicode getBuiltinId() const { return mcBuiltinId; } + /** Returns the token index used in API token arrays (com.sun.star.sheet.FormulaToken). */ + inline sal_Int32 getTokenIndex() const { return mnTokenIndex; } /** Tries to resolve the defined name to an absolute cell range. */ bool getAbsoluteRange( ::com::sun::star::table::CellRangeAddress& orRange ) const; @@ -201,16 +203,27 @@ public: If no local name is found, tries to find a matching global name. @return Reference to the defined name or empty reference. */ DefinedNameRef getByModelName( const ::rtl::OUString& rModelName, sal_Int16 nCalcSheet = -1 ) const; + /** Returns a built-in defined name by its built-in identifier. + @param nSheet The sheet index of the built-in name. + @return Reference to the defined name or empty reference. */ + DefinedNameRef getByBuiltinId( sal_Unicode cBuiltinId, sal_Int16 nCalcSheet ) const; private: DefinedNameRef createDefinedName(); private: + typedef ::std::pair< sal_Int16, ::rtl::OUString > SheetNameKey; + typedef ::std::pair< sal_Int16, sal_Unicode > BuiltinKey; + typedef RefVector< DefinedName > DefNameVector; - typedef RefMap< sal_Int32, DefinedName > DefNameMap; + typedef RefMap< SheetNameKey, DefinedName > DefNameNameMap; + typedef RefMap< BuiltinKey, DefinedName > DefNameBuiltinMap; + typedef RefMap< sal_Int32, DefinedName > DefNameTokenIdMap; DefNameVector maDefNames; /// List of all defined names in insertion order. - DefNameMap maDefNameMap; /// Maps all defined names by API token index. + DefNameNameMap maModelNameMap; /// Maps all defined names by sheet index and model name. + DefNameBuiltinMap maBuiltinMap; /// Maps all defined names by sheet index and built-in identifier. + DefNameTokenIdMap maTokenIdMap; /// Maps all defined names by API token index. sal_Int16 mnCalcSheet; /// Current sheet index for BIFF2-BIFF4 names (always sheet-local). }; diff --git a/oox/inc/oox/xls/pivotcachefragment.hxx b/oox/inc/oox/xls/pivotcachefragment.hxx index d2a5ab4d7ace..4521fc8c0859 100644 --- a/oox/inc/oox/xls/pivotcachefragment.hxx +++ b/oox/inc/oox/xls/pivotcachefragment.hxx @@ -126,7 +126,7 @@ class BiffPivotCacheRecordsContext : public BiffWorksheetContextBase { public: explicit BiffPivotCacheRecordsContext( - const BiffWorkbookFragmentBase& rFragment, + const WorkbookHelper& rHelper, const PivotCache& rPivotCache ); /** Reads the current record from stream and tries to insert a cell into diff --git a/oox/inc/oox/xls/pivottablefragment.hxx b/oox/inc/oox/xls/pivottablefragment.hxx index a6cfe7ef2c64..039adc36134f 100644 --- a/oox/inc/oox/xls/pivottablefragment.hxx +++ b/oox/inc/oox/xls/pivottablefragment.hxx @@ -100,7 +100,7 @@ private: class BiffPivotTableContext : public BiffWorksheetContextBase { public: - explicit BiffPivotTableContext( const BiffWorksheetFragmentBase& rFragment ); + explicit BiffPivotTableContext( const WorksheetHelper& rHelper ); /** Imports all records related to the current pivot table. */ virtual void importRecord( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/querytablefragment.hxx b/oox/inc/oox/xls/querytablefragment.hxx index 65727fb87351..9aafdd15684e 100644 --- a/oox/inc/oox/xls/querytablefragment.hxx +++ b/oox/inc/oox/xls/querytablefragment.hxx @@ -59,7 +59,7 @@ private: class BiffQueryTableContext : public BiffWorksheetContextBase { public: - explicit BiffQueryTableContext( const BiffWorksheetFragmentBase& rFragment ); + explicit BiffQueryTableContext( const WorksheetHelper& rHelper ); /** Imports all records related to the current query table. */ virtual void importRecord( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/sheetdatacontext.hxx b/oox/inc/oox/xls/sheetdatacontext.hxx index 54f4b64fb64b..6a267db28214 100644 --- a/oox/inc/oox/xls/sheetdatacontext.hxx +++ b/oox/inc/oox/xls/sheetdatacontext.hxx @@ -113,7 +113,7 @@ private: class BiffSheetDataContext : public BiffWorksheetContextBase { public: - explicit BiffSheetDataContext( const BiffWorksheetFragmentBase& rParent ); + explicit BiffSheetDataContext( const WorksheetHelper& rHelper ); /** Tries to import a sheet data record. */ virtual void importRecord( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/tablebuffer.hxx b/oox/inc/oox/xls/tablebuffer.hxx index 8c127184f15d..4e9cb9824df0 100644 --- a/oox/inc/oox/xls/tablebuffer.hxx +++ b/oox/inc/oox/xls/tablebuffer.hxx @@ -30,6 +30,7 @@ #include #include "oox/helper/containerhelper.hxx" +#include "oox/xls/autofilterbuffer.hxx" #include "oox/xls/workbookhelper.hxx" namespace oox { @@ -62,6 +63,8 @@ public: void importTable( const AttributeList& rAttribs, sal_Int16 nSheet ); /** Imports a table definition from a TABLE record. */ void importTable( RecordInputStream& rStrm, sal_Int16 nSheet ); + /** Creates a new auto filter and stores it internally. */ + inline AutoFilter& createAutoFilter() { return maAutoFilters.createAutoFilter(); } /** Creates a database range from this tables. */ void finalizeImport(); @@ -70,7 +73,7 @@ public: inline sal_Int32 getTableId() const { return maModel.mnId; } /** Returns the token index used in API token arrays (com.sun.star.sheet.FormulaToken). */ inline sal_Int32 getTokenIndex() const { return mnTokenIndex; } - /** Returns the display name of the table. */ + /** Returns the original display name of the table. */ inline const ::rtl::OUString& getDisplayName() const { return maModel.maDisplayName; } /** Returns the original (unchecked) total range of the table. */ @@ -88,6 +91,8 @@ public: private: TableModel maModel; + AutoFilterBuffer maAutoFilters; /// Filter settings for this table. + ::rtl::OUString maDBRangeName; /// Name of the databae range in the Calc document. ::com::sun::star::table::CellRangeAddress maDestRange; /// Validated range of the table in the worksheet. sal_Int32 mnTokenIndex; /// Token index used in API token array. @@ -102,10 +107,8 @@ class TableBuffer : public WorkbookHelper public: explicit TableBuffer( const WorkbookHelper& rHelper ); - /** Imports a table definition from the passed attributes. */ - TableRef importTable( const AttributeList& rAttribs, sal_Int16 nSheet ); - /** Imports a table definition from a TABLE record. */ - TableRef importTable( RecordInputStream& rStrm, sal_Int16 nSheet ); + /** Creates a new empty table. */ + Table& createTable(); /** Creates database ranges from all imported tables. */ void finalizeImport(); @@ -116,12 +119,15 @@ public: TableRef getTable( const ::rtl::OUString& rDispName ) const; private: - void insertTable( const TableRef& rxTable ); + /** Inserts the passed table into the maps according to its identifier and name. */ + void insertTableToMaps( const TableRef& rxTable ); private: + typedef RefVector< Table > TableVector; typedef RefMap< sal_Int32, Table > TableIdMap; typedef RefMap< ::rtl::OUString, Table > TableNameMap; + TableVector maTables; TableIdMap maIdTables; TableNameMap maNameTables; }; diff --git a/oox/inc/oox/xls/tablefragment.hxx b/oox/inc/oox/xls/tablefragment.hxx index 5b92063ba147..40b9cca3a8fd 100644 --- a/oox/inc/oox/xls/tablefragment.hxx +++ b/oox/inc/oox/xls/tablefragment.hxx @@ -29,11 +29,12 @@ #define OOX_XLS_TABLEFRAGMENT_HXX #include "oox/xls/excelhandlers.hxx" -#include "oox/xls/tablebuffer.hxx" namespace oox { namespace xls { +class Table; + // ============================================================================ class TableFragment : public WorksheetFragmentBase @@ -50,7 +51,7 @@ protected: virtual const ::oox::core::RecordInfo* getRecordInfos() const; private: - TableRef mxTable; /// Current table. + Table& mrTable; }; // ============================================================================ diff --git a/oox/inc/oox/xls/workbookhelper.hxx b/oox/inc/oox/xls/workbookhelper.hxx index 78a9d674fa96..ee5b2f12cea5 100644 --- a/oox/inc/oox/xls/workbookhelper.hxx +++ b/oox/inc/oox/xls/workbookhelper.hxx @@ -37,14 +37,15 @@ namespace com { namespace sun { namespace star { namespace container { class XNameAccess; } namespace container { class XNameContainer; } namespace lang { class XMultiServiceFactory; } - namespace table { struct CellAddress; } - namespace table { struct CellRangeAddress; } - namespace table { class XCell; } - namespace table { class XCellRange; } + namespace sheet { class XDatabaseRange; } namespace sheet { class XNamedRange; } namespace sheet { class XSpreadsheet; } namespace sheet { class XSpreadsheetDocument; } namespace style { class XStyle; } + namespace table { struct CellAddress; } + namespace table { struct CellRangeAddress; } + namespace table { class XCell; } + namespace table { class XCellRange; } } } } namespace oox { @@ -184,12 +185,21 @@ public: getStyleObject( const ::rtl::OUString& rStyleName, bool bPageStyle ) const; /** Creates and returns a defined name on-the-fly in the Calc document. - The name will not be buffered in this defined names buffer. + The name will not be buffered in the global defined names buffer. @param orName (in/out-parameter) Returns the resulting used name. */ ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XNamedRange > createNamedRangeObject( ::rtl::OUString& orName, sal_Int32 nNameFlags = 0 ) const; + + /** Creates and returns a database range on-the-fly in the Calc document. + The range will not be buffered in the global table buffer. + @param orName (in/out-parameter) Returns the resulting used name. */ + ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDatabaseRange > + createDatabaseRangeObject( + ::rtl::OUString& orName, + const ::com::sun::star::table::CellRangeAddress& rRangeAddr ) const; + /** Creates and returns a com.sun.star.style.Style object for cells or pages. */ ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle > createStyleObject( diff --git a/oox/inc/oox/xls/worksheetfragment.hxx b/oox/inc/oox/xls/worksheetfragment.hxx index 4a8fc9f3ef04..96d8f1229f23 100644 --- a/oox/inc/oox/xls/worksheetfragment.hxx +++ b/oox/inc/oox/xls/worksheetfragment.hxx @@ -144,6 +144,8 @@ public: virtual bool importFragment(); private: + /** Imports the AUTOFILTER and following records with auto filter settings. */ + void importAutoFilter( BiffInputStream& rStrm ); /** Imports the COLINFO record and sets column properties and formatting. */ void importColInfo( BiffInputStream& rStrm ); /** Imports the BIFF2 COLUMNDEFAULT record and sets column default formatting. */ diff --git a/oox/inc/oox/xls/worksheethelper.hxx b/oox/inc/oox/xls/worksheethelper.hxx index 6994470c34cd..d946818b0e5e 100644 --- a/oox/inc/oox/xls/worksheethelper.hxx +++ b/oox/inc/oox/xls/worksheethelper.hxx @@ -50,6 +50,7 @@ namespace com { namespace sun { namespace star { namespace oox { namespace xls { +class AutoFilterBuffer; struct BinAddress; struct BinRange; class BinRangeList; @@ -315,6 +316,8 @@ public: CondFormatBuffer& getCondFormats() const; /** Returns the buffer for all cell comments in this sheet. */ CommentsBuffer& getComments() const; + /** Returns the auto filters for the sheet. */ + AutoFilterBuffer& getAutoFilters() const; /** Returns the buffer for all web query tables in this sheet. */ QueryTableBuffer& getQueryTables() const; /** Returns the page/print settings for this sheet. */ diff --git a/oox/source/dump/biffdumper.cxx b/oox/source/dump/biffdumper.cxx index d768b08812b7..2f362af6ad2d 100644 --- a/oox/source/dump/biffdumper.cxx +++ b/oox/source/dump/biffdumper.cxx @@ -2433,6 +2433,19 @@ void WorkbookStreamObject::implDumpRecordBody() dumpString( "password-creator", BIFF_STR_8BITLENGTH, BIFF_STR_SMARTFLAGS ); break; + case BIFF_ID_FILTERCOLUMN: + { + dumpDec< sal_uInt16 >( "column-index" ); + dumpHex< sal_uInt16 >( "flags", "FILTERCOLUMN-FLAGS" ); + sal_uInt8 nStrLen1 = dumpFilterColumnOperator( "operator-1" ); + sal_uInt8 nStrLen2 = dumpFilterColumnOperator( "operator-2" ); + bool bBiff8 = eBiff == BIFF8; + rtl_TextEncoding eTextEnc = getBiffData().getTextEncoding(); + if( nStrLen1 > 0 ) writeStringItem( "string-1", bBiff8 ? rStrm.readUniStringBody( nStrLen1, true ) : rStrm.readCharArrayUC( nStrLen1, eTextEnc, true ) ); + if( nStrLen2 > 0 ) writeStringItem( "string-2", bBiff8 ? rStrm.readUniStringBody( nStrLen2, true ) : rStrm.readCharArrayUC( nStrLen2, eTextEnc, true ) ); + } + break; + case BIFF2_ID_FONT: case BIFF3_ID_FONT: dumpFontRec(); @@ -3260,6 +3273,38 @@ void WorkbookStreamObject::dumpExtGradientHead() dumpDec< double >( "pos-bottom" ); } +sal_uInt8 WorkbookStreamObject::dumpFilterColumnOperator( const String& rName ) +{ + sal_uInt8 nStrLen = 0; + writeEmptyItem( rName ); + IndentGuard aIndGuard( mxOut ); + sal_uInt8 nType = dumpDec< sal_uInt8 >( "data-type", "FILTERCOLUMN-DATATYPE" ); + dumpDec< sal_uInt8 >( "operator", "FILTERCOLUMN-OPERATOR" ); + switch( nType ) + { + case 2: + dumpRk( "value" ); + dumpUnused( 4 ); + break; + case 4: + dumpDec< double >( "value" ); + break; + case 6: + dumpUnused( 4 ); + nStrLen = dumpDec< sal_uInt8 >( "length" ); + dumpBoolean( "simple" ); + dumpUnused( 2 ); + break; + case 8: + dumpBoolErr(); + dumpUnused( 6 ); + break; + default: + dumpUnused( 8 ); + } + return nStrLen; +} + OUString WorkbookStreamObject::dumpPivotString( const String& rName, sal_uInt16 nStrLen ) { OUString aString; @@ -3289,9 +3334,9 @@ void WorkbookStreamObject::dumpBoolErr() { MultiItemsGuard aMultiGuard( mxOut ); sal_uInt8 nValue = dumpHex< sal_uInt8 >( "value" ); - bool bErrCode = dumpBool< sal_uInt8 >( "is-errorcode" ); + bool bErrCode = dumpBool< sal_uInt8 >( "is-error-code" ); if( bErrCode ) - writeErrorCodeItem( "errorcode", nValue ); + writeErrorCodeItem( "error-code", nValue ); else writeBooleanItem( "boolean", nValue ); } diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini index 8e3e25271cc9..f32ed89334f8 100644 --- a/oox/source/dump/biffdumper.ini +++ b/oox/source/dump/biffdumper.ini @@ -344,7 +344,7 @@ multilist=RECORD-NAMES-BIFF5 0x0018=DEFINEDNAME 0x0023=EXTERNALNAME 0x0031=FONT - 0x0098=,,,FILTERMODE,,AUTOFILTERINFO,AUTOFILTER, + 0x0098=,,,FILTERMODE,,AUTOFILTER,FILTERCOLUMN, 0x00A8=,,,,,,SCENARIOS,SCENARIO 0x00B0=PTDEFINITION,PTFIELD,PTFITEM,,PTROWCOLFIELDS,PTROWCOLITEMS,PTPAGEFIELDS, 0x00B8=DOCROUTE,RECIPNAME,,,,MULTRK,MULTBLANK,TOOLBARHDR @@ -390,7 +390,7 @@ multilist=RECORD-NAMES-BIFF8 0x0860=,,SHEETEXT,BOOKEXT,,,,SHAREDFEATHEAD 0x0868=,,,CHFRLABELPROPS,,,, 0x0870=,,,,,,CONNECTION, - 0x0878=,,CFRULE12,CFRULEEXT,XFCRC,XFEXT,, + 0x0878=,,CFRULE12,CFRULEEXT,XFCRC,XFEXT,FILTERCOLUMN12,CONTINUE12 0x0888=,,,PAGELAYOUTVIEW,CHECKCOMPAT,DXF,TABLESTYLES, 0x0890=,,STYLEEXT,,,,THEME, 0x0898=,,MTHREADSETTINGS,COMPRESSPICS,HEADERFOOTER,CHFRLAYOUT,CHFREXTPROPS,CHFREXTPROPSCONT @@ -465,6 +465,7 @@ end constlist=SIMPLE-RECORDS-BIFF5 include=SIMPLE-RECORDS-BIFF4 + 0x009D=uint16,dec,column-count 0x00C9=double,dec,value 0x00CA=uint16,bool,value 0x00CB=uint16,hex,error-code,ERRORCODES @@ -1413,6 +1414,30 @@ end shortlist=FILEPASS-TYPE,0,xor,rc4 shortlist=FILEPASS-MAJOR,1,rc4,crypto-api-2003,crypto-api-2007 +# FILTERCOLUMN --------------------------------------------------------------- + +combilist=FILTERCOLUMN-FLAGS + 0x0001=!and!or + 0x0004=op-1-simple + 0x0008=op-2-simple + 0x0010=top-10 + 0x0020=!bottom!top + 0x0040=percent + 0xFF80=uint16,dec,top-10-count +end + +constlist=FILTERCOLUMN-DATATYPE + 0=none + 2=rk + 4=double + 6=string + 8=boolean + 12=blank + 14=not-blank +end + +shortlist=FILTERCOLUMN-OPERATOR,0,none,less,equal,less-equal,greater,not-equal,greater-equal + # FONT ----------------------------------------------------------------------- flagslist=FONT-FLAGS @@ -1997,7 +2022,7 @@ end flagslist=QUERYTABLESETTINGS-EXT-FLAGS 0x0001=text-query 0x0002=table-names -endif +end unitconverter=QUERYTABLESETTINGS-INTERVAL,60,sec shortlist=QUERYTABLESETTINGS-HTMLFORMAT,1,none,rtf,all diff --git a/oox/source/dump/xlsbdumper.cxx b/oox/source/dump/xlsbdumper.cxx index 79135ca1daeb..bee33566bba8 100644 --- a/oox/source/dump/xlsbdumper.cxx +++ b/oox/source/dump/xlsbdumper.cxx @@ -1010,6 +1010,10 @@ void RecordStreamObject::implDumpRecordBody() mxFmlaObj->dumpCellFormula(); break; + case BIFF12_ID_AUTOFILTER: + dumpRange( "filter-range" ); + break; + case BIFF12_ID_BINARYINDEXBLOCK: dumpRowRange( "row-range" ); dumpUnknown( 12 ); @@ -1243,6 +1247,20 @@ void RecordStreamObject::implDumpRecordBody() dumpString( "name" ); break; + case BIFF12_ID_CUSTOMFILTER: + { + sal_uInt8 nType = dumpDec< sal_uInt8 >( "data-type", "CUSTOMFILTER-DATATYPE" ); + dumpDec< sal_uInt8 >( "operator", "CUSTOMFILTER-OPERATOR" ); + switch( nType ) + { + case 4: dumpDec< double >( "value" ); break; + case 6: dumpUnused( 8 ); dumpString( "value" ); break; + case 8: dumpBoolean( "value" ); dumpUnused( 7 ); break; + default: dumpUnused( 8 ); + } + } + break; + case BIFF12_ID_DATATABLE: dumpRange( "table-range" ); dumpAddress( "ref1" ); @@ -1295,6 +1313,15 @@ void RecordStreamObject::implDumpRecordBody() dumpRange( "used-range" ); break; + case BIFF12_ID_DISCRETEFILTER: + dumpString( "value" ); + break; + + case BIFF12_ID_DISCRETEFILTERS: + dumpBool< sal_Int32 >( "show-blank" ); + dumpDec< sal_Int32 >( "calendar-type", "DISCRETEFILTERS-CALTYPE" ); + break; + case BIFF12_ID_DRAWING: dumpString( "rel-id" ); break; @@ -1508,6 +1535,11 @@ void RecordStreamObject::implDumpRecordBody() dumpString( "build-version" ); break; + case BIFF12_ID_FILTERCOLUMN: + dumpDec< sal_Int32 >( "column-index" ); + dumpHex< sal_uInt16 >( "flags", "FILTERCOLUMN-FLAGS" ); + break; + case BIFF12_ID_FONT: dumpDec< sal_uInt16 >( "height", "CONV-TWIP-TO-PT" ); dumpHex< sal_uInt16 >( "flags", "FONT-FLAGS" ); diff --git a/oox/source/dump/xlsbdumper.ini b/oox/source/dump/xlsbdumper.ini index 0624eebb3ffc..3490111c4ba5 100644 --- a/oox/source/dump/xlsbdumper.ini +++ b/oox/source/dump/xlsbdumper.ini @@ -174,8 +174,8 @@ multilist=RECORD-NAMES 0x0088=BOOKVIEWS_END,SHEETVIEW,SHEETVIEW_END,CHARTSHEETVIEWS,CHARTSHEETVIEWS_END,CHARTSHEETVIEW,CHARTSHEETVIEW_END,SHEETS 0x0090=SHEETS_END,SHEETDATA,SHEETDATA_END,SHEETPR,DIMENSION,,,PANE 0x0098=SELECTION,WORKBOOKPR,SMARTTAGPR,FILERECOVERYPR,SHEET,CALCPR,WORKBOOKVIEW,SST - 0x00A0=SST_END,AUTOFILTER,AUTOFILTER_END,FILTERCOLUMN,FILTERCOLUMN_END,FILTERS,FILTERS_END,FILTER - 0x00A8=COLORFILTER,ICONFILTER,TOP10FILTER,DYNAMICFILTER,CUSTOMFILTERS,CUSTOMFILTERS_END,CUSTOMFILTER,AUTOFILTERDATEGROUPITEM + 0x00A0=SST_END,AUTOFILTER,AUTOFILTER_END,FILTERCOLUMN,FILTERCOLUMN_END,DISCRETEFILTERS,DISCRETEFILTERS_END,DISCRETEFILTER + 0x00A8=COLORFILTER,ICONFILTER,TOP10FILTER,DYNAMICFILTER,CUSTOMFILTERS,CUSTOMFILTERS_END,CUSTOMFILTER,AFDATEGROUPITEM 0x00B0=MERGECELL,MERGECELLS,MERGECELLS_END,PCDEFINITION,PCDEFINITION_END,PCDFIELDS,PCDFIELDS_END,PCDFIELD 0x00B8=PCDFIELD_END,PCDSOURCE,PCDSOURCE_END,PCDSHEETSOURCE,PCDSHEETSOURCE_END,PCDFSHAREDITEMS,PCDFSHAREDITEMS_END,PCITEM_ARRAY 0x00C0=PCITEM_ARRAY_END,PCRECORDS,PCRECORDS_END,,,,, @@ -242,6 +242,7 @@ end constlist=SIMPLE-RECORDS 0x001A=int32,dec,item-index + 0x00AC=int32,dec,relation,CUSTOMFILTERS-RELATION 0x00B5=int32,dec,count 0x00C1=int32,dec,count 0x00DD=int32,dec,count @@ -405,6 +406,22 @@ flagslist=CONNECTION-STRINGFLAGS 0x0010=has-sso-id end +# CUSTOMFILTER --------------------------------------------------------------- + +constlist=CUSTOMFILTER-DATATYPE + 4=double + 6=string + 8=boolean + 12=blank + 14=not-blank +end + +shortlist=CUSTOMFILTER-OPERATOR,1,less,equal,less-equal,greater,not-equal,greater-equal + +# CUSTOMFILTERS -------------------------------------------------------------- + +shortlist=CUSTOMFILTERS-RELATION,0,and,or + # DATATABLE ------------------------------------------------------------------ flagslist=DATATABLE-FLAGS @@ -459,6 +476,10 @@ constlist=DEFINEDNAME-SHEETID -1=global end +# DISCRETEFILTERS -------------------------------------------------------------------- + +shortlist=DISCRETEFILTERS-CALTYPE,0,none,gregorian,gregorian-us,japan,taiwan,korea,hijri,thai,hebrew,gregorian-mideast-fr,gregorian-ar,gregorian-xlit-en,gregorian-xlit-fr + # DXF ------------------------------------------------------------------------ flagslist=DXF-FLAGS @@ -509,6 +530,13 @@ end shortlist=FILL-GRADIENTTYPE,0,linear,path +# FILTERCOLUMN --------------------------------------------------------------- + +flagslist=FILTERCOLUMN-FLAGS + 0x0001=hidden-button + 0x0002=show-button +end + # FONT ----------------------------------------------------------------------- flagslist=FONT-FLAGS diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index 369c5e5218db..dbbc9de4e0eb 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -90,6 +90,7 @@ ContainsHeader Coordinates CopyBack CopyFormulas +CopyOutputData CopyStyles CrossoverPosition CrossoverValue @@ -147,6 +148,7 @@ FillGradientName FillStyle FillTransparence Filter +FilterCriteriaSource FilterOptions FirstLineOffset FirstPageNumber @@ -212,6 +214,7 @@ InputMessage InputTitle IsActive IsAdjustHeightEnabled +IsCaseSensitive IsCellBackgroundTransparent IsChangeReadOnlyEnabled IsDate @@ -284,6 +287,7 @@ NumberingType Offset OpCodeMap Orientation +OutputPosition OverlapSequence PageScale PageStyle @@ -356,6 +360,7 @@ RotationHorizontal RotationVertical RowGrand RowLabelRanges +SaveOutputPosition ScaleMode ScaleToPages ScaleToPagesX @@ -388,6 +393,7 @@ ShowPositiveError ShowZeroValues ShrinkToFit Size +SkipDuplicates SortInfo Sound SoundOn @@ -447,6 +453,7 @@ TriState Type URL Url +UseFilterCriteriaSource UseRegularExpressions UseRings UseSelectedPage diff --git a/oox/source/xls/autofilterbuffer.cxx b/oox/source/xls/autofilterbuffer.cxx new file mode 100755 index 000000000000..15cb2f726327 --- /dev/null +++ b/oox/source/xls/autofilterbuffer.cxx @@ -0,0 +1,856 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "oox/xls/autofilterbuffer.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include "oox/core/namespaces.hxx" +#include "oox/helper/attributelist.hxx" +#include "oox/helper/propertyset.hxx" +#include "oox/helper/recordinputstream.hxx" +#include "oox/xls/addressconverter.hxx" +#include "oox/xls/biffinputstream.hxx" +#include "oox/xls/defnamesbuffer.hxx" +#include "properties.hxx" +#include "tokens.hxx" + +namespace oox { +namespace xls { + +using namespace ::com::sun::star::sheet; +using namespace ::com::sun::star::table; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +// ============================================================================ + +namespace { + +const sal_uInt8 BIFF12_TOP10FILTER_TOP = 0x01; +const sal_uInt8 BIFF12_TOP10FILTER_PERCENT = 0x02; + +const sal_uInt16 BIFF12_FILTERCOLUMN_HIDDENBUTTON = 0x0001; +const sal_uInt16 BIFF12_FILTERCOLUMN_SHOWBUTTON = 0x0002; + +const sal_uInt16 BIFF_FILTERCOLUMN_OR = 0x0001; +const sal_uInt16 BIFF_FILTERCOLUMN_TOP10FILTER = 0x0010; +const sal_uInt16 BIFF_FILTERCOLUMN_TOP = 0x0020; +const sal_uInt16 BIFF_FILTERCOLUMN_PERCENT = 0x0040; + +const sal_uInt8 BIFF_FILTER_DATATYPE_NONE = 0; +const sal_uInt8 BIFF_FILTER_DATATYPE_RK = 2; +const sal_uInt8 BIFF_FILTER_DATATYPE_DOUBLE = 4; +const sal_uInt8 BIFF_FILTER_DATATYPE_STRING = 6; +const sal_uInt8 BIFF_FILTER_DATATYPE_BOOLEAN = 8; +const sal_uInt8 BIFF_FILTER_DATATYPE_EMPTY = 12; +const sal_uInt8 BIFF_FILTER_DATATYPE_NOTEMPTY = 14; + +// ---------------------------------------------------------------------------- + +bool lclGetApiOperatorFromToken( sal_Int32& rnApiOperator, sal_Int32 nToken ) +{ + switch( nToken ) + { + case XML_lessThan: rnApiOperator = FilterOperator2::NOT_EQUAL; return true; + case XML_equal: rnApiOperator = FilterOperator2::EQUAL; return true; + case XML_lessThanOrEqual: rnApiOperator = FilterOperator2::LESS_EQUAL; return true; + case XML_greaterThan: rnApiOperator = FilterOperator2::GREATER; return true; + case XML_notEqual: rnApiOperator = FilterOperator2::NOT_EQUAL; return true; + case XML_greaterThanOrEqual: rnApiOperator = FilterOperator2::GREATER_EQUAL; return true; + } + return false; +} + +/** Removes leading asterisk characters from the passed string. + @return True = at least one asterisk character has been removed. */ +bool lclTrimLeadingAsterisks( OUString& rValue ) +{ + sal_Int32 nLength = rValue.getLength(); + sal_Int32 nPos = 0; + while( (nPos < nLength) && (rValue[ nPos ] == '*') ) + ++nPos; + if( nPos > 0 ) + { + rValue = rValue.copy( nPos ); + return true; + } + return false; +} + +/** Removes trailing asterisk characters from the passed string. + @return True = at least one asterisk character has been removed. */ +bool lclTrimTrailingAsterisks( OUString& rValue ) +{ + sal_Int32 nLength = rValue.getLength(); + sal_Int32 nPos = nLength; + while( (nPos > 0) && (rValue[ nPos - 1 ] == '*') ) + --nPos; + if( nPos < nLength ) + { + rValue = rValue.copy( 0, nPos ); + return true; + } + return false; +} + +/** Converts wildcard characters '*' and '?' to regular expressions and quotes + RE meta characters. + @return True = passed string has been changed (RE needs to be enabled). */ +bool lclConvertWildcardsToRegExp( OUString& rValue ) +{ + // check existence of the wildcard characters '*' and '?' + if( (rValue.getLength() > 0) && ((rValue.indexOf( '*' ) >= 0) || (rValue.indexOf( '?' ) >= 0)) ) + { + OUStringBuffer aBuffer; + aBuffer.ensureCapacity( rValue.getLength() + 5 ); + const sal_Unicode* pcChar = rValue.getStr(); + const sal_Unicode* pcEnd = pcChar + rValue.getLength(); + for( ; pcChar < pcEnd; ++pcChar ) + { + switch( *pcChar ) + { + case '?': + aBuffer.append( sal_Unicode( '.' ) ); + break; + case '*': + aBuffer.append( sal_Unicode( '.' ) ).append( sal_Unicode( '*' ) ); + break; + case '\\': case '.': case '|': case '(': case ')': case '^': case '$': + // quote RE meta characters + aBuffer.append( sal_Unicode( '\\' ) ).append( *pcChar ); + break; + default: + aBuffer.append( *pcChar ); + } + } + rValue = aBuffer.makeStringAndClear(); + return true; + } + return false; +} + +} // namespace + +// ============================================================================ + +ApiFilterSettings::ApiFilterSettings() +{ +} + +void ApiFilterSettings::appendField( bool bAnd, sal_Int32 nOperator, double fValue ) +{ + maFilterFields.resize( maFilterFields.size() + 1 ); + TableFilterField2& rFilterField = maFilterFields.back(); + rFilterField.Connection = bAnd ? FilterConnection_AND : FilterConnection_OR; + rFilterField.Operator = nOperator; + rFilterField.IsNumeric = sal_True; + rFilterField.NumericValue = fValue; +} + +void ApiFilterSettings::appendField( bool bAnd, sal_Int32 nOperator, const OUString& rValue ) +{ + maFilterFields.resize( maFilterFields.size() + 1 ); + TableFilterField2& rFilterField = maFilterFields.back(); + rFilterField.Connection = bAnd ? FilterConnection_AND : FilterConnection_OR; + rFilterField.Operator = nOperator; + rFilterField.IsNumeric = sal_False; + rFilterField.StringValue = rValue; +} + +// ============================================================================ + +FilterSettingsBase::FilterSettingsBase( const WorkbookHelper& rHelper ) : + WorkbookHelper( rHelper ) +{ +} + +void FilterSettingsBase::importAttribs( sal_Int32 /*nElement*/, const AttributeList& /*rAttribs*/ ) +{ +} + +void FilterSettingsBase::importRecord( sal_Int32 /*nRecId*/, RecordInputStream& /*rStrm*/ ) +{ +} + +void FilterSettingsBase::importBiffRecord( BiffInputStream& /*rStrm*/, sal_uInt16 /*nFlags*/ ) +{ +} + +ApiFilterSettings FilterSettingsBase::finalizeImport( sal_Int32 /*nMaxCount*/ ) +{ + return ApiFilterSettings(); +} + +// ============================================================================ + +DiscreteFilter::DiscreteFilter( const WorkbookHelper& rHelper ) : + FilterSettingsBase( rHelper ), + mnCalendarType( XML_none ), + mbShowBlank( false ) +{ +} + +void DiscreteFilter::importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( nElement ) + { + case XLS_TOKEN( filters ): + mnCalendarType = rAttribs.getToken( XML_calendarType, XML_none ); + mbShowBlank = rAttribs.getBool( XML_blank, false ); + break; + + case XLS_TOKEN( filter ): + { + OUString aValue = rAttribs.getXString( XML_val, OUString() ); + if( aValue.getLength() > 0 ) + maValues.push_back( aValue ); + } + break; + } +} + +void DiscreteFilter::importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +{ + switch( nRecId ) + { + case BIFF12_ID_DISCRETEFILTERS: + { + sal_Int32 nShowBlank, nCalendarType; + rStrm >> nShowBlank >> nCalendarType; + + static const sal_Int32 spnCalendarTypes[] = { + XML_none, XML_gregorian, XML_gregorianUs, XML_japan, XML_taiwan, XML_korea, XML_hijri, XML_thai, XML_hebrew, + XML_gregorianMeFrench, XML_gregorianArabic, XML_gregorianXlitEnglish, XML_gregorianXlitFrench }; + mnCalendarType = STATIC_ARRAY_SELECT( spnCalendarTypes, nCalendarType, XML_none ); + mbShowBlank = nShowBlank != 0; + } + break; + + case BIFF12_ID_DISCRETEFILTER: + { + OUString aValue = rStrm.readString(); + if( aValue.getLength() > 0 ) + maValues.push_back( aValue ); + } + break; + } +} + +ApiFilterSettings DiscreteFilter::finalizeImport( sal_Int32 nMaxCount ) +{ + ApiFilterSettings aSettings; + if( static_cast< sal_Int32 >( maValues.size() ) <= nMaxCount ) + { + aSettings.maFilterFields.reserve( maValues.size() ); + + // insert all filter values + for( FilterValueVector::iterator aIt = maValues.begin(), aEnd = maValues.end(); aIt != aEnd; ++aIt ) + aSettings.appendField( false, FilterOperator2::EQUAL, *aIt ); + + // extra field for 'show empty' + if( mbShowBlank ) + aSettings.appendField( false, FilterOperator2::EMPTY, OUString() ); + + /* Require disabled regular expressions, filter entries may contain + any RE meta characters. */ + if( !maValues.empty() ) + aSettings.mobNeedsRegExp = false; + } + return aSettings; +} + +// ============================================================================ + +Top10Filter::Top10Filter( const WorkbookHelper& rHelper ) : + FilterSettingsBase( rHelper ), + mfValue( 0.0 ), + mbTop( true ), + mbPercent( false ) +{ +} + +void Top10Filter::importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + if( nElement == XLS_TOKEN( top10 ) ) + { + mfValue = rAttribs.getDouble( XML_val, 0.0 ); + mbTop = rAttribs.getBool( XML_top, true ); + mbPercent = rAttribs.getBool( XML_percent, false ); + } +} + +void Top10Filter::importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +{ + if( nRecId == BIFF12_ID_TOP10FILTER ) + { + sal_uInt8 nFlags; + rStrm >> nFlags >> mfValue; + mbTop = getFlag( nFlags, BIFF12_TOP10FILTER_TOP ); + mbPercent = getFlag( nFlags, BIFF12_TOP10FILTER_PERCENT ); + } +} + +void Top10Filter::importBiffRecord( BiffInputStream& /*rStrm*/, sal_uInt16 nFlags ) +{ + mfValue = extractValue< sal_uInt16 >( nFlags, 7, 9 ); + mbTop = getFlag( nFlags, BIFF_FILTERCOLUMN_TOP ); + mbPercent = getFlag( nFlags, BIFF_FILTERCOLUMN_PERCENT ); +} + +ApiFilterSettings Top10Filter::finalizeImport( sal_Int32 /*nMaxCount*/ ) +{ + sal_Int32 nOperator = mbTop ? + (mbPercent ? FilterOperator2::TOP_PERCENT : FilterOperator2::TOP_VALUES) : + (mbPercent ? FilterOperator2::BOTTOM_PERCENT : FilterOperator2::BOTTOM_VALUES); + ApiFilterSettings aSettings; + aSettings.appendField( true, nOperator, mfValue ); + return aSettings; +} + +// ============================================================================ + +FilterCriterionModel::FilterCriterionModel() : + mnOperator( XML_equal ), + mnDataType( BIFF_FILTER_DATATYPE_NONE ), + mnStrLen( 0 ) +{ +} + +void FilterCriterionModel::setBiffOperator( sal_uInt8 nOperator ) +{ + static const sal_Int32 spnOperators[] = { XML_TOKEN_INVALID, + XML_lessThan, XML_equal, XML_lessThanOrEqual, XML_greaterThan, XML_notEqual, XML_greaterThanOrEqual }; + mnOperator = STATIC_ARRAY_SELECT( spnOperators, nOperator, XML_TOKEN_INVALID ); +} + +void FilterCriterionModel::readBiffData( RecordInputStream& rStrm ) +{ + sal_uInt8 nOperator; + rStrm >> mnDataType >> nOperator; + setBiffOperator( nOperator ); + + switch( mnDataType ) + { + case BIFF_FILTER_DATATYPE_DOUBLE: + maValue <<= rStrm.readDouble(); + break; + case BIFF_FILTER_DATATYPE_STRING: + { + rStrm.skip( 8 ); + OUString aValue = rStrm.readString().trim(); + if( aValue.getLength() > 0 ) + maValue <<= aValue; + } + break; + case BIFF_FILTER_DATATYPE_BOOLEAN: + maValue <<= (rStrm.readuInt8() != 0); + rStrm.skip( 7 ); + break; + case BIFF_FILTER_DATATYPE_EMPTY: + rStrm.skip( 8 ); + if( mnOperator == XML_equal ) + maValue <<= OUString(); + break; + case BIFF_FILTER_DATATYPE_NOTEMPTY: + rStrm.skip( 8 ); + if( mnOperator == XML_notEqual ) + maValue <<= OUString(); + break; + default: + OSL_ENSURE( false, "FilterCriterionModel::readBiffData - unexpected data type" ); + rStrm.skip( 8 ); + } +} + +void FilterCriterionModel::readBiffData( BiffInputStream& rStrm ) +{ + sal_uInt8 nOperator; + rStrm >> mnDataType >> nOperator; + setBiffOperator( nOperator ); + + switch( mnDataType ) + { + case BIFF_FILTER_DATATYPE_NONE: + rStrm.skip( 8 ); + break; + case BIFF_FILTER_DATATYPE_RK: + maValue <<= BiffHelper::calcDoubleFromRk( rStrm.readInt32() ); + rStrm.skip( 4 ); + break; + case BIFF_FILTER_DATATYPE_DOUBLE: + maValue <<= rStrm.readDouble(); + break; + case BIFF_FILTER_DATATYPE_STRING: + rStrm.skip( 4 ); + rStrm >> mnStrLen; + rStrm.skip( 3 ); + break; + case BIFF_FILTER_DATATYPE_BOOLEAN: + { + sal_uInt8 nValue, nType; + rStrm >> nValue >> nType; + rStrm.skip( 6 ); + switch( nType ) + { + case BIFF_BOOLERR_BOOL: maValue <<= (nValue != 0); break; + case BIFF_BOOLERR_ERROR: maValue <<= BiffHelper::calcDoubleFromError( nValue ); break; + default: OSL_ENSURE( false, "FilterCriterionModel::readBiffData - unknown type" ); + } + } + break; + case BIFF_FILTER_DATATYPE_EMPTY: + rStrm.skip( 8 ); + if( mnOperator == XML_equal ) + maValue <<= OUString(); + break; + case BIFF_FILTER_DATATYPE_NOTEMPTY: + rStrm.skip( 8 ); + if( mnOperator == XML_notEqual ) + maValue <<= OUString(); + break; + default: + OSL_ENSURE( false, "FilterCriterionModel::readBiffData - unexpected data type" ); + rStrm.skip( 8 ); + } +} + +void FilterCriterionModel::readString( BiffInputStream& rStrm, BiffType eBiff, rtl_TextEncoding eTextEnc ) +{ + if( (mnDataType == BIFF_FILTER_DATATYPE_STRING) && (mnStrLen > 0) ) + { + OUString aValue = (eBiff == BIFF8) ? + rStrm.readUniStringBody( mnStrLen, true ) : + rStrm.readCharArrayUC( mnStrLen, eTextEnc, true ); + aValue = aValue.trim(); + if( aValue.getLength() > 0 ) + maValue <<= aValue; + } +} + +// ---------------------------------------------------------------------------- + +CustomFilter::CustomFilter( const WorkbookHelper& rHelper ) : + FilterSettingsBase( rHelper ), + mbAnd( false ) +{ +} + +void CustomFilter::importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( nElement ) + { + case XLS_TOKEN( customFilters ): + mbAnd = rAttribs.getBool( XML_and, false ); + break; + + case XLS_TOKEN( customFilter ): + { + FilterCriterionModel aCriterion; + aCriterion.mnOperator = rAttribs.getToken( XML_operator, XML_equal ); + OUString aValue = rAttribs.getXString( XML_val, OUString() ).trim(); + if( (aCriterion.mnOperator == XML_equal) || (aCriterion.mnOperator == XML_notEqual) || (aValue.getLength() > 0) ) + aCriterion.maValue <<= aValue; + appendCriterion( aCriterion ); + } + break; + } +} + +void CustomFilter::importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +{ + switch( nRecId ) + { + case BIFF12_ID_CUSTOMFILTERS: + mbAnd = rStrm.readInt32() == 0; + break; + + case BIFF12_ID_CUSTOMFILTER: + { + FilterCriterionModel aCriterion; + aCriterion.readBiffData( rStrm ); + appendCriterion( aCriterion ); + } + break; + } +} + +void CustomFilter::importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ) +{ + mbAnd = !getFlag( nFlags, BIFF_FILTERCOLUMN_OR ); + + FilterCriterionModel aCriterion1, aCriterion2; + aCriterion1.readBiffData( rStrm ); + aCriterion2.readBiffData( rStrm ); + aCriterion1.readString( rStrm, getBiff(), getTextEncoding() ); + aCriterion2.readString( rStrm, getBiff(), getTextEncoding() ); + appendCriterion( aCriterion1 ); + appendCriterion( aCriterion2 ); +} + +ApiFilterSettings CustomFilter::finalizeImport( sal_Int32 /*nMaxCount*/ ) +{ + ApiFilterSettings aSettings; + OSL_ENSURE( maCriteria.size() <= 2, "CustomFilter::finalizeImport - too many filter criteria" ); + for( FilterCriterionVector::iterator aIt = maCriteria.begin(), aEnd = maCriteria.end(); aIt != aEnd; ++aIt ) + { + // first extract the filter operator + sal_Int32 nOperator = 0; + bool bValidOperator = lclGetApiOperatorFromToken( nOperator, aIt->mnOperator ); + if( bValidOperator ) + { + if( aIt->maValue.has< OUString >() ) + { + // string argument + OUString aValue; + aIt->maValue >>= aValue; + // check for 'empty', 'contains', 'begins with', or 'ends with' text filters + bool bEqual = nOperator == FilterOperator2::EQUAL; + bool bNotEqual = nOperator == FilterOperator2::NOT_EQUAL; + if( bEqual || bNotEqual ) + { + if( aValue.getLength() == 0 ) + { + // empty comparison string: create empty/not empty filters + nOperator = bNotEqual ? FilterOperator2::NOT_EMPTY : FilterOperator2::EMPTY; + } + else + { + // compare to something: try to find begins/ends/contains + bool bHasLeadingAsterisk = lclTrimLeadingAsterisks( aValue ); + bool bHasTrailingAsterisk = lclTrimTrailingAsterisks( aValue ); + // just '***' matches everything, do not create a filter field + bValidOperator = aValue.getLength() > 0; + if( bValidOperator ) + { + if( bHasLeadingAsterisk && bHasTrailingAsterisk ) + nOperator = bNotEqual ? FilterOperator2::DOES_NOT_CONTAIN : FilterOperator2::CONTAINS; + else if( bHasLeadingAsterisk ) + nOperator = bNotEqual ? FilterOperator2::DOES_NOT_END_WITH : FilterOperator2::ENDS_WITH; + else if( bHasTrailingAsterisk ) + nOperator = bNotEqual ? FilterOperator2::DOES_NOT_BEGIN_WITH : FilterOperator2::BEGINS_WITH; + // else: no asterisks, stick to equal/not equal + } + } + } + + if( bValidOperator ) + { + // if wildcards are present, require RE mode, otherwise keep don't care state + if( lclConvertWildcardsToRegExp( aValue ) ) + aSettings.mobNeedsRegExp = true; + // create a new UNO API filter field + aSettings.appendField( mbAnd, nOperator, aValue ); + } + } + else if( aIt->maValue.has< double >() ) + { + // floating-point argument + double fValue; + aIt->maValue >>= fValue; + aSettings.appendField( mbAnd, nOperator, fValue ); + } + } + } + return aSettings; +} + +void CustomFilter::appendCriterion( const FilterCriterionModel& rCriterion ) +{ + if( (rCriterion.mnOperator != XML_TOKEN_INVALID) && rCriterion.maValue.hasValue() ) + maCriteria.push_back( rCriterion ); +} + +// ============================================================================ + +FilterColumn::FilterColumn( const WorkbookHelper& rHelper ) : + WorkbookHelper( rHelper ), + mnColId( -1 ), + mbHiddenButton( false ), + mbShowButton( true ) +{ +} + +void FilterColumn::importFilterColumn( const AttributeList& rAttribs ) +{ + mnColId = rAttribs.getInteger( XML_colId, -1 ); + mbHiddenButton = rAttribs.getBool( XML_hiddenButton, false ); + mbShowButton = rAttribs.getBool( XML_showButton, true ); +} + +void FilterColumn::importFilterColumn( RecordInputStream& rStrm ) +{ + sal_uInt16 nFlags; + rStrm >> mnColId >> nFlags; + mbHiddenButton = getFlag( nFlags, BIFF12_FILTERCOLUMN_HIDDENBUTTON ); + mbShowButton = getFlag( nFlags, BIFF12_FILTERCOLUMN_SHOWBUTTON ); +} + +void FilterColumn::importFilterColumn( BiffInputStream& rStrm ) +{ + sal_uInt16 nFlags; + mnColId = rStrm.readuInt16(); + rStrm >> nFlags; + + // BIFF5/BIFF8 support top-10 filters and custom filters + if( getFlag( nFlags, BIFF_FILTERCOLUMN_TOP10FILTER ) ) + createFilterSettings< Top10Filter >().importBiffRecord( rStrm, nFlags ); + else + createFilterSettings< CustomFilter >().importBiffRecord( rStrm, nFlags ); +} + +ApiFilterSettings FilterColumn::finalizeImport( sal_Int32 nMaxCount ) +{ + ApiFilterSettings aSettings; + if( (0 <= mnColId) && mxSettings.get() ) + { + // filter settings object creates a sequence of filter fields + aSettings = mxSettings->finalizeImport( nMaxCount ); + // add column index to all filter fields + for( ApiFilterSettings::FilterFieldVector::iterator aIt = aSettings.maFilterFields.begin(), aEnd = aSettings.maFilterFields.end(); aIt != aEnd; ++aIt ) + aIt->Field = mnColId; + } + return aSettings; +} + +// ============================================================================ + +AutoFilter::AutoFilter( const WorkbookHelper& rHelper ) : + WorkbookHelper( rHelper ) +{ +} + +void AutoFilter::importAutoFilter( const AttributeList& rAttribs, sal_Int16 nSheet ) +{ + OUString aRangeStr = rAttribs.getString( XML_ref, OUString() ); + getAddressConverter().convertToCellRangeUnchecked( maRange, aRangeStr, nSheet ); +} + +void AutoFilter::importAutoFilter( RecordInputStream& rStrm, sal_Int16 nSheet ) +{ + BinRange aBinRange; + rStrm >> aBinRange; + getAddressConverter().convertToCellRangeUnchecked( maRange, aBinRange, nSheet ); +} + +FilterColumn& AutoFilter::createFilterColumn() +{ + FilterColumnVector::value_type xFilterColumn( new FilterColumn( *this ) ); + maFilterColumns.push_back( xFilterColumn ); + return *xFilterColumn; +} + +void AutoFilter::finalizeImport( const Reference< XSheetFilterDescriptor2 >& rxFilterDesc ) +{ + if( rxFilterDesc.is() ) + { + // set some common properties for the auto filter range + PropertySet aDescProps( rxFilterDesc ); + aDescProps.setProperty( PROP_IsCaseSensitive, false ); + aDescProps.setProperty( PROP_SkipDuplicates, false ); + aDescProps.setProperty( PROP_Orientation, TableOrientation_ROWS ); + aDescProps.setProperty( PROP_ContainsHeader, true ); + aDescProps.setProperty( PROP_CopyOutputData, false ); + + // maximum number of UNO API filter fields + sal_Int32 nMaxCount = 0; + aDescProps.getProperty( nMaxCount, PROP_MaxFieldCount ); + OSL_ENSURE( nMaxCount > 0, "AutoFilter::finalizeImport - invalid maximum filter field count" ); + + // resulting list of all UNO API filter fields + ::std::vector< TableFilterField2 > aFilterFields; + + // track if columns require to enable or disable regular expressions + OptValue< bool > obNeedsRegExp; + + /* Track whether the filter fields of the first filter column are + connected with 'or'. In this case, other filter fields cannot be + inserted without altering the result of the entire filter, due to + Calc's precedence for the 'and' connection operator. Example: + Excel's filter conditions 'A1 and (B1 or B2) and C1' where B1 and + B2 belong to filter column B, will be evaluated by Calc as + '(A1 and B1) or (B2 and C1)'. */ + bool bHasOrConnection = false; + + // process all filter column objects, exit when 'or' connection exists + for( FilterColumnVector::iterator aIt = maFilterColumns.begin(), aEnd = maFilterColumns.end(); !bHasOrConnection && (aIt != aEnd); ++aIt ) + { + // the filter settings object creates a list of filter fields + ApiFilterSettings aSettings = (*aIt)->finalizeImport( nMaxCount ); + ApiFilterSettings::FilterFieldVector& rColumnFields = aSettings.maFilterFields; + + // new total number of filter fields + sal_Int32 nNewCount = static_cast< sal_Int32 >( aFilterFields.size() + rColumnFields.size() ); + + /* Check whether mode for regular expressions is compatible with + the global mode in obNeedsRegExp. If either one is still in + don't-care state, all is fine. If both are set, they must be + equal. */ + bool bRegExpCompatible = !obNeedsRegExp || !aSettings.mobNeedsRegExp || (obNeedsRegExp.get() == aSettings.mobNeedsRegExp.get()); + + // check whether fields are connected by 'or' (see comments above). + if( rColumnFields.size() >= 2 ) + for( ApiFilterSettings::FilterFieldVector::iterator aSIt = rColumnFields.begin() + 1, aSEnd = rColumnFields.end(); !bHasOrConnection && (aSIt != aSEnd); ++aSIt ) + bHasOrConnection = aSIt->Connection == FilterConnection_OR; + + /* Skip the column filter, if no filter fields have been created, + if the number of new filter fields would exceed the total limit + of filter fields, or if the mode for regular expressions of the + filter column does not fit. */ + if( !rColumnFields.empty() && (nNewCount <= nMaxCount) && bRegExpCompatible ) + { + /* Add 'and' connection to the first filter field to connect + it to the existing filter fields of other columns. */ + rColumnFields[ 0 ].Connection = FilterConnection_AND; + + // insert the new filter fields + aFilterFields.insert( aFilterFields.end(), rColumnFields.begin(), rColumnFields.end() ); + + // update the regular expressions mode + obNeedsRegExp.assignIfUsed( aSettings.mobNeedsRegExp ); + } + } + + // insert all filter fields to the filter descriptor + if( !aFilterFields.empty() ) + rxFilterDesc->setFilterFields2( ContainerHelper::vectorToSequence( aFilterFields ) ); + + // regular expressions + bool bUseRegExp = obNeedsRegExp.get( false ); + aDescProps.setProperty( PROP_UseRegularExpressions, bUseRegExp ); + } +} + +// ============================================================================ + +AutoFilterBuffer::AutoFilterBuffer( const WorkbookHelper& rHelper ) : + WorkbookHelper( rHelper ) +{ +} + +AutoFilter& AutoFilterBuffer::createAutoFilter() +{ + AutoFilterVector::value_type xAutoFilter( new AutoFilter( *this ) ); + maAutoFilters.push_back( xAutoFilter ); + return *xAutoFilter; +} + +void AutoFilterBuffer::finalizeImport( sal_Int16 nSheet ) +{ + // rely on existence of the defined name '_FilterDatabase' containing the range address of the filtered area + if( const DefinedName* pFilterDBName = getDefinedNames().getByBuiltinId( BIFF_DEFNAME_FILTERDATABASE, nSheet ).get() ) + { + CellRangeAddress aFilterRange; + if( pFilterDBName->getAbsoluteRange( aFilterRange ) && (aFilterRange.Sheet == nSheet) ) + { + // use the same name for the database range as used for the defined name '_FilterDatabase' + OUString aDBRangeName = pFilterDBName->getCalcName(); + Reference< XDatabaseRange > xDatabaseRange = createDatabaseRangeObject( aDBRangeName, aFilterRange ); + // first, try to create an auto filter + bool bHasAutoFilter = finalizeImport( xDatabaseRange ); + // no success: try to create an advanced filter + if( !bHasAutoFilter && xDatabaseRange.is() ) + { + // the built-in defined name 'Criteria' must exist + if( const DefinedName* pCriteriaName = getDefinedNames().getByBuiltinId( BIFF_DEFNAME_CRITERIA, nSheet ).get() ) + { + CellRangeAddress aCriteriaRange; + if( pCriteriaName->getAbsoluteRange( aCriteriaRange ) ) + { + // set some common properties for the filter descriptor + PropertySet aDescProps( xDatabaseRange->getFilterDescriptor() ); + aDescProps.setProperty( PROP_IsCaseSensitive, false ); + aDescProps.setProperty( PROP_SkipDuplicates, false ); + aDescProps.setProperty( PROP_Orientation, TableOrientation_ROWS ); + aDescProps.setProperty( PROP_ContainsHeader, true ); + // criteria range may contain wildcards, but these are incompatible with REs + aDescProps.setProperty( PROP_UseRegularExpressions, false ); + + // position of output data (if built-in defined name 'Extract' exists) + DefinedNameRef xExtractName = getDefinedNames().getByBuiltinId( BIFF_DEFNAME_EXTRACT, nSheet ); + CellRangeAddress aOutputRange; + bool bHasOutputRange = xExtractName.get() && xExtractName->getAbsoluteRange( aOutputRange ); + aDescProps.setProperty( PROP_CopyOutputData, bHasOutputRange ); + if( bHasOutputRange ) + { + aDescProps.setProperty( PROP_SaveOutputPosition, true ); + aDescProps.setProperty( PROP_OutputPosition, CellAddress( aOutputRange.Sheet, aOutputRange.StartColumn, aOutputRange.StartRow ) ); + } + + /* Properties of the database range (must be set after + modifying properties of the filter descriptor, + otherwise the 'FilterCriteriaSource' property gets + deleted). */ + PropertySet aRangeProps( xDatabaseRange ); + aRangeProps.setProperty( PROP_AutoFilter, false ); + aRangeProps.setProperty( PROP_FilterCriteriaSource, aCriteriaRange ); + } + } + } + } + } +} + +bool AutoFilterBuffer::finalizeImport( const Reference< XDatabaseRange >& rxDatabaseRange ) +{ + AutoFilter* pAutoFilter = getActiveAutoFilter(); + if( pAutoFilter && rxDatabaseRange.is() ) try + { + // the property 'AutoFilter' enables the drop-down buttons + PropertySet aRangeProps( rxDatabaseRange ); + aRangeProps.setProperty( PROP_AutoFilter, true ); + // convert filter settings using the filter descriptor of the database range + Reference< XSheetFilterDescriptor2 > xFilterDesc( rxDatabaseRange->getFilterDescriptor(), UNO_QUERY_THROW ); + pAutoFilter->finalizeImport( xFilterDesc ); + // return true to indicate enabled autofilter + return true; + } + catch( Exception& ) + { + } + return false; +} + +AutoFilter* AutoFilterBuffer::getActiveAutoFilter() +{ + // Excel expects not more than one auto filter per sheet or table + OSL_ENSURE( maAutoFilters.size() == 1, "AutoFilterBuffer::getActiveAutoFilter - too many auto filters" ); + // stick to the last imported auto filter + return maAutoFilters.empty() ? 0 : maAutoFilters.back().get(); +} + +// ============================================================================ + +} // namespace xls +} // namespace oox diff --git a/oox/source/xls/autofiltercontext.cxx b/oox/source/xls/autofiltercontext.cxx index 87514d7804c5..d88e7026b80f 100644 --- a/oox/source/xls/autofiltercontext.cxx +++ b/oox/source/xls/autofiltercontext.cxx @@ -27,745 +27,156 @@ #include "oox/xls/autofiltercontext.hxx" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "oox/core/filterbase.hxx" -#include "oox/helper/attributelist.hxx" -#include "oox/helper/propertyset.hxx" -#include "oox/xls/addressconverter.hxx" -#include "properties.hxx" - -#define DEBUG_OOX_AUTOFILTER 0 - -#if USE_SC_MULTI_STRING_FILTER_PATCH -#include -#include -#include -using ::com::sun::star::sheet::TableFilterFieldNormal; -using ::com::sun::star::sheet::TableFilterFieldMultiString; -using ::com::sun::star::sheet::XExtendedSheetFilterDescriptor; -#else -#include -using ::com::sun::star::sheet::TableFilterField; -#endif - -#if DEBUG_OOX_AUTOFILTER -#include -#endif - -using ::rtl::OUString; -using ::rtl::OUStringBuffer; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::container::XNameAccess; -using ::com::sun::star::container::XNamed; -using ::com::sun::star::table::CellRangeAddress; -using ::com::sun::star::table::XCellRange; -using ::com::sun::star::sheet::XDatabaseRange; -using ::com::sun::star::sheet::XDatabaseRanges; -using ::com::sun::star::sheet::XSheetFilterDescriptor; -using ::com::sun::star::i18n::LocaleDataItem; -using ::com::sun::star::i18n::XLocaleData; -using ::com::sun::star::lang::Locale; -using ::oox::core::ContextHandlerRef; +#include "oox/xls/autofilterbuffer.hxx" +#include "oox/xls/biffinputstream.hxx" namespace oox { namespace xls { -// ============================================================================ - -FilterFieldItem::FilterFieldItem() : -#if USE_SC_MULTI_STRING_FILTER_PATCH - mpField(new TableFilterFieldNormal), -#else - mpField(new TableFilterField), -#endif - meType(NORMAL) -{ -} - -FilterFieldItem::FilterFieldItem(Type eType) : - meType(eType) -{ -#if USE_SC_MULTI_STRING_FILTER_PATCH - switch ( eType ) - { - case MULTI_STRING: - mpField.reset(new TableFilterFieldMultiString); - break; - case NORMAL: - mpField.reset(new TableFilterFieldNormal); - break; - default: - mpField.reset(new TableFilterFieldNormal); - } -#else - mpField.reset(new TableFilterField); - meType = NORMAL; -#endif -} +using ::oox::core::ContextHandlerRef; +using ::rtl::OUString; // ============================================================================ -AutoFilterContext::AutoFilterContext( WorksheetFragmentBase& rFragment ) : - WorksheetContextBase( rFragment ), - mbValidAddress( false ), - mbUseRegex( false ), - mbShowBlank( false ), - mbConnectionAnd( false ) +FilterSettingsContext::FilterSettingsContext( WorksheetContextBase& rParent, FilterSettingsBase& rFilterSettings ) : + WorksheetContextBase( rParent ), + mrFilterSettings( rFilterSettings ) { } -ContextHandlerRef AutoFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& ) +ContextHandlerRef FilterSettingsContext::onCreateContext( sal_Int32 nElement, const AttributeList& /*rAttribs*/ ) { switch( getCurrentElement() ) { - case XLS_TOKEN( autoFilter ): - switch( nElement ) - { - case XLS_TOKEN( filterColumn ): return this; - } - break; - - case XLS_TOKEN( filterColumn ): - switch( nElement ) - { - case XLS_TOKEN( filters ): - case XLS_TOKEN( customFilters ): - case XLS_TOKEN( top10 ): - case XLS_TOKEN( dynamicFilter ): return this; - } - break; - case XLS_TOKEN( filters ): - switch( nElement ) - { - case XLS_TOKEN( filter ): return this; - } + if( nElement == XLS_TOKEN( filter ) ) return this; break; - case XLS_TOKEN( customFilters ): - switch( nElement ) - { - case XLS_TOKEN( customFilter ): return this; - } + if( nElement == XLS_TOKEN( customFilter ) ) return this; break; } return 0; } -void AutoFilterContext::onStartElement( const AttributeList& rAttribs ) +void FilterSettingsContext::onStartElement( const AttributeList& rAttribs ) { - switch( getCurrentElement() ) - { - case XLS_TOKEN( autoFilter ): - importAutoFilter( rAttribs ); - break; - case XLS_TOKEN( filterColumn ): - if ( mbValidAddress ) - importFilterColumn( rAttribs ); - break; - case XLS_TOKEN( filters ): - if ( mbValidAddress ) - importFilters( rAttribs ); - break; - case XLS_TOKEN( filter ): - if ( mbValidAddress ) - importFilter( rAttribs ); - break; - case XLS_TOKEN( customFilters ): - if ( mbValidAddress ) - importCustomFilters( rAttribs ); - break; - case XLS_TOKEN( customFilter ): - if ( mbValidAddress ) - importCustomFilter( rAttribs ); - break; - case XLS_TOKEN( top10 ): - if ( mbValidAddress ) - importTop10( rAttribs ); - break; - case XLS_TOKEN( dynamicFilter ): - if ( mbValidAddress ) - importDynamicFilter( rAttribs ); - break; - } + mrFilterSettings.importAttribs( getCurrentElement(), rAttribs ); } -void AutoFilterContext::onEndElement() +ContextHandlerRef FilterSettingsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& /*rStrm*/ ) { switch( getCurrentElement() ) { - case XLS_TOKEN( autoFilter ): - maybeShowBlank(); - setAutoFilter(); + case BIFF12_ID_DISCRETEFILTERS: + if( nRecId == BIFF12_ID_DISCRETEFILTER ) return this; break; - case XLS_TOKEN( filters ): - setFilterNames(); + case BIFF12_ID_CUSTOMFILTERS: + if( nRecId == BIFF12_ID_CUSTOMFILTER ) return this; break; } + return 0; } -#if DEBUG_OOX_AUTOFILTER -static void lclPrintNormalField( -#if USE_SC_MULTI_STRING_FILTER_PATCH - TableFilterFieldNormal* pField -#else - TableFilterField* pField -#endif -) +void FilterSettingsContext::onStartRecord( RecordInputStream& rStrm ) { - using namespace ::com::sun::star::sheet; - - printf(" Operator: "); - switch ( pField->Operator ) - { - case FilterOperator_EQUAL: - printf("EQUAL"); - break; - case FilterOperator_NOT_EQUAL: - printf("NOT_EQUAL"); - break; - case com::sun::star::sheet::FilterOperator_GREATER: - printf("GREATER"); - break; - case com::sun::star::sheet::FilterOperator_GREATER_EQUAL: - printf("GREATER_EQUAL"); - break; - case FilterOperator_LESS: - printf("LESS"); - break; - case FilterOperator_LESS_EQUAL: - printf("LESS_EQUAL"); - break; - case FilterOperator_NOT_EMPTY: - printf("NOT_EMPTY"); - break; - case FilterOperator_EMPTY: - printf("EMPTY"); - break; - case FilterOperator_BOTTOM_PERCENT: - printf("BOTTOM_PERCENT"); - break; - case FilterOperator_BOTTOM_VALUES: - printf("BOTTOM_VALUES"); - break; - case FilterOperator_TOP_PERCENT: - printf("TOP_PERCENT"); - break; - case FilterOperator_TOP_VALUES: - printf("TOP_VALUES"); - break; - default: - printf("other"); - } - printf("\n"); - - printf(" StringValue: %s\n", - OUStringToOString(pField->StringValue, RTL_TEXTENCODING_UTF8).getStr()); - - printf(" NumericValue: %g\n", pField->NumericValue); - - printf(" IsNumeric: "); - if (pField->IsNumeric) - printf("yes\n"); - else - printf("no\n"); + mrFilterSettings.importRecord( getCurrentElement(), rStrm ); } -static void lclPrintFieldConnection( ::com::sun::star::sheet::FilterConnection eConn ) -{ - using namespace ::com::sun::star::sheet; +// ============================================================================ - printf(" Connection: "); - switch ( eConn ) - { - case FilterConnection_AND: - printf("AND"); - break; - case FilterConnection_OR: - printf("OR"); - break; - case FilterConnection_MAKE_FIXED_SIZE: - printf("MAKE_FIXED_SIZE"); - break; - default: - printf("other"); - } - printf("\n"); +FilterColumnContext::FilterColumnContext( WorksheetContextBase& rParent, FilterColumn& rFilterColumn ) : + WorksheetContextBase( rParent ), + mrFilterColumn( rFilterColumn ) +{ } -static void lclPrintFilterField( const FilterFieldItem& aItem ) +ContextHandlerRef FilterColumnContext::onCreateContext( sal_Int32 nElement, const AttributeList& /*rAttribs*/ ) { - using namespace ::com::sun::star::sheet; - - printf("----------------------------------------\n"); -#if USE_SC_MULTI_STRING_FILTER_PATCH - { - // Print common fields first. - - TableFilterFieldBase* pField = aItem.mpField.get(); - printf(" Field: %ld\n", pField->Field); - lclPrintFieldConnection(pField->Connection); - } - switch ( aItem.meType ) + if( getCurrentElement() == XLS_TOKEN( filterColumn ) ) switch( nElement ) { - case FilterFieldItem::NORMAL: - { - TableFilterFieldNormal* pField = static_cast(aItem.mpField.get()); - lclPrintNormalField(pField); - } - break; - case FilterFieldItem::MULTI_STRING: - { - TableFilterFieldMultiString* pMultiStrField = static_cast(aItem.mpField.get()); - sal_Int32 nSize = pMultiStrField->StringSet.getLength(); - printf(" StringSet:\n"); - for ( sal_Int32 i = 0; i < nSize; ++i ) - { - printf(" * %s\n", - OUStringToOString(pMultiStrField->StringSet[i], RTL_TEXTENCODING_UTF8).getStr()); - } - } - break; + case XLS_TOKEN( filters ): + return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< DiscreteFilter >() ); + case XLS_TOKEN( top10 ): + return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< Top10Filter >() ); + case XLS_TOKEN( customFilters ): + return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< CustomFilter >() ); } -#else - TableFilterField* pField = aItem.mpField.get(); - printf(" Field: %ld\n", pField->Field); - lclPrintFieldConnection(pField->Connection); - lclPrintNormalField(pField); - -#endif - fflush(stdout); + return 0; } -#endif -void AutoFilterContext::initialize() +void FilterColumnContext::onStartElement( const AttributeList& rAttribs ) { - maFields.clear(); - maFilterNames.clear(); - mbValidAddress = mbShowBlank = mbUseRegex = mbConnectionAnd = false; + mrFilterColumn.importFilterColumn( rAttribs ); } -void AutoFilterContext::setAutoFilter() +ContextHandlerRef FilterColumnContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& /*rStrm*/ ) { - using namespace ::com::sun::star::sheet; - - // Name this built-in database. - OUStringBuffer sDataAreaNameBuf( CREATE_OUSTRING("Excel_BuiltIn__FilterDatabase_ ") ); - sDataAreaNameBuf.append( static_cast(getSheetIndex()+1) ); - - OUString sDataAreaName = sDataAreaNameBuf.makeStringAndClear(); - Reference< XCellRange > xCellRange = getCellRange( maAutoFilterRange ); - - // Create a new database range, add filters to it and refresh the database - // for that to take effect. - - PropertySet aDocProps( getDocument() ); - Reference< XDatabaseRanges > xDBRanges( aDocProps.getAnyProperty( PROP_DatabaseRanges ), UNO_QUERY ); - OSL_ENSURE( xDBRanges.is(), "AutoFilterContext::setAutoFilter: DBRange empty" ); - if ( !xDBRanges.is() ) - return; - - Reference< XNameAccess > xNA( xDBRanges, UNO_QUERY_THROW ); - if ( !xNA->hasByName( sDataAreaName ) ) - xDBRanges->addNewByName( sDataAreaName, maAutoFilterRange ); - - Reference< XDatabaseRange > xDB( xNA->getByName( sDataAreaName ), UNO_QUERY ); - if ( xDB.is() ) - { - PropertySet aProp( xDB ); - aProp.setProperty( PROP_AutoFilter, true ); - } - - sal_Int32 nSize = maFields.size(); - sal_Int32 nMaxFieldCount = nSize; - Reference< XSheetFilterDescriptor > xDescriptor = xDB->getFilterDescriptor(); - if ( xDescriptor.is() ) - { - PropertySet aProp( xDescriptor ); - aProp.setProperty( PROP_ContainsHeader, true ); - aProp.setProperty( PROP_UseRegularExpressions, mbUseRegex ); - aProp.getProperty( nMaxFieldCount, PROP_MaxFieldCount ); - } - else - { - OSL_ENSURE(false, "AutoFilterContext::setAutoFilter: descriptor is empty"); - return; - } - - // Unpack all column field items into a sequence. -#if USE_SC_MULTI_STRING_FILTER_PATCH - Reference< XExtendedSheetFilterDescriptor > xExtDescriptor( xDescriptor, UNO_QUERY ); - if ( !xExtDescriptor.is() ) - { - OSL_ENSURE(false, "AutoFilterContext::setAutoFilter: extended descriptor is empty"); - return; - } - - xExtDescriptor->begin(); - - ::std::list< FilterFieldItem >::const_iterator itr = maFields.begin(), itrEnd = maFields.end(); - for (sal_Int32 i = 0; itr != itrEnd && i < nMaxFieldCount; ++itr, ++i) + if( getCurrentElement() == BIFF12_ID_FILTERCOLUMN ) switch( nRecId ) { -#if DEBUG_OOX_AUTOFILTER - lclPrintFilterField(*itr); -#endif - switch ( itr->meType ) - { - case oox::xls::FilterFieldItem::MULTI_STRING: - { - // multi-string filter type - TableFilterFieldMultiString* pField = static_cast( itr->mpField.get() ); - xExtDescriptor->addFilterFieldMultiString( *pField ); - } - break; - case oox::xls::FilterFieldItem::NORMAL: - default: - // normal filter type - TableFilterFieldNormal* pField = static_cast( itr->mpField.get() ); - xExtDescriptor->addFilterFieldNormal( *pField ); - } + case BIFF12_ID_DISCRETEFILTERS: + return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< DiscreteFilter >() ); + case BIFF12_ID_TOP10FILTER: + return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< Top10Filter >() ); + case BIFF12_ID_CUSTOMFILTERS: + return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< CustomFilter >() ); } - xExtDescriptor->commit(); - -#else - Sequence< TableFilterField > aFields(nSize); - ::std::list< FilterFieldItem >::const_iterator itr = maFields.begin(), itrEnd = maFields.end(); - for (sal_Int32 i = 0; itr != itrEnd && i < nMaxFieldCount; ++itr, ++i) - { -#if DEBUG_OOX_AUTOFILTER - lclPrintFilterField( *itr ); -#endif - aFields[i] = *itr->mpField; - } - xDescriptor->setFilterFields( aFields ); -#endif - xDB->refresh(); + return 0; } -void AutoFilterContext::maybeShowBlank() +void FilterColumnContext::onStartRecord( RecordInputStream& rStrm ) { - using namespace ::com::sun::star::sheet; - - if ( !mbShowBlank ) - return; - -#if USE_SC_MULTI_STRING_FILTER_PATCH - FilterFieldItem aItem(FilterFieldItem::NORMAL); - TableFilterFieldNormal* pField = static_cast(aItem.mpField.get()); - pField->Field = mnCurColID; - pField->Operator = FilterOperator_EMPTY; - pField->Connection = FilterConnection_AND; - pField->IsNumeric = false; -#else - FilterFieldItem aItem; - aItem.mpField->Field = mnCurColID; - aItem.mpField->Operator = FilterOperator_EMPTY; - aItem.mpField->Connection = FilterConnection_AND; - aItem.mpField->IsNumeric = false; -#endif - maFields.push_back(aItem); + mrFilterColumn.importFilterColumn( rStrm ); } -void AutoFilterContext::setFilterNames() -{ - using namespace ::com::sun::star::sheet; - - - sal_Int32 size = maFilterNames.size(); - if ( !size ) - return; - -#if USE_SC_MULTI_STRING_FILTER_PATCH - Sequence< OUString > aStrList(size); - ::std::list< OUString >::const_iterator itr = maFilterNames.begin(), itrEnd = maFilterNames.end(); - for (sal_Int32 i = 0; itr != itrEnd; ++itr, ++i) - aStrList[i] = *itr; - - FilterFieldItem aItem(FilterFieldItem::MULTI_STRING); - TableFilterFieldMultiString* pField = static_cast( aItem.mpField.get() ); - pField->Field = mnCurColID; - pField->Connection = FilterConnection_AND; - pField->StringSet = aStrList; - - maFields.push_back(aItem); -#else - static const OUString sSep = CREATE_OUSTRING("|"); - - OUStringBuffer buf; - if ( size > 1 ) - { - buf.append( CREATE_OUSTRING("^(") ); - mbUseRegex = true; - } - - ::std::list< OUString >::const_iterator itr = maFilterNames.begin(), itrEnd = maFilterNames.end(); - bool bFirst = true; - for (; itr != itrEnd; ++itr) - { - if (bFirst) - bFirst = false; - else - buf.append( sSep ); - buf.append( *itr ); - } - if ( size > 1 ) - buf.append( CREATE_OUSTRING(")$") ); - - FilterFieldItem aItem; - aItem.mpField->Field = mnCurColID; - aItem.mpField->StringValue = buf.makeStringAndClear(); - aItem.mpField->Operator = FilterOperator_EQUAL; - aItem.mpField->Connection = FilterConnection_AND; - aItem.mpField->IsNumeric = false; - maFields.push_back(aItem); -#endif -} +// ============================================================================ -void AutoFilterContext::importAutoFilter( const AttributeList& rAttribs ) +AutoFilterContext::AutoFilterContext( WorksheetFragmentBase& rFragment, AutoFilter& rAutoFilter ) : + WorksheetContextBase( rFragment ), + mrAutoFilter( rAutoFilter ) { - initialize(); - - mbValidAddress = getAddressConverter().convertToCellRange( - maAutoFilterRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex(), true, true ); } -void AutoFilterContext::importFilterColumn( const AttributeList& rAttribs ) +ContextHandlerRef AutoFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& /*rAttribs*/ ) { - // hiddenButton and showButton attributes are not used for now. - mnCurColID = rAttribs.getInteger( XML_colId, -1 ); + if( (getCurrentElement() == XLS_TOKEN( autoFilter )) && (nElement == XLS_TOKEN( filterColumn )) ) + return new FilterColumnContext( *this, mrAutoFilter.createFilterColumn() ); + return 0; } -void AutoFilterContext::importTop10( const AttributeList& rAttribs ) +void AutoFilterContext::onStartElement( const AttributeList& rAttribs ) { - using namespace ::com::sun::star::sheet; - - // filterVal attribute is not necessarily, since Calc also supports top 10 - // and top 10% filter type. - FilterFieldItem aItem; -#if USE_SC_MULTI_STRING_FILTER_PATCH - TableFilterFieldNormal* pField = static_cast(aItem.mpField.get()); -#else - TableFilterField* pField = aItem.mpField.get(); -#endif - pField->Field = mnCurColID; - - bool bPercent = rAttribs.getBool( XML_percent, false ); - bool bTop = rAttribs.getBool( XML_top, true ); - pField->NumericValue = rAttribs.getDouble( XML_val, 0.0 ); - pField->IsNumeric = true; - - // When top10 filter item is present, that's the only filter item for that column. - if ( bTop ) - if ( bPercent ) - pField->Operator = FilterOperator_TOP_PERCENT; - else - pField->Operator = FilterOperator_TOP_VALUES; - else - if ( bPercent ) - pField->Operator = FilterOperator_BOTTOM_PERCENT; - else - pField->Operator = FilterOperator_BOTTOM_VALUES; - - maFields.push_back(aItem); + mrAutoFilter.importAutoFilter( rAttribs, getSheetIndex() ); } -void AutoFilterContext::importCustomFilters( const AttributeList& rAttribs ) +ContextHandlerRef AutoFilterContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& /*rStrm*/ ) { - // OR is default when the 'and' attribute is absent. - mbConnectionAnd = rAttribs.getBool( XML_and, false ); + if( (getCurrentElement() == BIFF12_ID_AUTOFILTER) && (nRecId == BIFF12_ID_FILTERCOLUMN) ) + return new FilterColumnContext( *this, mrAutoFilter.createFilterColumn() ); + return 0; } -/** Do a best-effort guess of whether or not the given string is numerical. */ -static bool lclIsNumeric( const OUString& _str, const LocaleDataItem& aLocaleItem ) +void AutoFilterContext::onStartRecord( RecordInputStream& rStrm ) { - OUString str = _str.trim(); - sal_Int32 size = str.getLength(); - - if ( !size ) - // Empty string. This can't be a number. - return false; - - // Get the decimal separator for the current locale. - const OUString& sep = aLocaleItem.decimalSeparator; - - bool bDecimalSep = false; - for (sal_Int32 i = 0; i < size; ++i) - { - OUString c = str.copy(i, 1); - if ( !c.compareTo(sep) ) - { - if ( bDecimalSep ) - return false; - else - { - bDecimalSep = true; - continue; - } - } - if ( (0 > c.compareToAscii("0") || 0 < c.compareToAscii("9")) ) - return false; - } - - return true; + mrAutoFilter.importAutoFilter( rStrm, getSheetIndex() ); } -/** Convert wildcard characters to regex equivalent. Returns true if any - wildcard character is found. */ -static bool lclWildcard2Regex( OUString& str ) -{ - bool bWCFound = false; - OUStringBuffer buf; - sal_Int32 size = str.getLength(); - buf.ensureCapacity(size + 6); // pure heuristics. - - sal_Unicode dot = '.', star = '*', hat = '^', dollar = '$'; - buf.append(hat); - for (sal_Int32 i = 0; i < size; ++i) - { - OUString c = str.copy(i, 1); - if ( !c.compareToAscii("?") ) - { - buf.append(dot); - bWCFound = true; - } - else if ( !c.compareToAscii("*") ) - { - buf.append(dot); - buf.append(star); - bWCFound = true; - } - else - buf.append(c); - } - buf.append(dollar); - - if (bWCFound) - str = buf.makeStringAndClear(); - - return bWCFound; -} +// ============================================================================ -/** Translate Excel's filter operator to Calc's. */ -static ::com::sun::star::sheet::FilterOperator lclTranslateFilterOp( sal_Int32 nToken ) +BiffAutoFilterContext::BiffAutoFilterContext( const WorksheetHelper& rHelper, AutoFilter& rAutoFilter ) : + BiffWorksheetContextBase( rHelper ), + mrAutoFilter( rAutoFilter ) { - using namespace ::com::sun::star::sheet; - - switch ( nToken ) - { - case XML_equal: - return FilterOperator_EQUAL; - case XML_notEqual: - return FilterOperator_NOT_EQUAL; - case XML_greaterThan: - return FilterOperator_GREATER; - case XML_greaterThanOrEqual: - return FilterOperator_GREATER_EQUAL; - case XML_lessThan: - return FilterOperator_LESS; - case XML_lessThanOrEqual: - return FilterOperator_LESS_EQUAL; - } - return FilterOperator_EQUAL; } -void AutoFilterContext::importCustomFilter( const AttributeList& rAttribs ) +void BiffAutoFilterContext::importRecord( BiffInputStream& rStrm ) { - using namespace ::com::sun::star::sheet; - - sal_Int32 nToken = rAttribs.getToken( XML_operator, XML_equal ); -#if USE_SC_MULTI_STRING_FILTER_PATCH - FilterFieldItem aItem(FilterFieldItem::NORMAL); - TableFilterFieldNormal* pField = static_cast(aItem.mpField.get()); -#else - FilterFieldItem aItem; - TableFilterField* pField = aItem.mpField.get(); -#endif - pField->Field = mnCurColID; - pField->StringValue = rAttribs.getString( XML_val, OUString() ); - pField->NumericValue = pField->StringValue.toDouble(); - pField->Operator = lclTranslateFilterOp( nToken ); - - if ( nToken == XML_notEqual && !pField->StringValue.compareToAscii(" ") ) - { - // Special case for hiding blanks. Excel translates "hide blanks" to - // (filter if notEqual " "). So, we need to translate it back. - pField->Operator = FilterOperator_NOT_EMPTY; - pField->IsNumeric = false; - maFields.push_back(aItem); - return; - } - - switch ( nToken ) + switch( rStrm.getRecId() ) { - case XML_equal: - case XML_notEqual: - { - Reference< XLocaleData > xLocale( getGlobalFactory()->createInstance( - CREATE_OUSTRING("com.sun.star.i18n.LocaleData") ), UNO_QUERY ); - - if ( !xLocale.is() ) - return; - - LocaleDataItem aLocaleItem = xLocale->getLocaleItem( ::com::sun::star::lang::Locale() ); - pField->IsNumeric = lclIsNumeric(pField->StringValue, aLocaleItem); - - if ( !pField->IsNumeric && lclWildcard2Regex(pField->StringValue) ) - mbUseRegex = true; - - maFields.push_back(aItem); - } - break; - - case XML_greaterThan: - case XML_greaterThanOrEqual: - case XML_lessThan: - case XML_lessThanOrEqual: - { - pField->IsNumeric = true; - maFields.push_back(aItem); - } - break; - default: - OSL_ENSURE( false, "AutoFilterContext::importCustomFilter: unhandled case" ); + // nothing to read for BIFF_ID_AUTOFILTER + case BIFF_ID_FILTERCOLUMN: mrAutoFilter.createFilterColumn().importFilterColumn( rStrm ); break; } } -void AutoFilterContext::importFilters( const AttributeList& rAttribs ) -{ - // blank (boolean) and calendarType attributes can be present, but not used for now. - - mbShowBlank = rAttribs.getBool( XML_blank, false ); - maFilterNames.clear(); -} - -void AutoFilterContext::importFilter( const AttributeList& rAttribs ) -{ - if (mnCurColID == -1) - return; - - OUString value = rAttribs.getString( XML_val, OUString() ); - if ( value.getLength() ) - maFilterNames.push_back(value); -} - -void AutoFilterContext::importDynamicFilter( const AttributeList& /*rAttribs*/ ) -{ - // not implemented yet - Calc doesn't support this. -} - // ============================================================================ } // namespace xls diff --git a/oox/source/xls/connectionsbuffer.cxx b/oox/source/xls/connectionsbuffer.cxx index 8a1d2c718948..12df30fe493f 100755 --- a/oox/source/xls/connectionsbuffer.cxx +++ b/oox/source/xls/connectionsbuffer.cxx @@ -51,6 +51,9 @@ const sal_Int32 BIFF12_RECONNECT_AS_REQUIRED = 1; const sal_Int32 BIFF12_RECONNECT_ALWAYS = 2; const sal_Int32 BIFF12_RECONNECT_NEVER = 3; +const sal_uInt8 BIFF12_CONNECTION_SAVEPASSWORD_ON = 1; +const sal_uInt8 BIFF12_CONNECTION_SAVEPASSWORD_OFF = 2; + const sal_uInt16 BIFF12_CONNECTION_KEEPALIVE = 0x0001; const sal_uInt16 BIFF12_CONNECTION_NEW = 0x0002; const sal_uInt16 BIFF12_CONNECTION_DELETED = 0x0004; @@ -187,6 +190,7 @@ ConnectionModel::ConnectionModel() : mnId( -1 ), mnType( BIFF12_CONNECTION_UNKNOWN ), mnReconnectMethod( BIFF12_RECONNECT_AS_REQUIRED ), + mnCredentials( XML_integrated ), mnInterval( 0 ), mbKeepAlive( false ), mbNew( false ), @@ -194,7 +198,8 @@ ConnectionModel::ConnectionModel() : mbOnlyUseConnFile( false ), mbBackground( false ), mbRefreshOnLoad( false ), - mbSaveData( false ) + mbSaveData( false ), + mbSavePassword( false ) { } @@ -224,6 +229,7 @@ void Connection::importConnection( const AttributeList& rAttribs ) // type and reconnectionMethod are using the BIFF12 constants instead of XML tokens maModel.mnType = rAttribs.getInteger( XML_type, BIFF12_CONNECTION_UNKNOWN ); maModel.mnReconnectMethod = rAttribs.getInteger( XML_reconnectionMethod, BIFF12_RECONNECT_AS_REQUIRED ); + maModel.mnCredentials = rAttribs.getToken( XML_credentials, XML_integrated ); maModel.mnInterval = rAttribs.getInteger( XML_interval, 0 ); maModel.mbKeepAlive = rAttribs.getBool( XML_keepAlive, false ); maModel.mbNew = rAttribs.getBool( XML_new, false ); @@ -231,6 +237,8 @@ void Connection::importConnection( const AttributeList& rAttribs ) maModel.mbOnlyUseConnFile = rAttribs.getBool( XML_onlyUseConnectionFile, false ); maModel.mbBackground = rAttribs.getBool( XML_background, false ); maModel.mbRefreshOnLoad = rAttribs.getBool( XML_refreshOnLoad, false ); + maModel.mbSaveData = rAttribs.getBool( XML_saveData, false ); + maModel.mbSavePassword = rAttribs.getBool( XML_savePassword, false ); } void Connection::importWebPr( const AttributeList& rAttribs ) @@ -281,11 +289,13 @@ void Connection::importTable( const AttributeList& rAttribs, sal_Int32 nElement void Connection::importConnection( RecordInputStream& rStrm ) { - rStrm.skip( 4 ); sal_uInt16 nFlags, nStrFlags; + sal_uInt8 nSavePassword, nCredentials; + rStrm.skip( 2 ); + rStrm >> nSavePassword; + rStrm.skip( 1 ); maModel.mnInterval = rStrm.readuInt16(); - rStrm >> nFlags >> nStrFlags >> maModel.mnType >> maModel.mnReconnectMethod >> maModel.mnId; - rStrm.skip( 1 ); // credentials + rStrm >> nFlags >> nStrFlags >> maModel.mnType >> maModel.mnReconnectMethod >> maModel.mnId >> nCredentials; if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_SOURCEFILE ) ) rStrm >> maModel.maSourceFile; @@ -298,6 +308,9 @@ void Connection::importConnection( RecordInputStream& rStrm ) if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_SSOID ) ) rStrm >> maModel.maSsoId; + static const sal_Int32 spnCredentials[] = { XML_integrated, XML_none, XML_stored, XML_prompt }; + maModel.mnCredentials = STATIC_ARRAY_SELECT( spnCredentials, nCredentials, XML_integrated ); + maModel.mbKeepAlive = getFlag( nFlags, BIFF12_CONNECTION_KEEPALIVE ); maModel.mbNew = getFlag( nFlags, BIFF12_CONNECTION_NEW ); maModel.mbDeleted = getFlag( nFlags, BIFF12_CONNECTION_DELETED ); @@ -305,6 +318,7 @@ void Connection::importConnection( RecordInputStream& rStrm ) maModel.mbBackground = getFlag( nFlags, BIFF12_CONNECTION_BACKGROUND ); maModel.mbRefreshOnLoad = getFlag( nFlags, BIFF12_CONNECTION_REFRESHONLOAD ); maModel.mbSaveData = getFlag( nFlags, BIFF12_CONNECTION_SAVEDATA ); + maModel.mbSavePassword = nSavePassword == BIFF12_CONNECTION_SAVEPASSWORD_ON; } void Connection::importWebPr( RecordInputStream& rStrm ) @@ -370,6 +384,7 @@ void Connection::importDbQuery( BiffInputStream& rStrm ) // same type constants in all BIFF versions maModel.mnType = extractValue< sal_Int32 >( nFlags, 0, 3 ); + maModel.mbSavePassword = getFlag( nFlags, BIFF_DBQUERY_SAVEPASSWORD ); OSL_ENSURE( getFlag( nFlags, BIFF_DBQUERY_ODBC ) == (maModel.mnType == BIFF12_CONNECTION_ODBC), "Connection::importDbQuery - wrong ODBC flag" ); OSL_ENSURE( getFlag( nFlags, BIFF_DBQUERY_SQLQUERY ) != (maModel.mnType == BIFF12_CONNECTION_HTML), "Connection::importDbQuery - wrong SQL query flag" ); @@ -446,41 +461,39 @@ ConnectionsBuffer::ConnectionsBuffer( const WorkbookHelper& rHelper ) : { } -ConnectionRef ConnectionsBuffer::importConnection( const AttributeList& rAttribs ) +Connection& ConnectionsBuffer::createConnection() { ConnectionRef xConnection( new Connection( *this ) ); - xConnection->importConnection( rAttribs ); - insertConnection( xConnection ); - return xConnection; + maConnections.push_back( xConnection ); + return *xConnection; } -ConnectionRef ConnectionsBuffer::importConnection( RecordInputStream& rStrm ) +Connection& ConnectionsBuffer::createConnectionWithId() { - ConnectionRef xConnection( new Connection( *this ) ); - xConnection->importConnection( rStrm ); - insertConnection( xConnection ); - return xConnection; + ConnectionRef xConnection( new Connection( *this, mnUnusedId ) ); + maConnections.push_back( xConnection ); + insertConnectionToMap( xConnection ); + return *xConnection; } -ConnectionRef ConnectionsBuffer::createConnection() +void ConnectionsBuffer::finalizeImport() { - ConnectionRef xConnection( new Connection( *this, mnUnusedId ) ); - insertConnection( xConnection ); - return xConnection; + for( ConnectionVector::iterator aIt = maConnections.begin(), aEnd = maConnections.end(); aIt != aEnd; ++aIt ) + insertConnectionToMap( *aIt ); } ConnectionRef ConnectionsBuffer::getConnection( sal_Int32 nConnId ) const { - return maConnections.get( nConnId ); + return maConnectionsById.get( nConnId ); } -void ConnectionsBuffer::insertConnection( const ConnectionRef& rxConnection ) +void ConnectionsBuffer::insertConnectionToMap( const ConnectionRef& rxConnection ) { sal_Int32 nConnId = rxConnection->getConnectionId(); if( nConnId > 0 ) { - OSL_ENSURE( !maConnections.has( nConnId ), "ConnectionsBuffer::insertConnection - multiple connection identifier" ); - maConnections[ nConnId ] = rxConnection; + OSL_ENSURE( !maConnectionsById.has( nConnId ), "ConnectionsBuffer::insertConnectionToMap - multiple connection identifier" ); + maConnectionsById[ nConnId ] = rxConnection; mnUnusedId = ::std::max< sal_Int32 >( mnUnusedId, nConnId + 1 ); } } diff --git a/oox/source/xls/connectionsfragment.cxx b/oox/source/xls/connectionsfragment.cxx index ee4aaa3a059e..f83f9028faa8 100644 --- a/oox/source/xls/connectionsfragment.cxx +++ b/oox/source/xls/connectionsfragment.cxx @@ -29,6 +29,7 @@ #include "oox/helper/attributelist.hxx" #include "oox/xls/biffhelper.hxx" +#include "oox/xls/connectionsbuffer.hxx" namespace oox { namespace xls { @@ -41,11 +42,10 @@ using ::oox::core::RecordInfo; // ============================================================================ -ConnectionContext::ConnectionContext( WorkbookFragmentBase& rParent, const ConnectionRef& rxConnection ) : +ConnectionContext::ConnectionContext( WorkbookFragmentBase& rParent, Connection& rConnection ) : WorkbookContextBase( rParent ), - mxConnection( rxConnection ) + mrConnection( rConnection ) { - OSL_ENSURE( mxConnection.get(), "ConnectionContext::ConnectionContext - missing connection" ); } ContextHandlerRef ConnectionContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) @@ -55,7 +55,7 @@ ContextHandlerRef ConnectionContext::onCreateContext( sal_Int32 nElement, const case XLS_TOKEN( connection ): if( nElement == XLS_TOKEN( webPr ) ) { - mxConnection->importWebPr( rAttribs ); + mrConnection.importWebPr( rAttribs ); return this; } break; @@ -63,18 +63,24 @@ ContextHandlerRef ConnectionContext::onCreateContext( sal_Int32 nElement, const case XLS_TOKEN( webPr ): if( nElement == XLS_TOKEN( tables ) ) { - mxConnection->importTables( rAttribs ); + mrConnection.importTables( rAttribs ); return this; } break; case XLS_TOKEN( tables ): - mxConnection->importTable( rAttribs, nElement ); + mrConnection.importTable( rAttribs, nElement ); break; } return 0; } +void ConnectionContext::onStartElement( const AttributeList& rAttribs ) +{ + if( getCurrentElement() == XLS_TOKEN( connection ) ) + mrConnection.importConnection( rAttribs ); +} + ContextHandlerRef ConnectionContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) { switch( getCurrentElement() ) @@ -82,7 +88,7 @@ ContextHandlerRef ConnectionContext::onCreateRecordContext( sal_Int32 nRecId, Re case BIFF12_ID_CONNECTION: if( nRecId == BIFF12_ID_WEBPR ) { - mxConnection->importWebPr( rStrm ); + mrConnection.importWebPr( rStrm ); return this; } break; @@ -90,18 +96,24 @@ ContextHandlerRef ConnectionContext::onCreateRecordContext( sal_Int32 nRecId, Re case BIFF12_ID_WEBPR: if( nRecId == BIFF12_ID_WEBPRTABLES ) { - mxConnection->importWebPrTables( rStrm ); + mrConnection.importWebPrTables( rStrm ); return this; } break; case BIFF12_ID_WEBPRTABLES: - mxConnection->importWebPrTable( rStrm, nRecId ); + mrConnection.importWebPrTable( rStrm, nRecId ); break; } return 0; } +void ConnectionContext::onStartRecord( RecordInputStream& rStrm ) +{ + if( getCurrentElement() == BIFF12_ID_CONNECTION ) + mrConnection.importConnection( rStrm ); +} + // ============================================================================ ConnectionsFragment::ConnectionsFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) : @@ -109,7 +121,7 @@ ConnectionsFragment::ConnectionsFragment( const WorkbookHelper& rHelper, const O { } -ContextHandlerRef ConnectionsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +ContextHandlerRef ConnectionsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& /*rAttribs*/ ) { switch( getCurrentElement() ) { @@ -120,17 +132,13 @@ ContextHandlerRef ConnectionsFragment::onCreateContext( sal_Int32 nElement, cons case XLS_TOKEN( connections ): if( nElement == XLS_TOKEN( connection ) ) - { - ConnectionRef xConnection = getConnections().importConnection( rAttribs ); - if( xConnection.get() ) - return new ConnectionContext( *this, xConnection ); - } + return new ConnectionContext( *this, getConnections().createConnection() ); break; } return 0; } -ContextHandlerRef ConnectionsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ConnectionsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& /*rStrm*/ ) { switch( getCurrentElement() ) { @@ -141,11 +149,7 @@ ContextHandlerRef ConnectionsFragment::onCreateRecordContext( sal_Int32 nRecId, case BIFF12_ID_CONNECTIONS: if( nRecId == BIFF12_ID_CONNECTION ) - { - ConnectionRef xConnection = getConnections().importConnection( rStrm ); - if( xConnection.get() ) - return new ConnectionContext( *this, xConnection ); - } + return new ConnectionContext( *this, getConnections().createConnection() ); break; } return 0; @@ -164,6 +168,11 @@ const RecordInfo* ConnectionsFragment::getRecordInfos() const return spRecInfos; } +void ConnectionsFragment::finalizeImport() +{ + getConnections().finalizeImport(); +} + // ============================================================================ } // namespace xls diff --git a/oox/source/xls/defnamesbuffer.cxx b/oox/source/xls/defnamesbuffer.cxx index 6ff80e0efe64..94ca1fb321bf 100644 --- a/oox/source/xls/defnamesbuffer.cxx +++ b/oox/source/xls/defnamesbuffer.cxx @@ -81,6 +81,11 @@ const sal_uInt8 BIFF2_DEFNAME_FUNC = 0x02; /// BIFF2 function/comma const sal_uInt16 BIFF_DEFNAME_GLOBAL = 0; /// 0 = Globally defined name. +const sal_uInt16 BIFF_REFFLAG_COL1REL = 0x0001; +const sal_uInt16 BIFF_REFFLAG_ROW1REL = 0x0002; +const sal_uInt16 BIFF_REFFLAG_COL2REL = 0x0004; +const sal_uInt16 BIFF_REFFLAG_ROW2REL = 0x0008; + // ---------------------------------------------------------------------------- const sal_Char* const spcLegacyPrefix = "Excel_BuiltIn_"; @@ -88,20 +93,20 @@ const sal_Char* const spcOoxPrefix = "_xlnm."; const sal_Char* const sppcBaseNames[] = { - "Consolidate_Area", /* OOXML */ + "Consolidate_Area", "Auto_Open", "Auto_Close", - "Extract", /* OOXML */ - "Database", /* OOXML */ - "Criteria", /* OOXML */ - "Print_Area", /* OOXML */ - "Print_Titles", /* OOXML */ + "Extract", + "Database", + "Criteria", + "Print_Area", + "Print_Titles", "Recorder", "Data_Form", "Auto_Activate", "Auto_Deactivate", - "Sheet_Title", /* OOXML */ - "_FilterDatabase" /* OOXML */ + "Sheet_Title", + "_FilterDatabase" }; /** Localized names for _xlnm._FilterDatabase as used in BIFF5. */ @@ -113,7 +118,7 @@ const sal_Char* const sppcFilterDbNames[] = OUString lclGetBaseName( sal_Unicode cBuiltinId ) { - OSL_ENSURE( cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ), "lclGetBaseName - unknown builtin name" ); + OSL_ENSURE( cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ), "lclGetBaseName - unsupported built-in identifier" ); OUStringBuffer aBuffer; if( cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ) ) aBuffer.appendAscii( sppcBaseNames[ cBuiltinId ] ); @@ -122,67 +127,52 @@ OUString lclGetBaseName( sal_Unicode cBuiltinId ) return aBuffer.makeStringAndClear(); } -OUString lclGetBuiltinName( sal_Unicode cBuiltinId ) +OUString lclGetPrefixedName( sal_Unicode cBuiltinId ) { return OUStringBuffer().appendAscii( spcOoxPrefix ).append( lclGetBaseName( cBuiltinId ) ).makeStringAndClear(); } -sal_Unicode lclGetBuiltinIdFromOox( const OUString& rOoxName ) +/** returns the built-in name identifier from a perfixed built-in name, e.g. '_xlnm.Print_Area'. */ +sal_Unicode lclGetBuiltinIdFromPrefixedName( const OUString& rModelName ) { OUString aPrefix = OUString::createFromAscii( spcOoxPrefix ); sal_Int32 nPrefixLen = aPrefix.getLength(); - if( rOoxName.matchIgnoreAsciiCase( aPrefix ) ) + if( rModelName.matchIgnoreAsciiCase( aPrefix ) ) { for( sal_Unicode cBuiltinId = 0; cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ); ++cBuiltinId ) { OUString aBaseName = lclGetBaseName( cBuiltinId ); sal_Int32 nBaseNameLen = aBaseName.getLength(); - if( (rOoxName.getLength() == nPrefixLen + nBaseNameLen) && rOoxName.matchIgnoreAsciiCase( aBaseName, nPrefixLen ) ) + if( (rModelName.getLength() == nPrefixLen + nBaseNameLen) && rModelName.matchIgnoreAsciiCase( aBaseName, nPrefixLen ) ) return cBuiltinId; } } return BIFF_DEFNAME_UNKNOWN; } -sal_Unicode lclGetBuiltinIdFromBiff( const OUString& rName ) +/** returns the built-in name identifier from a built-in base name, e.g. 'Print_Area'. */ +sal_Unicode lclGetBuiltinIdFromBaseName( const OUString& rModelName ) { for( sal_Unicode cBuiltinId = 0; cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ); ++cBuiltinId ) - if( rName.equalsIgnoreAsciiCaseAscii( sppcBaseNames[ cBuiltinId ] ) ) + if( rModelName.equalsIgnoreAsciiCaseAscii( sppcBaseNames[ cBuiltinId ] ) ) return cBuiltinId; return BIFF_DEFNAME_UNKNOWN; } -bool lclIsFilterDatabaseName( const OUString& rName ) +bool lclIsFilterDatabaseName( const OUString& rModelName ) { for( const sal_Char* const* ppcName = sppcFilterDbNames; ppcName < STATIC_ARRAY_END( sppcFilterDbNames ); ++ppcName ) - if( rName.equalsIgnoreAsciiCaseAscii( *ppcName ) ) + if( rModelName.equalsIgnoreAsciiCaseAscii( *ppcName ) ) return true; return false; } -} // namespace - -// ============================================================================ - -DefinedNameModel::DefinedNameModel() : - mnSheet( -1 ), - mnFuncGroupId( -1 ), - mbMacro( false ), - mbFunction( false ), - mbVBName( false ), - mbHidden( false ) +OUString lclGetUpcaseModelName( const OUString& rModelName ) { + // TODO: i18n? + return rModelName.toAsciiUpperCase(); } -// ============================================================================ - -namespace { - -const sal_uInt16 BIFF_REFFLAG_COL1REL = 0x0001; -const sal_uInt16 BIFF_REFFLAG_ROW1REL = 0x0002; -const sal_uInt16 BIFF_REFFLAG_COL2REL = 0x0004; -const sal_uInt16 BIFF_REFFLAG_ROW2REL = 0x0008; - void lclConvertRefFlags( sal_Int32& ornFlags, sal_Int32& ornAbsPos, sal_Int32& ornRelPos, sal_Int32 nBasePos, sal_Int32 nApiRelFlag, bool bRel ) { if( getFlag( ornFlags, nApiRelFlag ) && !bRel ) @@ -232,7 +222,19 @@ Any lclConvertReference( const Any& rRefAny, const CellAddress& rBaseAddress, sa } // namespace -// ---------------------------------------------------------------------------- +// ============================================================================ + +DefinedNameModel::DefinedNameModel() : + mnSheet( -1 ), + mnFuncGroupId( -1 ), + mbMacro( false ), + mbFunction( false ), + mbVBName( false ), + mbHidden( false ) +{ +} + +// ============================================================================ DefinedNameBase::DefinedNameBase( const WorkbookHelper& rHelper ) : WorkbookHelper( rHelper ) @@ -242,7 +244,7 @@ DefinedNameBase::DefinedNameBase( const WorkbookHelper& rHelper ) : const OUString& DefinedNameBase::getUpcaseModelName() const { if( maUpModelName.getLength() == 0 ) - maUpModelName = maModel.maName.toAsciiUpperCase(); + maUpModelName = lclGetUpcaseModelName( maModel.maName ); return maUpModelName; } @@ -325,8 +327,11 @@ void DefinedName::importDefinedName( const AttributeList& rAttribs ) maModel.mbFunction = rAttribs.getBool( XML_function, false ); maModel.mbVBName = rAttribs.getBool( XML_vbProcedure, false ); maModel.mbHidden = rAttribs.getBool( XML_hidden, false ); - mcBuiltinId = lclGetBuiltinIdFromOox( maModel.maName ); mnCalcSheet = (maModel.mnSheet >= 0) ? getWorksheets().getCalcSheetIndex( maModel.mnSheet ) : -1; + + /* Detect built-in state from name itself, there is no built-in flag. + Built-in names are prexixed with '_xlnm.' instead. */ + mcBuiltinId = lclGetBuiltinIdFromPrefixedName( maModel.maName ); } void DefinedName::setFormula( const OUString& rFormula ) @@ -349,12 +354,9 @@ void DefinedName::importDefinedName( RecordInputStream& rStrm ) maModel.mbVBName = getFlag( nFlags, BIFF12_DEFNAME_VBNAME ); maModel.mbHidden = getFlag( nFlags, BIFF12_DEFNAME_HIDDEN ); - // get builtin name index from name + // get built-in name index from name if( getFlag( nFlags, BIFF12_DEFNAME_BUILTIN ) ) - mcBuiltinId = lclGetBuiltinIdFromBiff( maModel.maName ); - // unhide built-in names (_xlnm._FilterDatabase is always hidden) - if( isBuiltinName() ) - maModel.mbHidden = false; + mcBuiltinId = lclGetBuiltinIdFromBaseName( maModel.maName ); // store token array data sal_Int64 nRecPos = rStrm.tell(); @@ -416,24 +418,22 @@ void DefinedName::importDefinedName( BiffInputStream& rStrm, sal_Int16 nCalcShee maModel.mbVBName = getFlag( nFlags, BIFF_DEFNAME_VBNAME ); maModel.mbHidden = getFlag( nFlags, BIFF_DEFNAME_HIDDEN ); - // get builtin name index from name + // get built-in name index from name if( getFlag( nFlags, BIFF_DEFNAME_BUILTIN ) ) { - OSL_ENSURE( maModel.maName.getLength() == 1, "DefinedName::importDefinedName - wrong builtin name" ); - if( maModel.maName.getLength() > 0 ) + // name may be the built-in identifier or the built-in base name + if( maModel.maName.getLength() == 1 ) mcBuiltinId = maModel.maName[ 0 ]; + else + mcBuiltinId = lclGetBuiltinIdFromBaseName( maModel.maName ); } - /* In BIFF5, _xlnm._FilterDatabase appears as hidden user name without + /* In BIFF5, '_FilterDatabase' appears as hidden user name without built-in flag, and even worse, localized. */ else if( (eBiff == BIFF5) && lclIsFilterDatabaseName( maModel.maName ) ) { mcBuiltinId = BIFF_DEFNAME_FILTERDATABASE; } - // unhide built-in names (_xlnm._FilterDatabase is always hidden) - if( isBuiltinName() ) - maModel.mbHidden = false; - // get sheet index for sheet-local names in BIFF5-BIFF8 switch( getBiff() ) { @@ -483,18 +483,13 @@ void DefinedName::importDefinedName( BiffInputStream& rStrm, sal_Int16 nCalcShee void DefinedName::createNameObject() { - // do not create names for (macro) functions + // do not create names for (macro) functions or VBA procedures // #163146# do not ignore hidden names (may be regular names created by VBA scripts) - if( /*maModel.mbHidden ||*/ maModel.mbFunction ) + if( /*maModel.mbHidden ||*/ maModel.mbFunction || maModel.mbVBName ) return; - // convert original name to final Calc name - if( maModel.mbVBName ) - maCalcName = maModel.maName; - else if( isBuiltinName() ) - maCalcName = lclGetBuiltinName( mcBuiltinId ); - else - maCalcName = maModel.maName; //! TODO convert to valid name + // convert original name to final Calc name (TODO: filter invalid characters from model name) + maCalcName = isBuiltinName() ? lclGetPrefixedName( mcBuiltinId ) : maModel.maName; // #163146# do not rename sheet-local names by default, this breaks VBA scripts #if 0 @@ -544,7 +539,7 @@ void DefinedName::convertFormula() case FILTER_UNKNOWN: break; } - // set builtin names (print ranges, repeated titles, filter ranges) + // set built-in names (print ranges, repeated titles, filter ranges) if( !isGlobalName() ) switch( mcBuiltinId ) { case BIFF_DEFNAME_PRINTAREA: @@ -652,14 +647,20 @@ void DefinedNamesBuffer::importDefinedName( BiffInputStream& rStrm ) void DefinedNamesBuffer::finalizeImport() { - // first insert all names without formula definition into the document + // first insert all names without formula definition into the document, and insert them into the maps for( DefNameVector::iterator aIt = maDefNames.begin(), aEnd = maDefNames.end(); aIt != aEnd; ++aIt ) { DefinedNameRef xDefName = *aIt; xDefName->createNameObject(); + // map by sheet index and original model name + maModelNameMap[ SheetNameKey( xDefName->getLocalCalcSheet(), xDefName->getUpcaseModelName() ) ] = xDefName; + // map by sheet index and built-in identifier + if( !xDefName->isGlobalName() && xDefName->isBuiltinName() ) + maBuiltinMap[ BuiltinKey( xDefName->getLocalCalcSheet(), xDefName->getBuiltinId() ) ] = xDefName; + // map by API formula token identifier sal_Int32 nTokenIndex = xDefName->getTokenIndex(); if( nTokenIndex >= 0 ) - maDefNameMap[ nTokenIndex ] = xDefName; + maTokenIdMap[ nTokenIndex ] = xDefName; } /* Now convert all name formulas, so that the formula parser can find all @@ -674,25 +675,22 @@ DefinedNameRef DefinedNamesBuffer::getByIndex( sal_Int32 nIndex ) const DefinedNameRef DefinedNamesBuffer::getByTokenIndex( sal_Int32 nIndex ) const { - return maDefNameMap.get( nIndex ); + return maTokenIdMap.get( nIndex ); } DefinedNameRef DefinedNamesBuffer::getByModelName( const OUString& rModelName, sal_Int16 nCalcSheet ) const { - DefinedNameRef xGlobalName; // a found global name - DefinedNameRef xLocalName; // a found local name - for( DefNameVector::const_iterator aIt = maDefNames.begin(), aEnd = maDefNames.end(); (aIt != aEnd) && !xLocalName; ++aIt ) - { - DefinedNameRef xCurrName = *aIt; - if( xCurrName->getModelName() == rModelName ) - { - if( xCurrName->getLocalCalcSheet() == nCalcSheet ) - xLocalName = xCurrName; - else if( xCurrName->isGlobalName() ) - xGlobalName = xCurrName; - } - } - return xLocalName.get() ? xLocalName : xGlobalName; + OUString aUpcaseName = lclGetUpcaseModelName( rModelName ); + DefinedNameRef xDefName = maModelNameMap.get( SheetNameKey( nCalcSheet, aUpcaseName ) ); + // lookup global name, if no local name exists + if( !xDefName && (nCalcSheet >= 0) ) + xDefName = maModelNameMap.get( SheetNameKey( -1, aUpcaseName ) ); + return xDefName; +} + +DefinedNameRef DefinedNamesBuffer::getByBuiltinId( sal_Unicode cBuiltinId, sal_Int16 nCalcSheet ) const +{ + return maBuiltinMap.get( BuiltinKey( nCalcSheet, cBuiltinId ) ); } DefinedNameRef DefinedNamesBuffer::createDefinedName() diff --git a/oox/source/xls/makefile.mk b/oox/source/xls/makefile.mk index b6d69dc5cf8c..6ca6e6a271b9 100644 --- a/oox/source/xls/makefile.mk +++ b/oox/source/xls/makefile.mk @@ -42,6 +42,7 @@ ENABLE_EXCEPTIONS=TRUE SLOFILES = \ $(SLO)$/addressconverter.obj \ + $(SLO)$/autofilterbuffer.obj \ $(SLO)$/autofiltercontext.obj \ $(SLO)$/biffcodec.obj \ $(SLO)$/biffdetector.obj \ @@ -94,7 +95,7 @@ SLOFILES = \ $(SLO)$/workbooksettings.obj \ $(SLO)$/worksheetbuffer.obj \ $(SLO)$/worksheetfragment.obj \ - $(SLO)$/worksheethelper.obj \ + $(SLO)$/worksheethelper.obj \ $(SLO)$/worksheetsettings.obj # --- Targets ------------------------------------------------------- diff --git a/oox/source/xls/pivotcachefragment.cxx b/oox/source/xls/pivotcachefragment.cxx index 3d69928f7ee8..8c4f56c7c820 100644 --- a/oox/source/xls/pivotcachefragment.cxx +++ b/oox/source/xls/pivotcachefragment.cxx @@ -387,9 +387,8 @@ bool BiffPivotCacheFragment::importFragment() // ============================================================================ -BiffPivotCacheRecordsContext::BiffPivotCacheRecordsContext( - const BiffWorkbookFragmentBase& rFragment, const PivotCache& rPivotCache ) : - BiffWorksheetContextBase( rFragment, ISegmentProgressBarRef(), SHEETTYPE_WORKSHEET, rPivotCache.getSourceRange().Sheet ), +BiffPivotCacheRecordsContext::BiffPivotCacheRecordsContext( const WorkbookHelper& rHelper, const PivotCache& rPivotCache ) : + BiffWorksheetContextBase( rHelper, ISegmentProgressBarRef(), SHEETTYPE_WORKSHEET, rPivotCache.getSourceRange().Sheet ), mrPivotCache( rPivotCache ), mnColIdx( 0 ), mnRow( 0 ), diff --git a/oox/source/xls/pivottablefragment.cxx b/oox/source/xls/pivottablefragment.cxx index 1486a600e131..1ed95b141b61 100644 --- a/oox/source/xls/pivottablefragment.cxx +++ b/oox/source/xls/pivottablefragment.cxx @@ -294,8 +294,8 @@ const RecordInfo* PivotTableFragment::getRecordInfos() const // ============================================================================ // ============================================================================ -BiffPivotTableContext::BiffPivotTableContext( const BiffWorksheetFragmentBase& rFragment ) : - BiffWorksheetContextBase( rFragment ), +BiffPivotTableContext::BiffPivotTableContext( const WorksheetHelper& rHelper ) : + BiffWorksheetContextBase( rHelper ), mrPivotTable( getPivotTables().createPivotTable() ) { } diff --git a/oox/source/xls/querytablebuffer.cxx b/oox/source/xls/querytablebuffer.cxx index 8f65fe1438db..2a4df73287ca 100644 --- a/oox/source/xls/querytablebuffer.cxx +++ b/oox/source/xls/querytablebuffer.cxx @@ -283,18 +283,14 @@ void QueryTable::importQueryTable( BiffInputStream& rStrm ) // create a new connection object that will store settings from following records OSL_ENSURE( maModel.mnConnId == -1, "QueryTable::importQueryTable - multiple call" ); - ConnectionRef xConnection = getConnections().createConnection(); - OSL_ENSURE( xConnection.get(), "QueryTable::importQueryTable - cannot create connection object" ); - if( xConnection.get() ) - { - maModel.mnConnId = xConnection->getConnectionId(); - - // a DBQUERY record with some PCITEM_STRING records must follow - bool bHasDbQuery = (rStrm.getNextRecId() == BIFF_ID_DBQUERY) && rStrm.startNextRecord(); - OSL_ENSURE( bHasDbQuery, "QueryTable::importQueryTable - missing DBQUERY record" ); - if( bHasDbQuery ) - xConnection->importDbQuery( rStrm ); - } + Connection& rConnection = getConnections().createConnectionWithId(); + maModel.mnConnId = rConnection.getConnectionId(); + + // a DBQUERY record with some PCITEM_STRING records must follow + bool bHasDbQuery = (rStrm.getNextRecId() == BIFF_ID_DBQUERY) && rStrm.startNextRecord(); + OSL_ENSURE( bHasDbQuery, "QueryTable::importQueryTable - missing DBQUERY record" ); + if( bHasDbQuery ) + rConnection.importDbQuery( rStrm ); } void QueryTable::importQueryTableRefresh( BiffInputStream& rStrm ) diff --git a/oox/source/xls/querytablefragment.cxx b/oox/source/xls/querytablefragment.cxx index 493fb22bc632..2f4b2d06ff11 100644 --- a/oox/source/xls/querytablefragment.cxx +++ b/oox/source/xls/querytablefragment.cxx @@ -84,8 +84,8 @@ const RecordInfo* QueryTableFragment::getRecordInfos() const // ============================================================================ -BiffQueryTableContext::BiffQueryTableContext( const BiffWorksheetFragmentBase& rFragment ) : - BiffWorksheetContextBase( rFragment ), +BiffQueryTableContext::BiffQueryTableContext( const WorksheetHelper& rHelper ) : + BiffWorksheetContextBase( rHelper ), mrQueryTable( getQueryTables().createQueryTable() ) { } diff --git a/oox/source/xls/sheetdatacontext.cxx b/oox/source/xls/sheetdatacontext.cxx index e132ec74b689..258ec995e9e0 100644 --- a/oox/source/xls/sheetdatacontext.cxx +++ b/oox/source/xls/sheetdatacontext.cxx @@ -77,9 +77,6 @@ const sal_uInt16 BIFF12_ROW_CUSTOMHEIGHT = 0x2000; const sal_uInt16 BIFF12_ROW_CUSTOMFORMAT = 0x4000; const sal_uInt8 BIFF12_ROW_SHOWPHONETIC = 0x01; -const sal_uInt8 BIFF_BOOLERR_BOOL = 0; -const sal_uInt8 BIFF_BOOLERR_ERROR = 1; - const sal_uInt16 BIFF_DATATABLE_ROW = 0x0004; const sal_uInt16 BIFF_DATATABLE_2D = 0x0008; const sal_uInt16 BIFF_DATATABLE_REF1DEL = 0x0010; @@ -591,8 +588,8 @@ void SheetDataContext::importDataTable( RecordInputStream& rStrm ) // ============================================================================ -BiffSheetDataContext::BiffSheetDataContext( const BiffWorksheetFragmentBase& rParent ) : - BiffWorksheetContextBase( rParent ), +BiffSheetDataContext::BiffSheetDataContext( const WorksheetHelper& rHelper ) : + BiffWorksheetContextBase( rHelper ), mnBiff2XfId( 0 ) { mnArrayIgnoreSize = (getBiff() == BIFF2) ? 1 : ((getBiff() <= BIFF4) ? 2 : 6); diff --git a/oox/source/xls/tablebuffer.cxx b/oox/source/xls/tablebuffer.cxx index 1d4444986adc..53408f366ae5 100644 --- a/oox/source/xls/tablebuffer.cxx +++ b/oox/source/xls/tablebuffer.cxx @@ -28,9 +28,7 @@ #include "oox/xls/tablebuffer.hxx" #include -#include #include "oox/helper/attributelist.hxx" -#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" @@ -61,6 +59,7 @@ TableModel::TableModel() : Table::Table( const WorkbookHelper& rHelper ) : WorkbookHelper( rHelper ), + maAutoFilters( rHelper ), mnTokenIndex( -1 ) { } @@ -91,24 +90,20 @@ void Table::importTable( RecordInputStream& rStrm, sal_Int16 nSheet ) void Table::finalizeImport() { - // validate cell range - maDestRange = maModel.maRange; - bool bValidRange = getAddressConverter().validateCellRange( maDestRange, true, true ); - // create database range - if( bValidRange && (maModel.mnId > 0) && (maModel.maDisplayName.getLength() > 0) ) try + if( (maModel.mnId > 0) && (maModel.maDisplayName.getLength() > 0) ) try { - // find an unused name - PropertySet aDocProps( getDocument() ); - Reference< XDatabaseRanges > xDatabaseRanges( aDocProps.getAnyProperty( PROP_DatabaseRanges ), UNO_QUERY_THROW ); - Reference< XNameAccess > xNameAccess( xDatabaseRanges, UNO_QUERY_THROW ); - OUString aName = ContainerHelper::getUnusedName( xNameAccess, maModel.maDisplayName, '_' ); - xDatabaseRanges->addNewByName( aName, maModel.maRange ); - Reference< XDatabaseRange > xDatabaseRange( xDatabaseRanges->getByName( aName ), UNO_QUERY_THROW ); + maDBRangeName = maModel.maDisplayName; + Reference< XDatabaseRange > xDatabaseRange( createDatabaseRangeObject( maDBRangeName, maModel.maRange ), UNO_SET_THROW ); + maDestRange = xDatabaseRange->getDataArea(); + // get formula token index of the database range PropertySet aPropSet( xDatabaseRange ); if( !aPropSet.getProperty( mnTokenIndex, PROP_TokenIndex ) ) mnTokenIndex = -1; + + // filter settings + maAutoFilters.finalizeImport( xDatabaseRange ); } catch( Exception& ) { @@ -123,24 +118,19 @@ TableBuffer::TableBuffer( const WorkbookHelper& rHelper ) : { } -TableRef TableBuffer::importTable( const AttributeList& rAttribs, sal_Int16 nSheet ) -{ - TableRef xTable( new Table( *this ) ); - xTable->importTable( rAttribs, nSheet ); - insertTable( xTable ); - return xTable; -} - -TableRef TableBuffer::importTable( RecordInputStream& rStrm, sal_Int16 nSheet ) +Table& TableBuffer::createTable() { - TableRef xTable( new Table( *this ) ); - xTable->importTable( rStrm, nSheet ); - insertTable( xTable ); - return xTable; + TableVector::value_type xTable( new Table( *this ) ); + maTables.push_back( xTable ); + return *xTable; } void TableBuffer::finalizeImport() { + // map all tables by identifier and display name + for( TableVector::iterator aIt = maTables.begin(), aEnd = maTables.end(); aIt != aEnd; ++aIt ) + insertTableToMaps( *aIt ); + // finalize all valid tables maIdTables.forEachMem( &Table::finalizeImport ); } @@ -156,15 +146,15 @@ TableRef TableBuffer::getTable( const OUString& rDispName ) const // private -------------------------------------------------------------------- -void TableBuffer::insertTable( const TableRef& rxTable ) +void TableBuffer::insertTableToMaps( const TableRef& rxTable ) { sal_Int32 nTableId = rxTable->getTableId(); const OUString& rDispName = rxTable->getDisplayName(); if( (nTableId > 0) && (rDispName.getLength() > 0) ) { - OSL_ENSURE( !maIdTables.has( nTableId ), "TableBuffer::insertTable - multiple table identifier" ); + OSL_ENSURE( !maIdTables.has( nTableId ), "TableBuffer::insertTableToMaps - multiple table identifier" ); maIdTables[ nTableId ] = rxTable; - OSL_ENSURE( !maNameTables.has( rDispName ), "TableBuffer::insertTable - multiple table name" ); + OSL_ENSURE( !maNameTables.has( rDispName ), "TableBuffer::insertTableToMaps - multiple table name" ); maNameTables[ rDispName ] = rxTable; } } diff --git a/oox/source/xls/tablefragment.cxx b/oox/source/xls/tablefragment.cxx index 54415081a288..853a3d73ecd0 100644 --- a/oox/source/xls/tablefragment.cxx +++ b/oox/source/xls/tablefragment.cxx @@ -27,6 +27,10 @@ #include "oox/xls/tablefragment.hxx" +#include "oox/xls/autofilterbuffer.hxx" +#include "oox/xls/autofiltercontext.hxx" +#include "oox/xls/tablebuffer.hxx" + namespace oox { namespace xls { @@ -39,7 +43,8 @@ using ::rtl::OUString; // ============================================================================ TableFragment::TableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) : - WorksheetFragmentBase( rHelper, rFragmentPath ) + WorksheetFragmentBase( rHelper, rFragmentPath ), + mrTable( getTables().createTable() ) { } @@ -49,7 +54,14 @@ ContextHandlerRef TableFragment::onCreateContext( sal_Int32 nElement, const Attr { case XML_ROOT_CONTEXT: if( nElement == XLS_TOKEN( table ) ) - mxTable = getTables().importTable( rAttribs, getSheetIndex() ); + { + mrTable.importTable( rAttribs, getSheetIndex() ); + return this; + } + break; + case XLS_TOKEN( table ): + if( nElement == XLS_TOKEN( autoFilter ) ) + return new AutoFilterContext( *this, mrTable.createAutoFilter() ); break; } return 0; @@ -61,7 +73,14 @@ ContextHandlerRef TableFragment::onCreateRecordContext( sal_Int32 nRecId, Record { case XML_ROOT_CONTEXT: if( nRecId == BIFF12_ID_TABLE ) - mxTable = getTables().importTable( rStrm, getSheetIndex() ); + { + mrTable.importTable( rStrm, getSheetIndex() ); + return this; + } + break; + case BIFF12_ID_TABLE: + if( nRecId == BIFF12_ID_AUTOFILTER ) + return new AutoFilterContext( *this, mrTable.createAutoFilter() ); break; } return 0; @@ -71,8 +90,12 @@ const RecordInfo* TableFragment::getRecordInfos() const { static const RecordInfo spRecInfos[] = { - { BIFF12_ID_TABLE, BIFF12_ID_TABLE + 1 }, - { -1, -1 } + { BIFF12_ID_AUTOFILTER, BIFF12_ID_AUTOFILTER + 1 }, + { BIFF12_ID_CUSTOMFILTERS, BIFF12_ID_CUSTOMFILTERS + 1 }, + { BIFF12_ID_DISCRETEFILTERS, BIFF12_ID_DISCRETEFILTERS + 1 }, + { BIFF12_ID_FILTERCOLUMN, BIFF12_ID_FILTERCOLUMN + 1 }, + { BIFF12_ID_TABLE, BIFF12_ID_TABLE + 1 }, + { -1, -1 } }; return spRecInfos; } diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx index aa29e45c1d19..e523d6e42111 100644 --- a/oox/source/xls/workbookhelper.cxx +++ b/oox/source/xls/workbookhelper.cxx @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include #include @@ -136,6 +138,8 @@ public: Reference< XStyle > getStyleObject( const OUString& rStyleName, bool bPageStyle ) const; /** Creates and returns a defined name on-the-fly in the Calc document. */ Reference< XNamedRange > createNamedRangeObject( OUString& orName, sal_Int32 nNameFlags ) const; + /** Creates and returns a database range on-the-fly in the Calc document. */ + Reference< XDatabaseRange > createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const; /** Creates and returns a com.sun.star.style.Style object for cells or pages. */ Reference< XStyle > createStyleObject( OUString& orStyleName, bool bPageStyle ) const; @@ -350,17 +354,16 @@ Reference< XStyle > WorkbookData::getStyleObject( const OUString& rStyleName, bo Reference< XNamedRange > WorkbookData::createNamedRangeObject( OUString& orName, sal_Int32 nNameFlags ) const { - // find an unused name - PropertySet aDocProps( mxDoc ); - Reference< XNamedRanges > xNamedRanges( aDocProps.getAnyProperty( PROP_NamedRanges ), UNO_QUERY ); - Reference< XNameAccess > xNameAccess( xNamedRanges, UNO_QUERY ); - if( xNameAccess.is() ) - orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' ); - // create the name and insert it into the Calc document Reference< XNamedRange > xNamedRange; - if( xNamedRanges.is() && (orName.getLength() > 0) ) try + if( orName.getLength() > 0 ) try { + // find an unused name + PropertySet aDocProps( mxDoc ); + Reference< XNamedRanges > xNamedRanges( aDocProps.getAnyProperty( PROP_NamedRanges ), UNO_QUERY_THROW ); + Reference< XNameAccess > xNameAccess( xNamedRanges, UNO_QUERY_THROW ); + orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' ); + // create the named range xNamedRanges->addNewByName( orName, OUString(), CellAddress( 0, 0, 0 ), nNameFlags ); xNamedRange.set( xNamedRanges->getByName( orName ), UNO_QUERY ); } @@ -371,6 +374,32 @@ Reference< XNamedRange > WorkbookData::createNamedRangeObject( OUString& orName, return xNamedRange; } +Reference< XDatabaseRange > WorkbookData::createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const +{ + // validate cell range + CellRangeAddress aDestRange = rRangeAddr; + bool bValidRange = getAddressConverter().validateCellRange( aDestRange, true, true ); + + // create database range and insert it into the Calc document + Reference< XDatabaseRange > xDatabaseRange; + if( bValidRange && (orName.getLength() > 0) ) try + { + // find an unused name + PropertySet aDocProps( mxDoc ); + Reference< XDatabaseRanges > xDatabaseRanges( aDocProps.getAnyProperty( PROP_DatabaseRanges ), UNO_QUERY_THROW ); + Reference< XNameAccess > xNameAccess( xDatabaseRanges, UNO_QUERY_THROW ); + orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' ); + // create the database range + xDatabaseRanges->addNewByName( orName, aDestRange ); + xDatabaseRange.set( xDatabaseRanges->getByName( orName ), UNO_QUERY ); + } + catch( Exception& ) + { + } + OSL_ENSURE( xDatabaseRange.is(), "WorkbookData::createDatabaseRangeObject - cannot create database range" ); + return xDatabaseRange; +} + Reference< XStyle > WorkbookData::createStyleObject( OUString& orStyleName, bool bPageStyle ) const { Reference< XStyle > xStyle; @@ -714,6 +743,11 @@ Reference< XNamedRange > WorkbookHelper::createNamedRangeObject( OUString& orNam return mrBookData.createNamedRangeObject( orName, nNameFlags ); } +Reference< XDatabaseRange > WorkbookHelper::createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const +{ + return mrBookData.createDatabaseRangeObject( orName, rRangeAddr ); +} + Reference< XStyle > WorkbookHelper::createStyleObject( OUString& orStyleName, bool bPageStyle ) const { return mrBookData.createStyleObject( orStyleName, bPageStyle ); diff --git a/oox/source/xls/worksheetfragment.cxx b/oox/source/xls/worksheetfragment.cxx index 19dc8e34c70f..dc51981fe230 100644 --- a/oox/source/xls/worksheetfragment.cxx +++ b/oox/source/xls/worksheetfragment.cxx @@ -32,6 +32,7 @@ #include "oox/helper/attributelist.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" +#include "oox/xls/autofilterbuffer.hxx" #include "oox/xls/autofiltercontext.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/commentsfragment.hxx" @@ -267,9 +268,10 @@ ContextHandlerRef WorksheetFragment::onCreateContext( sal_Int32 nElement, const switch( nElement ) { case XLS_TOKEN( sheetData ): return new SheetDataContext( *this ); - case XLS_TOKEN( autoFilter ): return new AutoFilterContext( *this ); case XLS_TOKEN( conditionalFormatting ): return new CondFormatContext( *this ); case XLS_TOKEN( dataValidations ): return new DataValidationsContext( *this ); + case XLS_TOKEN( autoFilter ): return new AutoFilterContext( *this, getAutoFilters().createAutoFilter() ); + case XLS_TOKEN( scenarios ): return new ScenariosContext( *this ); case XLS_TOKEN( sheetViews ): case XLS_TOKEN( cols ): @@ -292,8 +294,6 @@ ContextHandlerRef WorksheetFragment::onCreateContext( sal_Int32 nElement, const case XLS_TOKEN( picture ): getPageSettings().importPicture( getRelations(), rAttribs ); break; case XLS_TOKEN( drawing ): importDrawing( rAttribs ); break; case XLS_TOKEN( legacyDrawing ): importLegacyDrawing( rAttribs ); break; - case XLS_TOKEN( scenarios ): - return new ScenariosContext( *this ); } break; @@ -387,6 +387,7 @@ ContextHandlerRef WorksheetFragment::onCreateRecordContext( sal_Int32 nRecId, Re case BIFF12_ID_SHEETDATA: return new SheetDataContext( *this ); case BIFF12_ID_CONDFORMATTING: return new CondFormatContext( *this ); case BIFF12_ID_DATAVALIDATIONS: return new DataValidationsContext( *this ); + case BIFF12_ID_AUTOFILTER: return new AutoFilterContext( *this, getAutoFilters().createAutoFilter() ); case BIFF12_ID_SCENARIOS: return new ScenariosContext( *this ); case BIFF12_ID_SHEETVIEWS: @@ -453,16 +454,20 @@ const RecordInfo* WorksheetFragment::getRecordInfos() const { static const RecordInfo spRecInfos[] = { + { BIFF12_ID_AUTOFILTER, BIFF12_ID_AUTOFILTER + 1 }, { BIFF12_ID_CFRULE, BIFF12_ID_CFRULE + 1 }, { BIFF12_ID_COLBREAKS, BIFF12_ID_COLBREAKS + 1 }, { BIFF12_ID_COLORSCALE, BIFF12_ID_COLORSCALE + 1 }, { BIFF12_ID_COLS, BIFF12_ID_COLS + 1 }, { BIFF12_ID_CONDFORMATTING, BIFF12_ID_CONDFORMATTING + 1 }, { BIFF12_ID_CONTROLS, BIFF12_ID_CONTROLS + 2 }, + { BIFF12_ID_CUSTOMFILTERS, BIFF12_ID_CUSTOMFILTERS + 1 }, { BIFF12_ID_CUSTOMSHEETVIEW, BIFF12_ID_CUSTOMSHEETVIEW + 1 }, { BIFF12_ID_CUSTOMSHEETVIEWS, BIFF12_ID_CUSTOMSHEETVIEWS + 3 }, { BIFF12_ID_DATABAR, BIFF12_ID_DATABAR + 1 }, { BIFF12_ID_DATAVALIDATIONS, BIFF12_ID_DATAVALIDATIONS + 1 }, + { BIFF12_ID_DISCRETEFILTERS, BIFF12_ID_DISCRETEFILTERS + 1 }, + { BIFF12_ID_FILTERCOLUMN, BIFF12_ID_FILTERCOLUMN + 1 }, { BIFF12_ID_HEADERFOOTER, BIFF12_ID_HEADERFOOTER + 1 }, { BIFF12_ID_ICONSET, BIFF12_ID_ICONSET + 1 }, { BIFF12_ID_MERGECELLS, BIFF12_ID_MERGECELLS + 1 }, @@ -862,6 +867,7 @@ bool BiffWorksheetFragment::importFragment() case BIFF5: switch( nRecId ) { + case BIFF_ID_AUTOFILTER: importAutoFilter( rStrm ); break; case BIFF_ID_COLINFO: importColInfo( rStrm ); break; case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break; case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break; @@ -882,6 +888,7 @@ bool BiffWorksheetFragment::importFragment() case BIFF8: switch( nRecId ) { + case BIFF_ID_AUTOFILTER: importAutoFilter( rStrm ); break; case BIFF_ID_CFHEADER: rCondFormats.importCfHeader( rStrm ); break; case BIFF_ID_CODENAME: rWorksheetSett.importCodeName( rStrm ); break; case BIFF_ID_COLINFO: importColInfo( rStrm ); break; @@ -941,6 +948,12 @@ bool BiffWorksheetFragment::importFragment() // private -------------------------------------------------------------------- +void BiffWorksheetFragment::importAutoFilter( BiffInputStream& rStrm ) +{ + mxContext.reset( new BiffAutoFilterContext( *this, getAutoFilters().createAutoFilter() ) ); + mxContext->importRecord( rStrm ); +} + void BiffWorksheetFragment::importColInfo( BiffInputStream& rStrm ) { sal_uInt16 nFirstCol, nLastCol, nWidth, nXfId, nFlags; diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx index 48a83ab07f11..de3b540df0a8 100644 --- a/oox/source/xls/worksheethelper.cxx +++ b/oox/source/xls/worksheethelper.cxx @@ -59,6 +59,7 @@ #include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" #include "oox/xls/addressconverter.hxx" +#include "oox/xls/autofilterbuffer.hxx" #include "oox/xls/commentsbuffer.hxx" #include "oox/xls/condformatbuffer.hxx" #include "oox/xls/drawingfragment.hxx" @@ -389,6 +390,8 @@ public: inline CondFormatBuffer& getCondFormats() { return maCondFormats; } /** Returns the buffer for all cell comments in this sheet. */ inline CommentsBuffer& getComments() { return maComments; } + /** Returns the auto filters for the sheet. */ + inline AutoFilterBuffer& getAutoFilters() { return maAutoFilters; } /** Returns the buffer for all web query tables in this sheet. */ inline QueryTableBuffer& getQueryTables() { return maQueryTables; } /** Returns the page/print settings for this sheet. */ @@ -560,6 +563,7 @@ private: SharedFormulaBuffer maSharedFmlas; /// Buffer for shared formulas in this sheet. CondFormatBuffer maCondFormats; /// Buffer for conditional formattings. CommentsBuffer maComments; /// Buffer for all cell comments in this sheet. + AutoFilterBuffer maAutoFilters; /// Sheet auto filters (not associated to a table). QueryTableBuffer maQueryTables; /// Buffer for all web query tables in this sheet. PageSettings maPageSett; /// Page/print settings for this sheet. SheetViewSettings maSheetViewSett; /// View settings for this sheet. @@ -589,6 +593,7 @@ WorksheetData::WorksheetData( const WorkbookHelper& rHelper, const ISegmentProgr maSharedFmlas( *this ), maCondFormats( *this ), maComments( *this ), + maAutoFilters( *this ), maQueryTables( *this ), maPageSett( *this ), maSheetViewSett( *this ), @@ -1050,6 +1055,7 @@ void WorksheetData::finalizeWorksheetImport() finalizeHyperlinkRanges(); finalizeValidationRanges(); finalizeMergedRanges(); + maAutoFilters.finalizeImport( getSheetIndex() ); maSheetSett.finalizeImport(); maCondFormats.finalizeImport(); maQueryTables.finalizeImport(); @@ -1842,6 +1848,11 @@ CommentsBuffer& WorksheetHelper::getComments() const return mrSheetData.getComments(); } +AutoFilterBuffer& WorksheetHelper::getAutoFilters() const +{ + return mrSheetData.getAutoFilters(); +} + QueryTableBuffer& WorksheetHelper::getQueryTables() const { return mrSheetData.getQueryTables(); -- cgit From 8664f10f1005817f4ac87181b25db4509b37fbf6 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Thu, 4 Nov 2010 11:14:32 +0100 Subject: dr77: pass component factory --- sc/source/filter/excel/excimp8.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 8041269f16de..e2640a1f525a 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -240,7 +240,7 @@ void ImportExcel8::ReadBasic( void ) uno::Sequence< uno::Any > aArgs( 2 ); // framework calls filter objects with factory as first argument - aArgs[ 0 ] <<= getProcessServiceFactory(); + aArgs[ 0 ] <<= xFactory; aArgs[ 1 ] <<= aArgSeq; uno::Reference< document::XImporter > xImporter( xFactory->createInstanceWithArgumentsAndContext( -- cgit From 6cd16b7bc3fa70ba6c93fe64256e5ce16ab19c9f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 4 Nov 2010 18:48:18 +0100 Subject: vcl117: #i115056# clean up functions no longer used --- vcl/inc/vcl/print.hxx | 11 ++++++----- vcl/source/gdi/print.cxx | 5 +++++ vcl/source/gdi/print3.cxx | 4 ---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index 04f47d16bba8..1f3eba2610fd 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -318,7 +318,12 @@ public: BOOL Setup( Window* pWindow = NULL ); BOOL SetPrinterProps( const Printer* pPrinter ); - void SetPrinterOptions( const PrinterOptions& rOptions ) { *mpPrinterOptions = rOptions; } + // SetPrinterOptions is used internally only now + // in earlier times it was used only to set the options loaded directly from the configuration + // in SfxPrinter::InitJob, this is now handled internally + // should the need arise to set the printer options outside vcl, also a method would have to be devised + // to not override these again internally + SAL_DLLPRIVATE void SetPrinterOptions( const PrinterOptions& rOptions ); const PrinterOptions& GetPrinterOptions() const { return( *mpPrinterOptions ); } BOOL SetOrientation( Orientation eOrient ); @@ -354,10 +359,6 @@ public: BOOL IsPrinting() const { return mbPrinting; } - void SetPrintFile( const XubString& rFileName ) { maPrintFile = rFileName; } - const XubString& GetPrintFile() const { return maPrintFile; } - void EnablePrintFile( BOOL bEnable ) { mbPrintFile = bEnable; } - BOOL IsPrintFileEnabled() const { return mbPrintFile; } BOOL AbortJob(); const XubString& GetCurJobName() const { return maJobName; } USHORT GetCurPage() const { return mnCurPage; } diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index cafaf5cad6eb..78456992340f 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -230,6 +230,11 @@ bool PrinterOptions::ReadFromConfig( bool i_bFile ) return bSuccess; } +void Printer::SetPrinterOptions( const PrinterOptions& i_rOptions ) +{ + *mpPrinterOptions = i_rOptions; +} + // ------------- // - QueueInfo - // ------------- diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index afb510b05a17..0effb7e3ca44 100755 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -533,10 +533,6 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptrValue >>= bSinglePrintJobs; } - // remark: currently it is still possible to use EnablePrintFile and - // SetPrintFileName to redirect printout into file - // it can be argued that those methods should be removed in favor - // of only using the LocalFileName property beans::PropertyValue* pFileValue = i_pController->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LocalFileName" ) ) ); if( pFileValue ) { -- cgit From 7303928aa8e013c58c68e661155196b51f199b46 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 4 Nov 2010 18:49:17 +0100 Subject: vcl117: #i115056# remove now unused svtools PrintDialog --- sfx2/inc/sfx2/event.hxx | 1 - sfx2/inc/sfx2/viewsh.hxx | 8 +-- sfx2/source/doc/printhelper.cxx | 74 ---------------------- sfx2/source/view/printer.cxx | 75 ++-------------------- sfx2/source/view/viewprn.cxx | 136 ++-------------------------------------- 5 files changed, 14 insertions(+), 280 deletions(-) diff --git a/sfx2/inc/sfx2/event.hxx b/sfx2/inc/sfx2/event.hxx index 71ae9c182fb3..4c3d3c9062c9 100644 --- a/sfx2/inc/sfx2/event.hxx +++ b/sfx2/inc/sfx2/event.hxx @@ -95,7 +95,6 @@ public: SfxObjectShell* GetObjShell() const { return _pObjShell; } }; -class PrintDialog; class Printer; class SfxPrintingHint : public SfxHint { diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index ee8dfb1ca57c..f147c9419ec1 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -58,7 +58,6 @@ class SfxItemPool; class SfxTabPage; class SfxPrintMonitor; class SfxFrameSetDescriptor; -class PrintDialog; class Printer; class SfxPrinter; class SfxProgress; @@ -238,13 +237,12 @@ public: void AdjustVisArea(const Rectangle& rRect); // Printing Interface - virtual void PreparePrint( PrintDialog *pPrintDialog = 0 ); - virtual ErrCode DoPrint( SfxPrinter *pPrinter, PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ); - virtual USHORT Print( SfxProgress &rProgress, BOOL bIsAPI, PrintDialog *pPrintDialog = 0 ); + virtual void PreparePrint(); + virtual ErrCode DoPrint( SfxPrinter *pPrinter, BOOL bSilent, BOOL bIsAPI ); + virtual USHORT Print( SfxProgress &rProgress, BOOL bIsAPI ); virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE ); virtual USHORT SetPrinter( SfxPrinter *pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=FALSE ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); - virtual PrintDialog* CreatePrintDialog( Window *pParent ); void LockPrinter( BOOL bLock = TRUE ); BOOL IsPrinterLocked() const; virtual JobSetup GetJobSetup() const; diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 2cd195976832..1dc2423bcdaf 100755 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -53,7 +53,6 @@ #include #include #include -#include #include #include @@ -799,81 +798,8 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin { if ( !m_xPrintJob.is() ) m_xPrintJob = new SfxPrintJob_Impl( this ); -/* - PrintDialog* pDlg = pPrintHint->GetPrintDialog(); - Printer* pPrinter = pPrintHint->GetPrinter(); - ::rtl::OUString aPrintFile ( ( pPrinter && pPrinter->IsPrintFileEnabled() ) ? pPrinter->GetPrintFile() : String() ); - ::rtl::OUString aRangeText ( ( pDlg && pDlg->IsRangeChecked(PRINTDIALOG_RANGE) ) ? pDlg->GetRangeText() : String() ); - sal_Bool bSelectionOnly = ( ( pDlg && pDlg->IsRangeChecked(PRINTDIALOG_SELECTION) ) ? sal_True : sal_False ); - - sal_Int32 nArgs = 2; - if ( aPrintFile.getLength() ) - nArgs++; - if ( aRangeText.getLength() ) - nArgs++; - else if ( bSelectionOnly ) - nArgs++; - - m_aPrintOptions.realloc(nArgs); - m_aPrintOptions[0].Name = DEFINE_CONST_UNICODE("CopyCount"); - m_aPrintOptions[0].Value <<= (sal_Int16) (pPrinter ? pPrinter->GetCopyCount() : 1 ); - m_aPrintOptions[1].Name = DEFINE_CONST_UNICODE("Collate"); - m_aPrintOptions[1].Value <<= (sal_Bool) (pDlg ? pDlg->IsCollateChecked() : sal_False ); - - if ( bSelectionOnly ) - { - m_aPrintOptions[2].Name = DEFINE_CONST_UNICODE("Selection"); - m_aPrintOptions[2].Value <<= bSelectionOnly; - } - else if ( aRangeText.getLength() ) - { - m_aPrintOptions[2].Name = DEFINE_CONST_UNICODE("Pages"); - m_aPrintOptions[2].Value <<= aRangeText; - } - - if ( aPrintFile.getLength() ) - { - m_aPrintOptions[nArgs-1].Name = DEFINE_CONST_UNICODE("FileName"); - m_aPrintOptions[nArgs-1].Value <<= aPrintFile; - } -*/ m_aPrintOptions = pPrintHint->GetOptions(); } -/* - else if ( pPrintHint->GetWhich() == -3 ) // -3 : AdditionalPrintOptions - { - uno::Sequence < beans::PropertyValue >& lOldOpts = m_aPrintOptions; - const uno::Sequence < beans::PropertyValue >& lNewOpts = pPrintHint->GetAdditionalOptions(); - sal_Int32 nOld = lOldOpts.getLength(); - sal_Int32 nAdd = lNewOpts.getLength(); - lOldOpts.realloc( nOld + nAdd ); - - // assume that all new elements are overwriting old ones and so don't need to be added - sal_Int32 nTotal = nOld; - for ( sal_Int32 n=0; nGetWhich() != -2 ) // -2 : CancelPrintJob { view::PrintJobEvent aEvent; diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index 46a96bafab9a..fb4b93ae8475 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -337,51 +336,22 @@ void SfxPrinter::SetOptions( const SfxItemSet &rNewOptions ) void SfxPrinter::EnableRange( USHORT nRange ) { - PrintDialogRange eRange = (PrintDialogRange)nRange; - - if ( eRange == PRINTDIALOG_ALL ) - pImpl->mbAll = TRUE; - else if ( eRange == PRINTDIALOG_SELECTION ) - pImpl->mbSelection = TRUE; - else if ( eRange == PRINTDIALOG_FROMTO ) - pImpl->mbFromTo = TRUE; - else if ( eRange == PRINTDIALOG_RANGE ) - pImpl->mbRange = TRUE; + OSL_ENSURE( 0, "dead code !" ); } //-------------------------------------------------------------------- void SfxPrinter::DisableRange( USHORT nRange ) { - PrintDialogRange eRange = (PrintDialogRange)nRange; - - if ( eRange == PRINTDIALOG_ALL ) - pImpl->mbAll = FALSE; - else if ( eRange == PRINTDIALOG_SELECTION ) - pImpl->mbSelection = FALSE; - else if ( eRange == PRINTDIALOG_FROMTO ) - pImpl->mbFromTo = FALSE; - else if ( eRange == PRINTDIALOG_RANGE ) - pImpl->mbRange = FALSE; + OSL_ENSURE( 0, "dead code !" ); } //-------------------------------------------------------------------- BOOL SfxPrinter::IsRangeEnabled( USHORT nRange ) const { - PrintDialogRange eRange = (PrintDialogRange)nRange; - BOOL bRet = FALSE; - - if ( eRange == PRINTDIALOG_ALL ) - bRet = pImpl->mbAll; - else if ( eRange == PRINTDIALOG_SELECTION ) - bRet = pImpl->mbSelection; - else if ( eRange == PRINTDIALOG_FROMTO ) - bRet = pImpl->mbFromTo; - else if ( eRange == PRINTDIALOG_RANGE ) - bRet = pImpl->mbRange; - - return bRet; + OSL_ENSURE( 0, "dead code !" ); + return TRUE; } //-------------------------------------------------------------------- @@ -484,41 +454,8 @@ const SfxFont* SfxPrinter::GetFontByName( const String &rFontName ) BOOL SfxPrinter::InitJob( Window* pUIParent, BOOL bAskAboutTransparentObjects ) { - const SvtPrinterOptions aPrinterOpt; - const SvtPrintFileOptions aPrintFileOpt; - const SvtBasePrintOptions* pPrinterOpt = &aPrinterOpt; - const SvtBasePrintOptions* pPrintFileOpt = &aPrintFileOpt; - PrinterOptions aNewPrinterOptions; - BOOL bRet = TRUE; - - ( ( IsPrintFileEnabled() && GetPrintFile().Len() ) ? pPrintFileOpt : pPrinterOpt )->GetPrinterOptions( aNewPrinterOptions ); - - if( bAskAboutTransparentObjects && !aNewPrinterOptions.IsReduceTransparency() ) - { - if ( !Application::IsHeadlessModeEnabled() ) - { - SvtPrintWarningOptions aWarnOpt; - - if( aWarnOpt.IsTransparency() ) - { - TransparencyPrintWarningBox aWarnBox( pUIParent ); - const USHORT nRet = aWarnBox.Execute(); - - if( nRet == RET_CANCEL ) - bRet = FALSE; - else - { - aNewPrinterOptions.SetReduceTransparency( nRet != RET_NO ); - aWarnOpt.SetTransparency( !aWarnBox.IsNoWarningChecked() ); - } - } - } - } - - if( bRet ) - SetPrinterOptions( aNewPrinterOptions ); - - return bRet; + OSL_ENSURE( 0, "dead code !" ); + return FALSE; } //-------------------------------------------------------------------- diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 4ed0173be8e1..7dae3a4a4735 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -34,7 +34,6 @@ #include #include -#include #include #include #include @@ -338,30 +337,6 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt } } -// ----------------------------------------------------------------------- - -void DisableRanges( PrintDialog& rDlg, SfxPrinter* pPrinter ) - -/* [Beschreibung] - - Mit dieser Funktion werden die nicht verf"ugbaren Ranges - vom Printer zum PrintDialog geforwarded. -*/ - -{ - if ( !pPrinter ) - return; - - if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_ALL ) ) - rDlg.DisableRange( PRINTDIALOG_ALL ); - if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_SELECTION ) ) - rDlg.DisableRange( PRINTDIALOG_SELECTION ); - if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_FROMTO ) ) - rDlg.DisableRange( PRINTDIALOG_FROMTO ); - if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_RANGE ) ) - rDlg.DisableRange( PRINTDIALOG_RANGE ); -} - //==================================================================== class SfxDialogExecutor_Impl @@ -378,7 +353,6 @@ class SfxDialogExecutor_Impl { private: SfxViewShell* _pViewSh; - PrintDialog* _pPrintParent; PrinterSetupDialog* _pSetupParent; SfxItemSet* _pOptions; sal_Bool _bModified; @@ -387,7 +361,6 @@ private: DECL_LINK( Execute, void * ); public: - SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrintDialog* pParent ); SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrinterSetupDialog* pParent ); ~SfxDialogExecutor_Impl() { delete _pOptions; } @@ -398,22 +371,9 @@ public: //-------------------------------------------------------------------- -SfxDialogExecutor_Impl::SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrintDialog* pParent ) : - - _pViewSh ( pViewSh ), - _pPrintParent ( pParent ), - _pSetupParent ( NULL ), - _pOptions ( NULL ), - _bModified ( sal_False ), - _bHelpDisabled ( sal_False ) - -{ -} - SfxDialogExecutor_Impl::SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrinterSetupDialog* pParent ) : _pViewSh ( pViewSh ), - _pPrintParent ( NULL ), _pSetupParent ( pParent ), _pOptions ( NULL ), _bModified ( sal_False ), @@ -429,27 +389,13 @@ IMPL_LINK( SfxDialogExecutor_Impl, Execute, void *, EMPTYARG ) // Options lokal merken if ( !_pOptions ) { - DBG_ASSERT( _pPrintParent || _pSetupParent, "no dialog parent" ); - if( _pPrintParent ) - _pOptions = ( (SfxPrinter*)_pPrintParent->GetPrinter() )->GetOptions().Clone(); - else if( _pSetupParent ) + DBG_ASSERT( _pSetupParent, "no dialog parent" ); + if( _pSetupParent ) _pOptions = ( (SfxPrinter*)_pSetupParent->GetPrinter() )->GetOptions().Clone(); } - if ( _pOptions && _pPrintParent && _pPrintParent->IsSheetRangeAvailable() ) - { - SfxItemState eState = _pOptions->GetItemState( SID_PRINT_SELECTEDSHEET ); - if ( eState != SFX_ITEM_UNKNOWN ) - { - PrintSheetRange eRange = _pPrintParent->GetCheckedSheetRange(); - BOOL bValue = ( PRINTSHEETS_ALL != eRange ); - _pOptions->Put( SfxBoolItem( SID_PRINT_SELECTEDSHEET, bValue ) ); - } - } - // Dialog ausf"uhren - SfxPrintOptionsDialog* pDlg = new SfxPrintOptionsDialog( _pPrintParent ? static_cast(_pPrintParent) - : static_cast(_pSetupParent), + SfxPrintOptionsDialog* pDlg = new SfxPrintOptionsDialog( static_cast(_pSetupParent), _pViewSh, _pOptions ); if ( _bHelpDisabled ) pDlg->DisableHelp(); @@ -458,15 +404,6 @@ IMPL_LINK( SfxDialogExecutor_Impl, Execute, void *, EMPTYARG ) delete _pOptions; _pOptions = pDlg->GetOptions().Clone(); - if ( _pOptions && _pPrintParent && _pPrintParent->IsSheetRangeAvailable() ) - { - const SfxPoolItem* pItem; - if ( SFX_ITEM_SET == _pOptions->GetItemState( SID_PRINT_SELECTEDSHEET, FALSE , &pItem ) ) - { - _pPrintParent->CheckSheetRange( ( (const SfxBoolItem*)pItem )->GetValue() - ? PRINTSHEETS_SELECTED_SHEETS : PRINTSHEETS_ALL ); - } - } } delete pDlg; @@ -673,7 +610,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) USHORT nDialogRet = RET_CANCEL; // BOOL bCollate=FALSE; SfxPrinter* pPrinter = 0; - PrintDialog* pPrintDlg = 0; SfxDialogExecutor_Impl* pExecutor = 0; bool bSilent = false; BOOL bIsAPI = rReq.GetArgs() && rReq.GetArgs()->Count(); @@ -881,16 +817,12 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) // forget new printer, it was taken over (as pPrinter) or deleted pDlgPrinter = NULL; - /* Now lets reset the Dialog printer, since its freed */ - if (pPrintDlg) - pPrintDlg->SetPrinter (pPrinter); } else { // PrinterDialog is used to transfer information on printing, // so it will only be deleted here if dialog was cancelled DELETEZ( pDlgPrinter ); - DELETEZ( pPrintDlg ); rReq.Ignore(); if ( SID_PRINTDOC == nId ) rReq.SetReturnValue(SfxBoolItem(0,FALSE)); @@ -909,30 +841,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) //-------------------------------------------------------------------- -PrintDialog* SfxViewShell::CreatePrintDialog( Window* /*pParent*/ ) - -/* [Beschreibung] - - Diese Methode kann "uberladen werden, um einen speziellen PrintDialog - zu erzeugen. Dies ist z.B. notwendig wenn spezielle Features - wie drucken von Seitenbereichen. -*/ - -{ - #if 0 - PrintDialog *pDlg = new PrintDialog( pParent, false ); - pDlg->SetFirstPage( 1 ); - pDlg->SetLastPage( 9999 ); - pDlg->EnableCollate(); - return pDlg; - #else - return NULL; - #endif -} - -//-------------------------------------------------------------------- - -void SfxViewShell::PreparePrint( PrintDialog * ) +void SfxViewShell::PreparePrint() { } @@ -940,45 +849,10 @@ void SfxViewShell::PreparePrint( PrintDialog * ) ErrCode SfxViewShell::DoPrint( SfxPrinter* /*pPrinter*/, - PrintDialog* /*pPrintDlg*/, BOOL /*bSilent*/, BOOL /*bIsAPI*/ ) { - #if 0 - // Printer-Dialogbox waehrend des Ausdrucks mu\s schon vor - // StartJob erzeugt werden, da SV bei einem Quit-Event h"angt - SfxPrintProgress *pProgress = new SfxPrintProgress( this, !bSilent ); - SfxPrinter *pDocPrinter = GetPrinter(TRUE); - if ( !pPrinter ) - pPrinter = pDocPrinter; - else if ( pDocPrinter != pPrinter ) - { - pProgress->RestoreOnEndPrint( pDocPrinter->Clone() ); - SetPrinter( pPrinter, SFX_PRINTER_PRINTER ); - } - pProgress->SetWaitMode(FALSE); - - // Drucker starten - PreparePrint( pPrintDlg ); - SfxObjectShell *pObjShell = GetViewFrame()->GetObjectShell(); - if ( pPrinter->StartJob(pObjShell->GetTitle(0)) ) - { - // Drucken - Print( *pProgress, bIsAPI, pPrintDlg ); - pProgress->Stop(); - pProgress->DeleteOnEndPrint(); - pPrinter->EndJob(); - } - else - { - // Printer konnte nicht gestartet werden - delete pProgress; - } - - return pPrinter->GetError(); - #else DBG_ERROR( "DoPrint called, dead code !" ); return ERRCODE_IO_NOTSUPPORTED; - #endif } //-------------------------------------------------------------------- @@ -1008,7 +882,7 @@ void SfxViewShell::LockPrinter( BOOL bLock) //-------------------------------------------------------------------- -USHORT SfxViewShell::Print( SfxProgress& /*rProgress*/, BOOL /*bIsAPI*/, PrintDialog* /*pDlg*/ ) +USHORT SfxViewShell::Print( SfxProgress& /*rProgress*/, BOOL /*bIsAPI*/ ) { return 0; } -- cgit From 5dc2ff871dc5adf0eeb882b6b24a447be0012c9f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 4 Nov 2010 18:49:17 +0100 Subject: vcl117: #i115056# remove now unused svtools PrintDialog --- svtools/inc/svtools/printdlg.hxx | 297 -------------- svtools/source/dialogs/makefile.mk | 2 - svtools/source/dialogs/printdlg.cxx | 790 ------------------------------------ svtools/source/dialogs/printdlg.hrc | 74 ---- svtools/source/dialogs/printdlg.src | 349 ---------------- 5 files changed, 1512 deletions(-) delete mode 100644 svtools/inc/svtools/printdlg.hxx mode change 100755 => 100644 svtools/source/dialogs/makefile.mk delete mode 100644 svtools/source/dialogs/printdlg.cxx delete mode 100644 svtools/source/dialogs/printdlg.hrc delete mode 100644 svtools/source/dialogs/printdlg.src diff --git a/svtools/inc/svtools/printdlg.hxx b/svtools/inc/svtools/printdlg.hxx deleted file mode 100644 index 8c455b910b41..000000000000 --- a/svtools/inc/svtools/printdlg.hxx +++ /dev/null @@ -1,297 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SV_PRINTDLG_HXX_ -#define _SV_PRINTDLG_HXX_ - -#include "svtools/svtdllapi.h" - -#ifndef _VCL_DIALOG_HXX -#include -#endif -#ifndef _VCL_FIXED_HXX -#include -#endif -#ifndef _VCL_BUTTON_HXX -#include -#endif -#ifndef _VCL_GROUP_HXX -#include -#endif -#ifndef _VCL_FIELD_HXX -#include -#endif -#ifndef _VCL_EDIT_HXX -#include -#endif -#ifndef _VCL_LSTBOX_HXX -#include -#endif -#include - -class Printer; -class QueueInfo; -struct SvtPrinterImpl; - -// --------------------- -// - PrintDialog-Types - -// --------------------- - -enum PrintDialogRange{ - PRINTDIALOG_ALL, PRINTDIALOG_SELECTION, PRINTDIALOG_FROMTO, PRINTDIALOG_RANGE }; - -enum PrintSheetRange -{ - PRINTSHEETS_ALL, - PRINTSHEETS_SELECTED_SHEETS, - PRINTSHEETS_SELECTED_CELLS -}; - - -// --------------- -// - PrintDialog - -// --------------- - -class SVT_DLLPUBLIC PrintDialog : public ModalDialog -{ -private: - FixedLine maFlPrinter; - FixedText maFtName; - ListBox maLbName; - PushButton maBtnProperties; - FixedText maFtStatus; - FixedInfo maFiStatus; - FixedText maFtType; - FixedInfo maFiType; - FixedText maFtLocation; - FixedInfo maFiLocation; - FixedText maFtComment; - FixedInfo maFiComment; - - // "Print to file" or "Fax number" - CheckBox maCbxFilePrint; - FixedInfo maFiPrintFile; - FixedText maFiFaxNo; - Edit maEdtFaxNo; - //PushButton maBtnBrowse_nomore; - - // "Print" - FixedLine maFlPrint; - RadioButton maRbtAllSheets; - RadioButton maRbtSelectedSheets; - RadioButton maRbtSelectedCells; - - // "Print range" - FixedLine maFlPrintRange; - RadioButton maRbtAll; - RadioButton maRbtPages; - RadioButton maRbtSelection; - Edit maEdtPages; - - FixedLine maFlSepCopiesRange; - - // "Copies" - FixedLine maFlCopies; - FixedText maFtCopies; - NumericField maNumCopies; - FixedImage maImgCollate; - FixedImage maImgNotCollate; - CheckBox maCbxCollate; - - FixedLine maFlSepButtonLine; - PushButton maBtnOptions; - OKButton maBtnOK; - CancelButton maBtnCancel; - HelpButton maBtnHelp; - - AutoTimer maStatusTimer; - Printer* mpPrinter; - SvtPrinterImpl* mpPrinterImpl; - - XubString maRangeText; - USHORT mnCopyCount; - USHORT mnFirstPage; - USHORT mnLastPage; - USHORT mnMinPage; - USHORT mnMaxPage; - PrintDialogRange meCheckRange; - BOOL mbAll; - BOOL mbSelection; - BOOL mbFromTo; - BOOL mbRange; - BOOL mbCollate; - BOOL mbCollateCheck; - BOOL mbOptions; - bool mbWithSheetsAndCells; - Link maOptionsHdlLink; // Link zum Options-Handler - Link maOKHdlLink; // Link zum OK-Handler - - String maAllFilterStr; - - SVT_DLLPRIVATE void ImplCheckOK(); - SVT_DLLPRIVATE void ImplInitControls(); - SVT_DLLPRIVATE void ImplFillDialogData(); - SVT_DLLPRIVATE void ImplSetInfo(); - SVT_DLLPRIVATE void ImplSetImages(); - SVT_DLLPRIVATE bool ImplGetFilename(); - - DECL_DLLPRIVATE_LINK( ImplPropertiesHdl, void* ); - DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, void* ); - DECL_DLLPRIVATE_LINK( ImplModifyControlHdl, void* ); - DECL_DLLPRIVATE_LINK( ImplStatusHdl, Timer* ); - -public: - PrintDialog( Window* pWindow, bool bWithSheetsAndCells ); - ~PrintDialog(); - - virtual long OK(); - virtual long ClickOptionsHdl(); - - void SetPrinter( Printer* pNewPrinter ) { mpPrinter = pNewPrinter; } - Printer* GetPrinter() const { return mpPrinter; } - - inline bool IsSheetRangeAvailable() const { return mbWithSheetsAndCells; } - void EnableSheetRange( bool bEnable, PrintSheetRange eRange ); - bool IsSheetRangeEnabled( PrintSheetRange eRange ) const; - void CheckSheetRange( PrintSheetRange eRange ); - PrintSheetRange GetCheckedSheetRange() const; - bool IsSheetRangeChecked( PrintSheetRange eRange ) const; - - void EnableRange( PrintDialogRange eRange ); - void DisableRange( PrintDialogRange eRange ); - BOOL IsRangeEnabled( PrintDialogRange eRange ) const; - - void CheckRange( PrintDialogRange eRange = PRINTDIALOG_ALL ) - { meCheckRange = eRange; } - PrintDialogRange GetCheckedRange() const { return meCheckRange; } - BOOL IsRangeChecked( PrintDialogRange eRange ) const; - - void SetRangeText( const XubString& rRange ) { maRangeText = rRange; } - const XubString& GetRangeText() const { return maRangeText; } - - void SetFirstPage( USHORT nPage = 0 ); - USHORT GetFirstPage() const { return mnFirstPage; } - void SetLastPage( USHORT nPage = 0 ); - USHORT GetLastPage() const { return mnLastPage; } - - void SetMinPage( USHORT nPage = 1 ) { mnMinPage = nPage; } - USHORT GetMinPage() const { return mnMinPage; } - void SetMaxPage( USHORT nPage = 65535 ) { mnMaxPage = nPage; } - USHORT GetMaxPage() const { return mnMaxPage; } - - void SetCopyCount( USHORT nCopies = 1 ) { mnCopyCount = nCopies; } - USHORT GetCopyCount() const { return mnCopyCount; } - - void EnableCollate( BOOL bEnable = TRUE ) - { mbCollate = bEnable; } - BOOL IsCollateEnabled() const { return mbCollate; } - void CheckCollate( BOOL bCheck = TRUE ) - { mbCollateCheck = bCheck; } - BOOL IsCollateChecked() const { return mbCollateCheck; } - - void ShowOptionsButton( BOOL bShow = TRUE ) - { mbOptions = bShow; } - BOOL IsOptionsButtonVisible() const { return mbOptions; } - - void SetOptionsHdl( const Link& rLink ) { maOptionsHdlLink = rLink; } - const Link& GetOptionsHdl() const { return maOptionsHdlLink; } - - void SetOKHdl( const Link& rLink ) { maOKHdlLink = rLink; } - const Link& GetOKHdl() const { return maOKHdlLink; } - - virtual void DataChanged( const DataChangedEvent& rDCEvt ); - virtual long Notify( NotifyEvent& rNEvt ); - - virtual short Execute(); - - void DisableHelp(); -}; - -inline void PrintDialog::EnableRange( PrintDialogRange eRange ) -{ - if ( eRange == PRINTDIALOG_ALL ) - mbAll = TRUE; - else if ( eRange == PRINTDIALOG_SELECTION ) - mbSelection = TRUE; - else if ( eRange == PRINTDIALOG_FROMTO ) - mbFromTo = TRUE; - else - mbRange = TRUE; -} - -inline void PrintDialog::DisableRange( PrintDialogRange eRange ) -{ - if ( eRange == PRINTDIALOG_ALL ) - mbAll = FALSE; - else if ( eRange == PRINTDIALOG_SELECTION ) - mbSelection = FALSE; - else if ( eRange == PRINTDIALOG_FROMTO ) - mbFromTo = FALSE; - else - mbRange = FALSE; -} - -inline BOOL PrintDialog::IsRangeEnabled( PrintDialogRange eRange ) const -{ - BOOL bRet; - - if ( eRange == PRINTDIALOG_ALL ) - bRet = mbAll; - else if ( eRange == PRINTDIALOG_SELECTION ) - bRet = mbSelection; - else if ( eRange == PRINTDIALOG_FROMTO ) - bRet = mbFromTo; - else - bRet = mbRange; - - return bRet; -} - -inline BOOL PrintDialog::IsRangeChecked( PrintDialogRange eRange ) const -{ - if ( eRange == meCheckRange ) - return TRUE; - else - return FALSE; -} - -inline void PrintDialog::SetFirstPage( USHORT nPage ) -{ - mnFirstPage = nPage; - if ( nPage && (nPage < mnMinPage) ) - mnMinPage = nPage; -} - -inline void PrintDialog::SetLastPage( USHORT nPage ) -{ - mnLastPage = nPage; - if ( nPage && (nPage > mnMaxPage) ) - mnMaxPage = nPage; -} - -#endif // _SV_PRINTDLG_HXX_ - diff --git a/svtools/source/dialogs/makefile.mk b/svtools/source/dialogs/makefile.mk old mode 100755 new mode 100644 index 99c4b59b76ae..00626ec6b082 --- a/svtools/source/dialogs/makefile.mk +++ b/svtools/source/dialogs/makefile.mk @@ -42,7 +42,6 @@ SRC1FILES= filedlg2.src \ so3res.src \ formats.src \ prnsetup.src \ - printdlg.src \ colrdlg.src \ addresstemplate.src \ wizardmachine.src @@ -63,7 +62,6 @@ SLOFILES= \ $(SLO)$/filedlg.obj \ $(SLO)$/filedlg2.obj \ $(SLO)$/prnsetup.obj \ - $(SLO)$/printdlg.obj \ $(SLO)$/colctrl.obj \ $(SLO)$/colrdlg.obj \ $(SLO)$/property.obj \ diff --git a/svtools/source/dialogs/printdlg.cxx b/svtools/source/dialogs/printdlg.cxx deleted file mode 100644 index dba5ed627952..000000000000 --- a/svtools/source/dialogs/printdlg.cxx +++ /dev/null @@ -1,790 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" -#include -#include -#include -#include -#include -#include -#include "printdlg.hrc" -#include "controldims.hrc" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using rtl::OUString; -using namespace com::sun::star; - -struct SvtPrinterImpl -{ - Printer* m_pTempPrinter; - sal_Bool m_bHelpDisabled; - PrintSheetRange m_eSheetRange; - - SvtPrinterImpl() : - m_pTempPrinter( NULL ), m_bHelpDisabled( sal_False ), m_eSheetRange( PRINTSHEETS_ALL ) {} - ~SvtPrinterImpl() { delete m_pTempPrinter; } -}; - -#define TEMPPRINTER() mpPrinterImpl->m_pTempPrinter - -// ======================================================================= - -PrintDialog::PrintDialog( Window* pWindow, bool bWithSheetsAndCells ) : - ModalDialog ( pWindow, SvtResId( DLG_SVT_PRNDLG_PRINTDLG ) ), - maFlPrinter ( this, SvtResId( FL_PRINTER ) ), - maFtName ( this, SvtResId( FT_NAME ) ), - maLbName ( this, SvtResId( LB_NAMES ) ), - maBtnProperties ( this, SvtResId( BTN_PROPERTIES ) ), - maFtStatus ( this, SvtResId( FT_STATUS ) ), - maFiStatus ( this, SvtResId( FI_STATUS ) ), - maFtType ( this, SvtResId( FT_TYPE ) ), - maFiType ( this, SvtResId( FI_TYPE ) ), - maFtLocation ( this, SvtResId( FT_LOCATION ) ), - maFiLocation ( this, SvtResId( FI_LOCATION ) ), - maFtComment ( this, SvtResId( FT_COMMENT ) ), - maFiComment ( this, SvtResId( FI_COMMENT ) ), - maCbxFilePrint ( this, SvtResId( CBX_FILEPRINT ) ), - maFiPrintFile ( this, SvtResId( FI_PRINTFILE ) ), - maFiFaxNo ( this, SvtResId( FI_FAXNO ) ), - maEdtFaxNo ( this, SvtResId( EDT_FAXNO ) ), - maFlPrint ( this, SvtResId( FL_PRINT ) ), - maRbtAllSheets ( this, SvtResId( RBT_ALL_SHEETS ) ), - maRbtSelectedSheets ( this, SvtResId( RBT_SELECTED_SHEETS ) ), - maRbtSelectedCells ( this, SvtResId( RBT_SELECTED_CELLS ) ), - maFlPrintRange ( this, SvtResId( FL_PRINTRANGE ) ), - maRbtAll ( this, SvtResId( RBT_ALL ) ), - maRbtPages ( this, SvtResId( RBT_PAGES ) ), - maRbtSelection ( this, SvtResId( RBT_SELECTION ) ), - maEdtPages ( this, SvtResId( EDT_PAGES ) ), - maFlSepCopiesRange ( this, SvtResId( FL_SEPCOPIESRANGE ) ), - maFlCopies ( this, SvtResId( FL_COPIES ) ), - maFtCopies ( this, SvtResId( FT_COPIES ) ), - maNumCopies ( this, SvtResId( NUM_COPIES ) ), - maImgCollate ( this, SvtResId( IMG_COLLATE ) ), - maImgNotCollate ( this, SvtResId( IMG_NOT_COLLATE ) ), - maCbxCollate ( this, SvtResId( CBX_COLLATE ) ), - maFlSepButtonLine ( this, SvtResId( FL_SEPBUTTONLINE ) ), - maBtnOptions ( this, SvtResId( BTN_OPTIONS ) ), - maBtnOK ( this, SvtResId( BTN_OK ) ), - maBtnCancel ( this, SvtResId( BTN_CANCEL ) ), - maBtnHelp ( this, SvtResId( BTN_HELP ) ), - mbWithSheetsAndCells( bWithSheetsAndCells ), - maAllFilterStr ( SvtResId( STR_ALLFILTER ) ) - -{ - FreeResource(); - - mpPrinter = NULL; - mpPrinterImpl = new SvtPrinterImpl; - mnCopyCount = 1; - mnFirstPage = 0; - mnLastPage = 0; - mnMinPage = 1; - mnMaxPage = 65535; - meCheckRange = PRINTDIALOG_ALL; - mbAll = TRUE; - mbSelection = FALSE; - mbFromTo = FALSE; - mbRange = FALSE; - mbCollate = TRUE; - mbCollateCheck = TRUE; - mbOptions = FALSE; - - maStatusTimer.SetTimeout( IMPL_PRINTDLG_STATUS_UPDATE ); - maStatusTimer.SetTimeoutHdl( LINK( this, PrintDialog, ImplStatusHdl ) ); - maBtnProperties.SetClickHdl( LINK( this, PrintDialog, ImplPropertiesHdl ) ); - maLbName.SetSelectHdl( LINK( this, PrintDialog, ImplChangePrinterHdl ) ); - - maFiPrintFile.SetStyle( maFiPrintFile.GetStyle() | WB_PATHELLIPSIS ); - - Link aLink( LINK( this, PrintDialog, ImplModifyControlHdl ) ); - maCbxFilePrint.SetClickHdl( aLink ); - maRbtAll.SetClickHdl( aLink ); - maRbtPages.SetClickHdl( aLink ); - maRbtSelection.SetClickHdl( aLink ); - maEdtPages.SetModifyHdl( aLink ); - maNumCopies.SetModifyHdl( aLink ); - maCbxCollate.SetClickHdl( aLink ); - maBtnOptions.SetClickHdl( aLink ); - maEdtFaxNo.SetModifyHdl( aLink ); - maBtnOK.SetClickHdl( aLink ); - - maRbtAll.Check(); - ImplSetImages(); -} - -// ----------------------------------------------------------------------- - -PrintDialog::~PrintDialog() -{ - ImplFreePrnDlgListBox( &maLbName, FALSE ); - delete mpPrinterImpl; -} - -// ----------------------------------------------------------------------- - -void PrintDialog::ImplSetImages() -{ - if( ! GetSettings().GetStyleSettings().GetHighContrastMode() ) - { - maImgCollate.SetModeImage( Image( SvtResId( RID_IMG_PRNDLG_COLLATE ) ), BMP_COLOR_NORMAL ); - maImgNotCollate.SetModeImage( Image( SvtResId( RID_IMG_PRNDLG_NOCOLLATE ) ), BMP_COLOR_NORMAL ); - } - else - { - maImgCollate.SetModeImage( Image( SvtResId( RID_IMG_PRNDLG_COLLATE_HC ) ), BMP_COLOR_HIGHCONTRAST ); - maImgNotCollate.SetModeImage( Image( SvtResId( RID_IMG_PRNDLG_NOCOLLATE_HC ) ), BMP_COLOR_HIGHCONTRAST ); - } -} - -// ----------------------------------------------------------------------- - -void PrintDialog::ImplSetInfo() -{ - const QueueInfo* pInfo = Printer::GetQueueInfo( maLbName.GetSelectEntry(), true ); - if ( pInfo ) - { - maFiType.SetText( pInfo->GetDriver() ); - maFiLocation.SetText( pInfo->GetLocation() ); - maFiComment.SetText( pInfo->GetComment() ); - maFiStatus.SetText( ImplPrnDlgGetStatusText( *pInfo ) ); - } - else - { - XubString aTempStr; - maFiType.SetText( aTempStr ); - maFiLocation.SetText( aTempStr ); - maFiComment.SetText( aTempStr ); - maFiStatus.SetText( aTempStr ); - } - -#ifdef UNX - if( pInfo && pInfo->GetLocation().EqualsAscii( "fax_queue" ) ) - { - maFiPrintFile.Show( FALSE ); - maCbxFilePrint.Show( FALSE ); - maFiFaxNo.Show( TRUE ); - maEdtFaxNo.Show( TRUE ); - Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter; - maEdtFaxNo.SetText( pPrinter->GetJobValue( String::CreateFromAscii( "FAX#" ) ) ); - - Size aFTSize = maFiFaxNo.GetSizePixel(); - long nTextWidth = maFiFaxNo.GetCtrlTextWidth( maFiFaxNo.GetText() ) + 10; - if ( aFTSize.Width() < nTextWidth ) - { - long nDelta = nTextWidth - aFTSize.Width(); - aFTSize.Width() = aFTSize.Width() + nDelta; - maFiFaxNo.SetSizePixel( aFTSize ); - Size aEdtSize = maEdtFaxNo.GetSizePixel(); - aEdtSize.Width() = aEdtSize.Width() - nDelta; - Point aEdtPos = maEdtFaxNo.GetPosPixel(); - aEdtPos.X() = aEdtPos.X() + nDelta; - maEdtFaxNo.SetPosSizePixel( aEdtPos, aEdtSize ); - } - } - else -#endif - { - maFiPrintFile.Show( TRUE ); - maCbxFilePrint.Show( TRUE ); - maFiFaxNo.Show( FALSE ); - maEdtFaxNo.Show( FALSE ); - } - -} - -// ----------------------------------------------------------------------- - -void PrintDialog::ImplCheckOK() -{ - // Ueberprueft, ob der OK-Button enabled ist - BOOL bEnable = TRUE; - - if ( bEnable && maRbtPages.IsChecked() ) - bEnable = maEdtPages.GetText().Len() > 0; - - if ( bEnable ) - { - if ( TEMPPRINTER() ) - bEnable = TEMPPRINTER()->IsValid(); - else - bEnable = mpPrinter->IsValid(); - } - - maBtnOK.Enable( bEnable ); -} - -// ----------------------------------------------------------------------- - -void PrintDialog::ImplInitControls() -{ - // Alles - if ( mbAll ) - { - maRbtAll.Enable(); - if( meCheckRange == PRINTDIALOG_ALL ) - maRbtAll.Check( TRUE ); - } - else - maRbtAll.Enable( FALSE ); - - // Selektion - if ( mbSelection ) - { - maRbtSelection.Enable(); - if ( meCheckRange == PRINTDIALOG_SELECTION ) - maRbtSelection.Check( TRUE ); - } - else - maRbtSelection.Enable( FALSE ); - - // Seiten - if ( mbRange ) - { - maRbtPages.Enable(); - maEdtPages.Show(); - maEdtPages.SetText( maRangeText ); - - if( ( meCheckRange == PRINTDIALOG_FROMTO ) || - ( meCheckRange == PRINTDIALOG_RANGE ) ) - { - maRbtPages.Check( TRUE ); - maEdtPages.Enable(); - } - else - maEdtPages.Enable( FALSE ); - } - else - { - maRbtPages.Enable( FALSE ); - maEdtPages.Hide(); - } - - // Anzahl Kopien - maNumCopies.SetValue( mnCopyCount ); - - // Sortierung - maCbxCollate.Enable( mbCollate ); - maCbxCollate.Check( mbCollateCheck ); - - // Zusaetze-Button - if ( mbOptions ) - maBtnOptions.Show(); - - if ( !mbWithSheetsAndCells ) - { - Size aMarginSize = - LogicToPixel( Size( RSC_SP_CTRL_GROUP_X, RSC_SP_CTRL_GROUP_Y ), MAP_APPFONT ); - long nTempPos = maImgCollate.GetPosPixel().Y() + - maImgCollate.GetSizePixel().Height() + aMarginSize.Height(); - long nDelta1 = maFlPrintRange.GetPosPixel().Y() - maFlPrint.GetPosPixel().Y(); - long nDelta2 = maFlSepButtonLine.GetPosPixel().Y() - nTempPos; - - maFlPrint.Hide(); - maRbtAllSheets.Hide(); - maRbtSelectedSheets.Hide(); - maRbtSelectedCells.Hide(); - maRbtSelection.Show(); - - Size aNewSize = GetSizePixel(); - aNewSize.Height() -= nDelta2; - SetSizePixel( aNewSize ); - aNewSize = maFlSepCopiesRange.GetSizePixel(); - aNewSize.Height() -= nDelta2; - maFlSepCopiesRange.SetSizePixel( aNewSize ); - - long nDelta = nDelta1; - Window* pControls[] = { &maFlPrintRange, &maRbtAll, - &maRbtPages, &maEdtPages, &maRbtSelection, NULL, - &maFlSepButtonLine, &maBtnOptions, &maBtnOK, - &maBtnCancel, &maBtnHelp }; - Window** pCtrl = pControls; - const sal_Int32 nCount = sizeof( pControls ) / sizeof( pControls[0] ); - for ( sal_Int32 i = 0; i < nCount; ++i, ++pCtrl ) - { - if ( NULL == *pCtrl ) - { - nDelta = nDelta2; - continue; - } - Point aNewPos = (*pCtrl)->GetPosPixel(); - aNewPos.Y() -= nDelta; - (*pCtrl)->SetPosPixel( aNewPos ); - } - } -} - -// ----------------------------------------------------------------------- - -void PrintDialog::ImplFillDialogData() -{ - if ( maRbtAll.IsChecked() ) - meCheckRange = PRINTDIALOG_ALL; - else if( maRbtSelection.IsChecked() ) - meCheckRange = PRINTDIALOG_SELECTION; - else - { - meCheckRange = PRINTDIALOG_RANGE; - maRangeText = maEdtPages.GetText(); - } - - mnCopyCount = (USHORT) maNumCopies.GetValue(); - mbCollateCheck = maCbxCollate.IsChecked(); - - // In Datei drucken - if ( maCbxFilePrint.IsChecked() ) - mpPrinter->SetPrintFile( maFiPrintFile.GetText() ); - mpPrinter->EnablePrintFile( maCbxFilePrint.IsChecked() ); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( PrintDialog, ImplStatusHdl, Timer*, EMPTYARG ) -{ - QueueInfo aInfo; - ImplPrnDlgUpdateQueueInfo( &maLbName, aInfo ); - maFiStatus.SetText( ImplPrnDlgGetStatusText( aInfo ) ); - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( PrintDialog, ImplPropertiesHdl, void*, EMPTYARG ) -{ - if ( !TEMPPRINTER() ) - TEMPPRINTER() = new Printer( mpPrinter->GetJobSetup() ); - TEMPPRINTER()->Setup( this ); - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( PrintDialog, ImplChangePrinterHdl, void*, EMPTYARG ) -{ - TEMPPRINTER() = ImplPrnDlgListBoxSelect( &maLbName, &maBtnProperties, - mpPrinter, TEMPPRINTER() ); - ImplSetInfo(); - ImplCheckOK(); // Check if "OK" button can be enabled now! - - return 0; -} - -// ----------------------------------------------------------------------- - -bool PrintDialog::ImplGetFilename() -{ - uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - static ::rtl::OUString aOldFile; - if( xFactory.is() ) - { - uno::Sequence< uno::Any > aTempl( 1 ); - aTempl.getArray()[0] <<= ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION; - uno::Reference< ui::dialogs::XFilePicker > xFilePicker( - xFactory->createInstanceWithArguments( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ), - aTempl ), uno::UNO_QUERY ); - DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" ); - - uno::Reference< ui::dialogs::XFilterManager > xFilterMgr( xFilePicker, uno::UNO_QUERY ); - if( xFilePicker.is() && xFilterMgr.is() ) - { - try - { -#ifdef UNX - // add PostScript and PDF - Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter; - bool bPS = true, bPDF = true; - if( pPrinter ) - { - if( pPrinter->GetCapabilities( PRINTER_CAPABILITIES_PDF ) ) - bPS = false; - else - bPDF = false; - } - if( bPS ) - xFilterMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PostScript" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.ps" ) ) ); - if( bPDF ) - xFilterMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Portable Document Format" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.pdf" ) ) ); -#elif defined WNT - xFilterMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.PRN" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.prn" ) ) ); -#endif - // add arbitrary files - xFilterMgr->appendFilter( maAllFilterStr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.*" ) ) ); - } - catch( lang::IllegalArgumentException rExc ) - { - DBG_ERRORFILE( "caught IllegalArgumentException when registering filter\n" ); - } - - if( aOldFile.getLength() ) - { - INetURLObject aUrl( aOldFile, INET_PROT_FILE ); - xFilePicker->setDefaultName( aUrl.GetLastName() ); - aUrl.CutLastName(); - xFilePicker->setDisplayDirectory( aUrl.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); - } - - if( xFilePicker->execute() == ui::dialogs::ExecutableDialogResults::OK ) - { - uno::Sequence< ::rtl::OUString > aPathSeq( xFilePicker->getFiles() ); - INetURLObject aObj( aPathSeq[0] ); - maFiPrintFile.SetText( aOldFile = aObj.PathToFileName() ); - return true; - } - return false; - } - } - - // something went awry, lets try the old fashioned dialogue - Window* pDlgParent = IsReallyVisible() ? this : GetParent(); - FileDialog aDlg( pDlgParent, WB_STDDIALOG | WB_SAVEAS ); -#ifdef WNT - aDlg.AddFilter( String( RTL_CONSTASCII_USTRINGPARAM( "*.prn" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.prn" ) ) ); - aDlg.SetDefaultExt( String( RTL_CONSTASCII_USTRINGPARAM( "prn" ) ) ); -#elif defined UNX - aDlg.AddFilter( String( RTL_CONSTASCII_USTRINGPARAM( "PostScript" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.ps" ) ) ); - aDlg.SetDefaultExt( String( RTL_CONSTASCII_USTRINGPARAM( "ps" ) ) ); -#endif - - if( aOldFile.getLength() ) - aDlg.SetPath( aOldFile ); - - if( aDlg.Execute() ) - { - String aTargetFile = aDlg.GetPath(); - maFiPrintFile.SetText( aOldFile = aTargetFile ); - return true; - } - - return false; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( PrintDialog, ImplModifyControlHdl, void*, p ) -{ - // Radiobuttons (Umfang) - if ( !p || (p == &maRbtAll) || (p == &maRbtPages) || (p == &maRbtSelection) ) - { - BOOL bCheck = maRbtPages.IsChecked(); - maEdtPages.Enable( bCheck ); - if ( p == &maRbtPages ) - maEdtPages.GrabFocus(); - ImplCheckOK(); - } - - // Edit-Felder (Seiten) - if ( p == &maEdtPages ) - ImplCheckOK(); - - if( p == &maEdtFaxNo ) - { - Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter; - pPrinter->SetJobValue( String::CreateFromAscii( "FAX#" ), maEdtFaxNo.GetText() ); - } - - // Anzahl Kopien - BOOL bNumCopies = FALSE; - - if ( !p || p == &maNumCopies ) - { - if ( p ) - bNumCopies = TRUE; - //BOOL bCopies = maNumCopies.GetValue() > 1; - maCbxCollate.Enable( mbCollate ); - - /*if ( !bCopies ) - maCbxCollate.Check( FALSE ); - else*/ - if ( mbCollateCheck ) - maCbxCollate.Check( TRUE ); - } - - // Sortieren - if ( !p || p == &maCbxCollate || bNumCopies ) - { - BOOL bCheck = maCbxCollate.IsChecked(); - - if ( !bNumCopies ) - mbCollateCheck = maCbxCollate.IsChecked(); - - if( bCheck ) - { - maImgCollate.Show(); - maImgNotCollate.Hide(); - } - else - { - maImgCollate.Hide(); - maImgNotCollate.Show(); - } - } - - // Zus"atze - if ( p == &maBtnOptions ) - ClickOptionsHdl(); - - if( p == &maBtnOK ) - { - EndDialog( maCbxFilePrint.IsChecked() ? ImplGetFilename() : TRUE ); - } - - return 0; -} - -// ----------------------------------------------------------------------- - -long PrintDialog::ClickOptionsHdl() -{ - if ( maOptionsHdlLink.IsSet() ) - return maOptionsHdlLink.Call( this ); - else - return TRUE; -} - -// ----------------------------------------------------------------------- - -long PrintDialog::OK() -{ - if ( maOKHdlLink.IsSet() ) - return maOKHdlLink.Call( this ); - else - return TRUE; -} - -// ----------------------------------------------------------------------- - -void PrintDialog::EnableSheetRange( bool bEnable, PrintSheetRange eRange ) -{ - if ( mbWithSheetsAndCells ) - { - switch ( eRange ) - { - case PRINTSHEETS_ALL : - maRbtAllSheets.Enable( bEnable != false ); - break; - case PRINTSHEETS_SELECTED_SHEETS : - maRbtSelectedSheets.Enable( bEnable != false ); - break; - case PRINTSHEETS_SELECTED_CELLS : - maRbtSelectedCells.Enable( bEnable != false ); - break; - default: - DBG_ERRORFILE( "PrintDialog::EnableSheetRange(): invalid range" ); - } - } -} - -// ----------------------------------------------------------------------- - -bool PrintDialog::IsSheetRangeEnabled( PrintSheetRange eRange ) const -{ - if ( !mbWithSheetsAndCells ) - return false; - - bool bRet = false; - switch ( eRange ) - { - case PRINTSHEETS_ALL : - bRet = maRbtAllSheets.IsEnabled() != FALSE; - break; - case PRINTSHEETS_SELECTED_SHEETS : - bRet = maRbtSelectedSheets.IsEnabled() != FALSE; - break; - case PRINTSHEETS_SELECTED_CELLS : - bRet = maRbtSelectedCells.IsEnabled() != FALSE; - break; - default: - DBG_ERRORFILE( "PrintDialog::IsSheetRangeEnabled(): invalid range" ); - } - return bRet; -} - -// ----------------------------------------------------------------------- - -void PrintDialog::CheckSheetRange( PrintSheetRange eRange ) -{ - if ( mbWithSheetsAndCells ) - { - switch ( eRange ) - { - case PRINTSHEETS_ALL : - maRbtAllSheets.Check(); - break; - case PRINTSHEETS_SELECTED_SHEETS : - maRbtSelectedSheets.Check(); - break; - case PRINTSHEETS_SELECTED_CELLS : - maRbtSelectedCells.Check(); - break; - default: - DBG_ERRORFILE( "PrintDialog::CheckSheetRange(): invalid range" ); - } - } -} - -// ----------------------------------------------------------------------- - -PrintSheetRange PrintDialog::GetCheckedSheetRange() const -{ - PrintSheetRange eRange = PRINTSHEETS_ALL; - if ( mbWithSheetsAndCells ) - { - if ( maRbtSelectedSheets.IsChecked() ) - eRange = PRINTSHEETS_SELECTED_SHEETS; - else if ( maRbtSelectedCells.IsChecked() ) - eRange = PRINTSHEETS_SELECTED_CELLS; - } - return eRange; -} - -// ----------------------------------------------------------------------- - -bool PrintDialog::IsSheetRangeChecked( PrintSheetRange eRange ) const -{ - if ( !mbWithSheetsAndCells ) - return false; - - bool bRet = false; - switch ( eRange ) - { - case PRINTSHEETS_ALL : - bRet = maRbtAllSheets.IsChecked() != FALSE; - break; - case PRINTSHEETS_SELECTED_SHEETS : - bRet = maRbtSelectedSheets.IsChecked() != FALSE; - break; - case PRINTSHEETS_SELECTED_CELLS : - bRet = maRbtSelectedCells.IsChecked() != FALSE; - break; - default: - DBG_ERRORFILE( "PrintDialog::IsSheetRangeChecked(): invalid range" ); - } - return bRet; -} - -// ----------------------------------------------------------------------- - -long PrintDialog::Notify( NotifyEvent& rNEvt ) -{ - if ( (rNEvt.GetType() == EVENT_GETFOCUS) && IsReallyVisible() ) - ImplStatusHdl( &maStatusTimer ); - else if ( rNEvt.GetType() == EVENT_KEYINPUT ) - { - if ( rNEvt.GetKeyEvent()->GetKeyCode().GetCode() == KEY_F1 && mpPrinterImpl->m_bHelpDisabled ) - return 1; // do nothing - } - - return ModalDialog::Notify( rNEvt ); -} - -// ----------------------------------------------------------------------- - -void PrintDialog::DataChanged( const DataChangedEvent& rDCEvt ) -{ - if ( rDCEvt.GetType() == DATACHANGED_PRINTER ) - { - TEMPPRINTER() = ImplPrnDlgUpdatePrinter( mpPrinter, TEMPPRINTER() ); - Printer* pPrn; - if ( TEMPPRINTER() ) - pPrn = TEMPPRINTER(); - else - pPrn = mpPrinter; - ImplFillPrnDlgListBox( pPrn, &maLbName, &maBtnProperties ); - ImplSetInfo(); - ImplCheckOK(); - } - else if ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) - ImplSetImages(); - - ModalDialog::DataChanged( rDCEvt ); -} - -// ----------------------------------------------------------------------- - -short PrintDialog::Execute() -{ - if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() ) - { - DBG_ERRORFILE( "PrinterSetupDialog::Execute() - No Printer or printer is printing" ); - return FALSE; - } - - // check if the printer brings up its own dialog - // in that case leave the work to that dialog - if( mpPrinter->GetCapabilities( PRINTER_CAPABILITIES_EXTERNALDIALOG ) ) - return TRUE; - - Printer::updatePrinters(); - - // Controls initialisieren - ImplFillPrnDlgListBox( mpPrinter, &maLbName, &maBtnProperties ); - ImplSetInfo(); - maStatusTimer.Start(); - ImplInitControls(); - maNumCopies.GrabFocus(); - maNumCopies.SetSelection( Selection( 0, maNumCopies.GetText().Len() ) ); - ImplModifyControlHdl( NULL ); - - // Dialog starten - short nRet = ModalDialog::Execute(); - - // Wenn Dialog mit OK beendet wurde, dann die Daten updaten - if( nRet == TRUE ) - { - if ( TEMPPRINTER() ) - mpPrinter->SetPrinterProps( TEMPPRINTER() ); - ImplFillDialogData(); - } - - maStatusTimer.Stop(); - - return nRet; -} - -// ----------------------------------------------------------------------- - -void PrintDialog::DisableHelp() -{ - mpPrinterImpl->m_bHelpDisabled = sal_True; - maBtnHelp.Disable(); -} - diff --git a/svtools/source/dialogs/printdlg.hrc b/svtools/source/dialogs/printdlg.hrc deleted file mode 100644 index 83b7b0b28c82..000000000000 --- a/svtools/source/dialogs/printdlg.hrc +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include - -#define FL_PRINTER 1 -#define LB_NAMES 2 -#define BTN_PROPERTIES 3 -#define FT_NAME 4 -#define FT_STATUS 5 -#define FI_STATUS 6 -#define FT_TYPE 7 -#define FI_TYPE 8 -#define FT_LOCATION 9 -#define FI_LOCATION 10 -#define FT_COMMENT 11 -#define FI_COMMENT 12 -#define CBX_FILEPRINT 13 -#define FI_PRINTFILE 14 -#define FI_FAXNO 15 -#define EDT_FAXNO 16 - -#define FL_PRINT 20 -#define RBT_ALL_SHEETS 21 -#define RBT_SELECTED_SHEETS 22 -#define RBT_SELECTED_CELLS 23 - -#define FL_PRINTRANGE 30 -#define RBT_ALL 31 -#define RBT_PAGES 32 -#define EDT_PAGES 33 -#define RBT_SELECTION 34 - -#define FL_SEPCOPIESRANGE 35 - -#define FL_COPIES 40 -#define FT_COPIES 41 -#define NUM_COPIES 42 -#define CBX_COLLATE 43 -#define IMG_COLLATE 44 -#define IMG_NOT_COLLATE 45 - -#define FL_SEPBUTTONLINE 50 -#define BTN_OK 51 -#define BTN_CANCEL 52 -#define BTN_HELP 53 -#define BTN_OPTIONS 54 - -#define STR_ALLFILTER 10 - diff --git a/svtools/source/dialogs/printdlg.src b/svtools/source/dialogs/printdlg.src deleted file mode 100644 index 80c6e465d49a..000000000000 --- a/svtools/source/dialogs/printdlg.src +++ /dev/null @@ -1,349 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "printdlg.hrc" - -#define IMAGE_MAGENTA_MASK Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; } - -ModalDialog DLG_SVT_PRNDLG_PRINTDLG -{ - HelpID = "svtools:ModalDialog:DLG_SVT_PRNDLG_PRINTDLG"; - SVLook = TRUE ; - OutputSize = TRUE ; - Moveable = TRUE ; - Size = MAP_APPFONT ( 265 , 210 ) ; - Text [ en-US ] = "Print" ; - FixedLine FL_PRINTER - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 253 , 8 ) ; - Text [ en-US ] = "Printer" ; - }; - FixedText FT_NAME - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "~Name" ; - }; - ListBox LB_NAMES - { - HelpID = "svtools:ListBox:DLG_SVT_PRNDLG_PRINTDLG:LB_NAMES"; - Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 13 ) ; - Size = MAP_APPFONT ( 130 , 80 ) ; - DropDown = TRUE ; - Sort = TRUE ; - }; - PushButton BTN_PROPERTIES - { - HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_PROPERTIES"; - Pos = MAP_APPFONT ( 193 , 12 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "Propert~ies..." ; - }; - FixedText FT_STATUS - { - Pos = MAP_APPFONT ( 12 , 29 ) ; - Size = MAP_APPFONT ( 45 , 8 ) ; - Text [ en-US ] = "Status" ; - }; - FixedText FI_STATUS - { - Pos = MAP_APPFONT ( 60 , 29 ) ; - Size = MAP_APPFONT ( 193 , 8 ) ; - }; - FixedText FT_TYPE - { - Pos = MAP_APPFONT ( 12 , 40 ) ; - Size = MAP_APPFONT ( 45 , 8 ) ; - Text [ en-US ] = "Type" ; - }; - FixedText FI_TYPE - { - Pos = MAP_APPFONT ( 60 , 40 ) ; - Size = MAP_APPFONT ( 193 , 8 ) ; - }; - FixedText FT_LOCATION - { - Pos = MAP_APPFONT ( 12 , 51 ) ; - Size = MAP_APPFONT ( 45 , 8 ) ; - Text [ en-US ] = "Location" ; - }; - FixedText FI_LOCATION - { - Pos = MAP_APPFONT ( 60 , 51 ) ; - Size = MAP_APPFONT ( 193 , 8 ) ; - }; - FixedText FT_COMMENT - { - Pos = MAP_APPFONT ( 12 , 62 ) ; - Size = MAP_APPFONT ( 45 , 8 ) ; - Text [ en-US ] = "Comment" ; - }; - FixedText FI_COMMENT - { - Pos = MAP_APPFONT ( 60 , 62 ) ; - Size = MAP_APPFONT ( 193 , 8 ) ; - }; - FixedText FI_FAXNO - { - Pos = MAP_APPFONT ( 12 , 75 ) ; - Size = MAP_APPFONT ( 45 , 8 ) ; - Text [ en-US ] = "Fax number"; - }; - Edit EDT_FAXNO - { - HelpID = "svtools:Edit:DLG_SVT_PRNDLG_PRINTDLG:EDT_FAXNO"; - Border = TRUE; - Pos = MAP_APPFONT ( 60 , 73 ); - Size = MAP_APPFONT ( 188 , 12 ); - }; - CheckBox CBX_FILEPRINT - { - HelpID = "svtools:CheckBox:DLG_SVT_PRNDLG_PRINTDLG:CBX_FILEPRINT"; - Pos = MAP_APPFONT ( 12 , 73 ) ; - Size = MAP_APPFONT ( 75 , 10 ) ; - Text [ en-US ] = "Print to file" ; - }; - FixedText FI_PRINTFILE - { - Pos = MAP_APPFONT ( 90 , 74 ) ; - Size = MAP_APPFONT ( 163 , 8 ) ; - }; - /*!!! - PushButton BTN_BROWSE - { - HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_BROWSE"; - Pos = MAP_APPFONT ( 234 , 75 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - Text = "~..." ; - Hide = TRUE ; - }; - */ - FixedLine FL_PRINT - { - Pos = MAP_APPFONT ( 6 , 91 ) ; - Size = MAP_APPFONT ( 117 , 8 ) ; - Text [ en-US ] = "Print" ; - }; - RadioButton RBT_ALL_SHEETS - { - HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_ALL_SHEETS"; - Pos = MAP_APPFONT ( 12 , 102 ) ; - Size = MAP_APPFONT ( 105 , 10 ) ; - Text [ en-US ] = "All sheets" ; - }; - RadioButton RBT_SELECTED_SHEETS - { - HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTED_SHEETS"; - Pos = MAP_APPFONT ( 12 , 115 ) ; - Size = MAP_APPFONT ( 105 , 10 ) ; - Text [ en-US ] = "Selected sheets" ; - }; - RadioButton RBT_SELECTED_CELLS - { - HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTED_CELLS"; - Pos = MAP_APPFONT ( 12 , 128 ) ; - Size = MAP_APPFONT ( 105 , 10 ) ; - Text [ en-US ] = "Selected cells" ; - }; - FixedLine FL_PRINTRANGE - { - Pos = MAP_APPFONT ( 6 , 141 ) ; - Size = MAP_APPFONT ( 117 , 8 ) ; - Text [ en-US ] = "Print range" ; - }; - RadioButton RBT_ALL - { - HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_ALL"; - Pos = MAP_APPFONT ( 12 , 152 ) ; - Size = MAP_APPFONT ( 105 , 10 ) ; - Text [ en-US ] = "All pages" ; - }; - RadioButton RBT_PAGES - { - HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_PAGES"; - Pos = MAP_APPFONT ( 12 , 165 ) ; - Size = MAP_APPFONT ( 50 , 10 ) ; - Text [ en-US ] = "Pages" ; - }; - Edit EDT_PAGES - { - HelpID = "svtools:Edit:DLG_SVT_PRNDLG_PRINTDLG:EDT_PAGES"; - Border = TRUE ; - Pos = MAP_APPFONT ( 65 , 164 ) ; - Size = MAP_APPFONT ( 52 , 12 ) ; - }; - RadioButton RBT_SELECTION - { - HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTION"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 12 , 179 ) ; - Size = MAP_APPFONT ( 105 , 10 ) ; - Text [ en-US ] = "Selection" ; - }; - FixedLine FL_SEPCOPIESRANGE - { - Pos = MAP_APPFONT( 126, 102 ); - Size = MAP_APPFONT( 1, 74 ); - Vert = TRUE; - }; - FixedLine FL_COPIES - { - Pos = MAP_APPFONT ( 129 , 91 ) ; - Size = MAP_APPFONT ( 130 , 8 ) ; - Text [ en-US ] = "Copies" ; - }; - FixedText FT_COPIES - { - Pos = MAP_APPFONT ( 135 , 104 ) ; - Size = MAP_APPFONT ( 63 , 8 ) ; - Text [ en-US ] = "Number of copies" ; - }; - NumericField NUM_COPIES - { - HelpID = "svtools:NumericField:DLG_SVT_PRNDLG_PRINTDLG:NUM_COPIES"; - Border = TRUE ; - Pos = MAP_APPFONT ( 201 , 102 ) ; - Size = MAP_APPFONT ( 33 , 12 ) ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 9999 ; - StrictFormat = TRUE ; - First = 1 ; - Last = 9999 ; - }; - CheckBox CBX_COLLATE - { - HelpID = "svtools:CheckBox:DLG_SVT_PRNDLG_PRINTDLG:CBX_COLLATE"; - Pos = MAP_APPFONT ( 201 , 123 ) ; - Size = MAP_APPFONT ( 60 , 10 ) ; - Text [ en-US ] = "Co~llate" ; - }; - FixedImage IMG_COLLATE - { - Pos = MAP_APPFONT ( 132 , 117 ) ; - Size = MAP_APPFONT ( 67 , 22 ) ; - Hide = TRUE ; - }; - FixedImage IMG_NOT_COLLATE - { - Pos = MAP_APPFONT ( 132 , 117 ) ; - Size = MAP_APPFONT ( 67 , 22 ) ; - Hide = TRUE ; - }; - FixedLine FL_SEPBUTTONLINE - { - Pos = MAP_APPFONT( 0, 179 ); - Size = MAP_APPFONT( 265, 8 ); - }; - PushButton BTN_OPTIONS - { - HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_OPTIONS"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 6 , 190 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Options..." ; - }; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 100 , 190 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 153 , 190 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 209 , 190 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; - String STR_ALLFILTER - { - Text [ en-US ] = ""; - }; -}; - -Image RID_IMG_PRNDLG_COLLATE -{ - ImageBitmap = Bitmap { File = "collate.bmp" ; }; - MaskColor = IMAGE_MAGENTA_MASK ; -}; - -Image RID_IMG_PRNDLG_NOCOLLATE -{ - ImageBitmap = Bitmap { File = "ncollate.bmp" ; }; - MaskColor = IMAGE_MAGENTA_MASK ; -}; - -Image RID_IMG_PRNDLG_COLLATE_HC -{ - ImageBitmap = Bitmap { File = "collate_h.bmp" ; }; - MaskColor = IMAGE_MAGENTA_MASK ; -}; - -Image RID_IMG_PRNDLG_NOCOLLATE_HC -{ - ImageBitmap = Bitmap { File = "ncollate_h.bmp" ; }; - MaskColor = IMAGE_MAGENTA_MASK ; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit From e8d5e10eee4e163a359417d342f7edee724b216e Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 4 Nov 2010 18:49:17 +0100 Subject: vcl117: #i115056# remove now unused svtools PrintDialog --- sc/source/ui/docshell/docsh4.cxx | 30 ++++++---------- sc/source/ui/inc/docsh.hxx | 8 ++--- sc/source/ui/inc/prevwsh.hxx | 7 ++-- sc/source/ui/inc/tabvwsh.hxx | 6 ++-- sc/source/ui/view/prevwsh.cxx | 56 ++++++----------------------- sc/source/ui/view/tabvwsh4.cxx | 76 ++++++---------------------------------- 6 files changed, 39 insertions(+), 144 deletions(-) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index bba756b397cb..44fd347e5aed 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -55,7 +55,6 @@ using namespace ::com::sun::star; #include #include #include -#include #include #include #include @@ -1830,7 +1829,7 @@ void ScDocShell::GetStatePageStyle( SfxViewShell& /* rCaller */, void lcl_GetPrintData( ScDocShell* pDocShell /*in*/, ScDocument* pDocument /*in*/, SfxPrinter* pPrinter /*in*/, - PrintDialog* pPrintDialog /*in*/, bool bForceSelected /*in*/, + bool bForceSelected /*in*/, ScMarkData* pMarkData /*inout*/, bool& rbHasOptions /*out*/, ScPrintOptions& rOptions /*out*/, bool& rbAllTabs /*out*/, long& rnTotalPages /*out*/, long aPageArr[] /*out*/, @@ -1868,13 +1867,13 @@ void lcl_GetPrintData( ScDocShell* pDocShell /*in*/, rPageRanges.SetTotalRange( Range( 0, RANGE_MAX ) ); rPageRanges.Select( Range( 1, rnTotalPages ) ); - rbAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() ); + rbAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); if ( bForceSelected ) { rbAllTabs = false; } - if ( ( pPrintDialog && pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_SELECTED_CELLS ) || bForceSelected ) + if ( bForceSelected ) { if ( pMarkData && ( pMarkData->IsMarked() || pMarkData->IsMultiMarked() ) ) { @@ -1885,12 +1884,6 @@ void lcl_GetPrintData( ScDocShell* pDocShell /*in*/, } } - PrintDialogRange eDlgOption = pPrintDialog ? pPrintDialog->GetCheckedRange() : PRINTDIALOG_ALL; - if ( eDlgOption == PRINTDIALOG_RANGE ) - { - rPageRanges = MultiSelection( pPrintDialog->GetRangeText() ); - } - // get number of total pages if selection if ( !rbAllTabs ) { @@ -1907,14 +1900,14 @@ void lcl_GetPrintData( ScDocShell* pDocShell /*in*/, rnTotalPages += aPageArr[nTab]; } } - if ( eDlgOption == PRINTDIALOG_ALL || bForceSelected ) + if ( bForceSelected ) { rPageRanges.Select( Range( 1, rnTotalPages ) ); } } } -bool ScDocShell::CheckPrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI ) +bool ScDocShell::CheckPrint( ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI ) { SfxPrinter* pPrinter = GetPrinter(); if ( !pPrinter ) @@ -1930,7 +1923,7 @@ bool ScDocShell::CheckPrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData, b MultiSelection aPageRanges; // pages to print ScRange* pMarkedRange = NULL; - lcl_GetPrintData( this, &aDocument, pPrinter, pPrintDialog, bForceSelected, + lcl_GetPrintData( this, &aDocument, pPrinter, bForceSelected, pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages, aPageArr, aPageRanges, &pMarkedRange ); @@ -1950,7 +1943,7 @@ bool ScDocShell::CheckPrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData, b return true; } -void ScDocShell::PreparePrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData ) +void ScDocShell::PreparePrint( ScMarkData* pMarkData ) { SfxPrinter* pPrinter = GetPrinter(); if ( !pPrinter ) @@ -1973,7 +1966,7 @@ void ScDocShell::PreparePrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData MultiSelection aPageRanges; // pages to print ScRange* pMarkedRange = NULL; - lcl_GetPrintData( this, &aDocument, pPrinter, pPrintDialog, false, + lcl_GetPrintData( this, &aDocument, pPrinter, false, pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages, aPageArr, aPageRanges, &pMarkedRange ); @@ -2043,7 +2036,7 @@ BOOL lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange ) return bFound; } -void ScDocShell::Print( SfxProgress& rProgress, PrintDialog* pPrintDialog, +void ScDocShell::Print( SfxProgress& rProgress, ScMarkData* pMarkData, Window* pDialogParent, BOOL bForceSelected, BOOL bIsAPI ) { SfxPrinter* pPrinter = GetPrinter(); @@ -2060,14 +2053,11 @@ void ScDocShell::Print( SfxProgress& rProgress, PrintDialog* pPrintDialog, MultiSelection aPageRanges; // pages to print ScRange* pMarkedRange = NULL; - lcl_GetPrintData( this, &aDocument, pPrinter, pPrintDialog, bForceSelected, + lcl_GetPrintData( this, &aDocument, pPrinter, bForceSelected, pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages, aPageArr, aPageRanges, &pMarkedRange ); USHORT nCollateCopies = 1; - if ( pPrintDialog && pPrintDialog->IsCollateEnabled() && pPrintDialog->IsCollateChecked() ) - nCollateCopies = pPrintDialog->GetCopyCount(); - // test if printed range contains transparent objects BOOL bHasTransp = FALSE; diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index 19147cfaf61f..624aa5181da7 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -45,7 +45,6 @@ class ScEditEngineDefaulter; class FontList; -class PrintDialog; class SfxStyleSheetBasePool; class SfxStyleSheetHint; struct ChartSelectionInfo; @@ -303,10 +302,9 @@ public: void DoRecalc( BOOL bApi ); void DoHardRecalc( BOOL bApi ); - bool CheckPrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData, - bool bForceSelected, bool bIsAPI ); - void PreparePrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData ); - void Print( SfxProgress& rProgress, PrintDialog* pPrintDialog, + bool CheckPrint( ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI ); + void PreparePrint( ScMarkData* pMarkData ); + void Print( SfxProgress& rProgress, ScMarkData* pMarkData, Window* pDialogParent, BOOL bForceSelected, BOOL bIsAPI ); diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx index 7ff97f8d0152..d9f19d48c0c0 100644 --- a/sc/source/ui/inc/prevwsh.hxx +++ b/sc/source/ui/inc/prevwsh.hxx @@ -116,11 +116,10 @@ public: virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE ); virtual USHORT SetPrinter( SfxPrinter* pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ); - virtual PrintDialog* CreatePrintDialog( Window* pParent ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); - virtual void PreparePrint( PrintDialog* pPrintDialog = NULL ); - virtual ErrCode DoPrint( SfxPrinter *pPrinter, PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ); - virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI, PrintDialog* pPrintDialog = NULL ); + virtual void PreparePrint(); + virtual ErrCode DoPrint( SfxPrinter *pPrinter, BOOL bSilent, BOOL bIsAPI ); + virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI ); void AddAccessibilityObject( SfxListener& rObject ); void RemoveAccessibilityObject( SfxListener& rObject ); diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 28cc2a823928..27baaa6d9c56 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -369,13 +369,11 @@ public: virtual USHORT SetPrinter( SfxPrinter* pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false ); - virtual PrintDialog* CreatePrintDialog( Window* pParent ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); - virtual void PreparePrint( PrintDialog* pPrintDialog = NULL ); + virtual void PreparePrint(); virtual ErrCode DoPrint( SfxPrinter *pPrinter, - PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ); - virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI, PrintDialog* pPrintDialog = NULL ); + virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI ); void ConnectObject( SdrOle2Obj* pObj ); BOOL ActivateObject( SdrOle2Obj* pObj, long nVerb ); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 48ffd4fd39a4..59e3977e9f89 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include @@ -485,40 +484,6 @@ USHORT __EXPORT ScPreviewShell::SetPrinter( SfxPrinter *pNewPrinter, USHORT nDif return pDocShell->SetPrinter( pNewPrinter, nDiffFlags ); } -PrintDialog* __EXPORT ScPreviewShell::CreatePrintDialog( Window* pParent ) -{ - pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen - (void)GetPrinter(); - - const long nCurPage = pPreview->GetPageNo()+1; - const long nDocPageMax = pPreview->GetTotalPages(); - PrintDialog* pDlg = new PrintDialog( pParent, true ); -// wenn zu langsam wieder einbauen -// if ( pPreview->AllTested() ) -// nPageMax = pPreview->GetTotalPages(); - - pDlg->EnableSheetRange( true, PRINTSHEETS_ALL ); - pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_SHEETS ); - pDlg->EnableSheetRange( false, PRINTSHEETS_SELECTED_CELLS ); - bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); - pDlg->CheckSheetRange( bAllTabs ? PRINTSHEETS_ALL : PRINTSHEETS_SELECTED_SHEETS ); - - if ( nDocPageMax > 0 ) - pDlg->SetRangeText( String::CreateFromInt32( nCurPage ) ); - - pDlg->EnableRange ( PRINTDIALOG_ALL ); - pDlg->EnableRange ( PRINTDIALOG_RANGE ); - pDlg->SetFirstPage ( 1 ); - pDlg->SetMinPage ( 1 ); - pDlg->SetLastPage ( (USHORT)nDocPageMax ); - pDlg->SetMaxPage ( (USHORT)nDocPageMax ); - pDlg->EnableCollate (); - - // Selektion hier nicht - - return pDlg; -} - SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); @@ -530,38 +495,37 @@ SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt return 0; } -void __EXPORT ScPreviewShell::PreparePrint( PrintDialog* pPrintDialog ) +void __EXPORT ScPreviewShell::PreparePrint() { - SfxViewShell::PreparePrint( pPrintDialog ); + SfxViewShell::PreparePrint(); ScMarkData aMarkData; aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE ); - pDocShell->PreparePrint( pPrintDialog, &aMarkData ); + pDocShell->PreparePrint(&aMarkData ); } -ErrCode ScPreviewShell::DoPrint( SfxPrinter *pPrinter, - PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ) +ErrCode ScPreviewShell::DoPrint( SfxPrinter *pPrinter, BOOL bSilent, BOOL bIsAPI ) { ErrCode nRet = ERRCODE_IO_ABORT; ScMarkData aMarkData; aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE ); - if ( pDocShell->CheckPrint( pPrintDialog, &aMarkData, false, bIsAPI ) ) + if ( pDocShell->CheckPrint( &aMarkData, false, bIsAPI ) ) { // SfxViewShell::DoPrint calls Print (after StartJob etc.) - nRet = SfxViewShell::DoPrint( pPrinter, pPrintDialog, bSilent, bIsAPI ); + nRet = SfxViewShell::DoPrint( pPrinter, bSilent, bIsAPI ); } return nRet; } -USHORT __EXPORT ScPreviewShell::Print( SfxProgress& rProgress, BOOL bIsAPI, PrintDialog* pPrintDialog ) +USHORT __EXPORT ScPreviewShell::Print( SfxProgress& rProgress, BOOL bIsAPI ) { pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen // get the list of affected sheets before SfxViewShell::Print - bool bAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() ); + bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); ScMarkData aMarkData; aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE ); @@ -584,8 +548,8 @@ USHORT __EXPORT ScPreviewShell::Print( SfxProgress& rProgress, BOOL bIsAPI, Prin aProps[0].Value <<= aSheets; SetAdditionalPrintOptions( aProps ); - SfxViewShell::Print( rProgress, bIsAPI, pPrintDialog ); - pDocShell->Print( rProgress, pPrintDialog, &aMarkData, pPreview, FALSE, bIsAPI ); + SfxViewShell::Print( rProgress, bIsAPI ); + pDocShell->Print( rProgress, &aMarkData, pPreview, FALSE, bIsAPI ); return 0; } diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 0835d08de9fd..77fbe6bf5ada 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -1159,57 +1158,6 @@ USHORT __EXPORT ScTabViewShell::SetPrinter( SfxPrinter *pNewPrinter, USHORT nDif return GetViewData()->GetDocShell()->SetPrinter( pNewPrinter, nDiffFlags ); } -PrintDialog* __EXPORT ScTabViewShell::CreatePrintDialog( Window *pParent ) -{ - ScDocShell* pDocShell = GetViewData()->GetDocShell(); - ScDocument* pDoc = pDocShell->GetDocument(); - - pDoc->SetPrintOptions(); // Optionen aus OFA am Printer setzen - SfxPrinter* pPrinter = GetPrinter(); - - String aStrRange; - PrintDialog* pDlg = new PrintDialog( pParent, true ); - SCTAB nTabCount = pDoc->GetTableCount(); - long nDocPageMax = 0; - - pDlg->EnableSheetRange( true, PRINTSHEETS_ALL ); - pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_SHEETS ); - pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_CELLS ); - bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); - pDlg->CheckSheetRange( bAllTabs ? PRINTSHEETS_ALL : PRINTSHEETS_SELECTED_SHEETS ); - - // update all pending row heights with a single progress bar, - // instead of a separate progress for each sheet from ScPrintFunc - pDocShell->UpdatePendingRowHeights( MAXTAB, true ); - - for ( SCTAB i=0; i 0 ) - { - aStrRange = '1'; - if ( nDocPageMax > 1 ) - { - aStrRange += '-'; - aStrRange += String::CreateFromInt32( nDocPageMax ); - } - } - - pDlg->SetRangeText ( aStrRange ); - pDlg->EnableRange ( PRINTDIALOG_ALL ); - pDlg->EnableRange ( PRINTDIALOG_RANGE ); - pDlg->SetFirstPage ( 1 ); - pDlg->SetMinPage ( 1 ); - pDlg->SetLastPage ( (USHORT)nDocPageMax ); - pDlg->SetMaxPage ( (USHORT)nDocPageMax ); - pDlg->EnableCollate (); - - return pDlg; -} - SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); @@ -1221,22 +1169,21 @@ SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt return 0; } -void __EXPORT ScTabViewShell::PreparePrint( PrintDialog* pPrintDialog ) +void __EXPORT ScTabViewShell::PreparePrint() { ScDocShell* pDocShell = GetViewData()->GetDocShell(); - SfxViewShell::PreparePrint( pPrintDialog ); - pDocShell->PreparePrint( pPrintDialog, &GetViewData()->GetMarkData() ); + SfxViewShell::PreparePrint(); + pDocShell->PreparePrint( &GetViewData()->GetMarkData() ); } -ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter, - PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ) +ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter, BOOL bSilent, BOOL bIsAPI ) { // #72527# if SID_PRINTDOCDIRECT is executed and there's a selection, // ask if only the selection should be printed const ScMarkData& rMarkData = GetViewData()->GetMarkData(); - if ( !pPrintDialog && !bSilent && !bIsAPI && ( rMarkData.IsMarked() || rMarkData.IsMultiMarked() ) ) + if ( !bSilent && !bIsAPI && ( rMarkData.IsMarked() || rMarkData.IsMultiMarked() ) ) { SvxPrtQryBox aQuery( GetDialogParent() ); short nBtn = aQuery.Execute(); @@ -1251,10 +1198,10 @@ ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter, ErrCode nRet = ERRCODE_IO_ABORT; ScDocShell* pDocShell = GetViewData()->GetDocShell(); - if ( pDocShell->CheckPrint( pPrintDialog, &GetViewData()->GetMarkData(), bPrintSelected, bIsAPI ) ) + if ( pDocShell->CheckPrint( &GetViewData()->GetMarkData(), bPrintSelected, bIsAPI ) ) { // get the list of affected sheets before SfxViewShell::Print - bool bAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() ); + bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); uno::Sequence aSheets; SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount(); @@ -1273,7 +1220,7 @@ ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter, SetAdditionalPrintOptions( aProps ); // SfxViewShell::DoPrint calls Print (after StartJob etc.) - nRet = SfxViewShell::DoPrint( pPrinter, pPrintDialog, bSilent, bIsAPI ); + nRet = SfxViewShell::DoPrint( pPrinter, bSilent, bIsAPI ); } bPrintSelected = FALSE; @@ -1281,14 +1228,13 @@ ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter, return nRet; } -USHORT __EXPORT ScTabViewShell::Print( SfxProgress& rProgress, BOOL bIsAPI, - PrintDialog* pPrintDialog ) +USHORT __EXPORT ScTabViewShell::Print( SfxProgress& rProgress, BOOL bIsAPI ) { ScDocShell* pDocShell = GetViewData()->GetDocShell(); pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen - SfxViewShell::Print( rProgress, bIsAPI, pPrintDialog ); - pDocShell->Print( rProgress, pPrintDialog, &GetViewData()->GetMarkData(), + SfxViewShell::Print( rProgress, bIsAPI ); + pDocShell->Print( rProgress, &GetViewData()->GetMarkData(), GetDialogParent(), bPrintSelected, bIsAPI ); return 0; } -- cgit From 77c0617953a9de9546467f2433989cefa8be6a92 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 4 Nov 2010 18:49:17 +0100 Subject: vcl117: #i115056# remove now unused svtools PrintDialog --- starmath/inc/view.hxx | 2 +- starmath/source/view.cxx | 2 +- sw/source/ui/inc/pview.hxx | 1 - sw/source/ui/inc/view.hxx | 2 -- sw/source/ui/uiview/pview.cxx | 13 ------------- sw/source/ui/uiview/view.cxx | 1 - sw/source/ui/uiview/viewfunc.hxx | 2 -- sw/source/ui/uiview/viewprt.cxx | 37 ------------------------------------- 8 files changed, 2 insertions(+), 58 deletions(-) mode change 100755 => 100644 sw/source/ui/uiview/pview.cxx diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index d414d1e72309..0eae96d02328 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -244,7 +244,7 @@ protected: const String& rText, USHORT MaxWidth); - virtual USHORT Print(SfxProgress &rProgress, BOOL bIsAPI, PrintDialog *pPrintDialog = 0); + virtual USHORT Print(SfxProgress &rProgress, BOOL bIsAPI); virtual SfxPrinter *GetPrinter(BOOL bCreate = FALSE); virtual USHORT SetPrinter(SfxPrinter *pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false); diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 20c235408013..da7f089b0f41 100755 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -1160,7 +1160,7 @@ void SmViewShell::Impl_Print( rOutDev.Pop(); } -USHORT SmViewShell::Print(SfxProgress & /*rProgress*/, BOOL /*bIsAPI*/, PrintDialog * /*pPrintDialog*/) +USHORT SmViewShell::Print(SfxProgress & /*rProgress*/, BOOL /*bIsAPI*/) { RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::Print" ); DBG_ASSERT( 0, "SmViewShell::Print: no longer used with new UI print dialog. Should be removed!!" ); diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx index d0d8f2cb804a..2b1c9366707e 100644 --- a/sw/source/ui/inc/pview.hxx +++ b/sw/source/ui/inc/pview.hxx @@ -223,7 +223,6 @@ class SW_DLLPUBLIC SwPagePreView: public SfxViewShell SW_DLLPRIVATE virtual USHORT SetPrinter( SfxPrinter *pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ); SW_DLLPRIVATE virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); - SW_DLLPRIVATE virtual PrintDialog* CreatePrintDialog( Window *pParent ); SW_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill, BOOL bInner ); diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index a21dc8cfb30e..834f11775642 100644 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -57,7 +57,6 @@ class SvxRuler; class SvxLRSpaceItem; class SwDocShell; class SwScrollbar; -class PrintDialog; class SvxVCBrowser; class SvBorder; class Ruler; @@ -356,7 +355,6 @@ class SW_DLLPUBLIC SwView: public SfxViewShell // Methoden fuers Printing SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE ); - SW_DLLPRIVATE virtual PrintDialog* CreatePrintDialog( Window* pParent ); SfxTabPage* CreatePrintOptionsPage( Window* pParent, const SfxItemSet& rSet); // fuer Readonly-Umschaltung diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx old mode 100755 new mode 100644 index 2319be573e25..0bb37154cc1b --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -2002,18 +2001,6 @@ SfxTabPage* SwPagePreView::CreatePrintOptionsPage( Window *pParent, --------------------------------------------------------------------*/ -PrintDialog* SwPagePreView::CreatePrintDialog( Window *pParent ) -{ - PrintDialog *pDlg = ::CreatePrintDialog( pParent, 1, 0 ); - pDlg->DisableRange( PRINTDIALOG_SELECTION ); - return pDlg; -} - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - // OD 18.12.2002 #103492# - no longer needed ?? Size SwPagePreView::GetOptimalSizePixel() const { diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 15c94782883f..66dbb2cb18bf 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/ui/uiview/viewfunc.hxx b/sw/source/ui/uiview/viewfunc.hxx index f04db152ec2f..6da6c01bbda4 100644 --- a/sw/source/ui/uiview/viewfunc.hxx +++ b/sw/source/ui/uiview/viewfunc.hxx @@ -30,7 +30,6 @@ class ImageButton; class Point; -class PrintDialog; class SfxItemSet; class SfxPrinter; class SfxTabPage; @@ -42,7 +41,6 @@ class Window; class SwWrtShell; // folgende Funktionen stehen im viewprt.cxx -PrintDialog* CreatePrintDialog( Window* , USHORT, SwWrtShell* ); void SetPrinter( IDocumentDeviceAccess*, SfxPrinter*, BOOL bWeb ); SfxTabPage* CreatePrintOptionsPage( Window*, const SfxItemSet& ); void SetAppPrintOptions( ViewShell* pSh, BOOL bWeb ); diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx index 8721f425eb8d..5af3554c323f 100644 --- a/sw/source/ui/uiview/viewprt.cxx +++ b/sw/source/ui/uiview/viewprt.cxx @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include @@ -183,42 +182,6 @@ SfxTabPage* __EXPORT SwView::CreatePrintOptionsPage(Window* pParent, return ::CreatePrintOptionsPage( pParent, rSet, FALSE ); } -/*-------------------------------------------------------------------- - Beschreibung: Druckerdialog - --------------------------------------------------------------------*/ - -PrintDialog* CreatePrintDialog( Window* pParent, USHORT nPg, SwWrtShell* pSh ) -{ - PrintDialog *pDlg = new PrintDialog( pParent, false ); -// pDlg->ChangeFirstPage( 1 ); - - if ( !nPg ) - nPg = 1; -// pDlg->ChangeLastPage( nPg ); -// pDlg->ChangeMaxPage( 9999 ); - pDlg->EnableRange( PRINTDIALOG_FROMTO ); - - if (pSh && (pSh->IsSelection() || pSh->IsFrmSelected() || pSh->IsObjSelected())) - pDlg->EnableRange( PRINTDIALOG_SELECTION ); - - pDlg->SetRangeText( String::CreateFromInt32(nPg) ); - pDlg->EnableRange( PRINTDIALOG_RANGE ); - pDlg->EnableCollate(); - return pDlg; -} - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -PrintDialog* __EXPORT SwView::CreatePrintDialog( Window* pParent ) -{ - // AMA: Hier sollte vielleicht die virtuelle Seitennummer angezeigt werden, - // aber nur, wenn das Drucken virtuelle Seitennummern und nicht wie - // bisher (auch beim SWG 2.0) physikalische beachtet werden. - return ::CreatePrintDialog( pParent, GetWrtShell().GetPhyPageNum(), &GetWrtShell() ); -} - /*-------------------------------------------------------------------- Beschreibung: Print-Dispatcher --------------------------------------------------------------------*/ -- cgit From cb2c8f642352c47c2c1c151bc7eb08c04c45c852 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 4 Nov 2010 18:49:17 +0100 Subject: vcl117: #i115056# remove now unused svtools PrintDialog --- sd/source/ui/inc/ViewShellBase.hxx | 8 ++------ sd/source/ui/view/ViewShellBase.cxx | 19 +++---------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx index 38f7223f1d83..463b32ac2fb6 100755 --- a/sd/source/ui/inc/ViewShellBase.hxx +++ b/sd/source/ui/inc/ViewShellBase.hxx @@ -143,24 +143,20 @@ public: SfxPrinter* pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false); - /// Forwarded to the print manager. - virtual PrintDialog* CreatePrintDialog (::Window *pParent); - /// Forwarded to the print manager. virtual SfxTabPage* CreatePrintOptionsPage ( ::Window *pParent, const SfxItemSet &rOptions); /// Forwarded to the print manager. - virtual USHORT Print (SfxProgress& rProgress, BOOL bIsAPI, PrintDialog* pDialog); + virtual USHORT Print (SfxProgress& rProgress, BOOL bIsAPI); /// Forwarded to the print manager. virtual ErrCode DoPrint ( SfxPrinter *pPrinter, - PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ); - virtual void PreparePrint (PrintDialog* pPrintDialog); + virtual void PreparePrint (); /// Forward methods to main sub shell. virtual void WriteUserDataSequence ( diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index c748ffbc05e0..244bcc3b4da7 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -654,16 +654,6 @@ USHORT ViewShellBase::SetPrinter ( -PrintDialog* ViewShellBase::CreatePrintDialog (::Window *pParent) -{ - (void)pParent; - return NULL; - // return mpImpl->mpPrintManager->CreatePrintDialog (pParent); -} - - - - SfxTabPage* ViewShellBase::CreatePrintOptionsPage( ::Window *pParent, const SfxItemSet &rOptions) @@ -677,10 +667,9 @@ SfxTabPage* ViewShellBase::CreatePrintOptionsPage( -USHORT ViewShellBase::Print(SfxProgress&, BOOL bIsAPI, PrintDialog* pDlg) +USHORT ViewShellBase::Print(SfxProgress&, BOOL bIsAPI) { (void)bIsAPI; - (void)pDlg; return 0; // return mpImpl->mpPrintManager->Print (rProgress, bIsAPI, pDlg); } @@ -690,11 +679,9 @@ USHORT ViewShellBase::Print(SfxProgress&, BOOL bIsAPI, PrintDialog* pDlg) ErrCode ViewShellBase::DoPrint ( SfxPrinter* pPrinter, - PrintDialog* pPrintDialog, BOOL bSilent, BOOL bIsAPI ) { (void)pPrinter; - (void)pPrintDialog; (void)bSilent; (void)bIsAPI; return 0; @@ -704,9 +691,9 @@ ErrCode ViewShellBase::DoPrint ( -void ViewShellBase::PreparePrint (PrintDialog* pPrintDialog) +void ViewShellBase::PreparePrint () { - SfxViewShell::PreparePrint (pPrintDialog); + SfxViewShell::PreparePrint (); //mpImpl->mpPrintManager->PreparePrint (pPrintDialog); } -- cgit From 5adb4c0572ebb341a8db83888181b13a08704c7d Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 5 Nov 2010 11:17:34 +0100 Subject: fix warnings --- sfx2/source/view/printer.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index fb4b93ae8475..fb8f60241b8e 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -334,21 +334,21 @@ void SfxPrinter::SetOptions( const SfxItemSet &rNewOptions ) //-------------------------------------------------------------------- -void SfxPrinter::EnableRange( USHORT nRange ) +void SfxPrinter::EnableRange( USHORT ) { OSL_ENSURE( 0, "dead code !" ); } //-------------------------------------------------------------------- -void SfxPrinter::DisableRange( USHORT nRange ) +void SfxPrinter::DisableRange( USHORT ) { OSL_ENSURE( 0, "dead code !" ); } //-------------------------------------------------------------------- -BOOL SfxPrinter::IsRangeEnabled( USHORT nRange ) const +BOOL SfxPrinter::IsRangeEnabled( USHORT ) const { OSL_ENSURE( 0, "dead code !" ); return TRUE; @@ -452,7 +452,7 @@ const SfxFont* SfxPrinter::GetFontByName( const String &rFontName ) //-------------------------------------------------------------------- -BOOL SfxPrinter::InitJob( Window* pUIParent, BOOL bAskAboutTransparentObjects ) +BOOL SfxPrinter::InitJob( Window*, BOOL ) { OSL_ENSURE( 0, "dead code !" ); return FALSE; -- cgit From 508ed1f813934bdb6e33747e1b26afd1b7c8980d Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 5 Nov 2010 16:11:41 +0100 Subject: remove ignored help strings --- vcl/source/src/btntext.src | 64 ---------------------------------------------- 1 file changed, 64 deletions(-) diff --git a/vcl/source/src/btntext.src b/vcl/source/src/btntext.src index 6d2360dae6cb..b786184fa2f3 100644 --- a/vcl/source/src/btntext.src +++ b/vcl/source/src/btntext.src @@ -80,68 +80,4 @@ String SV_BUTTONTEXT_ABORT { Text [ en-US ] = "~Abort"; }; - -/* HelpTexte, die wir derzeit nicht mehr verwenden: -SV_BUTTONHELPTEXT_OK -{ - Text = "Schließt dieses Dialogfeld und speichert alle vorgenommenen Änderungen." ; -}; - -SV_BUTTONHELPTEXT_CANCEL -{ - Text = "Schließt dieses Dialogfeld, ohne Ihre Änderungen zu speichern." ; -}; - -SV_BUTTONHELPTEXT_HELP -{ - Text = "Zeigt Hilfe zu diesem Fenster an." ; -}; - -SV_BUTTONHELPTEXT_MORE -{ - Text = "Zeigt weitere EinstellmÖglichkeiten an oder versteckt diese wieder." ; -}; - -Finnische-Texte: -OK OK -CANCEL Peruuta -HELP ~Ohje -MORE ~Enemmän -YES ~Kyllä -NO ~Ei -RETRY ~Yritäuudelleen -*/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit From 93924469d64d5a316fa78c18a1dd571e51b09824 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 5 Nov 2010 16:18:53 +0100 Subject: #i115432# fix test string for UI-font check --- vcl/source/window/window.cxx | 46 ++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 69999f6c7188..cddd0f898392 100755 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -270,19 +270,41 @@ bool Window::ImplCheckUIFont( const Font& rFont ) if( ImplGetSVData()->maGDIData.mbNativeFontConfig ) return true; + // create a text string using the localized text of important buttons String aTestText; - aTestText.Append( Button::GetStandardText( BUTTON_OK ) ); - aTestText.Append( Button::GetStandardText( BUTTON_CANCEL ) ); - aTestText.Append( Button::GetStandardText( BUTTON_YES ) ); - aTestText.Append( Button::GetStandardText( BUTTON_NO ) ); - aTestText.Append( Button::GetStandardText( BUTTON_RETRY ) ); - aTestText.Append( Button::GetStandardText( BUTTON_HELP ) ); - aTestText.Append( Button::GetStandardText( BUTTON_CLOSE ) ); - aTestText.Append( Button::GetStandardText( BUTTON_MORE ) ); - aTestText.Append( Button::GetStandardText( BUTTON_LESS ) ); - aTestText.Append( Button::GetStandardText( BUTTON_ABORT ) ); - - return HasGlyphs( rFont, aTestText ) >= aTestText.Len(); + static const StandardButtonType aTestButtons[] = + { + BUTTON_OK, BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_ABORT, + BUTTON_YES, BUTTON_NO, BUTTON_MORE, BUTTON_LESS, + BUTTON_RETRY, BUTTON_HELP + }; + + const int nTestButtonCount = sizeof(aTestButtons)/sizeof(*aTestButtons); + for( int n = 0; n < nTestButtonCount; ++n ) + { + String aButtonStr = Button::GetStandardText( aTestButtons[n] ); + // #i115432# ignore mnemonic+accelerator part of each string + // TODO: use a string filtering method when it becomes available + const int nLen = aButtonStr.Len(); + bool bInside = false; + for( int i = 0; i < nLen; ++i ) { + const sal_Unicode c = aButtonStr.GetChar( i ); + if( (c == '(')) + bInside = true; + if( (c == ')')) + bInside = false; + if( (c == '~') + || (c == '(') || (c == ')') + || ((c >= 'A') && (c <= 'Z') && bInside) ) + aButtonStr.SetChar( i, ' ' ); + } + // append sanitized button text to test string + aTestText.Append( aButtonStr ); + } + + const int nFirstChar = HasGlyphs( rFont, aTestText ); + const bool bUIFontOk = (nFirstChar >= aTestText.Len()); + return bUIFontOk; } // ----------------------------------------------------------------------- -- cgit From d38917161cff8b8f4f6edb622e571c3a5b5bca88 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 5 Nov 2010 16:20:01 +0100 Subject: #i115432# less is more since CWS pbfinal01 --- vcl/source/window/window.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index cddd0f898392..8054afd33080 100755 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -275,7 +275,7 @@ bool Window::ImplCheckUIFont( const Font& rFont ) static const StandardButtonType aTestButtons[] = { BUTTON_OK, BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_ABORT, - BUTTON_YES, BUTTON_NO, BUTTON_MORE, BUTTON_LESS, + BUTTON_YES, BUTTON_NO, BUTTON_MORE, BUTTON_IGNORE, BUTTON_RETRY, BUTTON_HELP }; -- cgit From 49c2ff49746388195e25d2f222132e6424261bd8 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 8 Nov 2010 12:33:56 +0100 Subject: vcl117: #i115469# activate application if termination was canceled --- vcl/aqua/source/app/vclnsapp.mm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm index ff2b4226bfa0..caa506772272 100755 --- a/vcl/aqua/source/app/vclnsapp.mm +++ b/vcl/aqua/source/app/vclnsapp.mm @@ -360,6 +360,8 @@ { YIELD_GUARD; + NSApplicationTerminateReply aReply = NSTerminateNow; + SalData* pSalData = GetSalData(); #if 1 // currently do some really bad hack if( ! pSalData->maFrames.empty() ) @@ -399,7 +401,7 @@ #endif [(*it) release]; } - return NSTerminateCancel; + aReply = NSTerminateCancel; } #if OSL_DEBUG_LEVEL > 1 for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin(); @@ -416,9 +418,12 @@ #endif } #else // the clean version follows - return pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow; + aReply = pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow; #endif - return NSTerminateNow; + + if( aReply != NSTerminateNow ) + [NSApp activateIgnoringOtherApps: YES]; + return aReply; } -(void)systemColorsChanged: (NSNotification*) pNotification -- cgit From 6cafb68322fa85a54a6fa1ca47239af459f519ce Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Mon, 8 Nov 2010 13:47:01 +0100 Subject: dr77: optimizations in generation of XML tokens, XML namespaces, property names; code cleanup --- oox/inc/oox/core/contexthandler.hxx | 4 +- oox/inc/oox/core/contexthandler2.hxx | 6 +- oox/inc/oox/core/fastparser.hxx | 93 ++++++++ oox/inc/oox/core/fasttokenhandler.hxx | 13 +- oox/inc/oox/core/relations.hxx | 11 +- oox/inc/oox/drawingml/chart/modelbase.hxx | 1 - oox/inc/oox/drawingml/clrscheme.hxx | 1 - oox/inc/oox/drawingml/customshapeproperties.hxx | 14 +- oox/inc/oox/helper/attributelist.hxx | 3 +- oox/inc/oox/helper/propertymap.hxx | 7 +- oox/inc/oox/helper/propertyset.hxx | 1 + oox/inc/oox/ole/axbinaryreader.hxx | 1 - oox/inc/oox/ole/axcontrolfragment.hxx | 1 - oox/inc/oox/ole/olehelper.hxx | 1 - oox/inc/oox/ole/oleobjecthelper.hxx | 3 +- oox/inc/oox/ole/olestorage.hxx | 2 +- oox/inc/oox/ole/vbainputstream.hxx | 1 - oox/inc/oox/ole/vbamodule.hxx | 2 +- oox/inc/oox/ppt/pptimport.hxx | 1 - oox/inc/oox/ppt/slidepersist.hxx | 1 - oox/inc/oox/token/namespacemap.hxx | 49 ++++ oox/inc/oox/token/propertylist.hxx | 50 ---- oox/inc/oox/token/propertynames.hxx | 49 ++++ oox/inc/oox/xls/autofilterbuffer.hxx | 6 +- oox/prj/d.lst | 7 +- oox/source/core/contexthandler2.cxx | 2 +- oox/source/core/facreg.cxx | 102 -------- oox/source/core/fastparser.cxx | 136 +++++++++++ oox/source/core/fasttokenhandler.cxx | 49 +++- oox/source/core/filterbase.cxx | 1 - oox/source/core/filterdetect.cxx | 53 ++--- oox/source/core/makefile.mk | 3 +- oox/source/core/relations.cxx | 4 +- oox/source/core/relationshandler.cxx | 6 +- oox/source/core/services.cxx | 102 ++++++++ oox/source/core/xmlfilterbase.cxx | 95 +++----- oox/source/docprop/docprophandler.cxx | 138 ++++++----- oox/source/docprop/docprophandler.hxx | 10 + oox/source/docprop/ooxmldocpropimport.cxx | 261 +++++++++------------ oox/source/docprop/ooxmldocpropimport.hxx | 40 ++-- oox/source/drawingml/chart/axisconverter.cxx | 1 - .../drawingml/chart/chartdrawingfragment.cxx | 4 +- oox/source/drawingml/chart/chartspaceconverter.cxx | 1 - oox/source/drawingml/chart/chartspacefragment.cxx | 4 +- oox/source/drawingml/chart/converterbase.cxx | 1 - oox/source/drawingml/chart/datasourceconverter.cxx | 1 - oox/source/drawingml/chart/objectformatter.cxx | 2 - oox/source/drawingml/chart/plotareaconverter.cxx | 1 - oox/source/drawingml/chart/seriesconverter.cxx | 1 - oox/source/drawingml/chart/titleconverter.cxx | 1 - oox/source/drawingml/chart/typegroupconverter.cxx | 1 - oox/source/drawingml/clrscheme.cxx | 2 +- oox/source/drawingml/clrschemecontext.cxx | 4 +- oox/source/drawingml/color.cxx | 8 +- oox/source/drawingml/colorchoicecontext.cxx | 1 - oox/source/drawingml/connectorshapecontext.cxx | 4 +- oox/source/drawingml/customshapegeometry.cxx | 57 +++-- oox/source/drawingml/customshapeproperties.cxx | 3 - oox/source/drawingml/diagram/datamodelcontext.cxx | 43 ++-- oox/source/drawingml/diagram/diagram.cxx | 2 - .../drawingml/diagram/diagramdefinitioncontext.cxx | 18 +- .../drawingml/diagram/diagramfragmenthandler.cxx | 10 +- oox/source/drawingml/diagram/layoutnodecontext.cxx | 41 ++-- oox/source/drawingml/drawingmltypes.cxx | 2 +- oox/source/drawingml/embeddedwavaudiofile.cxx | 5 +- oox/source/drawingml/fillproperties.cxx | 3 +- .../drawingml/fillpropertiesgroupcontext.cxx | 19 +- oox/source/drawingml/graphicshapecontext.cxx | 21 +- oox/source/drawingml/guidcontext.cxx | 3 - oox/source/drawingml/hyperlinkcontext.cxx | 15 +- oox/source/drawingml/lineproperties.cxx | 4 +- oox/source/drawingml/linepropertiescontext.cxx | 4 +- oox/source/drawingml/objectdefaultcontext.cxx | 8 +- oox/source/drawingml/shape.cxx | 3 - oox/source/drawingml/shapecontext.cxx | 4 +- oox/source/drawingml/shapegroupcontext.cxx | 4 +- oox/source/drawingml/shapepropertiescontext.cxx | 20 +- oox/source/drawingml/shapestylecontext.cxx | 12 +- oox/source/drawingml/spdefcontext.cxx | 10 +- .../table/tablebackgroundstylecontext.cxx | 11 +- oox/source/drawingml/table/tablecell.cxx | 3 - oox/source/drawingml/table/tablecellcontext.cxx | 21 +- oox/source/drawingml/table/tablecontext.cxx | 13 +- .../drawingml/table/tablepartstylecontext.cxx | 7 +- oox/source/drawingml/table/tableproperties.cxx | 2 - oox/source/drawingml/table/tablerow.cxx | 2 - oox/source/drawingml/table/tablerowcontext.cxx | 6 +- .../drawingml/table/tablestylecellstylecontext.cxx | 33 ++- oox/source/drawingml/table/tablestylecontext.cxx | 33 ++- .../table/tablestylelistfragmenthandler.cxx | 4 +- oox/source/drawingml/table/tablestylepart.cxx | 2 - .../drawingml/table/tablestyletextstylecontext.cxx | 17 +- oox/source/drawingml/textbodycontext.cxx | 28 +-- oox/source/drawingml/textbodyproperties.cxx | 3 +- oox/source/drawingml/textbodypropertiescontext.cxx | 19 +- oox/source/drawingml/textcharacterproperties.cxx | 3 +- .../drawingml/textcharacterpropertiescontext.cxx | 52 ++-- oox/source/drawingml/textfieldcontext.cxx | 10 +- oox/source/drawingml/textfont.cxx | 1 - oox/source/drawingml/textliststylecontext.cxx | 26 +- oox/source/drawingml/textparagraphproperties.cxx | 3 - .../drawingml/textparagraphpropertiescontext.cxx | 35 ++- oox/source/drawingml/textrun.cxx | 1 - oox/source/drawingml/textspacingcontext.cxx | 9 +- oox/source/drawingml/texttabstoplistcontext.cxx | 4 +- oox/source/drawingml/theme.cxx | 1 - oox/source/drawingml/themeelementscontext.cxx | 46 ++-- oox/source/drawingml/themefragmenthandler.cxx | 14 +- oox/source/drawingml/transform2dcontext.cxx | 9 +- oox/source/export/drawingml.cxx | 1 - oox/source/export/shapes.cxx | 1 - oox/source/helper/graphichelper.cxx | 2 +- oox/source/helper/propertymap.cxx | 18 +- oox/source/ole/axbinaryreader.cxx | 8 +- oox/source/ole/axcontrol.cxx | 2 - oox/source/ole/axcontrolfragment.cxx | 18 +- oox/source/ole/olehelper.cxx | 12 +- oox/source/ole/oleobjecthelper.cxx | 33 ++- oox/source/ole/olestorage.cxx | 37 +-- oox/source/ole/vbacontrol.cxx | 2 - oox/source/ole/vbahelper.cxx | 5 +- oox/source/ole/vbainputstream.cxx | 2 + oox/source/ole/vbaproject.cxx | 2 - oox/source/ppt/animationspersist.cxx | 4 - oox/source/ppt/animationtypes.cxx | 2 - oox/source/ppt/animvariantcontext.cxx | 12 +- oox/source/ppt/backgroundproperties.cxx | 4 +- oox/source/ppt/buildlistcontext.cxx | 15 +- oox/source/ppt/commonbehaviorcontext.cxx | 18 +- oox/source/ppt/commontimenodecontext.cxx | 20 +- oox/source/ppt/conditioncontext.cxx | 12 +- oox/source/ppt/customshowlistcontext.cxx | 9 +- oox/source/ppt/headerfootercontext.cxx | 2 - oox/source/ppt/layoutfragmenthandler.cxx | 6 +- oox/source/ppt/pptimport.cxx | 4 +- oox/source/ppt/pptshape.cxx | 2 - oox/source/ppt/pptshapecontext.cxx | 15 +- oox/source/ppt/pptshapegroupcontext.cxx | 22 +- oox/source/ppt/pptshapepropertiescontext.cxx | 5 +- oox/source/ppt/presentationfragmenthandler.cxx | 38 ++- oox/source/ppt/slidefragmenthandler.cxx | 45 ++-- oox/source/ppt/slidemastertextstylescontext.cxx | 10 +- oox/source/ppt/slidepersist.cxx | 2 - oox/source/ppt/slidetimingcontext.cxx | 8 +- oox/source/ppt/slidetransition.cxx | 45 ++-- oox/source/ppt/slidetransitioncontext.cxx | 49 ++-- oox/source/ppt/soundactioncontext.cxx | 11 +- oox/source/ppt/timeanimvaluecontext.cxx | 10 +- oox/source/ppt/timenodelistcontext.cxx | 122 +++++----- oox/source/ppt/timetargetelementcontext.cxx | 28 +-- oox/source/shape/FastTokenHandlerService.cxx | 118 ---------- oox/source/shape/FastTokenHandlerService.hxx | 73 ------ oox/source/shape/ShapeContextHandler.cxx | 7 +- oox/source/shape/makefile.mk | 3 +- oox/source/token/gennamespaces.pl | 66 ------ oox/source/token/genproperties.pl | 46 ---- oox/source/token/gentoken.pl | 61 ----- oox/source/token/makefile.mk | 44 ++-- oox/source/token/namespacemap.cxx | 49 ++++ oox/source/token/namespaces.hxx.head | 36 +++ oox/source/token/namespaces.hxx.tail | 35 +++ oox/source/token/namespaces.pl | 79 +++++++ oox/source/token/namespaces.txt | 101 ++++---- oox/source/token/parsexsd.pl | 27 +++ oox/source/token/properties.hxx.head | 36 +++ oox/source/token/properties.hxx.tail | 6 + oox/source/token/properties.pl | 67 ++++++ oox/source/token/propertylist.cxx | 56 ----- oox/source/token/propertynames.cxx | 51 ++++ oox/source/token/tokenmap.cxx | 34 +-- oox/source/token/tokens.hxx.head | 36 +++ oox/source/token/tokens.hxx.tail | 8 + oox/source/token/tokens.pl | 80 +++++++ oox/source/vml/vmldrawing.cxx | 1 - oox/source/vml/vmldrawingfragment.cxx | 4 +- oox/source/vml/vmlformatting.cxx | 1 - oox/source/vml/vmlshape.cxx | 1 - oox/source/vml/vmltextbox.cxx | 1 - oox/source/xls/autofilterbuffer.cxx | 3 - oox/source/xls/chartsheetfragment.cxx | 4 +- oox/source/xls/commentsfragment.cxx | 4 +- oox/source/xls/condformatbuffer.cxx | 1 - oox/source/xls/connectionsbuffer.cxx | 2 - oox/source/xls/connectionsfragment.cxx | 4 +- oox/source/xls/defnamesbuffer.cxx | 1 - oox/source/xls/drawingfragment.cxx | 1 - oox/source/xls/excelfilter.cxx | 2 +- oox/source/xls/excelvbaproject.cxx | 1 - oox/source/xls/externallinkbuffer.cxx | 5 +- oox/source/xls/externallinkfragment.cxx | 4 +- oox/source/xls/formulabase.cxx | 1 - oox/source/xls/formulaparser.cxx | 1 - oox/source/xls/numberformatsbuffer.cxx | 1 - oox/source/xls/pagesettings.cxx | 1 - oox/source/xls/pivotcachebuffer.cxx | 1 - oox/source/xls/pivotcachefragment.cxx | 3 +- oox/source/xls/pivottablebuffer.cxx | 1 - oox/source/xls/pivottablefragment.cxx | 4 +- oox/source/xls/querytablebuffer.cxx | 1 - oox/source/xls/querytablefragment.cxx | 4 +- oox/source/xls/scenariobuffer.cxx | 1 - oox/source/xls/sharedformulabuffer.cxx | 1 - oox/source/xls/sharedstringsfragment.cxx | 4 +- oox/source/xls/stylesbuffer.cxx | 1 - oox/source/xls/stylesfragment.cxx | 4 +- oox/source/xls/tablebuffer.cxx | 1 - oox/source/xls/tablefragment.cxx | 4 +- oox/source/xls/themebuffer.cxx | 1 - oox/source/xls/unitconverter.cxx | 1 - oox/source/xls/viewsettings.cxx | 1 - oox/source/xls/workbookfragment.cxx | 25 +- oox/source/xls/workbookhelper.cxx | 1 - oox/source/xls/workbooksettings.cxx | 1 - oox/source/xls/worksheetbuffer.cxx | 1 - oox/source/xls/worksheetfragment.cxx | 13 +- oox/source/xls/worksheethelper.cxx | 2 - oox/source/xls/worksheetsettings.cxx | 1 - writerfilter/source/ooxml/model.xml | 26 +- writerfilter/source/ooxml/namespaceids.xsl | 2 +- .../source/resourcemodel/namespace_preprocess.pl | 25 +- 220 files changed, 2075 insertions(+), 1977 deletions(-) create mode 100755 oox/inc/oox/core/fastparser.hxx mode change 100644 => 100755 oox/inc/oox/core/relations.hxx mode change 100755 => 100644 oox/inc/oox/ole/axbinaryreader.hxx mode change 100755 => 100644 oox/inc/oox/ole/olestorage.hxx mode change 100755 => 100644 oox/inc/oox/ole/vbamodule.hxx create mode 100755 oox/inc/oox/token/namespacemap.hxx delete mode 100644 oox/inc/oox/token/propertylist.hxx create mode 100644 oox/inc/oox/token/propertynames.hxx delete mode 100644 oox/source/core/facreg.cxx create mode 100755 oox/source/core/fastparser.cxx create mode 100644 oox/source/core/services.cxx mode change 100755 => 100644 oox/source/ole/axbinaryreader.cxx mode change 100755 => 100644 oox/source/ole/olestorage.cxx delete mode 100644 oox/source/shape/FastTokenHandlerService.cxx delete mode 100644 oox/source/shape/FastTokenHandlerService.hxx delete mode 100644 oox/source/token/gennamespaces.pl delete mode 100644 oox/source/token/genproperties.pl delete mode 100644 oox/source/token/gentoken.pl create mode 100755 oox/source/token/namespacemap.cxx create mode 100755 oox/source/token/namespaces.hxx.head create mode 100755 oox/source/token/namespaces.hxx.tail create mode 100644 oox/source/token/namespaces.pl create mode 100755 oox/source/token/properties.hxx.head create mode 100755 oox/source/token/properties.hxx.tail create mode 100644 oox/source/token/properties.pl delete mode 100644 oox/source/token/propertylist.cxx create mode 100644 oox/source/token/propertynames.cxx create mode 100755 oox/source/token/tokens.hxx.head create mode 100755 oox/source/token/tokens.hxx.tail create mode 100644 oox/source/token/tokens.pl diff --git a/oox/inc/oox/core/contexthandler.hxx b/oox/inc/oox/core/contexthandler.hxx index c5c198c34c23..10de170f9e40 100644 --- a/oox/inc/oox/core/contexthandler.hxx +++ b/oox/inc/oox/core/contexthandler.hxx @@ -28,10 +28,12 @@ #ifndef OOX_CORE_CONTEXTHANDLER_HXX #define OOX_CORE_CONTEXTHANDLER_HXX -#include #include +#include #include #include +#include "oox/token/namespaces.hxx" +#include "oox/token/tokens.hxx" namespace com { namespace sun { namespace star { namespace xml { namespace sax { class XLocator; } } diff --git a/oox/inc/oox/core/contexthandler2.hxx b/oox/inc/oox/core/contexthandler2.hxx index 59da648883b0..314a0886b866 100644 --- a/oox/inc/oox/core/contexthandler2.hxx +++ b/oox/inc/oox/core/contexthandler2.hxx @@ -30,17 +30,19 @@ #include #include -#include "tokens.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/core/contexthandler.hxx" -#include "oox/core/namespaces.hxx" namespace oox { namespace core { // ============================================================================ +const sal_Int32 XML_ROOT_CONTEXT = SAL_MAX_INT32; + +// ============================================================================ + struct ElementInfo; /** Helper class that provides a context stack. diff --git a/oox/inc/oox/core/fastparser.hxx b/oox/inc/oox/core/fastparser.hxx new file mode 100755 index 000000000000..967c42474dcc --- /dev/null +++ b/oox/inc/oox/core/fastparser.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_CORE_FASTPARSER_HXX +#define OOX_CORE_FASTPARSER_HXX + +#include +#include + +namespace oox { + struct NamespaceMap; + class StorageBase; +} + +namespace oox { +namespace core { + +// ============================================================================ + +/** Wrapper for a fast SAX parser that works on automatically generated OOXML + token and namespace identifiers. + */ +class FastParser +{ +public: + explicit FastParser( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ~FastParser(); + + /** Registers an OOXML namespace at the parser. */ + void registerNamespace( sal_Int32 nNamespaceId ) + throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + + /** Sets the passed document handler that will receive the SAX parser events. */ + void setDocumentHandler( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastDocumentHandler >& rxDocHandler ) + throw( ::com::sun::star::uno::RuntimeException ); + + /** Parses the passed SAX input source. + @param bCloseStream True = closes the stream in the input source after parsing. */ + void parseStream( const ::com::sun::star::xml::sax::InputSource& rInputSource, bool bCloseStream = false ) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ); + + /** Parses the passed input stream. + @param bCloseStream True = closes the passed stream after parsing. */ + void parseStream( + const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream, + const ::rtl::OUString& rStreamName, bool bCloseStream = false ) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ); + + /** Parses a stream from the passed storage with the specified name. + @param bCloseStream True = closes the stream after parsing. */ + void parseStream( StorageBase& rStorage, const ::rtl::OUString& rStreamName, bool bCloseStream = false ) + throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ); + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastParser > + mxParser; + const NamespaceMap& mrNamespaceMap; +}; + +// ============================================================================ + +} // namespace core +} // namespace oox + +#endif diff --git a/oox/inc/oox/core/fasttokenhandler.hxx b/oox/inc/oox/core/fasttokenhandler.hxx index 01422aebc3ea..a6c73de9842b 100644 --- a/oox/inc/oox/core/fasttokenhandler.hxx +++ b/oox/inc/oox/core/fasttokenhandler.hxx @@ -28,8 +28,9 @@ #ifndef OOX_CORE_FASTTOKENHANDLER_HXX #define OOX_CORE_FASTTOKENHANDLER_HXX +#include #include -#include +#include namespace oox { class TokenMap; } @@ -38,15 +39,23 @@ namespace core { // ============================================================================ +typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::xml::sax::XFastTokenHandler > FastTokenHandlerBase; + /** Wrapper implementing the com.sun.star.xml.sax.XFastTokenHandler API interface that provides access to the tokens generated from the internal token name list. */ -class FastTokenHandler : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastTokenHandler > +class FastTokenHandler : public FastTokenHandlerBase { public: explicit FastTokenHandler(); virtual ~FastTokenHandler(); + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XFastTokenHandler virtual sal_Int32 SAL_CALL getToken( const ::rtl::OUString& rIdentifier ) throw (::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getIdentifier( sal_Int32 nToken ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getUTF8Identifier( sal_Int32 nToken ) throw (::com::sun::star::uno::RuntimeException); diff --git a/oox/inc/oox/core/relations.hxx b/oox/inc/oox/core/relations.hxx old mode 100644 new mode 100755 index 6abb48c361a0..285c4ed947e4 --- a/oox/inc/oox/core/relations.hxx +++ b/oox/inc/oox/core/relations.hxx @@ -37,14 +37,19 @@ namespace core { // ============================================================================ -/** Expands to an OUString containing an officeDocument relation type created +/** Expands to an OUString containing an 'officeDocument' relation type created from the passed literal(!) ASCII(!) character array. */ -#define CREATE_OFFICEDOC_RELATIONSTYPE( ascii ) \ +#define CREATE_OFFICEDOC_RELATION_TYPE( ascii ) \ CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/" ascii ) +/** Expands to an OUString containing a 'package' relation type created from + the passed literal(!) ASCII(!) character array. */ +#define CREATE_PACKAGE_RELATION_TYPE( ascii ) \ + CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships/" ascii ) + /** Expands to an OUString containing an MS Office specific relation type created from the passed literal(!) ASCII(!) character array. */ -#define CREATE_MSOFFICE_RELATIONSTYPE( ascii ) \ +#define CREATE_MSOFFICE_RELATION_TYPE( ascii ) \ CREATE_OUSTRING( "http://schemas.microsoft.com/office/2006/relationships/" ascii ) // ============================================================================ diff --git a/oox/inc/oox/drawingml/chart/modelbase.hxx b/oox/inc/oox/drawingml/chart/modelbase.hxx index 065c45f3c2df..f29374bd6c69 100644 --- a/oox/inc/oox/drawingml/chart/modelbase.hxx +++ b/oox/inc/oox/drawingml/chart/modelbase.hxx @@ -30,7 +30,6 @@ #include "oox/helper/containerhelper.hxx" #include "oox/helper/helper.hxx" -#include "tokens.hxx" namespace oox { class AttributeList; } diff --git a/oox/inc/oox/drawingml/clrscheme.hxx b/oox/inc/oox/drawingml/clrscheme.hxx index 22eab1a892a1..5f13f54b705d 100644 --- a/oox/inc/oox/drawingml/clrscheme.hxx +++ b/oox/inc/oox/drawingml/clrscheme.hxx @@ -31,7 +31,6 @@ #include #include #include -#include "oox/core/namespaces.hxx" #include "oox/drawingml/color.hxx" namespace oox { namespace drawingml { diff --git a/oox/inc/oox/drawingml/customshapeproperties.hxx b/oox/inc/oox/drawingml/customshapeproperties.hxx index 282e0c6009b5..985507d22265 100644 --- a/oox/inc/oox/drawingml/customshapeproperties.hxx +++ b/oox/inc/oox/drawingml/customshapeproperties.hxx @@ -28,13 +28,7 @@ #ifndef OOX_DRAWINGML_CUSTOMSHAPEPROPERTIES_HXX #define OOX_DRAWINGML_CUSTOMSHAPEPROPERTIES_HXX -#include "oox/helper/propertymap.hxx" -#include "oox/drawingml/color.hxx" -#include "oox/core/xmlfilterbase.hxx" -#include #include -#include "oox/helper/helper.hxx" -#include "tokens.hxx" #include #include #include @@ -45,11 +39,15 @@ #include #include #include -#ifndef __com_sun_star_beans_PropertyValues_hpp__ #include -#endif #include #include +#include +#include "oox/core/xmlfilterbase.hxx" +#include "oox/drawingml/color.hxx" +#include "oox/helper/helper.hxx" +#include "oox/helper/propertymap.hxx" +#include "oox/token/tokens.hxx" namespace oox { namespace drawingml { diff --git a/oox/inc/oox/helper/attributelist.hxx b/oox/inc/oox/helper/attributelist.hxx index f2919e889994..87e21e553c2d 100644 --- a/oox/inc/oox/helper/attributelist.hxx +++ b/oox/inc/oox/helper/attributelist.hxx @@ -31,7 +31,8 @@ #include #include #include "oox/helper/helper.hxx" -#include "tokens.hxx" +#include "oox/token/namespaces.hxx" +#include "oox/token/tokens.hxx" namespace oox { diff --git a/oox/inc/oox/helper/propertymap.hxx b/oox/inc/oox/helper/propertymap.hxx index 0bc16b3443ff..9e7196381002 100644 --- a/oox/inc/oox/helper/propertymap.hxx +++ b/oox/inc/oox/helper/propertymap.hxx @@ -30,9 +30,10 @@ #include #include -#include #include #include +#include +#include "oox/token/properties.hxx" namespace com { namespace sun { namespace star { namespace beans { struct PropertyValue; @@ -41,7 +42,7 @@ namespace com { namespace sun { namespace star { namespace beans { namespace oox { -struct PropertyList; +struct PropertyNameVector; // ============================================================================ @@ -90,7 +91,7 @@ public: makePropertySet() const; private: - const PropertyList* mpPropNames; + const PropertyNameVector* mpPropNames; }; // ============================================================================ diff --git a/oox/inc/oox/helper/propertyset.hxx b/oox/inc/oox/helper/propertyset.hxx index bb8307ad39b1..9a49bb48cf92 100644 --- a/oox/inc/oox/helper/propertyset.hxx +++ b/oox/inc/oox/helper/propertyset.hxx @@ -30,6 +30,7 @@ #include #include +#include "oox/token/properties.hxx" namespace oox { diff --git a/oox/inc/oox/ole/axbinaryreader.hxx b/oox/inc/oox/ole/axbinaryreader.hxx old mode 100755 new mode 100644 index 9b3cfae723b8..36346402a0e3 --- a/oox/inc/oox/ole/axbinaryreader.hxx +++ b/oox/inc/oox/ole/axbinaryreader.hxx @@ -296,4 +296,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/ole/axcontrolfragment.hxx b/oox/inc/oox/ole/axcontrolfragment.hxx index 3c9aed61bd3e..a5273070ba8f 100644 --- a/oox/inc/oox/ole/axcontrolfragment.hxx +++ b/oox/inc/oox/ole/axcontrolfragment.hxx @@ -78,4 +78,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/ole/olehelper.hxx b/oox/inc/oox/ole/olehelper.hxx index f19efa835f4e..98085e66cfd8 100644 --- a/oox/inc/oox/ole/olehelper.hxx +++ b/oox/inc/oox/ole/olehelper.hxx @@ -144,4 +144,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/ole/oleobjecthelper.hxx b/oox/inc/oox/ole/oleobjecthelper.hxx index ef3570c4fa20..c3a58213abc9 100644 --- a/oox/inc/oox/ole/oleobjecthelper.hxx +++ b/oox/inc/oox/ole/oleobjecthelper.hxx @@ -32,8 +32,8 @@ namespace com { namespace sun { namespace star { namespace awt { struct Size; } - namespace lang { class XMultiServiceFactory; } namespace document { class XEmbeddedObjectResolver; } + namespace lang { class XMultiServiceFactory; } } } } namespace oox { class PropertyMap; } @@ -83,4 +83,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/ole/olestorage.hxx b/oox/inc/oox/ole/olestorage.hxx old mode 100755 new mode 100644 index a84fadfadc92..eabcfd4d0f87 --- a/oox/inc/oox/ole/olestorage.hxx +++ b/oox/inc/oox/ole/olestorage.hxx @@ -31,8 +31,8 @@ #include "oox/helper/storagebase.hxx" namespace com { namespace sun { namespace star { - namespace lang { class XMultiServiceFactory; } namespace container { class XNameContainer; } + namespace lang { class XMultiServiceFactory; } } } } namespace oox { diff --git a/oox/inc/oox/ole/vbainputstream.hxx b/oox/inc/oox/ole/vbainputstream.hxx index 4de0a91a622f..858698518968 100644 --- a/oox/inc/oox/ole/vbainputstream.hxx +++ b/oox/inc/oox/ole/vbainputstream.hxx @@ -69,4 +69,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/ole/vbamodule.hxx b/oox/inc/oox/ole/vbamodule.hxx old mode 100755 new mode 100644 index 377c7abc335a..52b2261e55b5 --- a/oox/inc/oox/ole/vbamodule.hxx +++ b/oox/inc/oox/ole/vbamodule.hxx @@ -28,8 +28,8 @@ #ifndef OOX_OLE_VBAMODULE_HXX #define OOX_OLE_VBAMODULE_HXX -#include #include +#include namespace com { namespace sun { namespace star { namespace container { class XNameAccess; } diff --git a/oox/inc/oox/ppt/pptimport.hxx b/oox/inc/oox/ppt/pptimport.hxx index d3a4b1bbd7b3..158584eeb3f5 100644 --- a/oox/inc/oox/ppt/pptimport.hxx +++ b/oox/inc/oox/ppt/pptimport.hxx @@ -34,7 +34,6 @@ #include #include "oox/ppt/presentationfragmenthandler.hxx" #include "oox/ppt/slidepersist.hxx" -#include "tokens.hxx" #include #include diff --git a/oox/inc/oox/ppt/slidepersist.hxx b/oox/inc/oox/ppt/slidepersist.hxx index e8c5d21448ce..29f857c8340e 100644 --- a/oox/inc/oox/ppt/slidepersist.hxx +++ b/oox/inc/oox/ppt/slidepersist.hxx @@ -28,7 +28,6 @@ #ifndef OOX_POWERPOINT_SLIDEPERSIST_HXX #define OOX_POWERPOINT_SLIDEPERSIST_HXX -#include "tokens.hxx" #include #include "oox/drawingml/shape.hxx" #include "oox/drawingml/theme.hxx" diff --git a/oox/inc/oox/token/namespacemap.hxx b/oox/inc/oox/token/namespacemap.hxx new file mode 100755 index 000000000000..e4daa18f6b56 --- /dev/null +++ b/oox/inc/oox/token/namespacemap.hxx @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_TOKEN_NAMESPACEMAP_HXX +#define OOX_TOKEN_NAMESPACEMAP_HXX + +#include +#include +#include + +namespace oox { + +// ============================================================================ + +/** A map that contains all XML namespace URLs used in the filters. */ +struct NamespaceMap : public ::std::map< sal_Int32, ::rtl::OUString > { NamespaceMap(); }; + +/** Thread-save singleton of a map of all supported XML namespace URLs. */ +struct StaticNamespaceMap : public ::rtl::Static< NamespaceMap, StaticNamespaceMap > {}; + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/inc/oox/token/propertylist.hxx b/oox/inc/oox/token/propertylist.hxx deleted file mode 100644 index 5f75b13e10c4..000000000000 --- a/oox/inc/oox/token/propertylist.hxx +++ /dev/null @@ -1,50 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef OOX_TOKEN_PROPERTYLIST_HXX -#define OOX_TOKEN_PROPERTYLIST_HXX - -#include -#include - -namespace oox { - -// ============================================================================ - -/** A vector that contains all predefined property names used in the filters. */ -struct PropertyList : public ::std::vector< ::rtl::OUString > -{ - explicit PropertyList(); - ~PropertyList(); -}; - -// ============================================================================ - -} // namespace oox - -#endif - diff --git a/oox/inc/oox/token/propertynames.hxx b/oox/inc/oox/token/propertynames.hxx new file mode 100644 index 000000000000..5f94e74c2b96 --- /dev/null +++ b/oox/inc/oox/token/propertynames.hxx @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_TOKEN_PROPERTYNAMES_HXX +#define OOX_TOKEN_PROPERTYNAMES_HXX + +#include +#include +#include + +namespace oox { + +// ============================================================================ + +/** A vector that contains all predefined property names used in the filters. */ +struct PropertyNameVector : public ::std::vector< ::rtl::OUString > { PropertyNameVector(); }; + +/** Thread-save singleton of a vector of all supported property names. */ +struct StaticPropertyNameVector : public ::rtl::Static< PropertyNameVector, StaticPropertyNameVector > {}; + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/inc/oox/xls/autofilterbuffer.hxx b/oox/inc/oox/xls/autofilterbuffer.hxx index 105afa606f47..31aeca252414 100755 --- a/oox/inc/oox/xls/autofilterbuffer.hxx +++ b/oox/inc/oox/xls/autofilterbuffer.hxx @@ -133,10 +133,10 @@ private: /** A filter criterion for a custom filter. */ struct FilterCriterionModel { - ::com::sun::star::uno::Any maValue; /// The comparison operator. + ::com::sun::star::uno::Any maValue; /// Comparison operand. sal_Int32 mnOperator; /// Comparison operator. - sal_uInt8 mnDataType; /// Operator data type (BIFF only). - sal_uInt8 mnStrLen; /// Length of string operator (BIFF5-BIFF8 only). + sal_uInt8 mnDataType; /// Operand data type (BIFF only). + sal_uInt8 mnStrLen; /// Length of string operand (BIFF5-BIFF8 only). explicit FilterCriterionModel(); diff --git a/oox/prj/d.lst b/oox/prj/d.lst index 482a270926a3..41cadacbecd5 100644 --- a/oox/prj/d.lst +++ b/oox/prj/d.lst @@ -1,10 +1,11 @@ mkdir: %_DEST%\inc%_EXT%\oox -mkdir: %_DEST%\inc%_EXT%\oox\helper mkdir: %_DEST%\inc%_EXT%\oox\core mkdir: %_DEST%\inc%_EXT%\oox\drawingml mkdir: %_DEST%\inc%_EXT%\oox\drawingml\chart mkdir: %_DEST%\inc%_EXT%\oox\drawingml\table +mkdir: %_DEST%\inc%_EXT%\oox\helper mkdir: %_DEST%\inc%_EXT%\oox\ole +mkdir: %_DEST%\inc%_EXT%\oox\token mkdir: %_DEST%\inc%_EXT%\oox\vml mkdir: %_DEST%\inc%_EXT%\oox\xls @@ -17,10 +18,10 @@ mkdir: %_DEST%\inc%_EXT%\oox\xls ..\%__SRC%\lib\i*.lib %_DEST%\lib%_EXT%\i*.lib ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib -..\%__SRC%\inc\tokens.hxx %_DEST%\inc%_EXT%\oox\core\tokens.hxx +..\%__SRC%\inc\oox\token\tokens.hxx %_DEST%\inc%_EXT%\oox\token\tokens.hxx +..\%__SRC%\misc\namespaces.txt %_DEST%\inc%_EXT%\oox\namespaces.txt ..\source\token\tokens.txt %_DEST%\inc%_EXT%\oox\token.txt -..\source\token\namespaces.txt %_DEST%\inc%_EXT%\oox\namespaces.txt ..\inc\oox\dllapi.h %_DEST%\inc%_EXT%\oox\dllapi.h ..\inc\oox\helper\binarystreambase.hxx %_DEST%\inc%_EXT%\oox\helper\binarystreambase.hxx ..\inc\oox\helper\helper.hxx %_DEST%\inc%_EXT%\oox\helper\helper.hxx diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx index 0cb7017372da..8ba5dd65cd9b 100644 --- a/oox/source/core/contexthandler2.cxx +++ b/oox/source/core/contexthandler2.cxx @@ -102,7 +102,7 @@ Reference< XFastContextHandler > ContextHandler2Helper::implCreateChildContext( void ContextHandler2Helper::implStartElement( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) { AttributeList aAttribs( rxAttribs ); - pushElementInfo( nElement ).mbTrimSpaces = aAttribs.getToken( NMSP_XML | XML_space, XML_TOKEN_INVALID ) != XML_preserve; + pushElementInfo( nElement ).mbTrimSpaces = aAttribs.getToken( XML_TOKEN( space ), XML_TOKEN_INVALID ) != XML_preserve; onStartElement( aAttribs ); } diff --git a/oox/source/core/facreg.cxx b/oox/source/core/facreg.cxx deleted file mode 100644 index 3ae1be13defa..000000000000 --- a/oox/source/core/facreg.cxx +++ /dev/null @@ -1,102 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include - -using ::rtl::OUString; -using namespace ::com::sun::star::uno; - -// Declare static functions providing service information ===================== - -#define DECLARE_FUNCTIONS( className ) \ -extern OUString SAL_CALL className##_getImplementationName() throw(); \ -extern Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \ -extern Reference< XInterface > SAL_CALL className##_createInstance( \ - const Reference< XComponentContext >& rxContext ) throw (Exception) - -namespace oox { - namespace core { DECLARE_FUNCTIONS( FilterDetect ); } - namespace docprop { DECLARE_FUNCTIONS( OOXMLDocPropImportImpl ); } - namespace ole { DECLARE_FUNCTIONS( WordVbaProjectFilter ); } - namespace ppt { DECLARE_FUNCTIONS( PowerPointImport ); } - namespace shape { DECLARE_FUNCTIONS( FastTokenHandlerService ); } - namespace shape { DECLARE_FUNCTIONS( ShapeContextHandler ); } - namespace xls { DECLARE_FUNCTIONS( BiffDetector ); } - namespace xls { DECLARE_FUNCTIONS( ExcelFilter ); } - namespace xls { DECLARE_FUNCTIONS( ExcelBiffFilter ); } - namespace xls { DECLARE_FUNCTIONS( ExcelVbaProjectFilter ); } - namespace xls { DECLARE_FUNCTIONS( OOXMLFormulaParser ); } -} - -#undef DECLARE_FUNCTIONS - -// ============================================================================ - -namespace { - -#define IMPLEMENTATION_ENTRY( className ) \ - { &className##_createInstance, &className##_getImplementationName, &className##_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 } - -static ::cppu::ImplementationEntry const spServices[] = -{ - IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ), - IMPLEMENTATION_ENTRY( ::oox::docprop::OOXMLDocPropImportImpl ), - IMPLEMENTATION_ENTRY( ::oox::ole::WordVbaProjectFilter ), - IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ), - IMPLEMENTATION_ENTRY( ::oox::shape::FastTokenHandlerService ), - IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ), - IMPLEMENTATION_ENTRY( ::oox::xls::BiffDetector ), - IMPLEMENTATION_ENTRY( ::oox::xls::ExcelFilter ), - IMPLEMENTATION_ENTRY( ::oox::xls::ExcelBiffFilter ), - IMPLEMENTATION_ENTRY( ::oox::xls::ExcelVbaProjectFilter ), - IMPLEMENTATION_ENTRY( ::oox::xls::OOXMLFormulaParser ), - { 0, 0, 0, 0, 0, 0 } -}; - -#undef IMPLEMENTATION_ENTRY - -} // namespace - -// ---------------------------------------------------------------------------- - -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char** ppEnvironmentTypeName, uno_Environment** /*ppEnvironment*/ ) -{ - *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey ) -{ - return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices ); -} - -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey ) -{ - return ::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, spServices ); -} - -// ============================================================================ diff --git a/oox/source/core/fastparser.cxx b/oox/source/core/fastparser.cxx new file mode 100755 index 000000000000..eaf8c428b92c --- /dev/null +++ b/oox/source/core/fastparser.cxx @@ -0,0 +1,136 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "oox/core/fastparser.hxx" + +#include "oox/core/fasttokenhandler.hxx" +#include "oox/helper/containerhelper.hxx" +#include "oox/helper/helper.hxx" +#include "oox/helper/storagebase.hxx" +#include "oox/token/namespacemap.hxx" + +namespace oox { +namespace core { + +// ============================================================================ + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +using ::rtl::OUString; + +// ============================================================================ + +namespace { + +class InputStreamCloseGuard +{ +public: + explicit InputStreamCloseGuard( const Reference< XInputStream >& rxInStream, bool bCloseStream ); + ~InputStreamCloseGuard(); +private: + Reference< XInputStream > mxInStream; + bool mbCloseStream; +}; + +InputStreamCloseGuard::InputStreamCloseGuard( const Reference< XInputStream >& rxInStream, bool bCloseStream ) : + mxInStream( rxInStream ), + mbCloseStream( bCloseStream ) +{ +} + +InputStreamCloseGuard::~InputStreamCloseGuard() +{ + if( mxInStream.is() && mbCloseStream ) try { mxInStream->closeInput(); } catch( Exception& ) {} +} + +} // namespace + +// ============================================================================ + +FastParser::FastParser( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + mrNamespaceMap( StaticNamespaceMap::get() ) +{ + // create a fast parser instance + Reference< XMultiComponentFactory > xFactory( rxContext->getServiceManager(), UNO_SET_THROW ); + mxParser.set( xFactory->createInstanceWithContext( CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ), rxContext ), UNO_QUERY_THROW ); + + // create the fast token handler based on the OOXML token list + mxParser->setTokenHandler( new FastTokenHandler ); +} + +FastParser::~FastParser() +{ +} + +void FastParser::registerNamespace( sal_Int32 nNamespaceId ) throw( IllegalArgumentException, RuntimeException ) +{ + if( !mxParser.is() ) + throw RuntimeException(); + + const OUString* pNamespaceUrl = ContainerHelper::getMapElement( mrNamespaceMap, nNamespaceId ); + if( !pNamespaceUrl ) + throw IllegalArgumentException(); + + mxParser->registerNamespace( *pNamespaceUrl, nNamespaceId ); +} + +void FastParser::setDocumentHandler( const Reference< XFastDocumentHandler >& rxDocHandler ) throw( RuntimeException ) +{ + if( !mxParser.is() ) + throw RuntimeException(); + mxParser->setFastDocumentHandler( rxDocHandler ); +} + +void FastParser::parseStream( const InputSource& rInputSource, bool bCloseStream ) throw( SAXException, IOException, RuntimeException ) +{ + // guard closing the input stream also when exceptions are thrown + InputStreamCloseGuard aGuard( rInputSource.aInputStream, bCloseStream ); + if( !mxParser.is() ) + throw RuntimeException(); + mxParser->parseStream( rInputSource ); +} + +void FastParser::parseStream( const Reference< XInputStream >& rxInStream, const OUString& rStreamName, bool bCloseStream ) throw( SAXException, IOException, RuntimeException ) +{ + InputSource aInputSource; + aInputSource.sSystemId = rStreamName; + aInputSource.aInputStream = rxInStream; + parseStream( aInputSource, bCloseStream ); +} + +void FastParser::parseStream( StorageBase& rStorage, const OUString& rStreamName, bool bCloseStream ) throw( SAXException, IOException, RuntimeException ) +{ + parseStream( rStorage.openInputStream( rStreamName ), rStreamName, bCloseStream ); +} + +// ============================================================================ + +} // namespace core +} // namespace oox diff --git a/oox/source/core/fasttokenhandler.cxx b/oox/source/core/fasttokenhandler.cxx index 547570e29439..e09687cc5470 100644 --- a/oox/source/core/fasttokenhandler.cxx +++ b/oox/source/core/fasttokenhandler.cxx @@ -27,7 +27,8 @@ #include "oox/core/fasttokenhandler.hxx" -#include +#include +#include "oox/helper/helper.hxx" #include "oox/token/tokenmap.hxx" namespace oox { @@ -37,21 +38,26 @@ namespace core { using namespace ::com::sun::star::uno; -using ::osl::Mutex; -using ::osl::MutexGuard; using ::rtl::OUString; // ============================================================================ -namespace { +OUString SAL_CALL FastTokenHandler_getImplementationName() +{ + return CREATE_OUSTRING( "com.sun.star.comp.oox.core.FastTokenHandler" ); +} -Mutex& lclGetTokenMutex() +Sequence< OUString > SAL_CALL FastTokenHandler_getSupportedServiceNames() { - static Mutex aMutex; - return aMutex; + Sequence< OUString > aServiceNames( 1 ); + aServiceNames[ 0 ] = CREATE_OUSTRING( "com.sun.star.xml.sax.FastTokenHandler" ); + return aServiceNames; } -} // namespace +Reference< XInterface > SAL_CALL FastTokenHandler_createInstance( const Reference< XComponentContext >& /*rxContext*/ ) throw (Exception) +{ + return static_cast< ::cppu::OWeakObject* >( new FastTokenHandler ); +} // ============================================================================ @@ -64,27 +70,46 @@ FastTokenHandler::~FastTokenHandler() { } +// XServiceInfo + +OUString SAL_CALL FastTokenHandler::getImplementationName() throw (RuntimeException) +{ + return FastTokenHandler_getImplementationName(); +} + +sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& rServiceName ) throw (RuntimeException) +{ + Sequence< OUString > aServiceNames = FastTokenHandler_getSupportedServiceNames(); + for( sal_Int32 nIndex = 0, nLength = aServiceNames.getLength(); nIndex < nLength; ++nIndex ) + if( aServiceNames[ nIndex ] == rServiceName ) + return sal_True; + return sal_False; +} + +Sequence< OUString > SAL_CALL FastTokenHandler::getSupportedServiceNames() throw (RuntimeException) +{ + return FastTokenHandler_getSupportedServiceNames(); +} + +// XFastTokenHandler + sal_Int32 FastTokenHandler::getToken( const OUString& rIdentifier ) throw( RuntimeException ) { - MutexGuard aGuard( lclGetTokenMutex() ); return mrTokenMap.getTokenFromUnicode( rIdentifier ); } OUString FastTokenHandler::getIdentifier( sal_Int32 nToken ) throw( RuntimeException ) { - MutexGuard aGuard( lclGetTokenMutex() ); return mrTokenMap.getUnicodeTokenName( nToken ); } Sequence< sal_Int8 > FastTokenHandler::getUTF8Identifier( sal_Int32 nToken ) throw( RuntimeException ) { - MutexGuard aGuard( lclGetTokenMutex() ); return mrTokenMap.getUtf8TokenName( nToken ); } sal_Int32 FastTokenHandler::getTokenFromUTF8( const Sequence< sal_Int8 >& rIdentifier ) throw( RuntimeException ) { - MutexGuard aGuard( lclGetTokenMutex() ); return mrTokenMap.getTokenFromUtf8( rIdentifier ); } diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index f17fb3f5014d..9eaf5fb29a14 100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -42,7 +42,6 @@ #include "oox/helper/modelobjecthelper.hxx" #include "oox/ole/oleobjecthelper.hxx" #include "oox/ole/vbaproject.hxx" -#include "tokens.hxx" namespace oox { namespace core { diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx index fb17c69155ef..4f8bd8ef2463 100644 --- a/oox/source/core/filterdetect.cxx +++ b/oox/source/core/filterdetect.cxx @@ -28,13 +28,11 @@ #include "oox/core/filterdetect.hxx" #include -#include #include #include #include #include -#include "oox/core/fasttokenhandler.hxx" -#include "oox/core/namespaces.hxx" +#include "oox/core/fastparser.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/binaryoutputstream.hxx" @@ -91,22 +89,22 @@ void SAL_CALL FilterDetectDocHandler::startFastElement( switch ( nElement ) { // cases for _rels/.rels - case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationships: + case PR_TOKEN( Relationships ): break; - case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationship: - if( !maContextStack.empty() && (maContextStack.back() == (NMSP_PACKAGE_RELATIONSHIPS|XML_Relationships)) ) + case PR_TOKEN( Relationship ): + if( !maContextStack.empty() && (maContextStack.back() == PR_TOKEN( Relationships )) ) parseRelationship( aAttribs ); break; // cases for [Content_Types].xml - case NMSP_CONTENT_TYPES|XML_Types: + case PC_TOKEN( Types ): break; - case NMSP_CONTENT_TYPES|XML_Default: - if( !maContextStack.empty() && (maContextStack.back() == (NMSP_CONTENT_TYPES|XML_Types)) ) + case PC_TOKEN( Default ): + if( !maContextStack.empty() && (maContextStack.back() == PC_TOKEN( Types )) ) parseContentTypesDefault( aAttribs ); break; - case NMSP_CONTENT_TYPES|XML_Override: - if( !maContextStack.empty() && (maContextStack.back() == (NMSP_CONTENT_TYPES|XML_Types)) ) + case PC_TOKEN( Override ): + if( !maContextStack.empty() && (maContextStack.back() == PC_TOKEN( Types )) ) parseContentTypesOverride( aAttribs ); break; } @@ -604,30 +602,21 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq descriptor. */ Reference< XInputStream > xInStrm( extractUnencryptedPackage( aMediaDesc ), UNO_SET_THROW ); - // try to detect the file type, must be a ZIP package + // stream must be a ZIP package ZipStorage aZipStorage( xFactory, xInStrm ); if( aZipStorage.isStorage() ) { - Reference< XFastParser > xParser( xFactory->createInstance( - CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW ); - - xParser->setFastDocumentHandler( new FilterDetectDocHandler( aFilterName ) ); - xParser->setTokenHandler( new FastTokenHandler ); - - xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships" ), NMSP_PACKAGE_RELATIONSHIPS ); - xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships" ), NMSP_RELATIONSHIPS ); - xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/content-types" ), NMSP_CONTENT_TYPES ); - - // Parse _rels/.rels to get the target path. - InputSource aParserInput; - aParserInput.sSystemId = CREATE_OUSTRING( "_rels/.rels" ); - aParserInput.aInputStream = aZipStorage.openInputStream( aParserInput.sSystemId ); - xParser->parseStream( aParserInput ); - - // Parse [Content_Types].xml to determine the content type of the part at the target path. - aParserInput.sSystemId = CREATE_OUSTRING( "[Content_Types].xml" ); - aParserInput.aInputStream = aZipStorage.openInputStream( aParserInput.sSystemId ); - xParser->parseStream( aParserInput ); + // create the fast parser, register the XML namespaces, set document handler + FastParser aParser( mxContext ); + aParser.registerNamespace( NMSP_packageRel ); + aParser.registerNamespace( NMSP_officeRel ); + aParser.registerNamespace( NMSP_packageContentTypes ); + aParser.setDocumentHandler( new FilterDetectDocHandler( aFilterName ) ); + + /* Parse '_rels/.rels' to get the target path and '[Content_Types].xml' + to determine the content type of the part at the target path. */ + aParser.parseStream( aZipStorage, CREATE_OUSTRING( "_rels/.rels" ) ); + aParser.parseStream( aZipStorage, CREATE_OUSTRING( "[Content_Types].xml" ) ); } } catch( Exception& ) diff --git a/oox/source/core/makefile.mk b/oox/source/core/makefile.mk index 2e29cf01543a..2b58b95777df 100644 --- a/oox/source/core/makefile.mk +++ b/oox/source/core/makefile.mk @@ -49,7 +49,7 @@ SLOFILES = \ $(SLO)$/binaryfilterbase.obj \ $(SLO)$/contexthandler.obj \ $(SLO)$/contexthandler2.obj \ - $(SLO)$/facreg.obj \ + $(SLO)$/fastparser.obj \ $(SLO)$/fasttokenhandler.obj \ $(SLO)$/filterbase.obj \ $(SLO)$/filterdetect.obj \ @@ -58,6 +58,7 @@ SLOFILES = \ $(SLO)$/recordparser.obj \ $(SLO)$/relations.obj \ $(SLO)$/relationshandler.obj \ + $(SLO)$/services.obj \ $(SLO)$/xmlfilterbase.obj # --- Targets ------------------------------------------------------- diff --git a/oox/source/core/relations.cxx b/oox/source/core/relations.cxx index db3420906f30..f6cade391a0f 100644 --- a/oox/source/core/relations.cxx +++ b/oox/source/core/relations.cxx @@ -71,7 +71,7 @@ const Relation* Relations::getRelationFromRelId( const OUString& rId ) const const Relation* Relations::getRelationFromFirstType( const OUString& rType ) const { for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt ) - if( aIt->second.maType == rType ) + if( aIt->second.maType.equalsIgnoreAsciiCase( rType ) ) return &aIt->second; return 0; } @@ -80,7 +80,7 @@ RelationsRef Relations::getRelationsFromType( const OUString& rType ) const { RelationsRef xRelations( new Relations( maFragmentPath ) ); for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt ) - if( aIt->second.maType == rType ) + if( aIt->second.maType.equalsIgnoreAsciiCase( rType ) ) (*xRelations)[ aIt->first ] = aIt->second; return xRelations; } diff --git a/oox/source/core/relationshandler.cxx b/oox/source/core/relationshandler.cxx index 5ff41b6613f7..6812a4acada6 100644 --- a/oox/source/core/relationshandler.cxx +++ b/oox/source/core/relationshandler.cxx @@ -28,9 +28,7 @@ #include "oox/core/relationshandler.hxx" #include -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" namespace oox { namespace core { @@ -80,7 +78,7 @@ Reference< XFastContextHandler > RelationsFragment::createFastChildContext( AttributeList aAttribs( rxAttribs ); switch( nElement ) { - case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationship: + case PR_TOKEN( Relationship ): { Relation aRelation; aRelation.maId = aAttribs.getString( XML_Id, OUString() ); @@ -99,7 +97,7 @@ Reference< XFastContextHandler > RelationsFragment::createFastChildContext( } } break; - case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationships: + case PR_TOKEN( Relationships ): xRet = getFastContextHandler(); break; } diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx new file mode 100644 index 000000000000..29b31e4672ab --- /dev/null +++ b/oox/source/core/services.cxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include + +using ::rtl::OUString; +using namespace ::com::sun::star::uno; + +// Declare static functions providing service information ===================== + +#define DECLARE_FUNCTIONS( className ) \ +extern OUString SAL_CALL className##_getImplementationName() throw(); \ +extern Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \ +extern Reference< XInterface > SAL_CALL className##_createInstance( \ + const Reference< XComponentContext >& rxContext ) throw (Exception) + +namespace oox { + namespace core { DECLARE_FUNCTIONS( FastTokenHandler ); } + namespace core { DECLARE_FUNCTIONS( FilterDetect ); } + namespace docprop { DECLARE_FUNCTIONS( DocumentPropertiesImport ); } + namespace ole { DECLARE_FUNCTIONS( WordVbaProjectFilter ); } + namespace ppt { DECLARE_FUNCTIONS( PowerPointImport ); } + namespace shape { DECLARE_FUNCTIONS( ShapeContextHandler ); } + namespace xls { DECLARE_FUNCTIONS( BiffDetector ); } + namespace xls { DECLARE_FUNCTIONS( ExcelFilter ); } + namespace xls { DECLARE_FUNCTIONS( ExcelBiffFilter ); } + namespace xls { DECLARE_FUNCTIONS( ExcelVbaProjectFilter ); } + namespace xls { DECLARE_FUNCTIONS( OOXMLFormulaParser ); } +} + +#undef DECLARE_FUNCTIONS + +// ============================================================================ + +namespace { + +#define IMPLEMENTATION_ENTRY( className ) \ + { &className##_createInstance, &className##_getImplementationName, &className##_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 } + +static ::cppu::ImplementationEntry const spServices[] = +{ + IMPLEMENTATION_ENTRY( ::oox::core::FastTokenHandler ), + IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ), + IMPLEMENTATION_ENTRY( ::oox::docprop::DocumentPropertiesImport ), + IMPLEMENTATION_ENTRY( ::oox::ole::WordVbaProjectFilter ), + IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ), + IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ), + IMPLEMENTATION_ENTRY( ::oox::xls::BiffDetector ), + IMPLEMENTATION_ENTRY( ::oox::xls::ExcelFilter ), + IMPLEMENTATION_ENTRY( ::oox::xls::ExcelBiffFilter ), + IMPLEMENTATION_ENTRY( ::oox::xls::ExcelVbaProjectFilter ), + IMPLEMENTATION_ENTRY( ::oox::xls::OOXMLFormulaParser ), + { 0, 0, 0, 0, 0, 0 } +}; + +#undef IMPLEMENTATION_ENTRY + +} // namespace + +// ---------------------------------------------------------------------------- + +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( + const sal_Char** ppEnvironmentTypeName, uno_Environment** /*ppEnvironment*/ ) +{ + *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey ) +{ + return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices ); +} + +extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey ) +{ + return ::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, spServices ); +} + +// ============================================================================ diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 8cb35e6d090f..f678bb17b1b2 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -37,17 +37,14 @@ #include #include #include -#include "oox/core/fasttokenhandler.hxx" +#include "oox/core/fastparser.hxx" #include "oox/core/filterdetect.hxx" #include "oox/core/fragmenthandler.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/recordparser.hxx" #include "oox/core/relationshandler.hxx" #include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" #include "oox/helper/zipstorage.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace core { @@ -89,63 +86,54 @@ struct XmlFilterBaseImpl { typedef RefMap< OUString, Relations > RelationsMap; - Reference< XFastParser > mxFastParser; - OUString maBinSuffix; - OUString maVmlSuffix; + FastParser maFastParser; + const OUString maBinSuffix; + const OUString maVmlSuffix; RelationsMap maRelationsMap; TextFieldStack maTextFieldStack; - explicit XmlFilterBaseImpl(); + + explicit XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ); }; // ---------------------------------------------------------------------------- -XmlFilterBaseImpl::XmlFilterBaseImpl() : +XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) : + maFastParser( rxContext ), maBinSuffix( CREATE_OUSTRING( ".bin" ) ), maVmlSuffix( CREATE_OUSTRING( ".vml" ) ) { + // register XML namespaces + maFastParser.registerNamespace( NMSP_xml ); + maFastParser.registerNamespace( NMSP_packageRel ); + maFastParser.registerNamespace( NMSP_officeRel ); + + maFastParser.registerNamespace( NMSP_dml ); + maFastParser.registerNamespace( NMSP_dmlDiagram ); + maFastParser.registerNamespace( NMSP_dmlChart ); + maFastParser.registerNamespace( NMSP_dmlChartDr ); + maFastParser.registerNamespace( NMSP_dmlSpreadDr ); + + maFastParser.registerNamespace( NMSP_vml ); + maFastParser.registerNamespace( NMSP_vmlOffice ); + maFastParser.registerNamespace( NMSP_vmlWord ); + maFastParser.registerNamespace( NMSP_vmlExcel ); + maFastParser.registerNamespace( NMSP_vmlPowerpoint ); + + maFastParser.registerNamespace( NMSP_xls ); + maFastParser.registerNamespace( NMSP_ppt ); + + maFastParser.registerNamespace( NMSP_ax ); + maFastParser.registerNamespace( NMSP_xm ); } // ============================================================================ XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : FilterBase( rxContext ), - mxImpl( new XmlFilterBaseImpl ), + mxImpl( new XmlFilterBaseImpl( rxContext ) ), mnRelId( 1 ), mnMaxDocId( 0 ) { - try - { - // create the fast parser - mxImpl->mxFastParser.set( getServiceFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW ); - mxImpl->mxFastParser->setTokenHandler( new FastTokenHandler ); - - // register XML namespaces - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://www.w3.org/XML/1998/namespace" ), NMSP_XML ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships" ), NMSP_PACKAGE_RELATIONSHIPS ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships" ), NMSP_RELATIONSHIPS ); - - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/main" ), NMSP_DRAWINGML ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/diagram" ), NMSP_DIAGRAM ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chart" ), NMSP_CHART ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing" ), NMSP_CDR ); - - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:vml" ), NMSP_VML ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:office" ), NMSP_OFFICE ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:word" ), NMSP_VML_DOC ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:excel" ), NMSP_VML_XLS ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:powerpoint" ), NMSP_VML_PPT ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.microsoft.com/office/2006/activeX" ), NMSP_AX ); - - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/spreadsheetml/2006/main"), NMSP_XLS ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" ), NMSP_XDR ); - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.microsoft.com/office/excel/2006/main" ), NMSP_XM ); - - mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/presentationml/2006/main"), NMSP_PPT ); - } - catch( Exception& ) - { - throw RuntimeException(); - } } XmlFilterBase::~XmlFilterBase() @@ -202,25 +190,20 @@ bool XmlFilterBase::importFragment( const ::rtl::Reference< FragmentHandler >& r if( !xDocHandler.is() ) return false; - // check that the fast parser exists - if( !mxImpl->mxFastParser.is() ) - return false; - // try to import XML stream try { - // try to open the fragment stream (this may fail - do not assert) - Reference< XInputStream > xInStrm( rxHandler->openFragmentStream(), UNO_SET_THROW ); + /* Try to open the fragment stream (may fail, do not throw/assert). + Using the virtual function openFragmentStream() allows a document + handler to create specialized input streams, e.g. VML streams that + have to preprocess the raw input data. */ + Reference< XInputStream > xInStrm = rxHandler->openFragmentStream(); - // create the input source and parse the stream - InputSource aSource; - aSource.aInputStream = xInStrm; - aSource.sSystemId = aFragmentPath; // own try/catch block for showing parser failure assertion with fragment path - try + if( xInStrm.is() ) try { - mxImpl->mxFastParser->setFastDocumentHandler( xDocHandler ); - mxImpl->mxFastParser->parseStream( aSource ); + mxImpl->maFastParser.setDocumentHandler( xDocHandler ); + mxImpl->maFastParser.parseStream( xInStrm, aFragmentPath ); return true; } catch( Exception& ) diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx index 1830a8c5d5f9..560fcf141c19 100644 --- a/oox/source/docprop/docprophandler.cxx +++ b/oox/source/docprop/docprophandler.cxx @@ -33,9 +33,7 @@ #include -#include "tokens.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" using namespace ::com::sun::star; @@ -226,19 +224,19 @@ void OOXMLDocPropHandler::UpdateDocStatistic( const ::rtl::OUString& aChars ) switch( m_nBlock ) { - case XML_Characters|NMSP_EXTPR: + case EXTPR_TOKEN( Characters ): aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharacterCount" ) ); break; - case XML_Pages|NMSP_EXTPR: + case EXTPR_TOKEN( Pages ): aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageCount" ) ); break; - case XML_Words|NMSP_EXTPR: + case EXTPR_TOKEN( Words ): aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WordCount" ) ); break; - case XML_Paragraphs|NMSP_EXTPR: + case EXTPR_TOKEN( Paragraphs ): aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParagraphCount" ) ); break; @@ -299,9 +297,9 @@ void SAL_CALL OOXMLDocPropHandler::startFastElement( ::sal_Int32 nElement, const { if ( !m_nInBlock && !m_nState ) { - if ( nElement == ( XML_coreProperties|NMSP_COREPR ) - || nElement == ( XML_Properties|NMSP_EXTPR ) - || nElement == ( XML_Properties|NMSP_CUSTPR ) ) + if ( nElement == COREPR_TOKEN( coreProperties ) + || nElement == EXTPR_TOKEN( Properties ) + || nElement == CUSTPR_TOKEN( Properties ) ) { m_nState = nElement; } @@ -320,7 +318,7 @@ void SAL_CALL OOXMLDocPropHandler::startFastElement( ::sal_Int32 nElement, const if ( xAttribs.is() && xAttribs->hasAttribute( XML_name ) ) m_aCustomPropertyName = xAttribs->getValue( XML_name ); } - else if ( m_nState && m_nInBlock && m_nInBlock == 2 && ( nElement >> 16 ) == ( NMSP_VT >> 16 ) ) + else if ( m_nState && m_nInBlock && m_nInBlock == 2 && getNamespace( nElement ) == NMSP_officeDocPropsVT ) { m_nType = nElement; } @@ -402,72 +400,72 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars ) { if ( (m_nInBlock == 2) || ((m_nInBlock == 3) && m_nType) ) { - if ( m_nState == ( XML_coreProperties|NMSP_COREPR ) ) + if ( m_nState == COREPR_TOKEN( coreProperties ) ) { switch( m_nBlock ) { - case XML_category|NMSP_COREPR: + case COREPR_TOKEN( category ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "category" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_contentStatus|NMSP_COREPR: + case COREPR_TOKEN( contentStatus ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "contentStatus" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_contentType|NMSP_COREPR: + case COREPR_TOKEN( contentType ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "contentType" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_identifier|NMSP_COREPR: + case COREPR_TOKEN( identifier ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "identifier" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_version|NMSP_COREPR: + case COREPR_TOKEN( version ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "version" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_created|NMSP_DCTERMS: + case DCT_TOKEN( created ): if ( aChars.getLength() >= 4 ) m_xDocProp->setCreationDate( GetDateTimeFromW3CDTF( aChars ) ); break; - case XML_creator|NMSP_DC: + case DC_TOKEN( creator ): m_xDocProp->setAuthor( aChars ); break; - case XML_description|NMSP_DC: + case DC_TOKEN( description ): m_xDocProp->setDescription( aChars ); break; - case XML_keywords|NMSP_COREPR: + case COREPR_TOKEN( keywords ): m_xDocProp->setKeywords( GetKeywordsSet( aChars ) ); break; - case XML_language|NMSP_DC: + case DC_TOKEN( language ): if ( aChars.getLength() >= 2 ) m_xDocProp->setLanguage( GetLanguage( aChars ) ); break; - case XML_lastModifiedBy|NMSP_COREPR: + case COREPR_TOKEN( lastModifiedBy ): m_xDocProp->setModifiedBy( aChars ); break; - case XML_lastPrinted|NMSP_COREPR: + case COREPR_TOKEN( lastPrinted ): if ( aChars.getLength() >= 4 ) m_xDocProp->setPrintDate( GetDateTimeFromW3CDTF( aChars ) ); break; - case XML_modified|NMSP_DCTERMS: + case DCT_TOKEN( modified ): if ( aChars.getLength() >= 4 ) m_xDocProp->setModificationDate( GetDateTimeFromW3CDTF( aChars ) ); break; - case XML_revision|NMSP_COREPR: + case COREPR_TOKEN( revision ): try { m_xDocProp->setEditingCycles( @@ -479,11 +477,11 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars ) } break; - case XML_subject|NMSP_DC: + case DC_TOKEN( subject ): m_xDocProp->setSubject( aChars ); break; - case XML_title|NMSP_DC: + case DC_TOKEN( title ): m_xDocProp->setTitle( aChars ); break; @@ -491,19 +489,19 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars ) OSL_ASSERT( "Unexpected core property!" ); } } - else if ( m_nState == ( XML_Properties|NMSP_EXTPR ) ) + else if ( m_nState == EXTPR_TOKEN( Properties ) ) { switch( m_nBlock ) { - case XML_Application|NMSP_EXTPR: + case EXTPR_TOKEN( Application ): m_xDocProp->setGenerator( aChars ); break; - case XML_Template|NMSP_EXTPR: + case EXTPR_TOKEN( Template ): m_xDocProp->setTemplateName( aChars ); break; - case XML_TotalTime|NMSP_EXTPR: + case EXTPR_TOKEN( TotalTime ): try { m_xDocProp->setEditingDuration( aChars.toInt32() ); @@ -514,89 +512,89 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars ) } break; - case XML_Characters|NMSP_EXTPR: - case XML_Pages|NMSP_EXTPR: - case XML_Words|NMSP_EXTPR: - case XML_Paragraphs|NMSP_EXTPR: + case EXTPR_TOKEN( Characters ): + case EXTPR_TOKEN( Pages ): + case EXTPR_TOKEN( Words ): + case EXTPR_TOKEN( Paragraphs ): UpdateDocStatistic( aChars ); break; - case XML_HyperlinksChanged|NMSP_EXTPR: + case EXTPR_TOKEN( HyperlinksChanged ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HyperlinksChanged" ) ); AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type break; - case XML_LinksUpToDate|NMSP_EXTPR: + case EXTPR_TOKEN( LinksUpToDate ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LinksUpToDate" ) ); AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type break; - case XML_ScaleCrop|NMSP_EXTPR: + case EXTPR_TOKEN( ScaleCrop ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ScaleCrop" ) ); AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type break; - case XML_SharedDoc|NMSP_EXTPR: + case EXTPR_TOKEN( SharedDoc ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ShareDoc" ) ); AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type break; - case XML_DocSecurity|NMSP_EXTPR: + case EXTPR_TOKEN( DocSecurity ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DocSecurity" ) ); AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type break; - case XML_HiddenSlides|NMSP_EXTPR: + case EXTPR_TOKEN( HiddenSlides ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HiddenSlides" ) ); AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type break; - case XML_MMClips|NMSP_EXTPR: + case EXTPR_TOKEN( MMClips ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MMClips" ) ); AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type break; - case XML_Notes|NMSP_EXTPR: + case EXTPR_TOKEN( Notes ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Notes" ) ); AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type break; - case XML_Slides|NMSP_EXTPR: + case EXTPR_TOKEN( Slides ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Slides" ) ); AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type break; - case XML_AppVersion|NMSP_EXTPR: + case EXTPR_TOKEN( AppVersion ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AppVersion" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_Company|NMSP_EXTPR: + case EXTPR_TOKEN( Company ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Company" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_HyperlinkBase|NMSP_EXTPR: + case EXTPR_TOKEN( HyperlinkBase ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HyperlinkBase" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_Manager|NMSP_EXTPR: + case EXTPR_TOKEN( Manager ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Manager" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_PresentationFormat|NMSP_EXTPR: + case EXTPR_TOKEN( PresentationFormat ): m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PresentationFormat" ) ); AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type break; - case XML_CharactersWithSpaces|NMSP_EXTPR: - case XML_Lines|NMSP_EXTPR: - case XML_DigSig|NMSP_EXTPR: - case XML_HeadingPairs|NMSP_EXTPR: - case XML_HLinks|NMSP_EXTPR: - case XML_TitlesOfParts|NMSP_EXTPR: + case EXTPR_TOKEN( CharactersWithSpaces ): + case EXTPR_TOKEN( Lines ): + case EXTPR_TOKEN( DigSig ): + case EXTPR_TOKEN( HeadingPairs ): + case EXTPR_TOKEN( HLinks ): + case EXTPR_TOKEN( TitlesOfParts ): // ignored during the import currently break; @@ -604,46 +602,46 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars ) OSL_ASSERT( "Unexpected extended property!" ); } } - else if ( m_nState == ( XML_Properties|NMSP_CUSTPR ) ) + else if ( m_nState == CUSTPR_TOKEN( Properties ) ) { - if ( m_nBlock == ( XML_property|NMSP_CUSTPR ) ) + if ( m_nBlock == CUSTPR_TOKEN( property ) ) { // this is a custom property switch( m_nType ) { - case XML_bool|NMSP_VT: + case VT_TOKEN( bool ): AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); break; - case XML_bstr|NMSP_VT: - case XML_lpstr|NMSP_VT: - case XML_lpwstr|NMSP_VT: + case VT_TOKEN( bstr ): + case VT_TOKEN( lpstr ): + case VT_TOKEN( lpwstr ): AddCustomProperty( uno::makeAny( AttributeConversion::decodeXString( aChars ) ) ); // the property has string type break; - case XML_date|NMSP_VT: - case XML_filetime|NMSP_VT: + case VT_TOKEN( date ): + case VT_TOKEN( filetime ): AddCustomProperty( uno::makeAny( GetDateTimeFromW3CDTF( aChars ) ) ); - case XML_i1|NMSP_VT: - case XML_i2|NMSP_VT: + case VT_TOKEN( i1 ): + case VT_TOKEN( i2 ): AddCustomProperty( uno::makeAny( (sal_Int16)aChars.toInt32() ) ); break; - case XML_i4|NMSP_VT: - case XML_int|NMSP_VT: + case VT_TOKEN( i4 ): + case VT_TOKEN( int ): AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); break; - case XML_i8|NMSP_VT: + case VT_TOKEN( i8 ): AddCustomProperty( uno::makeAny( aChars.toInt64() ) ); break; - case XML_r4|NMSP_VT: + case VT_TOKEN( r4 ): AddCustomProperty( uno::makeAny( aChars.toFloat() ) ); break; - case XML_r8|NMSP_VT: + case VT_TOKEN( r8 ): AddCustomProperty( uno::makeAny( aChars.toDouble() ) ); break; diff --git a/oox/source/docprop/docprophandler.hxx b/oox/source/docprop/docprophandler.hxx index bb2cff323159..13e6e47b025e 100644 --- a/oox/source/docprop/docprophandler.hxx +++ b/oox/source/docprop/docprophandler.hxx @@ -34,9 +34,19 @@ #include +#include "oox/token/namespaces.hxx" +#include "oox/token/tokens.hxx" + namespace oox { namespace docprop { +#define COREPR_TOKEN( token ) (::oox::NMSP_packageMetaCorePr | XML_##token) +#define CUSTPR_TOKEN( token ) (::oox::NMSP_officeCustomPr | XML_##token) +#define EXTPR_TOKEN( token ) (::oox::NMSP_officeExtPr | XML_##token) +#define VT_TOKEN( token ) (::oox::NMSP_officeDocPropsVT | XML_##token) +#define DC_TOKEN( token ) (::oox::NMSP_dc | XML_##token) +#define DCT_TOKEN( token ) (::oox::NMSP_dcTerms | XML_##token) + class OOXMLDocPropHandler : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastDocumentHandler > { ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx index de34f592e98a..794950e0fbf3 100644 --- a/oox/source/docprop/ooxmldocpropimport.cxx +++ b/oox/source/docprop/ooxmldocpropimport.cxx @@ -25,203 +25,166 @@ * ************************************************************************/ -#include +#include "ooxmldocpropimport.hxx" + +#include +#include #include #include -#include -#include -#include -#include - -#include -#include - -#include +#include +#include "oox/core/fastparser.hxx" +#include "oox/core/relations.hxx" +#include "oox/helper/containerhelper.hxx" +#include "oox/helper/helper.hxx" #include "docprophandler.hxx" -#include "ooxmldocpropimport.hxx" - -using namespace ::com::sun::star; namespace oox { namespace docprop { -// ----------------------------------------------------------- -::rtl::OUString SAL_CALL OOXMLDocPropImportImpl_getImplementationName() +// ============================================================================ + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::document; +using namespace ::com::sun::star::embed; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +using ::rtl::OUString; + +// ============================================================================ + +OUString SAL_CALL DocumentPropertiesImport_getImplementationName() { - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.oox.docprop.OOXMLDocumentPropertiesImporter")); + return CREATE_OUSTRING( "com.sun.star.comp.oox.docprop.DocumentPropertiesImport" ); } -// ----------------------------------------------------------- -uno::Sequence< ::rtl::OUString > SAL_CALL OOXMLDocPropImportImpl_getSupportedServiceNames() +Sequence< OUString > SAL_CALL DocumentPropertiesImport_getSupportedServiceNames() { - uno::Sequence< ::rtl::OUString > s(1); - s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.document.OOXMLDocumentPropertiesImporter")); - return s; + Sequence< OUString > aServices( 1 ); + aServices[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.OOXMLDocumentPropertiesImporter" ); + return aServices; } -// ----------------------------------------------------------- -uno::Reference< uno::XInterface > SAL_CALL OOXMLDocPropImportImpl_createInstance( - const uno::Reference< uno::XComponentContext > & context) - SAL_THROW((uno::Exception)) +Reference< XInterface > SAL_CALL DocumentPropertiesImport_createInstance( const Reference< XComponentContext >& rxContext ) SAL_THROW((Exception)) { - return static_cast< ::cppu::OWeakObject * >(new OOXMLDocPropImportImpl(context)); + return static_cast< ::cppu::OWeakObject* >( new DocumentPropertiesImport( rxContext ) ); } +// ============================================================================ -// ----------------------------------------------------------- -OOXMLDocPropImportImpl::OOXMLDocPropImportImpl(uno::Reference< uno::XComponentContext > const & xContext) : - m_xContext( xContext ) -{} +namespace { -// ----------------------------------------------------------- -uno::Sequence< xml::sax::InputSource > OOXMLDocPropImportImpl::GetRelatedStreams( const uno::Reference< embed::XStorage > xStorage, const ::rtl::OUString& aStreamType ) +Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxStorage, const OUString& rStreamType ) throw (RuntimeException) { - if ( !xStorage.is() ) - throw uno::RuntimeException(); + Reference< XRelationshipAccess > xRelation( rxStorage, UNO_QUERY_THROW ); + Reference< XHierarchicalStorageAccess > xHierarchy( rxStorage, UNO_QUERY_THROW ); - uno::Reference< embed::XRelationshipAccess > xRelation( xStorage, uno::UNO_QUERY_THROW ); - uno::Reference< embed::XHierarchicalStorageAccess > xHierarchy( xStorage, uno::UNO_QUERY_THROW ); - - uno::Sequence< uno::Sequence< beans::StringPair > > aPropsInfo = xRelation->getRelationshipsByType( aStreamType ); + Sequence< Sequence< StringPair > > aPropsInfo = xRelation->getRelationshipsByType( rStreamType ); sal_Int32 nLength = 0; - uno::Sequence< xml::sax::InputSource > aResult( aPropsInfo.getLength() ); - if ( aPropsInfo.getLength() ) + ::std::vector< InputSource > aResult; + + for( sal_Int32 nIndex = 0, nLength = aPropsInfo.getLength(); nIndex < nLength; ++nIndex ) { - for ( sal_Int32 nInd = 0; nInd < aPropsInfo.getLength(); nInd++ ) - for ( sal_Int32 nEntryInd = 0; nEntryInd < aPropsInfo[nInd].getLength(); nEntryInd++ ) - if ( aPropsInfo[nInd][nEntryInd].First.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Target" ) ) ) ) + const Sequence< StringPair >& rEntries = aPropsInfo[ nIndex ]; + for( sal_Int32 nEntryIndex = 0, nEntryLength = rEntries.getLength(); nEntryIndex < nEntryLength; ++nEntryIndex ) + { + const StringPair& rEntry = rEntries[ nEntryIndex ]; + if( rEntry.First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Target" ) ) ) + { + Reference< XExtendedStorageStream > xExtStream( + xHierarchy->openStreamElementByHierarchicalName( rEntry.Second, ElementModes::READ ), UNO_QUERY_THROW ); + Reference< XInputStream > xInStream = xExtStream->getInputStream(); + if( xInStream.is() ) { - uno::Reference< embed::XExtendedStorageStream > xExtStream = xHierarchy->openStreamElementByHierarchicalName( aPropsInfo[nInd][nEntryInd].Second, embed::ElementModes::READ ); - if ( !xExtStream.is() ) - throw uno::RuntimeException(); - - aResult[nLength].sSystemId = aPropsInfo[nInd][nEntryInd].Second; - aResult[nLength++].aInputStream = xExtStream->getInputStream(); - break; + aResult.resize( aResult.size() + 1 ); + aResult.back().sSystemId = rEntry.Second; + aResult.back().aInputStream = xExtStream->getInputStream(); } - - aResult.realloc( nLength ); + break; + } + } } - return aResult; + return ContainerHelper::vectorToSequence( aResult ); } -// com.sun.star.uno.XServiceInfo: -// ----------------------------------------------------------- -::rtl::OUString SAL_CALL OOXMLDocPropImportImpl::getImplementationName() throw (uno::RuntimeException) +} // namespace + +// ============================================================================ + +DocumentPropertiesImport::DocumentPropertiesImport( const Reference< XComponentContext >& rxContext ) : + mxContext( rxContext ) { - return OOXMLDocPropImportImpl_getImplementationName(); } -// ----------------------------------------------------------- -::sal_Bool SAL_CALL OOXMLDocPropImportImpl::supportsService(::rtl::OUString const & serviceName) throw (uno::RuntimeException) -{ - uno::Sequence< ::rtl::OUString > serviceNames = OOXMLDocPropImportImpl_getSupportedServiceNames(); - for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) - { - if (serviceNames[i] == serviceName) - return sal_True; - } +// XServiceInfo - return sal_False; +OUString SAL_CALL DocumentPropertiesImport::getImplementationName() throw (RuntimeException) +{ + return DocumentPropertiesImport_getImplementationName(); } -// ----------------------------------------------------------- -uno::Sequence< ::rtl::OUString > SAL_CALL OOXMLDocPropImportImpl::getSupportedServiceNames() throw (uno::RuntimeException) +sal_Bool SAL_CALL DocumentPropertiesImport::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - return OOXMLDocPropImportImpl_getSupportedServiceNames(); + Sequence< OUString > aServiceNames = DocumentPropertiesImport_getSupportedServiceNames(); + for( sal_Int32 nIndex = 0, nLength = aServiceNames.getLength(); nIndex < nLength; ++nIndex ) + if( aServiceNames[ nIndex ] == rServiceName ) + return sal_True; + return sal_False; } -// ----------------------------------------------------------- -// ::com::sun::star::document::XOOXMLDocumentPropertiesImporter: -void SAL_CALL OOXMLDocPropImportImpl::importProperties(const uno::Reference< embed::XStorage > & xSource, const uno::Reference< document::XDocumentProperties > & xDocumentProperties) throw (uno::RuntimeException, lang::IllegalArgumentException, xml::sax::SAXException, uno::Exception) +Sequence< OUString > SAL_CALL DocumentPropertiesImport::getSupportedServiceNames() throw (RuntimeException) { - // TODO: Insert your implementation for "importProperties" here. - if ( !m_xContext.is() ) - throw uno::RuntimeException(); + return DocumentPropertiesImport_getSupportedServiceNames(); +} - if ( !xSource.is() || !xDocumentProperties.is() ) - throw lang::IllegalArgumentException(); +// XOOXMLDocumentPropertiesImporter - // the MS Office seems to have a bug, so we have to do similar handling - ::rtl::OUString aCoreType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officedocument/2006/relationships/metadata/core-properties" ) ); - ::rtl::OUString aCoreWorkaroundType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" ) ); +void SAL_CALL DocumentPropertiesImport::importProperties( + const Reference< XStorage >& rxSource, const Reference< XDocumentProperties >& rxDocumentProperties ) + throw (RuntimeException, IllegalArgumentException, SAXException, Exception) +{ + if( !mxContext.is() ) + throw RuntimeException(); - ::rtl::OUString aExtType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officedocument/2006/relationships/extended-properties" ) ); - ::rtl::OUString aCustomType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officedocument/2006/relationships/custom-properties" ) ); + if( !rxSource.is() || !rxDocumentProperties.is() ) + throw IllegalArgumentException(); - uno::Sequence< xml::sax::InputSource > aCoreStreams = GetRelatedStreams( xSource, aCoreType ); - if ( !aCoreStreams.getLength() ) - aCoreStreams = GetRelatedStreams( xSource, aCoreWorkaroundType ); + Sequence< InputSource > aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "metadata/core-properties" ) ); + // MS Office seems to have a bug, so we have to do similar handling + if( !aCoreStreams.hasElements() ) + aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_PACKAGE_RELATION_TYPE( "metadata/core-properties" ) ); - uno::Sequence< xml::sax::InputSource > aExtStreams = GetRelatedStreams( xSource, aExtType ); - uno::Sequence< xml::sax::InputSource > aCustomStreams = GetRelatedStreams( xSource, aCustomType ); + Sequence< InputSource > aExtStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "extended-properties" ) ); + Sequence< InputSource > aCustomStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "custom-properties" ) ); - if ( aCoreStreams.getLength() || aExtStreams.getLength() || aCustomStreams.getLength() ) + if( aCoreStreams.hasElements() || aExtStreams.hasElements() || aCustomStreams.hasElements() ) { - if ( aCoreStreams.getLength() > 1 ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected core properties stream!" ) ), uno::Reference< uno::XInterface >() ); - - uno::Reference< lang::XMultiComponentFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY_THROW ); - - uno::Reference< xml::sax::XFastParser > xParser( - xFactory->createInstanceWithContext( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.FastParser" ) ), - m_xContext ), - uno::UNO_QUERY_THROW ); - - uno::Reference< xml::sax::XFastTokenHandler > xTokenHandler( - xFactory->createInstanceWithContext( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.oox.FastTokenHandlerService" ) ), - m_xContext ), - uno::UNO_QUERY_THROW ); - - uno::Reference< xml::sax::XFastDocumentHandler > xDocHandler( static_cast< xml::sax::XFastDocumentHandler* >( new OOXMLDocPropHandler( m_xContext, xDocumentProperties ) ) ); - - xParser->setFastDocumentHandler( xDocHandler ); - xParser->setTokenHandler( xTokenHandler ); - - xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/package/2006/metadata/core-properties" ) ), NMSP_COREPR ); - xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://purl.org/dc/elements/1.1/" ) ), NMSP_DC ); - xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://purl.org/dc/terms/" ) ), NMSP_DCTERMS ); - xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" ) ), NMSP_EXTPR ); - xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" ) ), NMSP_CUSTPR ); - xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes" ) ), NMSP_VT ); - - // #158414# XFastParser::parseStream() throws on invalid XML - if ( aCoreStreams.getLength() ) try - { - if ( aCoreStreams[0].aInputStream.is() ) - { - xParser->parseStream( aCoreStreams[0] ); - aCoreStreams[0].aInputStream->closeInput(); - } - } - catch( uno::Exception& ) - { - } - - sal_Int32 nInd = 0; - for ( nInd = 0; nInd < aExtStreams.getLength(); nInd++ ) - { - xParser->parseStream( aExtStreams[nInd] ); - if ( aExtStreams[nInd].aInputStream.is() ) - aExtStreams[nInd].aInputStream->closeInput(); - } - - for ( nInd = 0; nInd < aCustomStreams.getLength(); nInd++ ) - { - xParser->parseStream( aCustomStreams[nInd] ); - if ( aCustomStreams[nInd].aInputStream.is() ) - aCustomStreams[nInd].aInputStream->closeInput(); - } + if( aCoreStreams.getLength() > 1 ) + throw IOException( CREATE_OUSTRING( "Unexpected core properties stream!" ), Reference< XInterface >() ); + + ::oox::core::FastParser aParser( mxContext ); + aParser.registerNamespace( NMSP_packageMetaCorePr ); + aParser.registerNamespace( NMSP_dc ); + aParser.registerNamespace( NMSP_dcTerms ); + aParser.registerNamespace( NMSP_officeExtPr ); + aParser.registerNamespace( NMSP_officeCustomPr ); + aParser.registerNamespace( NMSP_officeDocPropsVT ); + aParser.setDocumentHandler( new OOXMLDocPropHandler( mxContext, rxDocumentProperties ) ); + + if( aCoreStreams.hasElements() ) + aParser.parseStream( aCoreStreams[ 0 ], true ); + for( sal_Int32 nIndex = 0; nIndex < aExtStreams.getLength(); ++nIndex ) + aParser.parseStream( aExtStreams[ nIndex ], true ); + for( sal_Int32 nIndex = 0; nIndex < aCustomStreams.getLength(); ++nIndex ) + aParser.parseStream( aCustomStreams[ nIndex ], true ); } } +// ============================================================================ + } // namespace docprop } // namespace oox - - diff --git a/oox/source/docprop/ooxmldocpropimport.hxx b/oox/source/docprop/ooxmldocpropimport.hxx index a10eafbe1eb4..79f4d1f7e60b 100644 --- a/oox/source/docprop/ooxmldocpropimport.hxx +++ b/oox/source/docprop/ooxmldocpropimport.hxx @@ -28,44 +28,44 @@ #ifndef OOX_DOCPROP_OOXMLDOCPROPIMPORT_HXX #define OOX_DOCPROP_OOXMLDOCPROPIMPORT_HXX -#include -#include +#include #include +#include #include -#include +#include namespace oox { namespace docprop { -class OOXMLDocPropImportImpl: +// ============================================================================ + +class DocumentPropertiesImport : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::document::XOOXMLDocumentPropertiesImporter> + ::com::sun::star::document::XOOXMLDocumentPropertiesImporter > { -private: - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; - - OOXMLDocPropImportImpl(const OOXMLDocPropImportImpl &); // not defined - OOXMLDocPropImportImpl& operator=(const OOXMLDocPropImportImpl &); // not defined - public: - explicit OOXMLDocPropImportImpl(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context); - virtual ~OOXMLDocPropImportImpl() {} - - ::com::sun::star::uno::Sequence< ::com::sun::star::xml::sax::InputSource > GetRelatedStreams( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > xStorage, const ::rtl::OUString& aStreamType ); + explicit DocumentPropertiesImport( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); - // ::com::sun::star::lang::XServiceInfo: + // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString & ServiceName) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); - // ::com::sun::star::document::XOOXMLDocumentPropertiesImporter: - virtual void SAL_CALL importProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > & xSource, const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > & xDocumentProperties) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::Exception); + // XOOXMLDocumentPropertiesImporter + virtual void SAL_CALL importProperties( + const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxSource, + const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties >& rxDocumentProperties ) + throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::Exception); +private: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext; }; +// ============================================================================ + } // namespace docprop } // namespace oox #endif - diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx index 4c214aed857b..028fc3d19eb1 100644 --- a/oox/source/drawingml/chart/axisconverter.cxx +++ b/oox/source/drawingml/chart/axisconverter.cxx @@ -40,7 +40,6 @@ #include "oox/drawingml/chart/titleconverter.hxx" #include "oox/drawingml/chart/typegroupconverter.hxx" #include "oox/drawingml/lineproperties.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx index 5342f3535e51..03c634453e8b 100644 --- a/oox/source/drawingml/chart/chartdrawingfragment.cxx +++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx @@ -42,10 +42,8 @@ namespace chart { using namespace ::com::sun::star::awt; using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::uno; +using namespace ::oox::core; -using ::oox::core::ContextHandlerRef; -using ::oox::core::FragmentHandler2; -using ::oox::core::XmlFilterBase; using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx index 8c05b0c8a53f..b16ac91e09c9 100644 --- a/oox/source/drawingml/chart/chartspaceconverter.cxx +++ b/oox/source/drawingml/chart/chartspaceconverter.cxx @@ -39,7 +39,6 @@ #include "oox/drawingml/chart/chartspacemodel.hxx" #include "oox/drawingml/chart/plotareaconverter.hxx" #include "oox/drawingml/chart/titleconverter.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index f7aca001df5e..d4b4a66f361f 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -39,8 +39,8 @@ namespace chart { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::XmlFilterBase; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx index f2949c99a2ab..df4d40e952ac 100644 --- a/oox/source/drawingml/chart/converterbase.cxx +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -40,7 +40,6 @@ #include // for F_PI180 #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/theme.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/datasourceconverter.cxx b/oox/source/drawingml/chart/datasourceconverter.cxx index abb9ad111a8a..c68a6cbe4adf 100644 --- a/oox/source/drawingml/chart/datasourceconverter.cxx +++ b/oox/source/drawingml/chart/datasourceconverter.cxx @@ -30,7 +30,6 @@ #include #include "oox/drawingml/chart/chartconverter.hxx" #include "oox/drawingml/chart/datasourcemodel.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index c66b9a14c924..f6d441ded650 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -39,8 +39,6 @@ #include "oox/drawingml/theme.hxx" #include "oox/drawingml/chart/chartspacemodel.hxx" #include "oox/helper/modelobjecthelper.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx index 19556d16dbf5..78379ae855bd 100644 --- a/oox/source/drawingml/chart/plotareaconverter.cxx +++ b/oox/source/drawingml/chart/plotareaconverter.cxx @@ -38,7 +38,6 @@ #include "oox/drawingml/chart/axisconverter.hxx" #include "oox/drawingml/chart/plotareamodel.hxx" #include "oox/drawingml/chart/typegroupconverter.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 0ff1aa2eaa12..f901506f555c 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -39,7 +39,6 @@ #include "oox/drawingml/chart/titleconverter.hxx" #include "oox/drawingml/chart/typegroupconverter.hxx" #include "oox/drawingml/chart/typegroupmodel.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx index c1cd02e17378..1baefdc641e4 100644 --- a/oox/source/drawingml/chart/titleconverter.cxx +++ b/oox/source/drawingml/chart/titleconverter.cxx @@ -38,7 +38,6 @@ #include "oox/drawingml/textparagraph.hxx" #include "oox/drawingml/chart/datasourceconverter.hxx" #include "oox/drawingml/chart/titlemodel.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx index 7c1f1a56fe25..6b0975f26260 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -40,7 +40,6 @@ #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/chart/seriesconverter.hxx" #include "oox/drawingml/chart/typegroupmodel.hxx" -#include "properties.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/clrscheme.cxx b/oox/source/drawingml/clrscheme.cxx index fdeb28a27ef0..b011cd27b147 100644 --- a/oox/source/drawingml/clrscheme.cxx +++ b/oox/source/drawingml/clrscheme.cxx @@ -26,7 +26,7 @@ ************************************************************************/ #include "oox/drawingml/clrscheme.hxx" -#include "tokens.hxx" +#include "oox/token/tokens.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/clrschemecontext.cxx b/oox/source/drawingml/clrschemecontext.cxx index 996ddef2ab0f..fad92dd35c3c 100644 --- a/oox/source/drawingml/clrschemecontext.cxx +++ b/oox/source/drawingml/clrschemecontext.cxx @@ -26,9 +26,7 @@ ************************************************************************/ #include "oox/drawingml/clrschemecontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -99,7 +97,7 @@ Reference< XFastContextHandler > clrSchemeContext::createFastChildContext( case A_TOKEN( accent6 ): case A_TOKEN( hlink ): case A_TOKEN( folHlink ): - return new clrSchemeColorContext( *this, mrClrScheme, getToken( nElement ) ); + return new clrSchemeColorContext( *this, mrClrScheme, getBaseToken( nElement ) ); } return 0; } diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx index 8653d787517d..4ff19a4bf987 100644 --- a/oox/source/drawingml/color.cxx +++ b/oox/source/drawingml/color.cxx @@ -28,11 +28,11 @@ #include "oox/drawingml/color.hxx" #include #include -#include "tokens.hxx" #include "oox/helper/containerhelper.hxx" #include "oox/helper/graphichelper.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/drawingmltypes.hxx" +#include "oox/token/namespaces.hxx" +#include "oox/token/tokens.hxx" using ::rtl::OUString; @@ -314,7 +314,7 @@ void Color::addTransformation( sal_Int32 nElement, sal_Int32 nValue ) /* Execute alpha transformations directly, store other transformations in a vector, they may depend on a scheme base color which will be resolved in Color::getColor(). */ - sal_Int32 nToken = getToken( nElement ); + sal_Int32 nToken = getBaseToken( nElement ); switch( nToken ) { case XML_alpha: lclSetValue( mnAlpha, nValue ); break; @@ -336,7 +336,7 @@ void Color::addChartTintTransformation( double fTint ) void Color::addExcelTintTransformation( double fTint ) { sal_Int32 nValue = getLimitedValue< sal_Int32, double >( fTint * MAX_PERCENT + 0.5, -MAX_PERCENT, MAX_PERCENT ); - maTransforms.push_back( Transformation( NMSP_XLS | XML_tint, nValue ) ); + maTransforms.push_back( Transformation( XLS_TOKEN( tint ), nValue ) ); } void Color::clearTransformations() diff --git a/oox/source/drawingml/colorchoicecontext.cxx b/oox/source/drawingml/colorchoicecontext.cxx index 2bc01e049a8e..a909f2f68d0c 100644 --- a/oox/source/drawingml/colorchoicecontext.cxx +++ b/oox/source/drawingml/colorchoicecontext.cxx @@ -27,7 +27,6 @@ #include "oox/drawingml/colorchoicecontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/color.hxx" using ::com::sun::star::uno::Reference; diff --git a/oox/source/drawingml/connectorshapecontext.cxx b/oox/source/drawingml/connectorshapecontext.cxx index 3327d627af6d..f2840a8d82fa 100644 --- a/oox/source/drawingml/connectorshapecontext.cxx +++ b/oox/source/drawingml/connectorshapecontext.cxx @@ -35,8 +35,6 @@ #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace oox::core; @@ -63,7 +61,7 @@ Reference< XFastContextHandler > ConnectorShapeContext::createFastChildContext( { Reference< XFastContextHandler > xRet; - switch( getToken( aElementToken ) ) + switch( getBaseToken( aElementToken ) ) { case XML_nvCxnSpPr : break; diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx index a0fcc3142f51..d0c5c6a2dde2 100644 --- a/oox/source/drawingml/customshapegeometry.cxx +++ b/oox/source/drawingml/customshapegeometry.cxx @@ -32,10 +32,7 @@ #include #include "oox/helper/helper.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/token/tokenmap.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -243,7 +240,7 @@ static EnhancedCustomShapeParameter GetAdjCoordinate( CustomShapeProperties& rCu sal_Char nVal = 0; // first check if its a constant value - switch( StaticTokenMap::get().getTokenFromUnicode( rValue ) ) + switch( AttributeConversion::decodeToken( rValue ) ) { case XML_3cd4 : nConstant = 270 * 60000; break; case XML_3cd8 : nConstant = 135 * 60000; break; @@ -631,7 +628,7 @@ static rtl::OUString convertToOOEquation( CustomShapeProperties& rCustomShapePro Reference< XFastContextHandler > GeomGuideListContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { - if ( aElementToken == ( NMSP_DRAWINGML | XML_gd ) ) // CT_GeomGuide + if ( aElementToken == A_TOKEN( gd ) ) // CT_GeomGuide { CustomShapeGuide aGuide; aGuide.maName = xAttribs->getOptionalValue( XML_name ); @@ -712,7 +709,7 @@ XYAdjustHandleContext::XYAdjustHandleContext( ContextHandler& rParent, const Ref Reference< XFastContextHandler > XYAdjustHandleContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pos ) ) + if ( aElementToken == A_TOKEN( pos ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjustHandle.pos ); // CT_AdjPoint2D return xContext; } @@ -766,7 +763,7 @@ PolarAdjustHandleContext::PolarAdjustHandleContext( ContextHandler& rParent, con Reference< XFastContextHandler > PolarAdjustHandleContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pos ) ) + if ( aElementToken == A_TOKEN( pos ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjustHandle.pos ); // CT_AdjPoint2D return xContext; } @@ -794,13 +791,13 @@ AdjustHandleListContext::AdjustHandleListContext( ContextHandler& rParent, Custo Reference< XFastContextHandler > AdjustHandleListContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_ahXY ) ) // CT_XYAdjustHandle + if ( aElementToken == A_TOKEN( ahXY ) ) // CT_XYAdjustHandle { AdjustHandle aAdjustHandle( sal_False ); mrAdjustHandleList.push_back( aAdjustHandle ); xContext = new XYAdjustHandleContext( *this, xAttribs, mrCustomShapeProperties, mrAdjustHandleList.back() ); } - else if ( aElementToken == ( NMSP_DRAWINGML | XML_ahPolar ) ) // CT_PolarAdjustHandle + else if ( aElementToken == A_TOKEN( ahPolar ) ) // CT_PolarAdjustHandle { AdjustHandle aAdjustHandle( sal_True ); mrAdjustHandleList.push_back( aAdjustHandle ); @@ -833,7 +830,7 @@ ConnectionSiteContext::ConnectionSiteContext( ContextHandler& rParent, const Ref Reference< XFastContextHandler > ConnectionSiteContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pos ) ) + if ( aElementToken == A_TOKEN( pos ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrConnectionSite.pos ); // CT_AdjPoint2D return xContext; } @@ -861,7 +858,7 @@ Path2DMoveToContext::Path2DMoveToContext( ContextHandler& rParent, CustomShapePr Reference< XFastContextHandler > Path2DMoveToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) ) + if ( aElementToken == A_TOKEN( pt ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjPoint2D ); // CT_AdjPoint2D return xContext; } @@ -889,7 +886,7 @@ Path2DLineToContext::Path2DLineToContext( ContextHandler& rParent, CustomShapePr Reference< XFastContextHandler > Path2DLineToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) ) + if ( aElementToken == A_TOKEN( pt ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjPoint2D ); // CT_AdjPoint2D return xContext; } @@ -924,7 +921,7 @@ Path2DQuadBezierToContext::Path2DQuadBezierToContext( ContextHandler& rParent, Reference< XFastContextHandler > Path2DQuadBezierToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) ) + if ( aElementToken == A_TOKEN( pt ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, nCount++ ? mrPt2 : mrPt1 ); // CT_AdjPoint2D return xContext; } @@ -962,7 +959,7 @@ Path2DCubicBezierToContext::Path2DCubicBezierToContext( ContextHandler& rParent, Reference< XFastContextHandler > Path2DCubicBezierToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) ) + if ( aElementToken == A_TOKEN( pt ) ) xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, nCount++ ? nCount == 2 ? mrControlPt2 : mrEndPt : mrControlPt1 ); // CT_AdjPoint2D return xContext; @@ -1021,7 +1018,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3 Reference< XFastContextHandler > xContext; switch( aElementToken ) { - case NMSP_DRAWINGML | XML_close : + case A_TOKEN( close ) : { EnhancedCustomShapeSegment aNewSegment; aNewSegment.Command = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH; @@ -1029,7 +1026,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3 mrSegments.push_back( aNewSegment ); } break; - case NMSP_DRAWINGML | XML_moveTo : + case A_TOKEN( moveTo ) : { EnhancedCustomShapeSegment aNewSegment; aNewSegment.Command = EnhancedCustomShapeSegmentCommand::MOVETO; @@ -1041,7 +1038,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3 xContext = new Path2DMoveToContext( *this, mrCustomShapeProperties, mrPath2D.parameter.back() ); } break; - case NMSP_DRAWINGML | XML_lnTo : + case A_TOKEN( lnTo ) : { if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::LINETO ) ) @@ -1058,7 +1055,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3 xContext = new Path2DLineToContext( *this, mrCustomShapeProperties, mrPath2D.parameter.back() ); } break; - case NMSP_DRAWINGML | XML_arcTo : // CT_Path2DArcTo + case A_TOKEN( arcTo ) : // CT_Path2DArcTo { if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::ARCTO ) ) mrSegments.back().Count++; @@ -1084,7 +1081,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3 mrPath2D.parameter.push_back( aPt ); } break; - case NMSP_DRAWINGML | XML_quadBezTo : + case A_TOKEN( quadBezTo ) : { if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::QUADRATICCURVETO ) ) mrSegments.back().Count++; @@ -1104,7 +1101,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3 mrPath2D.parameter.back() ); } break; - case NMSP_DRAWINGML | XML_cubicBezTo : + case A_TOKEN( cubicBezTo ) : { if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::CURVETO ) ) mrSegments.back().Count++; @@ -1160,7 +1157,7 @@ Path2DListContext::Path2DListContext( ContextHandler& rParent, CustomShapeProper ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL Path2DListContext::createFastChildContext( sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException) { Reference< XFastContextHandler > xContext; - if ( aElementToken == ( NMSP_DRAWINGML | XML_path ) ) + if ( aElementToken == A_TOKEN( path ) ) { Path2D aPath2D; mrPath2DList.push_back( aPath2D ); @@ -1983,19 +1980,19 @@ Reference< XFastContextHandler > CustomShapeGeometryContext::createFastChildCont Reference< XFastContextHandler > xContext; switch( aElementToken ) { - case NMSP_DRAWINGML|XML_avLst: // CT_GeomGuideList adjust value list + case A_TOKEN( avLst ): // CT_GeomGuideList adjust value list xContext = new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() ); break; - case NMSP_DRAWINGML|XML_gdLst: // CT_GeomGuideList guide list + case A_TOKEN( gdLst ): // CT_GeomGuideList guide list xContext = new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getGuideList() ); break; - case NMSP_DRAWINGML|XML_ahLst: // CT_AdjustHandleList adjust handle list + case A_TOKEN( ahLst ): // CT_AdjustHandleList adjust handle list xContext = new AdjustHandleListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustHandleList() ); break; - case NMSP_DRAWINGML|XML_cxnLst: // CT_ConnectionSiteList connection site list + case A_TOKEN( cxnLst ): // CT_ConnectionSiteList connection site list xContext = this; break; - case NMSP_DRAWINGML|XML_rect: // CT_GeomRectList geometry rect list + case A_TOKEN( rect ): // CT_GeomRectList geometry rect list { GeomRect aGeomRect; aGeomRect.l = GetAdjCoordinate( mrCustomShapeProperties, xAttribs->getOptionalValue( XML_l ), sal_True ); @@ -2005,12 +2002,12 @@ Reference< XFastContextHandler > CustomShapeGeometryContext::createFastChildCont mrCustomShapeProperties.getTextRect() = aGeomRect; } break; - case NMSP_DRAWINGML|XML_pathLst: // CT_Path2DList 2d path list + case A_TOKEN( pathLst ): // CT_Path2DList 2d path list xContext = new Path2DListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getSegments(), mrCustomShapeProperties.getPath2DList() ); break; // from cxnLst: - case NMSP_DRAWINGML|XML_cxn: // CT_ConnectionSite + case A_TOKEN( cxn ): // CT_ConnectionSite { ConnectionSite aConnectionSite; mrCustomShapeProperties.getConnectionSiteList().push_back( aConnectionSite ); @@ -2037,7 +2034,7 @@ PresetShapeGeometryContext::PresetShapeGeometryContext( ContextHandler& rParent, Reference< XFastContextHandler > PresetShapeGeometryContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& ) throw (SAXException, RuntimeException) { - if ( aElementToken == ( NMSP_DRAWINGML | XML_avLst ) ) + if ( aElementToken == A_TOKEN( avLst ) ) return new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() ); else return this; @@ -2059,7 +2056,7 @@ PresetTextShapeContext::PresetTextShapeContext( ContextHandler& rParent, const R Reference< XFastContextHandler > PresetTextShapeContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& ) throw (SAXException, RuntimeException) { - if ( aElementToken == ( NMSP_DRAWINGML | XML_avLst ) ) + if ( aElementToken == A_TOKEN( avLst ) ) return new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() ); else return this; diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index d296a4041fb9..052fdc5e1dfc 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -29,9 +29,6 @@ #include "oox/helper/helper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/core/namespaces.hxx" -#include "properties.hxx" -#include "tokens.hxx" #include #include #include diff --git a/oox/source/drawingml/diagram/datamodelcontext.cxx b/oox/source/drawingml/diagram/datamodelcontext.cxx index 901b9267df36..8d81c800b2df 100644 --- a/oox/source/drawingml/diagram/datamodelcontext.cxx +++ b/oox/source/drawingml/diagram/datamodelcontext.cxx @@ -27,7 +27,6 @@ #include "oox/drawingml/diagram/datamodelcontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/shapepropertiescontext.hxx" #include "oox/drawingml/textbodycontext.hxx" @@ -39,8 +38,6 @@ using ::rtl::OUString; namespace oox { namespace drawingml { - - // CL_Cxn class CxnContext : public ContextHandler @@ -73,7 +70,7 @@ public: switch( aElementToken ) { - case NMSP_DIAGRAM|XML_extLst: + case DGM_TOKEN( extLst ): return xRet; default: break; @@ -106,7 +103,7 @@ public: switch( aElementToken ) { - case NMSP_DIAGRAM|XML_cxn: + case DGM_TOKEN( cxn ): { dgm::ConnectionPtr pConnection( new dgm::Connection() ); maConnections.push_back( pConnection ); @@ -161,17 +158,17 @@ public: switch( aElementToken ) { - case NMSP_DIAGRAM|XML_extLst: + case DGM_TOKEN( extLst ): return xRet; - case NMSP_DIAGRAM|XML_prSet: + case DGM_TOKEN( prSet ): // TODO // CT_ElemPropSet break; - case NMSP_DIAGRAM|XML_spPr: + case DGM_TOKEN( spPr ): OSL_TRACE( "shape props for point"); xRet = new ShapePropertiesContext( *this, *mpPoint->getShape() ); break; - case NMSP_DIAGRAM|XML_t: + case DGM_TOKEN( t ): { OSL_TRACE( "shape text body for point"); TextBodyPtr xTextBody( new TextBody ); @@ -212,7 +209,7 @@ public: switch( aElementToken ) { - case NMSP_DIAGRAM|XML_pt: + case DGM_TOKEN( pt ): { // CT_Pt dgm::PointPtr pPoint( new dgm::Point() ); @@ -253,18 +250,18 @@ public: switch( aElementToken ) { - case NMSP_DRAWINGML|XML_blipFill: - case NMSP_DRAWINGML|XML_gradFill: - case NMSP_DRAWINGML|XML_grpFill: - case NMSP_DRAWINGML|XML_noFill: - case NMSP_DRAWINGML|XML_pattFill: - case NMSP_DRAWINGML|XML_solidFill: + case A_TOKEN( blipFill ): + case A_TOKEN( gradFill ): + case A_TOKEN( grpFill ): + case A_TOKEN( noFill ): + case A_TOKEN( pattFill ): + case A_TOKEN( solidFill ): // EG_FillProperties xRet.set( FillPropertiesContext::createFillContext( *this, aElementToken, xAttribs, *mpDataModel->getFillProperties() ) ); break; - case NMSP_DRAWINGML|XML_effectDag: - case NMSP_DRAWINGML|XML_effectLst: + case A_TOKEN( effectDag ): + case A_TOKEN( effectLst ): // TODO // EG_EffectProperties break; @@ -306,23 +303,23 @@ DataModelContext::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_cxnLst: + case DGM_TOKEN( cxnLst ): // CT_CxnList xRet.set( new CxnListContext( *this, mpDataModel->getConnections() ) ); break; - case NMSP_DIAGRAM|XML_ptLst: + case DGM_TOKEN( ptLst ): // CT_PtList xRet.set( new PtListContext( *this, mpDataModel->getPoints() ) ); break; - case NMSP_DIAGRAM|XML_bg: + case DGM_TOKEN( bg ): // CT_BackgroundFormatting xRet.set( new BackgroundFormattingContext( *this, mpDataModel ) ); break; - case NMSP_DIAGRAM|XML_whole: + case DGM_TOKEN( whole ): // CT_WholeE2oFormatting // TODO return xRet; - case NMSP_DIAGRAM|XML_extLst: + case DGM_TOKEN( extLst ): return xRet; default: break; diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx index 516d6bfb231c..cebb730af103 100644 --- a/oox/source/drawingml/diagram/diagram.cxx +++ b/oox/source/drawingml/diagram/diagram.cxx @@ -33,8 +33,6 @@ #include #include "oox/drawingml/diagram/diagram.hxx" #include "oox/drawingml/fillproperties.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; diff --git a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx index 53477211848e..ac98bfb18c38 100644 --- a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx +++ b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx @@ -26,11 +26,9 @@ ************************************************************************/ #include "diagramdefinitioncontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/helper.hxx" #include "layoutnodecontext.hxx" #include "oox/drawingml/diagram/datamodelcontext.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -80,29 +78,29 @@ DiagramDefinitionContext::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_title: + case DGM_TOKEN( title ): mpLayout->setTitle( xAttribs->getOptionalValue( XML_val ) ); break; - case NMSP_DIAGRAM|XML_desc: + case DGM_TOKEN( desc ): mpLayout->setDesc( xAttribs->getOptionalValue( XML_val ) ); break; - case NMSP_DIAGRAM|XML_layoutNode: + case DGM_TOKEN( layoutNode ): mpLayout->getNode().reset( new LayoutNode() ); xRet.set( new LayoutNodeContext( *this, xAttribs, mpLayout->getNode() ) ); break; - case NMSP_DIAGRAM|XML_clrData: + case DGM_TOKEN( clrData ): // TODO, does not matter for the UI. skip. return xRet; - case NMSP_DIAGRAM|XML_sampData: + case DGM_TOKEN( sampData ): mpLayout->getSampData().reset( new DiagramData ); xRet.set( new DataModelContext( *this, mpLayout->getSampData() ) ); break; - case NMSP_DIAGRAM|XML_styleData: + case DGM_TOKEN( styleData ): mpLayout->getStyleData().reset( new DiagramData ); xRet.set( new DataModelContext( *this, mpLayout->getStyleData() ) ); break; - case NMSP_DIAGRAM|XML_cat: - case NMSP_DIAGRAM|XML_catLst: + case DGM_TOKEN( cat ): + case DGM_TOKEN( catLst ): // TODO, does not matter for the UI default: break; diff --git a/oox/source/drawingml/diagram/diagramfragmenthandler.cxx b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx index ac2e755bee40..644e84771b3e 100644 --- a/oox/source/drawingml/diagram/diagramfragmenthandler.cxx +++ b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx @@ -29,9 +29,7 @@ #include "oox/drawingml/diagram/diagramfragmenthandler.hxx" #include "oox/drawingml/diagram/datamodelcontext.hxx" -#include "oox/core/namespaces.hxx" #include "diagramdefinitioncontext.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::xml::sax; @@ -70,7 +68,7 @@ DiagramDataFragmentHandler::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_dataModel: + case DGM_TOKEN( dataModel ): xRet.set( new DataModelContext( *this, mpDataPtr ) ); break; default: @@ -115,7 +113,7 @@ DiagramLayoutFragmentHandler::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_layoutDef: + case DGM_TOKEN( layoutDef ): xRet.set( new DiagramDefinitionContext( *this, xAttribs, mpDataPtr ) ); break; default: @@ -160,7 +158,7 @@ DiagramQStylesFragmentHandler::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_styleDef: + case DGM_TOKEN( styleDef ): // TODO break; default: @@ -205,7 +203,7 @@ DiagramColorsFragmentHandler::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_colorsDef: + case DGM_TOKEN( colorsDef ): // TODO break; default: diff --git a/oox/source/drawingml/diagram/layoutnodecontext.cxx b/oox/source/drawingml/diagram/layoutnodecontext.cxx index 4d430bb6ba36..0815843dd424 100644 --- a/oox/source/drawingml/diagram/layoutnodecontext.cxx +++ b/oox/source/drawingml/diagram/layoutnodecontext.cxx @@ -28,7 +28,6 @@ #include "layoutnodecontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/diagram/diagram.hxx" #include "oox/drawingml/shapecontext.hxx" #include "diagramdefinitioncontext.hxx" @@ -178,7 +177,7 @@ public: { Reference< XFastContextHandler > xRet; - sal_Int32 nIdx = LayoutNodeContext::tagToVarIdx( getToken( aElement ) ); + sal_Int32 nIdx = LayoutNodeContext::tagToVarIdx( getBaseToken( aElement ) ); if( nIdx != -1 ) { mVariables[ nIdx ] = makeAny( xAttribs->getOptionalValue( XML_val ) ); @@ -229,31 +228,31 @@ sal_Int32 LayoutNodeContext::tagToVarIdx( sal_Int32 aTag ) sal_Int32 nIdx = -1; switch( aTag ) { - case NMSP_DIAGRAM|XML_animLvl: + case DGM_TOKEN( animLvl ): nIdx = LayoutNode::VAR_animLvl; break; - case NMSP_DIAGRAM|XML_animOne: + case DGM_TOKEN( animOne ): nIdx = LayoutNode::VAR_animOne; break; - case NMSP_DIAGRAM|XML_bulletEnabled: + case DGM_TOKEN( bulletEnabled ): nIdx = LayoutNode::VAR_bulletEnabled; break; - case NMSP_DIAGRAM|XML_chMax: + case DGM_TOKEN( chMax ): nIdx = LayoutNode::VAR_chMax; break; - case NMSP_DIAGRAM|XML_chPref: + case DGM_TOKEN( chPref ): nIdx = LayoutNode::VAR_chPref; break; - case NMSP_DIAGRAM|XML_dir: + case DGM_TOKEN( dir ): nIdx = LayoutNode::VAR_dir; break; - case NMSP_DIAGRAM|XML_hierBranch: + case DGM_TOKEN( hierBranch ): nIdx = LayoutNode::VAR_hierBranch; break; - case NMSP_DIAGRAM|XML_orgChart: + case DGM_TOKEN( orgChart ): nIdx = LayoutNode::VAR_orgChart; break; - case NMSP_DIAGRAM|XML_resizeHandles: + case DGM_TOKEN( resizeHandles ): nIdx = LayoutNode::VAR_resizeHandles; break; default: @@ -272,22 +271,22 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement, switch( aElement ) { - case NMSP_DIAGRAM|XML_layoutNode: + case DGM_TOKEN( layoutNode ): { LayoutNodePtr pNode( new LayoutNode() ); mpNode->addChild( pNode ); xRet.set( new LayoutNodeContext( *this, xAttribs, pNode ) ); break; } - case NMSP_DIAGRAM|XML_shape: + case DGM_TOKEN( shape ): { ShapePtr pShape( new Shape() ); xRet.set( new ShapeContext( *this, ShapePtr(), pShape ) ); break; } - case NMSP_DIAGRAM|XML_extLst: + case DGM_TOKEN( extLst ): return xRet; - case NMSP_DIAGRAM|XML_alg: + case DGM_TOKEN( alg ): { // CT_Algorithm LayoutAtomPtr pAtom( new AlgAtom ); @@ -295,7 +294,7 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement, xRet.set( new AlgorithmContext( *this, xAttribs, pAtom ) ); break; } - case NMSP_DIAGRAM|XML_choose: + case DGM_TOKEN( choose ): { // CT_Choose LayoutAtomPtr pAtom( new ChooseAtom ); @@ -303,7 +302,7 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement, xRet.set( new ChooseContext( *this, xAttribs, pAtom ) ); break; } - case NMSP_DIAGRAM|XML_forEach: + case DGM_TOKEN( forEach ): { // CT_ForEach LayoutAtomPtr pAtom( new ForEachAtom ); @@ -311,11 +310,11 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement, xRet.set( new ForEachContext( *this, xAttribs, pAtom ) ); break; } - case NMSP_DIAGRAM|XML_constrLst: + case DGM_TOKEN( constrLst ): // CT_Constraints // TODO break; - case NMSP_DIAGRAM|XML_presOf: + case DGM_TOKEN( presOf ): { // CT_PresentationOf // TODO @@ -327,11 +326,11 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement, xAttribs->getOptionalValue( XML_step ); break; } - case NMSP_DIAGRAM|XML_ruleLst: + case DGM_TOKEN( ruleLst ): // CT_Rules // TODO break; - case NMSP_DIAGRAM|XML_varLst: + case DGM_TOKEN( varLst ): { LayoutNodePtr pNode( boost::dynamic_pointer_cast< LayoutNode >( mpNode ) ); if( pNode ) diff --git a/oox/source/drawingml/drawingmltypes.cxx b/oox/source/drawingml/drawingmltypes.cxx index e5aef824bf54..f99fdc21ab55 100644 --- a/oox/source/drawingml/drawingmltypes.cxx +++ b/oox/source/drawingml/drawingmltypes.cxx @@ -31,7 +31,7 @@ #include #include #include -#include "tokens.hxx" +#include "oox/token/tokens.hxx" using ::rtl::OUString; using ::com::sun::star::uno::Reference; diff --git a/oox/source/drawingml/embeddedwavaudiofile.cxx b/oox/source/drawingml/embeddedwavaudiofile.cxx index 02cad5ce9f05..5c9484894109 100644 --- a/oox/source/drawingml/embeddedwavaudiofile.cxx +++ b/oox/source/drawingml/embeddedwavaudiofile.cxx @@ -27,9 +27,6 @@ #include "oox/drawingml/embeddedwavaudiofile.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" - -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -46,7 +43,7 @@ namespace oox { namespace drawingml { { AttributeList attribs(xAttribs); - OUString sId = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_embed ); + OUString sId = xAttribs->getOptionalValue( R_TOKEN( embed ) ); aAudio.msEmbed = rRelations.getFragmentPathFromRelId( sId ); aAudio.mbBuiltIn = attribs.getBool( XML_builtIn, false ); aAudio.msName = xAttribs->getOptionalValue( XML_name ); diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 168055935104..558ce2abdfc8 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -35,13 +35,12 @@ #include #include #include -#include "properties.hxx" -#include "tokens.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/modelobjecthelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" #include "oox/drawingml/drawingmltypes.hxx" +#include "oox/token/tokens.hxx" using namespace ::com::sun::star; using namespace ::com::sun::star::drawing; diff --git a/oox/source/drawingml/fillpropertiesgroupcontext.cxx b/oox/source/drawingml/fillpropertiesgroupcontext.cxx index b9d7fa7e1142..508bba587add 100644 --- a/oox/source/drawingml/fillpropertiesgroupcontext.cxx +++ b/oox/source/drawingml/fillpropertiesgroupcontext.cxx @@ -28,7 +28,6 @@ #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/graphichelper.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/fillproperties.hxx" @@ -190,7 +189,7 @@ Reference< XFastContextHandler > BlipContext::createFastChildContext( { case A_TOKEN( biLevel ): case A_TOKEN( grayscl ): - mrBlipProps.moColorEffect = getToken( nElement ); + mrBlipProps.moColorEffect = getBaseToken( nElement ); break; case A_TOKEN( clrChange ): @@ -229,7 +228,7 @@ Reference< XFastContextHandler > BlipFillContext::createFastChildContext( break; case A_TOKEN( tile ): - mrBlipProps.moBitmapMode = getToken( nElement ); + mrBlipProps.moBitmapMode = getBaseToken( nElement ); mrBlipProps.moTileOffsetX = aAttribs.getInteger( XML_tx ); mrBlipProps.moTileOffsetY = aAttribs.getInteger( XML_ty ); mrBlipProps.moTileScaleX = aAttribs.getInteger( XML_sx ); @@ -239,7 +238,7 @@ Reference< XFastContextHandler > BlipFillContext::createFastChildContext( break; case A_TOKEN( stretch ): - mrBlipProps.moBitmapMode = getToken( nElement ); + mrBlipProps.moBitmapMode = getBaseToken( nElement ); return this; // for fillRect element case A_TOKEN( fillRect ): @@ -271,12 +270,12 @@ Reference< XFastContextHandler > FillPropertiesContext::createFastChildContext( { switch( nElement ) { - case A_TOKEN( noFill ): { rFillProps.moFillType = getToken( nElement ); return 0; }; - case A_TOKEN( solidFill ): { rFillProps.moFillType = getToken( nElement ); return new SolidFillContext( rParent, rxAttribs, rFillProps ); }; - case A_TOKEN( gradFill ): { rFillProps.moFillType = getToken( nElement ); return new GradientFillContext( rParent, rxAttribs, rFillProps.maGradientProps ); }; - case A_TOKEN( pattFill ): { rFillProps.moFillType = getToken( nElement ); return new PatternFillContext( rParent, rxAttribs, rFillProps.maPatternProps ); }; - case A_TOKEN( blipFill ): { rFillProps.moFillType = getToken( nElement ); return new BlipFillContext( rParent, rxAttribs, rFillProps.maBlipProps ); }; - case A_TOKEN( grpFill ): { rFillProps.moFillType = getToken( nElement ); return 0; }; // TODO + case A_TOKEN( noFill ): { rFillProps.moFillType = getBaseToken( nElement ); return 0; }; + case A_TOKEN( solidFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new SolidFillContext( rParent, rxAttribs, rFillProps ); }; + case A_TOKEN( gradFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new GradientFillContext( rParent, rxAttribs, rFillProps.maGradientProps ); }; + case A_TOKEN( pattFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new PatternFillContext( rParent, rxAttribs, rFillProps.maPatternProps ); }; + case A_TOKEN( blipFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new BlipFillContext( rParent, rxAttribs, rFillProps.maBlipProps ); }; + case A_TOKEN( grpFill ): { rFillProps.moFillType = getBaseToken( nElement ); return 0; }; // TODO } return 0; } diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx index 0df33903ffbb..646017aa22ea 100644 --- a/oox/source/drawingml/graphicshapecontext.cxx +++ b/oox/source/drawingml/graphicshapecontext.cxx @@ -32,7 +32,6 @@ #include "oox/drawingml/customshapeproperties.hxx" #include "oox/drawingml/diagram/diagramfragmenthandler.hxx" #include "oox/drawingml/table/tablecontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/graphichelper.hxx" @@ -42,8 +41,6 @@ #include "oox/vml/vmlshapecontainer.hxx" #include "oox/drawingml/fillproperties.hxx" #include "oox/drawingml/transform2dcontext.hxx" -#include "properties.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::com::sun::star; @@ -69,7 +66,7 @@ Reference< XFastContextHandler > GraphicShapeContext::createFastChildContext( sa { Reference< XFastContextHandler > xRet; - switch( getToken( aElementToken ) ) + switch( getBaseToken( aElementToken ) ) { // CT_ShapeProperties case XML_xfrm: @@ -80,13 +77,13 @@ Reference< XFastContextHandler > GraphicShapeContext::createFastChildContext( sa break; } - if (getNamespace( aElementToken ) == NMSP_VML && mpShapePtr) + if ((getNamespace( aElementToken ) == NMSP_vml) && mpShapePtr) { mpShapePtr->setServiceName("com.sun.star.drawing.CustomShape"); CustomShapePropertiesPtr pCstmShpProps (mpShapePtr->getCustomShapeProperties()); - sal_uInt32 nType = aElementToken & (~ NMSP_MASK); + sal_uInt32 nType = getBaseToken( aElementToken ); OUString sType(GetShapeType(nType)); if (sType.getLength() > 0) @@ -112,7 +109,7 @@ Reference< XFastContextHandler > GraphicalObjectFrameContext::createFastChildCon { Reference< XFastContextHandler > xRet; - switch( aElementToken &(~NMSP_MASK) ) + switch( getBaseToken( aElementToken ) ) { // CT_ShapeProperties case XML_nvGraphicFramePr: // CT_GraphicalObjectFrameNonVisual @@ -272,12 +269,12 @@ Reference< XFastContextHandler > DiagramGraphicDataContext::createFastChildConte switch( aElementToken ) { - case NMSP_DIAGRAM|XML_relIds: + case DGM_TOKEN( relIds ): { - msDm = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_dm ); - msLo = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_lo ); - msQs = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_qs ); - msCs = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_cs ); + msDm = xAttribs->getOptionalValue( R_TOKEN( dm ) ); + msLo = xAttribs->getOptionalValue( R_TOKEN( lo ) ); + msQs = xAttribs->getOptionalValue( R_TOKEN( qs ) ); + msCs = xAttribs->getOptionalValue( R_TOKEN( cs ) ); DiagramPtr pDiagram = loadDiagram(); pDiagram->addTo( mpShapePtr ); OSL_TRACE("diagram added shape %s of type %s", OUSTRING_TO_CSTR( mpShapePtr->getName() ), diff --git a/oox/source/drawingml/guidcontext.cxx b/oox/source/drawingml/guidcontext.cxx index b53e33fcb746..d5fbc10783ac 100644 --- a/oox/source/drawingml/guidcontext.cxx +++ b/oox/source/drawingml/guidcontext.cxx @@ -25,10 +25,7 @@ * ************************************************************************/ -#include #include "oox/drawingml/guidcontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; diff --git a/oox/source/drawingml/hyperlinkcontext.cxx b/oox/source/drawingml/hyperlinkcontext.cxx index 280077eb0b5b..2b2b1ee1cef6 100644 --- a/oox/source/drawingml/hyperlinkcontext.cxx +++ b/oox/source/drawingml/hyperlinkcontext.cxx @@ -27,17 +27,12 @@ #include "hyperlinkcontext.hxx" -#include - #include #include "oox/helper/propertymap.hxx" #include "oox/core/relations.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/embeddedwavaudiofile.hxx" -#include "properties.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -53,7 +48,7 @@ HyperLinkContext::HyperLinkContext( ContextHandler& rParent, , maProperties(aProperties) { OUString sURL, sHref; - OUString aRelId = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_id ); + OUString aRelId = xAttributes->getOptionalValue( R_TOKEN( id ) ); if ( aRelId.getLength() ) { OSL_TRACE("OOX: URI rId %s", ::rtl::OUStringToOString (aRelId, RTL_TEXTENCODING_UTF8).pData->buffer); @@ -64,10 +59,10 @@ HyperLinkContext::HyperLinkContext( ContextHandler& rParent, sURL = getFilter().getAbsoluteUrl( sHref ); } } - OUString sTooltip = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tooltip ); + OUString sTooltip = xAttributes->getOptionalValue( R_TOKEN( tooltip ) ); if ( sTooltip.getLength() ) maProperties[ PROP_Representation ] <<= sTooltip; - OUString sFrame = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tgtFrame ); + OUString sFrame = xAttributes->getOptionalValue( R_TOKEN( tgtFrame ) ); if( sFrame.getLength() ) maProperties[ PROP_TargetFrame ] <<= sFrame; OUString aAction = xAttributes->getOptionalValue( XML_action ); @@ -164,9 +159,9 @@ Reference< XFastContextHandler > HyperLinkContext::createFastChildContext( Reference< XFastContextHandler > xRet; switch( aElement ) { - case NMSP_DRAWINGML|XML_extLst: + case A_TOKEN( extLst ): return xRet; - case NMSP_DRAWINGML|XML_snd: + case A_TOKEN( snd ): EmbeddedWAVAudioFile aAudio; getEmbeddedWAVAudioFile( getRelations(), xAttribs, aAudio ); break; diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx index 9f23cf466d30..38b6eb2d82a3 100644 --- a/oox/source/drawingml/lineproperties.cxx +++ b/oox/source/drawingml/lineproperties.cxx @@ -35,14 +35,12 @@ #include #include #include -#include "properties.hxx" -#include "tokens.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/modelobjecthelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/drawingmltypes.hxx" +#include "oox/token/tokens.hxx" using namespace ::com::sun::star::drawing; diff --git a/oox/source/drawingml/linepropertiescontext.cxx b/oox/source/drawingml/linepropertiescontext.cxx index a2cf4111a524..a200b60f9e4b 100644 --- a/oox/source/drawingml/linepropertiescontext.cxx +++ b/oox/source/drawingml/linepropertiescontext.cxx @@ -30,8 +30,6 @@ #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/lineproperties.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -88,7 +86,7 @@ Reference< XFastContextHandler > LinePropertiesContext::createFastChildContext( case A_TOKEN( round ): case A_TOKEN( bevel ): case A_TOKEN( miter ): - mrLineProperties.moLineJoint = getToken( nElement ); + mrLineProperties.moLineJoint = getBaseToken( nElement ); break; case A_TOKEN( headEnd ): // CT_LineEndProperties diff --git a/oox/source/drawingml/objectdefaultcontext.cxx b/oox/source/drawingml/objectdefaultcontext.cxx index 69b9423a4abc..d233379f9b02 100644 --- a/oox/source/drawingml/objectdefaultcontext.cxx +++ b/oox/source/drawingml/objectdefaultcontext.cxx @@ -28,8 +28,6 @@ #include "oox/drawingml/objectdefaultcontext.hxx" #include "oox/drawingml/spdefcontext.hxx" #include "oox/drawingml/theme.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; @@ -48,11 +46,11 @@ Reference< XFastContextHandler > objectDefaultContext::createFastChildContext( s { switch( aElementToken ) { - case NMSP_DRAWINGML|XML_spDef: + case A_TOKEN( spDef ): return new spDefContext( *this, mrTheme.getSpDef() ); - case NMSP_DRAWINGML|XML_lnDef: + case A_TOKEN( lnDef ): return new spDefContext( *this, mrTheme.getLnDef() ); - case NMSP_DRAWINGML|XML_txDef: + case A_TOKEN( txDef ): return new spDefContext( *this, mrTheme.getTxDef() ); } return 0; diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 4d98de51a002..61956c068deb 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -38,12 +38,9 @@ #include "oox/vml/vmldrawing.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertyset.hxx" -#include "properties.hxx" -#include "tokens.hxx" #include // for the F_PI180 define #include diff --git a/oox/source/drawingml/shapecontext.cxx b/oox/source/drawingml/shapecontext.cxx index a5f3b1598447..d4781fdaa436 100644 --- a/oox/source/drawingml/shapecontext.cxx +++ b/oox/source/drawingml/shapecontext.cxx @@ -34,13 +34,11 @@ #include "oox/helper/attributelist.hxx" #include "oox/drawingml/shapecontext.hxx" #include "oox/drawingml/shapestylecontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace oox::core; @@ -80,7 +78,7 @@ Reference< XFastContextHandler > ShapeContext::createFastChildContext( sal_Int32 { Reference< XFastContextHandler > xRet; - switch( getToken( aElementToken ) ) + switch( getBaseToken( aElementToken ) ) { // nvSpPr CT_ShapeNonVisual begin // case XML_drElemPr: diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx index 2c8e0808d8af..183302667066 100644 --- a/oox/source/drawingml/shapegroupcontext.cxx +++ b/oox/source/drawingml/shapegroupcontext.cxx @@ -37,8 +37,6 @@ #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace oox::core; @@ -68,7 +66,7 @@ Reference< XFastContextHandler > ShapeGroupContext::createFastChildContext( sal_ { Reference< XFastContextHandler > xRet; - switch( getToken( aElementToken ) ) + switch( getBaseToken( aElementToken ) ) { case XML_cNvPr: { diff --git a/oox/source/drawingml/shapepropertiescontext.cxx b/oox/source/drawingml/shapepropertiescontext.cxx index dd1814ac23cf..13fd8c421784 100644 --- a/oox/source/drawingml/shapepropertiescontext.cxx +++ b/oox/source/drawingml/shapepropertiescontext.cxx @@ -33,12 +33,10 @@ #include #include -#include "oox/core/namespaces.hxx" #include "oox/drawingml/linepropertiescontext.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/transform2dcontext.hxx" #include "oox/drawingml/customshapegeometry.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace oox::core; @@ -68,17 +66,17 @@ Reference< XFastContextHandler > ShapePropertiesContext::createFastChildContext( switch( aElementToken ) { // CT_Transform2D - case NMSP_DRAWINGML|XML_xfrm: + case A_TOKEN( xfrm ): xRet.set( new Transform2DContext( *this, xAttribs, mrShape ) ); break; // GeometryGroup - case NMSP_DRAWINGML|XML_custGeom: // custom geometry "CT_CustomGeometry2D" + case A_TOKEN( custGeom ): // custom geometry "CT_CustomGeometry2D" xRet.set( new CustomShapeGeometryContext( *this, xAttribs, *(mrShape.getCustomShapeProperties()) ) ); break; - case NMSP_DRAWINGML|XML_prstGeom: // preset geometry "CT_PresetGeometry2D" + case A_TOKEN( prstGeom ): // preset geometry "CT_PresetGeometry2D" { sal_Int32 nToken = xAttribs->getOptionalValueToken( XML_prst, 0 ); if ( nToken == XML_line ) @@ -90,24 +88,24 @@ Reference< XFastContextHandler > ShapePropertiesContext::createFastChildContext( } break; - case NMSP_DRAWINGML|XML_prstTxWarp: + case A_TOKEN( prstTxWarp ): xRet.set( new PresetTextShapeContext( *this, xAttribs, *(mrShape.getCustomShapeProperties()) ) ); break; // CT_LineProperties - case NMSP_DRAWINGML|XML_ln: + case A_TOKEN( ln ): xRet.set( new LinePropertiesContext( *this, xAttribs, mrShape.getLineProperties() ) ); break; // EffectPropertiesGroup // todo not supported by core - case NMSP_DRAWINGML|XML_effectLst: // CT_EffectList - case NMSP_DRAWINGML|XML_effectDag: // CT_EffectContainer + case A_TOKEN( effectLst ): // CT_EffectList + case A_TOKEN( effectDag ): // CT_EffectContainer break; // todo - case NMSP_DRAWINGML|XML_scene3d: // CT_Scene3D - case NMSP_DRAWINGML|XML_sp3d: // CT_Shape3D + case A_TOKEN( scene3d ): // CT_Scene3D + case A_TOKEN( sp3d ): // CT_Shape3D break; } diff --git a/oox/source/drawingml/shapestylecontext.cxx b/oox/source/drawingml/shapestylecontext.cxx index 13f15783e49b..a1ae5df43cda 100644 --- a/oox/source/drawingml/shapestylecontext.cxx +++ b/oox/source/drawingml/shapestylecontext.cxx @@ -28,9 +28,7 @@ #include "oox/drawingml/shapestylecontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/colorchoicecontext.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -67,12 +65,12 @@ Reference< XFastContextHandler > ShapeStyleContext::createFastChildContext( sal_ AttributeList aAttribs( rxAttributes ); switch( aElementToken ) { - case NMSP_DRAWINGML|XML_lnRef : // CT_StyleMatrixReference - case NMSP_DRAWINGML|XML_fillRef : // CT_StyleMatrixReference - case NMSP_DRAWINGML|XML_effectRef : // CT_StyleMatrixReference - case NMSP_DRAWINGML|XML_fontRef : // CT_FontReference + case A_TOKEN( lnRef ) : // CT_StyleMatrixReference + case A_TOKEN( fillRef ) : // CT_StyleMatrixReference + case A_TOKEN( effectRef ) : // CT_StyleMatrixReference + case A_TOKEN( fontRef ) : // CT_FontReference { - sal_Int32 nToken = getToken( aElementToken ); + sal_Int32 nToken = getBaseToken( aElementToken ); ShapeStyleRef& rStyleRef = mrShape.getShapeStyleRefs()[ nToken ]; rStyleRef.mnThemedIdx = (nToken == XML_fontRef) ? aAttribs.getToken( XML_idx, XML_none ) : aAttribs.getInteger( XML_idx, 0 ); xRet.set( new ColorContext( *this, rStyleRef.maPhClr ) ); diff --git a/oox/source/drawingml/spdefcontext.cxx b/oox/source/drawingml/spdefcontext.cxx index d85fe2ceb2bb..da86e031ddec 100644 --- a/oox/source/drawingml/spdefcontext.cxx +++ b/oox/source/drawingml/spdefcontext.cxx @@ -30,8 +30,6 @@ #include "oox/drawingml/textbody.hxx" #include "oox/drawingml/textbodypropertiescontext.hxx" #include "oox/drawingml/textliststylecontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; @@ -51,22 +49,22 @@ Reference< XFastContextHandler > spDefContext::createFastChildContext( sal_Int32 Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_DRAWINGML|XML_spPr: + case A_TOKEN( spPr ): { xRet = new ShapePropertiesContext( *this, mrDefaultObject ); break; } - case NMSP_DRAWINGML|XML_bodyPr: + case A_TOKEN( bodyPr ): { TextBodyPtr xTextBody( new TextBody ); mrDefaultObject.setTextBody( xTextBody ); xRet = new TextBodyPropertiesContext( *this, xAttribs, xTextBody->getTextProperties() ); break; } - case NMSP_DRAWINGML|XML_lstStyle: + case A_TOKEN( lstStyle ): xRet.set( new TextListStyleContext( *this, *mrDefaultObject.getMasterTextListStyle() ) ); break; - case NMSP_DRAWINGML|XML_style: + case A_TOKEN( style ): break; } if( !xRet.is() ) diff --git a/oox/source/drawingml/table/tablebackgroundstylecontext.cxx b/oox/source/drawingml/table/tablebackgroundstylecontext.cxx index c9be0287a7cc..075e8ded9b31 100644 --- a/oox/source/drawingml/table/tablebackgroundstylecontext.cxx +++ b/oox/source/drawingml/table/tablebackgroundstylecontext.cxx @@ -29,9 +29,8 @@ #include "oox/drawingml/table/tablebackgroundstylecontext.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" + using namespace ::oox::core; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -60,14 +59,14 @@ TableBackgroundStyleContext::createFastChildContext( ::sal_Int32 aElementToken, switch( aElementToken ) { // EG_ThemeableFillStyle (choice) - case NMSP_DRAWINGML|XML_fill: // CT_FillProperties + case A_TOKEN( fill ): // CT_FillProperties { boost::shared_ptr< FillProperties >& rxFillProperties = mrTableStyle.getBackgroundFillProperties(); rxFillProperties.reset( new FillProperties ); xRet.set( new FillPropertiesContext( *this, *rxFillProperties ) ); } break; - case NMSP_DRAWINGML|XML_fillRef: // CT_StyleMatrixReference + case A_TOKEN( fillRef ): // CT_StyleMatrixReference { ShapeStyleRef& rStyleRef = mrTableStyle.getBackgroundFillStyleRef(); rStyleRef.mnThemedIdx = aAttribs.getInteger( XML_idx, 0 ); @@ -76,9 +75,9 @@ TableBackgroundStyleContext::createFastChildContext( ::sal_Int32 aElementToken, break; // EG_ThemeableEffectStyle (choice) - case NMSP_DRAWINGML|XML_effect: // CT_EffectProperties + case A_TOKEN( effect ): // CT_EffectProperties break; - case NMSP_DRAWINGML|XML_effectRef: // CT_StyleMatrixReference + case A_TOKEN( effectRef ): // CT_StyleMatrixReference break; } if( !xRet.is() ) diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx index ee3ac495f4d6..f381b20d5383 100644 --- a/oox/source/drawingml/table/tablecell.cxx +++ b/oox/source/drawingml/table/tablecell.cxx @@ -28,10 +28,7 @@ #include "oox/drawingml/table/tablecell.hxx" #include "oox/drawingml/table/tableproperties.hxx" #include "oox/drawingml/textbody.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" -#include "properties.hxx" -#include "tokens.hxx" #include "oox/helper/propertyset.hxx" #include #include diff --git a/oox/source/drawingml/table/tablecellcontext.cxx b/oox/source/drawingml/table/tablecellcontext.cxx index 68e3cd3a864a..844f134c3e85 100644 --- a/oox/source/drawingml/table/tablecellcontext.cxx +++ b/oox/source/drawingml/table/tablecellcontext.cxx @@ -31,7 +31,6 @@ #include "oox/drawingml/textbodycontext.hxx" #include "oox/drawingml/linepropertiescontext.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" using namespace ::oox::core; @@ -66,7 +65,7 @@ TableCellContext::createFastChildContext( ::sal_Int32 aElementToken, const uno:: switch( aElementToken ) { - case NMSP_DRAWINGML|XML_txBody: // CT_TextBody + case A_TOKEN( txBody ): // CT_TextBody { oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody ); mrTableCell.setTextBody( xTextBody ); @@ -74,7 +73,7 @@ TableCellContext::createFastChildContext( ::sal_Int32 aElementToken, const uno:: } break; - case NMSP_DRAWINGML|XML_tcPr: // CT_TableCellProperties + case A_TOKEN( tcPr ): // CT_TableCellProperties { AttributeList aAttribs( xAttribs ); mrTableCell.setLeftMargin( aAttribs.getInteger( XML_marL, 91440 ) ); @@ -87,28 +86,28 @@ TableCellContext::createFastChildContext( ::sal_Int32 aElementToken, const uno:: mrTableCell.setHorzOverflowToken( xAttribs->getOptionalValueToken( XML_horzOverflow, XML_clip ) ); // ST_TextHorzOverflowType } break; - case NMSP_DRAWINGML|XML_lnL: + case A_TOKEN( lnL ): xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesLeft ) ); break; - case NMSP_DRAWINGML|XML_lnR: + case A_TOKEN( lnR ): xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesRight ) ); break; - case NMSP_DRAWINGML|XML_lnT: + case A_TOKEN( lnT ): xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesTop ) ); break; - case NMSP_DRAWINGML|XML_lnB: + case A_TOKEN( lnB ): xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesBottom ) ); break; - case NMSP_DRAWINGML|XML_lnTlToBr: + case A_TOKEN( lnTlToBr ): xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesTopLeftToBottomRight ) ); break; - case NMSP_DRAWINGML|XML_lnBlToTr: + case A_TOKEN( lnBlToTr ): xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesBottomLeftToTopRight ) ); break; - case NMSP_DRAWINGML|XML_cell3D: // CT_Cell3D + case A_TOKEN( cell3D ): // CT_Cell3D break; - case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList + case A_TOKEN( extLst ): // CT_OfficeArtExtensionList break; default: diff --git a/oox/source/drawingml/table/tablecontext.cxx b/oox/source/drawingml/table/tablecontext.cxx index ef5d87e3081b..f7e7af620428 100644 --- a/oox/source/drawingml/table/tablecontext.cxx +++ b/oox/source/drawingml/table/tablecontext.cxx @@ -32,7 +32,6 @@ #include "oox/drawingml/table/tableproperties.hxx" #include "oox/drawingml/table/tablestylecontext.hxx" #include "oox/drawingml/table/tablerowcontext.hxx" -#include "oox/core/namespaces.hxx" using namespace ::oox::core; using namespace ::com::sun::star; @@ -59,7 +58,7 @@ TableContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::Refe switch( aElementToken ) { - case NMSP_DRAWINGML|XML_tblPr: // CT_TableProperties + case A_TOKEN( tblPr ): // CT_TableProperties { AttributeList aAttribs( xAttribs ); mrTableProperties.isRtl() = aAttribs.getBool( XML_rtl, sal_False ); @@ -71,26 +70,26 @@ TableContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::Refe mrTableProperties.isBandCol() = aAttribs.getBool( XML_bandCol, sal_False ); } break; - case NMSP_DRAWINGML|XML_tableStyle: // CT_TableStyle + case A_TOKEN( tableStyle ): // CT_TableStyle { boost::shared_ptr< TableStyle >& rTableStyle = mrTableProperties.getTableStyle(); rTableStyle.reset( new TableStyle() ); xRet = new TableStyleContext( *this, xAttribs, *rTableStyle ); } break; - case NMSP_DRAWINGML|XML_tableStyleId: // ST_Guid + case A_TOKEN( tableStyleId ): // ST_Guid xRet.set( new oox::drawingml::GuidContext( *this, mrTableProperties.getStyleId() ) ); break; - case NMSP_DRAWINGML|XML_tblGrid: // CT_TableGrid + case A_TOKEN( tblGrid ): // CT_TableGrid break; - case NMSP_DRAWINGML|XML_gridCol: // CT_TableCol + case A_TOKEN( gridCol ): // CT_TableCol { std::vector< sal_Int32 >& rvTableGrid( mrTableProperties.getTableGrid() ); rvTableGrid.push_back( xAttribs->getOptionalValue( XML_w ).toInt32() ); } break; - case NMSP_DRAWINGML|XML_tr: // CT_TableRow + case A_TOKEN( tr ): // CT_TableRow { std::vector< TableRow >& rvTableRows( mrTableProperties.getTableRows() ); rvTableRows.resize( rvTableRows.size() + 1 ); diff --git a/oox/source/drawingml/table/tablepartstylecontext.cxx b/oox/source/drawingml/table/tablepartstylecontext.cxx index 92e314d6afa7..1d48cbcf2a18 100644 --- a/oox/source/drawingml/table/tablepartstylecontext.cxx +++ b/oox/source/drawingml/table/tablepartstylecontext.cxx @@ -30,8 +30,7 @@ #include "oox/drawingml/table/tablepartstylecontext.hxx" #include "oox/drawingml/table/tablestyletextstylecontext.hxx" #include "oox/drawingml/table/tablestylecellstylecontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" + using namespace ::oox::core; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -59,10 +58,10 @@ TablePartStyleContext::createFastChildContext( ::sal_Int32 aElementToken, const switch( aElementToken ) { - case NMSP_DRAWINGML|XML_tcTxStyle: // CT_TableStyleTextStyle + case A_TOKEN( tcTxStyle ): // CT_TableStyleTextStyle xRet.set( new TableStyleTextStyleContext( *this, xAttribs, mrTableStylePart ) ); break; - case NMSP_DRAWINGML|XML_tcStyle: // CT_TableStyleCellStyle + case A_TOKEN( tcStyle ): // CT_TableStyleCellStyle xRet.set( new TableStyleCellStyleContext( *this, mrTableStylePart ) ); break; } diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx index 136754fbccc3..e0d0ac91c2ab 100644 --- a/oox/source/drawingml/table/tableproperties.cxx +++ b/oox/source/drawingml/table/tableproperties.cxx @@ -33,10 +33,8 @@ #include #include #include -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/helper/propertyset.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; diff --git a/oox/source/drawingml/table/tablerow.cxx b/oox/source/drawingml/table/tablerow.cxx index 8986a6e35d08..3c4af56a5d42 100644 --- a/oox/source/drawingml/table/tablerow.cxx +++ b/oox/source/drawingml/table/tablerow.cxx @@ -27,8 +27,6 @@ #include "oox/drawingml/table/tablerow.hxx" #include "oox/drawingml/drawingmltypes.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" #include #include #include "oox/helper/propertyset.hxx" diff --git a/oox/source/drawingml/table/tablerowcontext.cxx b/oox/source/drawingml/table/tablerowcontext.cxx index 7e0ff052bb4e..1a6c38167a8d 100644 --- a/oox/source/drawingml/table/tablerowcontext.cxx +++ b/oox/source/drawingml/table/tablerowcontext.cxx @@ -30,8 +30,6 @@ #include "oox/drawingml/table/tablerowcontext.hxx" #include "oox/drawingml/table/tablecellcontext.hxx" #include "oox/drawingml/table/tablerow.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star; @@ -58,14 +56,14 @@ TableRowContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::R switch( aElementToken ) { - case NMSP_DRAWINGML|XML_tc: // CT_TableCell + case A_TOKEN( tc ): // CT_TableCell { std::vector< TableCell >& rvTableCells = mrTableRow.getTableCells(); rvTableCells.resize( rvTableCells.size() + 1 ); xRet.set( new TableCellContext( *this, xAttribs, rvTableCells.back() ) ); } break; - case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList + case A_TOKEN( extLst ): // CT_OfficeArtExtensionList default: break; } diff --git a/oox/source/drawingml/table/tablestylecellstylecontext.cxx b/oox/source/drawingml/table/tablestylecellstylecontext.cxx index 47d747bf8b20..56127b0c049c 100644 --- a/oox/source/drawingml/table/tablestylecellstylecontext.cxx +++ b/oox/source/drawingml/table/tablestylecellstylecontext.cxx @@ -30,9 +30,8 @@ #include "oox/drawingml/table/tablestylecellstylecontext.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/linepropertiescontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" + using namespace ::oox::core; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -61,20 +60,20 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c AttributeList aAttribs( xAttribs ); switch( aElementToken ) { - case NMSP_DRAWINGML|XML_tcBdr: // CT_TableCellBorderStyle + case A_TOKEN( tcBdr ): // CT_TableCellBorderStyle break; - case NMSP_DRAWINGML|XML_left: // CT_ThemeableLineStyle - case NMSP_DRAWINGML|XML_right: - case NMSP_DRAWINGML|XML_top: - case NMSP_DRAWINGML|XML_bottom: - case NMSP_DRAWINGML|XML_insideH: - case NMSP_DRAWINGML|XML_insideV: - case NMSP_DRAWINGML|XML_tl2br: - case NMSP_DRAWINGML|XML_tr2bl: - mnLineType = getToken( aElementToken ); + case A_TOKEN( left ): // CT_ThemeableLineStyle + case A_TOKEN( right ): + case A_TOKEN( top ): + case A_TOKEN( bottom ): + case A_TOKEN( insideH ): + case A_TOKEN( insideV ): + case A_TOKEN( tl2br ): + case A_TOKEN( tr2bl ): + mnLineType = getBaseToken( aElementToken ); break; - case NMSP_DRAWINGML|XML_ln: + case A_TOKEN( ln ): { if ( mnLineType != XML_none ) { @@ -85,7 +84,7 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c } } break; - case NMSP_DRAWINGML|XML_lnRef: + case A_TOKEN( lnRef ): { if ( mnLineType != XML_none ) { @@ -97,14 +96,14 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c break; // EG_ThemeableFillStyle (choice) - case NMSP_DRAWINGML|XML_fill: // CT_FillProperties + case A_TOKEN( fill ): // CT_FillProperties { FillPropertiesPtr& rxFillProperties = mrTableStylePart.getFillProperties(); rxFillProperties.reset( new FillProperties ); xRet.set( new FillPropertiesContext( *this, *rxFillProperties ) ); } break; - case NMSP_DRAWINGML|XML_fillRef: // CT_StyleMatrixReference + case A_TOKEN( fillRef ): // CT_StyleMatrixReference { ShapeStyleRef& rStyleRef = mrTableStylePart.getStyleRefs()[ XML_fillRef ]; rStyleRef.mnThemedIdx = aAttribs.getInteger( XML_idx, 0 ); @@ -112,7 +111,7 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c } break; - case NMSP_DRAWINGML|XML_cell3D: // CT_Cell3D + case A_TOKEN( cell3D ): // CT_Cell3D break; } if( !xRet.is() ) diff --git a/oox/source/drawingml/table/tablestylecontext.cxx b/oox/source/drawingml/table/tablestylecontext.cxx index 4d0b945d3d72..aee23eaf9c7b 100644 --- a/oox/source/drawingml/table/tablestylecontext.cxx +++ b/oox/source/drawingml/table/tablestylecontext.cxx @@ -30,8 +30,7 @@ #include "oox/drawingml/table/tablestylecontext.hxx" #include "oox/drawingml/table/tablebackgroundstylecontext.hxx" #include "oox/drawingml/table/tablepartstylecontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" + using namespace ::oox::core; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -61,49 +60,49 @@ TableStyleContext::createFastChildContext( ::sal_Int32 aElementToken, const uno: switch( aElementToken ) { - case NMSP_DRAWINGML|XML_tblBg: // CT_TableBackgroundStyle + case A_TOKEN( tblBg ): // CT_TableBackgroundStyle xRet = new TableBackgroundStyleContext( *this, mrTableStyle ); break; - case NMSP_DRAWINGML|XML_wholeTbl: // CT_TablePartStyle + case A_TOKEN( wholeTbl ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getWholeTbl() ); break; - case NMSP_DRAWINGML|XML_band1H: // CT_TablePartStyle + case A_TOKEN( band1H ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getBand1H() ); break; - case NMSP_DRAWINGML|XML_band2H: // CT_TablePartStyle + case A_TOKEN( band2H ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getBand2H() ); break; - case NMSP_DRAWINGML|XML_band1V: // CT_TablePartStyle + case A_TOKEN( band1V ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getBand1V() ); break; - case NMSP_DRAWINGML|XML_band2V: // CT_TablePartStyle + case A_TOKEN( band2V ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getBand2V() ); break; - case NMSP_DRAWINGML|XML_lastCol: // CT_TablePartStyle + case A_TOKEN( lastCol ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getLastCol() ); break; - case NMSP_DRAWINGML|XML_firstCol: // CT_TablePartStyle + case A_TOKEN( firstCol ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getFirstCol() ); break; - case NMSP_DRAWINGML|XML_lastRow: // CT_TablePartStyle + case A_TOKEN( lastRow ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getLastRow() ); break; - case NMSP_DRAWINGML|XML_seCell: // CT_TablePartStyle + case A_TOKEN( seCell ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getSeCell() ); break; - case NMSP_DRAWINGML|XML_swCell: // CT_TablePartStyle + case A_TOKEN( swCell ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getSwCell() ); break; - case NMSP_DRAWINGML|XML_firstRow: // CT_TablePartStyle + case A_TOKEN( firstRow ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getFirstRow() ); break; - case NMSP_DRAWINGML|XML_neCell: // CT_TablePartStyle + case A_TOKEN( neCell ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getNeCell() ); break; - case NMSP_DRAWINGML|XML_nwCell: // CT_TablePartStyle + case A_TOKEN( nwCell ): // CT_TablePartStyle xRet = new TablePartStyleContext( *this, mrTableStyle.getNwCell() ); break; - case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList + case A_TOKEN( extLst ): // CT_OfficeArtExtensionList break; } if( !xRet.is() ) diff --git a/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx b/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx index e90554409d4d..7b837d27e826 100644 --- a/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx +++ b/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx @@ -62,10 +62,10 @@ Reference< XFastContextHandler > TableStyleListFragmentHandler::createFastChildC Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_DRAWINGML|XML_tblStyleLst: // CT_TableStyleList + case A_TOKEN( tblStyleLst ): // CT_TableStyleList mrTableStyleList.getDefaultStyleId() = xAttribs->getOptionalValue( XML_def ); break; - case NMSP_DRAWINGML|XML_tblStyle: // CT_TableStyle + case A_TOKEN( tblStyle ): // CT_TableStyle std::vector< TableStyle >& rTableStyles = mrTableStyleList.getTableStyles(); rTableStyles.resize( rTableStyles.size() + 1 ); xRet = new TableStyleContext( *this, xAttribs, rTableStyles.back() ); diff --git a/oox/source/drawingml/table/tablestylepart.cxx b/oox/source/drawingml/table/tablestylepart.cxx index f8e700e5fccd..b4a68fd488cd 100644 --- a/oox/source/drawingml/table/tablestylepart.cxx +++ b/oox/source/drawingml/table/tablestylepart.cxx @@ -27,8 +27,6 @@ #include "oox/drawingml/table/tablestylepart.hxx" #include "oox/drawingml/drawingmltypes.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; diff --git a/oox/source/drawingml/table/tablestyletextstylecontext.cxx b/oox/source/drawingml/table/tablestyletextstylecontext.cxx index ec117f4ac3c1..7c04e3293eb1 100644 --- a/oox/source/drawingml/table/tablestyletextstylecontext.cxx +++ b/oox/source/drawingml/table/tablestyletextstylecontext.cxx @@ -29,9 +29,8 @@ #include "oox/drawingml/table/tablestyletextstylecontext.hxx" #include "oox/drawingml/colorchoicecontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" + using namespace ::oox::core; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -73,23 +72,23 @@ TableStyleTextStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c switch( aElementToken ) { // EG_ThemeableFontStyles (choice) - case NMSP_DRAWINGML|XML_font: // CT_FontCollection + case A_TOKEN( font ): // CT_FontCollection xRet.set( this ); break; - case NMSP_DRAWINGML|XML_ea: // CT_TextFont + case A_TOKEN( ea ): // CT_TextFont mrTableStylePart.getAsianFont().setAttributes( aAttribs ); return 0; - case NMSP_DRAWINGML|XML_cs: // CT_TextFont + case A_TOKEN( cs ): // CT_TextFont mrTableStylePart.getComplexFont().setAttributes( aAttribs ); return 0; - case NMSP_DRAWINGML|XML_sym: // CT_TextFont + case A_TOKEN( sym ): // CT_TextFont mrTableStylePart.getSymbolFont().setAttributes( aAttribs ); return 0; - case NMSP_DRAWINGML|XML_latin: // CT_TextFont + case A_TOKEN( latin ): // CT_TextFont mrTableStylePart.getLatinFont().setAttributes( aAttribs ); return 0; - case NMSP_DRAWINGML|XML_fontRef: // CT_FontReference + case A_TOKEN( fontRef ): // CT_FontReference { ShapeStyleRef& rFontStyle = mrTableStylePart.getStyleRefs()[ XML_fontRef ]; rFontStyle.mnThemedIdx = aAttribs.getToken( XML_idx, XML_none ); @@ -97,7 +96,7 @@ TableStyleTextStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c } break; - case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList + case A_TOKEN( extLst ): // CT_OfficeArtExtensionList break; } if( !xRet.is() ) diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx index 8de730849b24..8d695e295fd4 100644 --- a/oox/source/drawingml/textbodycontext.cxx +++ b/oox/source/drawingml/textbodycontext.cxx @@ -33,8 +33,6 @@ #include "oox/drawingml/textliststylecontext.hxx" #include "oox/drawingml/textfield.hxx" #include "oox/drawingml/textfieldcontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -69,7 +67,7 @@ TextParagraphContext::TextParagraphContext( ContextHandler& rParent, TextParagra // -------------------------------------------------------------------- void TextParagraphContext::endFastElement( sal_Int32 aElementToken ) throw (SAXException, RuntimeException) { - if( aElementToken == (NMSP_DRAWINGML|XML_p) ) + if( aElementToken == (A_TOKEN( p )) ) { } } @@ -83,14 +81,14 @@ Reference< XFastContextHandler > TextParagraphContext::createFastChildContext( s // EG_TextRun switch( aElementToken ) { - case NMSP_DRAWINGML|XML_r: // "CT_RegularTextRun" Regular Text Run. + case A_TOKEN( r ): // "CT_RegularTextRun" Regular Text Run. { TextRunPtr pRun( new TextRun ); mrParagraph.addRun( pRun ); xRet.set( new RegularTextRunContext( *this, pRun ) ); break; } - case NMSP_DRAWINGML|XML_br: // "CT_TextLineBreak" Soft return line break (vertical tab). + case A_TOKEN( br ): // "CT_TextLineBreak" Soft return line break (vertical tab). { TextRunPtr pRun( new TextRun ); pRun->setLineBreak(); @@ -98,17 +96,17 @@ Reference< XFastContextHandler > TextParagraphContext::createFastChildContext( s xRet.set( new RegularTextRunContext( *this, pRun ) ); break; } - case NMSP_DRAWINGML|XML_fld: // "CT_TextField" Text Field. + case A_TOKEN( fld ): // "CT_TextField" Text Field. { TextFieldPtr pField( new TextField ); mrParagraph.addRun( pField ); xRet.set( new TextFieldContext( *this, xAttribs, *pField ) ); break; } - case NMSP_DRAWINGML|XML_pPr: + case A_TOKEN( pPr ): xRet.set( new TextParagraphPropertiesContext( *this, xAttribs, mrParagraph.getProperties() ) ); break; - case NMSP_DRAWINGML|XML_endParaRPr: + case A_TOKEN( endParaRPr ): xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mrParagraph.getEndProperties() ) ); break; } @@ -130,12 +128,12 @@ void RegularTextRunContext::endFastElement( sal_Int32 aElementToken ) throw (SAX { switch( aElementToken ) { - case NMSP_DRAWINGML|XML_t: + case A_TOKEN( t ): { mbIsInText = false; break; } - case NMSP_DRAWINGML|XML_r: + case A_TOKEN( r ): { break; } @@ -161,10 +159,10 @@ Reference< XFastContextHandler > RegularTextRunContext::createFastChildContext( switch( aElementToken ) { - case NMSP_DRAWINGML|XML_rPr: // "CT_TextCharPropertyBag" The text char properties of this text run. + case A_TOKEN( rPr ): // "CT_TextCharPropertyBag" The text char properties of this text run. xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mpRunPtr->getTextCharacterProperties() ) ); break; - case NMSP_DRAWINGML|XML_t: // "xsd:string" minOccurs="1" The actual text string. + case A_TOKEN( t ): // "xsd:string" minOccurs="1" The actual text string. mbIsInText = true; break; } @@ -194,13 +192,13 @@ Reference< XFastContextHandler > TextBodyContext::createFastChildContext( sal_In switch( aElementToken ) { - case NMSP_DRAWINGML|XML_bodyPr: // CT_TextBodyPropertyBag + case A_TOKEN( bodyPr ): // CT_TextBodyPropertyBag xRet.set( new TextBodyPropertiesContext( *this, xAttribs, mrTextBody.getTextProperties() ) ); break; - case NMSP_DRAWINGML|XML_lstStyle: // CT_TextListStyle + case A_TOKEN( lstStyle ): // CT_TextListStyle xRet.set( new TextListStyleContext( *this, mrTextBody.getTextListStyle() ) ); break; - case NMSP_DRAWINGML|XML_p: // CT_TextParagraph + case A_TOKEN( p ): // CT_TextParagraph xRet.set( new TextParagraphContext( *this, mrTextBody.addParagraph() ) ); break; } diff --git a/oox/source/drawingml/textbodyproperties.cxx b/oox/source/drawingml/textbodyproperties.cxx index 6cec7643e58e..4339c93aa0ae 100644 --- a/oox/source/drawingml/textbodyproperties.cxx +++ b/oox/source/drawingml/textbodyproperties.cxx @@ -27,8 +27,7 @@ #include "oox/drawingml/textbodyproperties.hxx" #include -#include "properties.hxx" -#include "tokens.hxx" +#include "oox/token/tokens.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 668266f2f679..f22258075e16 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -36,9 +36,6 @@ #include "oox/drawingml/drawingmltypes.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/core/namespaces.hxx" -#include "properties.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -156,27 +153,27 @@ Reference< XFastContextHandler > TextBodyPropertiesContext::createFastChildConte switch( aElementToken ) { // Sequence - case NMSP_DRAWINGML|XML_prstTxWarp: // CT_PresetTextShape - case NMSP_DRAWINGML|XML_prot: // CT_TextProtectionProperty + case A_TOKEN( prstTxWarp ): // CT_PresetTextShape + case A_TOKEN( prot ): // CT_TextProtectionProperty break; // EG_TextAutofit - case NMSP_DRAWINGML|XML_noAutofit: + case A_TOKEN( noAutofit ): mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= false; // CT_TextNoAutofit break; - case NMSP_DRAWINGML|XML_normAutofit: // CT_TextNormalAutofit + case A_TOKEN( normAutofit ): // CT_TextNormalAutofit mrTextBodyProp.maPropertyMap[ PROP_TextFitToSize ] <<= true; mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= false; break; - case NMSP_DRAWINGML|XML_spAutoFit: + case A_TOKEN( spAutoFit ): mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= true; break; - case NMSP_DRAWINGML|XML_scene3d: // CT_Scene3D + case A_TOKEN( scene3d ): // CT_Scene3D // EG_Text3D - case NMSP_DRAWINGML|XML_sp3d: // CT_Shape3D - case NMSP_DRAWINGML|XML_flatTx: // CT_FlatText + case A_TOKEN( sp3d ): // CT_Shape3D + case A_TOKEN( flatTx ): // CT_FlatText break; } diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index 3ac5018c1dad..c55751ba25f6 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -33,8 +33,7 @@ #include "oox/helper/propertyset.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/drawingmltypes.hxx" -#include "properties.hxx" -#include "tokens.hxx" +#include "oox/token/tokens.hxx" using ::rtl::OUString; using ::oox::core::XmlFilterBase; diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx index cfba04a7b44b..f3be44773a39 100644 --- a/oox/source/drawingml/textcharacterpropertiescontext.cxx +++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx @@ -32,10 +32,8 @@ #include "oox/drawingml/colorchoicecontext.hxx" #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/textparagraphproperties.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/relations.hxx" #include "hyperlinkcontext.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -76,21 +74,21 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext( // ST_TextNonNegativePoint const OUString sCharKerning( CREATE_OUSTRING( "CharKerning" ) ); - //case NMSP_DRAWINGML|XML_kern: + //case A_TOKEN( kern ): // ST_TextLanguageID OUString sAltLang = rXAttributes->getOptionalValue( XML_altLang ); - case NMSP_DRAWINGML|XML_kumimoji: // xsd:boolean + case A_TOKEN( kumimoji ): // xsd:boolean break; - case NMSP_DRAWINGML|XML_spc: // ST_TextPoint - case NMSP_DRAWINGML|XML_normalizeH: // xsd:boolean - case NMSP_DRAWINGML|XML_baseline: // ST_Percentage - case NMSP_DRAWINGML|XML_noProof: // xsd:boolean - case NMSP_DRAWINGML|XML_dirty: // xsd:boolean - case NMSP_DRAWINGML|XML_err: // xsd:boolean - case NMSP_DRAWINGML|XML_smtClean: // xsd:boolean - case NMSP_DRAWINGML|XML_smtId: // xsd:unsignedInt + case A_TOKEN( spc ): // ST_TextPoint + case A_TOKEN( normalizeH ): // xsd:boolean + case A_TOKEN( baseline ): // ST_Percentage + case A_TOKEN( noProof ): // xsd:boolean + case A_TOKEN( dirty ): // xsd:boolean + case A_TOKEN( err ): // xsd:boolean + case A_TOKEN( smtClean ): // xsd:boolean + case A_TOKEN( smtId ): // xsd:unsignedInt break; */ @@ -115,56 +113,56 @@ Reference< XFastContextHandler > TextCharacterPropertiesContext::createFastChild switch( aElementToken ) { // TODO unsupported yet -// case NMSP_DRAWINGML|XML_ln: // CT_LineProperties +// case A_TOKEN( ln ): // CT_LineProperties // xRet.set( new LinePropertiesContext( getHandler(), xAttributes, maTextOutlineProperties ) ); // break; - case NMSP_DRAWINGML|XML_solidFill: // EG_FillProperties + case A_TOKEN( solidFill ): // EG_FillProperties xRet.set( new ColorContext( *this, mrTextCharacterProperties.maCharColor ) ); break; // EG_EffectProperties - case NMSP_DRAWINGML|XML_effectDag: // CT_EffectContainer 5.1.10.25 - case NMSP_DRAWINGML|XML_effectLst: // CT_EffectList 5.1.10.26 + case A_TOKEN( effectDag ): // CT_EffectContainer 5.1.10.25 + case A_TOKEN( effectLst ): // CT_EffectList 5.1.10.26 break; - case NMSP_DRAWINGML|XML_highlight: // CT_Color + case A_TOKEN( highlight ): // CT_Color xRet.set( new ColorContext( *this, mrTextCharacterProperties.maHighlightColor ) ); break; // EG_TextUnderlineLine - case NMSP_DRAWINGML|XML_uLnTx: // CT_TextUnderlineLineFollowText + case A_TOKEN( uLnTx ): // CT_TextUnderlineLineFollowText mrTextCharacterProperties.moUnderlineLineFollowText = true; break; // TODO unsupported yet -// case NMSP_DRAWINGML|XML_uLn: // CT_LineProperties +// case A_TOKEN( uLn ): // CT_LineProperties // xRet.set( new LinePropertiesContext( getHandler(), xAttributes, maUnderlineProperties ) ); // break; // EG_TextUnderlineFill - case NMSP_DRAWINGML|XML_uFillTx: // CT_TextUnderlineFillFollowText + case A_TOKEN( uFillTx ): // CT_TextUnderlineFillFollowText mrTextCharacterProperties.moUnderlineFillFollowText = true; break; - case NMSP_DRAWINGML|XML_uFill: // CT_TextUnderlineFillGroupWrapper->EG_FillProperties (not supported) + case A_TOKEN( uFill ): // CT_TextUnderlineFillGroupWrapper->EG_FillProperties (not supported) xRet.set( new SimpleFillPropertiesContext( *this, mrTextCharacterProperties.maUnderlineColor ) ); break; // CT_FontCollection - case NMSP_DRAWINGML|XML_latin: // CT_TextFont + case A_TOKEN( latin ): // CT_TextFont mrTextCharacterProperties.maLatinFont.setAttributes( aAttribs ); break; - case NMSP_DRAWINGML|XML_ea: // CT_TextFont + case A_TOKEN( ea ): // CT_TextFont mrTextCharacterProperties.maAsianFont.setAttributes( aAttribs ); break; - case NMSP_DRAWINGML|XML_cs: // CT_TextFont + case A_TOKEN( cs ): // CT_TextFont mrTextCharacterProperties.maComplexFont.setAttributes( aAttribs ); break; - case NMSP_DRAWINGML|XML_sym: // CT_TextFont + case A_TOKEN( sym ): // CT_TextFont mrTextCharacterProperties.maSymbolFont.setAttributes( aAttribs ); break; - case NMSP_DRAWINGML|XML_hlinkClick: // CT_Hyperlink - case NMSP_DRAWINGML|XML_hlinkMouseOver: // CT_Hyperlink + case A_TOKEN( hlinkClick ): // CT_Hyperlink + case A_TOKEN( hlinkMouseOver ): // CT_Hyperlink xRet.set( new HyperLinkContext( *this, xAttributes, mrTextCharacterProperties.maHyperlinkPropertyMap ) ); break; } diff --git a/oox/source/drawingml/textfieldcontext.cxx b/oox/source/drawingml/textfieldcontext.cxx index 2c993af562bf..4e9f576a0ca9 100644 --- a/oox/source/drawingml/textfieldcontext.cxx +++ b/oox/source/drawingml/textfieldcontext.cxx @@ -29,8 +29,6 @@ #include "oox/drawingml/textparagraphpropertiescontext.hxx" #include "oox/drawingml/textcharacterpropertiescontext.hxx" #include "oox/drawingml/textfield.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -52,7 +50,7 @@ TextFieldContext::TextFieldContext( ContextHandler& rParent, void TextFieldContext::endFastElement( sal_Int32 aElementToken ) throw (SAXException, RuntimeException) { - if( aElementToken == (NMSP_DRAWINGML|XML_t) ) + if( aElementToken == (A_TOKEN( t )) ) { mbIsInText = false; } @@ -72,13 +70,13 @@ Reference< XFastContextHandler > TextFieldContext::createFastChildContext( sal_I Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_DRAWINGML|XML_rPr: + case A_TOKEN( rPr ): xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mrTextField.getTextCharacterProperties() ) ); break; - case NMSP_DRAWINGML|XML_pPr: + case A_TOKEN( pPr ): xRet.set( new TextParagraphPropertiesContext( *this, xAttribs, mrTextField.getTextParagraphProperties() ) ); break; - case NMSP_DRAWINGML|XML_t: + case A_TOKEN( t ): mbIsInText = true; break; } diff --git a/oox/source/drawingml/textfont.cxx b/oox/source/drawingml/textfont.cxx index 8d58787e544a..b4f9d359fb14 100644 --- a/oox/source/drawingml/textfont.cxx +++ b/oox/source/drawingml/textfont.cxx @@ -31,7 +31,6 @@ #include "oox/drawingml/theme.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" using ::rtl::OUString; using ::oox::core::XmlFilterBase; diff --git a/oox/source/drawingml/textliststylecontext.cxx b/oox/source/drawingml/textliststylecontext.cxx index 693957490579..21afc698d730 100644 --- a/oox/source/drawingml/textliststylecontext.cxx +++ b/oox/source/drawingml/textliststylecontext.cxx @@ -27,9 +27,7 @@ #include "oox/drawingml/textliststylecontext.hxx" #include "oox/drawingml/textparagraphpropertiescontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -64,40 +62,40 @@ Reference< XFastContextHandler > TextListStyleContext::createFastChildContext( s Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_DRAWINGML|XML_defPPr: // CT_TextParagraphProperties + case A_TOKEN( defPPr ): // CT_TextParagraphProperties xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 0 ] ) ); break; - case NMSP_DRAWINGML|XML_outline1pPr: + case A_TOKEN( outline1pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getAggregationListStyle()[ 0 ] ) ); break; - case NMSP_DRAWINGML|XML_outline2pPr: + case A_TOKEN( outline2pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getAggregationListStyle()[ 1 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl1pPr: + case A_TOKEN( lvl1pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 0 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl2pPr: + case A_TOKEN( lvl2pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 1 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl3pPr: + case A_TOKEN( lvl3pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 2 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl4pPr: + case A_TOKEN( lvl4pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 3 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl5pPr: + case A_TOKEN( lvl5pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 4 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl6pPr: + case A_TOKEN( lvl6pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 5 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl7pPr: + case A_TOKEN( lvl7pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 6 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl8pPr: + case A_TOKEN( lvl8pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 7 ] ) ); break; - case NMSP_DRAWINGML|XML_lvl9pPr: + case A_TOKEN( lvl9pPr ): xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 8 ] ) ); break; } diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx index 2f5954168d37..cd969874513e 100644 --- a/oox/source/drawingml/textparagraphproperties.cxx +++ b/oox/source/drawingml/textparagraphproperties.cxx @@ -37,11 +37,8 @@ #include "oox/helper/helper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/drawingmltypes.hxx" -#include "properties.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx index 3c41fef69a76..eb888867556b 100644 --- a/oox/source/drawingml/textparagraphpropertiescontext.cxx +++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx @@ -34,11 +34,8 @@ #include "oox/drawingml/textcharacterpropertiescontext.hxx" #include "oox/drawingml/fillproperties.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" -#include "properties.hxx" #include "textspacingcontext.hxx" #include "texttabstoplistcontext.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -187,49 +184,49 @@ Reference< XFastContextHandler > TextParagraphPropertiesContext::createFastChild Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_DRAWINGML|XML_lnSpc: // CT_TextSpacing + case A_TOKEN( lnSpc ): // CT_TextSpacing xRet.set( new TextSpacingContext( *this, maLineSpacing ) ); break; - case NMSP_DRAWINGML|XML_spcBef: // CT_TextSpacing + case A_TOKEN( spcBef ): // CT_TextSpacing xRet.set( new TextSpacingContext( *this, mrSpaceBefore ) ); break; - case NMSP_DRAWINGML|XML_spcAft: // CT_TextSpacing + case A_TOKEN( spcAft ): // CT_TextSpacing xRet.set( new TextSpacingContext( *this, mrSpaceAfter ) ); break; // EG_TextBulletColor - case NMSP_DRAWINGML|XML_buClrTx: // CT_TextBulletColorFollowText ??? + case A_TOKEN( buClrTx ): // CT_TextBulletColorFollowText ??? mrBulletList.mbBulletColorFollowText <<= sal_True; break; - case NMSP_DRAWINGML|XML_buClr: // CT_Color + case A_TOKEN( buClr ): // CT_Color xRet.set( new ColorContext( *this, *mrBulletList.maBulletColorPtr ) ); break; // EG_TextBulletSize - case NMSP_DRAWINGML|XML_buSzTx: // CT_TextBulletSizeFollowText + case A_TOKEN( buSzTx ): // CT_TextBulletSizeFollowText mrBulletList.setBulletSize(100); break; - case NMSP_DRAWINGML|XML_buSzPct: // CT_TextBulletSizePercent + case A_TOKEN( buSzPct ): // CT_TextBulletSizePercent mrBulletList.setBulletSize( static_cast( GetPercent( rXAttributes->getOptionalValue( XML_val ) ) / 1000 ) ); break; - case NMSP_DRAWINGML|XML_buSzPts: // CT_TextBulletSizePoint + case A_TOKEN( buSzPts ): // CT_TextBulletSizePoint mrBulletList.setBulletSize(0); mrBulletList.setFontSize( static_cast(GetTextSize( rXAttributes->getOptionalValue( XML_val ) ) ) ); break; // EG_TextBulletTypeface - case NMSP_DRAWINGML|XML_buFontTx: // CT_TextBulletTypefaceFollowText + case A_TOKEN( buFontTx ): // CT_TextBulletTypefaceFollowText mrBulletList.mbBulletFontFollowText <<= sal_True; break; - case NMSP_DRAWINGML|XML_buFont: // CT_TextFont + case A_TOKEN( buFont ): // CT_TextFont mrBulletList.maBulletFont.setAttributes( aAttribs ); break; // EG_TextBullet - case NMSP_DRAWINGML|XML_buNone: // CT_TextNoBullet + case A_TOKEN( buNone ): // CT_TextNoBullet mrBulletList.setNone(); break; - case NMSP_DRAWINGML|XML_buAutoNum: // CT_TextAutonumberBullet + case A_TOKEN( buAutoNum ): // CT_TextAutonumberBullet { AttributeList attribs( rXAttributes ); try { @@ -252,7 +249,7 @@ Reference< XFastContextHandler > TextParagraphPropertiesContext::createFastChild } break; } - case NMSP_DRAWINGML|XML_buChar: // CT_TextCharBullet + case A_TOKEN( buChar ): // CT_TextCharBullet try { mrBulletList.setBulletChar( rXAttributes->getValue( XML_char ) ); } @@ -261,17 +258,17 @@ Reference< XFastContextHandler > TextParagraphPropertiesContext::createFastChild OSL_TRACE("OOX: SAXException in XML_buChar"); } break; - case NMSP_DRAWINGML|XML_buBlip: // CT_TextBlipBullet + case A_TOKEN( buBlip ): // CT_TextBlipBullet { mxBlipProps.reset( new BlipFillProperties ); xRet.set( new BlipFillContext( *this, rXAttributes, *mxBlipProps ) ); } break; - case NMSP_DRAWINGML|XML_tabLst: // CT_TextTabStopList + case A_TOKEN( tabLst ): // CT_TextTabStopList xRet.set( new TextTabStopListContext( *this, maTabList ) ); break; - case NMSP_DRAWINGML|XML_defRPr: // CT_TextCharacterProperties + case A_TOKEN( defRPr ): // CT_TextCharacterProperties xRet.set( new TextCharacterPropertiesContext( *this, rXAttributes, mrTextParagraphProperties.getTextCharacterProperties() ) ); break; } diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx index aa74d767a7ad..944e17691c56 100644 --- a/oox/source/drawingml/textrun.cxx +++ b/oox/source/drawingml/textrun.cxx @@ -35,7 +35,6 @@ #include "oox/helper/helper.hxx" #include "oox/helper/propertyset.hxx" #include "oox/core/xmlfilterbase.hxx" -#include "properties.hxx" using ::rtl::OUString; using namespace ::com::sun::star::uno; diff --git a/oox/source/drawingml/textspacingcontext.cxx b/oox/source/drawingml/textspacingcontext.cxx index 6bc6b79497d6..5eb5f3d77f82 100644 --- a/oox/source/drawingml/textspacingcontext.cxx +++ b/oox/source/drawingml/textspacingcontext.cxx @@ -27,10 +27,7 @@ #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/textspacing.hxx" -#include "oox/core/namespaces.hxx" #include "textspacingcontext.hxx" -#include "tokens.hxx" - using namespace ::oox::core; using namespace ::com::sun::star::xml::sax; @@ -52,17 +49,17 @@ namespace oox { namespace drawingml { } Reference< XFastContextHandler > TextSpacingContext::createFastChildContext( ::sal_Int32 aElement, - const Reference< XFastAttributeList >& xAttribs ) + const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException ) { Reference< XFastContextHandler > xRet; switch( aElement ) { - case NMSP_DRAWINGML|XML_spcPct: + case A_TOKEN( spcPct ): maSpacing.nUnit = TextSpacing::PERCENT; maSpacing.nValue = GetPercent( xAttribs->getValue( XML_val ) ); break; - case NMSP_DRAWINGML|XML_spcPts: + case A_TOKEN( spcPts ): maSpacing.nUnit = TextSpacing::POINTS; maSpacing.nValue = GetTextSpacingPoint( xAttribs->getValue( XML_val ) ); break; diff --git a/oox/source/drawingml/texttabstoplistcontext.cxx b/oox/source/drawingml/texttabstoplistcontext.cxx index 1a8affa898bb..78248fd0b6f7 100644 --- a/oox/source/drawingml/texttabstoplistcontext.cxx +++ b/oox/source/drawingml/texttabstoplistcontext.cxx @@ -30,10 +30,8 @@ #include -#include "oox/core/namespaces.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "texttabstoplistcontext.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -66,7 +64,7 @@ namespace oox { namespace drawingml { Reference< XFastContextHandler > xRet; switch( aElement ) { - case NMSP_DRAWINGML|XML_tab: + case A_TOKEN( tab ): { OUString sValue; TabStop aTabStop; diff --git a/oox/source/drawingml/theme.cxx b/oox/source/drawingml/theme.cxx index 59245201eb61..b37ccdbaf13c 100644 --- a/oox/source/drawingml/theme.cxx +++ b/oox/source/drawingml/theme.cxx @@ -26,7 +26,6 @@ ************************************************************************/ #include "oox/drawingml/theme.hxx" -#include "tokens.hxx" using ::rtl::OUString; diff --git a/oox/source/drawingml/themeelementscontext.cxx b/oox/source/drawingml/themeelementscontext.cxx index 7e8b5177498f..a27afdbc0ea3 100644 --- a/oox/source/drawingml/themeelementscontext.cxx +++ b/oox/source/drawingml/themeelementscontext.cxx @@ -32,9 +32,7 @@ #include "oox/drawingml/fillproperties.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/theme.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -67,12 +65,12 @@ Reference< XFastContextHandler > FillStyleListContext::createFastChildContext( s { switch( nElement ) { - case NMSP_DRAWINGML|XML_noFill: - case NMSP_DRAWINGML|XML_solidFill: - case NMSP_DRAWINGML|XML_gradFill: - case NMSP_DRAWINGML|XML_blipFill: - case NMSP_DRAWINGML|XML_pattFill: - case NMSP_DRAWINGML|XML_grpFill: + case A_TOKEN( noFill ): + case A_TOKEN( solidFill ): + case A_TOKEN( gradFill ): + case A_TOKEN( blipFill ): + case A_TOKEN( pattFill ): + case A_TOKEN( grpFill ): mrFillStyleList.push_back( FillPropertiesPtr( new FillProperties ) ); return FillPropertiesContext::createFillContext( *this, nElement, xAttribs, *mrFillStyleList.back() ); } @@ -102,7 +100,7 @@ Reference< XFastContextHandler > LineStyleListContext::createFastChildContext( s { switch( nElement ) { - case NMSP_DRAWINGML|XML_ln: + case A_TOKEN( ln ): mrLineStyleList.push_back( LinePropertiesPtr( new LineProperties ) ); return new LinePropertiesContext( *this, xAttribs, *mrLineStyleList.back() ); } @@ -131,7 +129,7 @@ Reference< XFastContextHandler > EffectStyleListContext::createFastChildContext( { switch( nElement ) { - case NMSP_DRAWINGML|XML_effectStyle: + case A_TOKEN( effectStyle ): mrEffectStyleList.push_back( EffectStyleList::value_type( new PropertyMap ) ); // TODO: import effect styles return 0; @@ -165,24 +163,24 @@ Reference< XFastContextHandler > FontSchemeContext::createFastChildContext( sal_ AttributeList aAttribs( rxAttribs ); switch( nElement ) { - case NMSP_DRAWINGML|XML_majorFont: + case A_TOKEN( majorFont ): mxCharProps.reset( new TextCharacterProperties ); mrFontScheme[ XML_major ] = mxCharProps; return this; - case NMSP_DRAWINGML|XML_minorFont: + case A_TOKEN( minorFont ): mxCharProps.reset( new TextCharacterProperties ); mrFontScheme[ XML_minor ] = mxCharProps; return this; - case NMSP_DRAWINGML|XML_latin: + case A_TOKEN( latin ): if( mxCharProps.get() ) mxCharProps->maLatinFont.setAttributes( aAttribs ); break; - case NMSP_DRAWINGML|XML_ea: + case A_TOKEN( ea ): if( mxCharProps.get() ) mxCharProps->maAsianFont.setAttributes( aAttribs ); break; - case NMSP_DRAWINGML|XML_cs: + case A_TOKEN( cs ): if( mxCharProps.get() ) mxCharProps->maComplexFont.setAttributes( aAttribs ); break; @@ -194,8 +192,8 @@ void FontSchemeContext::endFastElement( sal_Int32 nElement ) throw (SAXException { switch( nElement ) { - case NMSP_DRAWINGML|XML_majorFont: - case NMSP_DRAWINGML|XML_minorFont: + case A_TOKEN( majorFont ): + case A_TOKEN( minorFont ): mxCharProps.reset(); break; } @@ -215,22 +213,22 @@ Reference< XFastContextHandler > ThemeElementsContext::createFastChildContext( s Reference< XFastContextHandler > xRet; switch( nElement ) { - case NMSP_DRAWINGML|XML_clrScheme: // CT_ColorScheme + case A_TOKEN( clrScheme ): // CT_ColorScheme return new clrSchemeContext( *this, mrTheme.getClrScheme() ); - case NMSP_DRAWINGML|XML_fontScheme: // CT_FontScheme + case A_TOKEN( fontScheme ): // CT_FontScheme return new FontSchemeContext( *this, mrTheme.getFontScheme() ); - case NMSP_DRAWINGML|XML_fmtScheme: // CT_StyleMatrix + case A_TOKEN( fmtScheme ): // CT_StyleMatrix mrTheme.setStyleName( xAttribs->getOptionalValue( XML_name ) ); return this; - case NMSP_DRAWINGML|XML_fillStyleLst: // CT_FillStyleList + case A_TOKEN( fillStyleLst ): // CT_FillStyleList return new FillStyleListContext( *this, mrTheme.getFillStyleList() ); - case NMSP_DRAWINGML|XML_lnStyleLst: // CT_LineStyleList + case A_TOKEN( lnStyleLst ): // CT_LineStyleList return new LineStyleListContext( *this, mrTheme.getLineStyleList() ); - case NMSP_DRAWINGML|XML_effectStyleLst: // CT_EffectStyleList + case A_TOKEN( effectStyleLst ): // CT_EffectStyleList return new EffectStyleListContext( *this, mrTheme.getEffectStyleList() ); - case NMSP_DRAWINGML|XML_bgFillStyleLst: // CT_BackgroundFillStyleList + case A_TOKEN( bgFillStyleLst ): // CT_BackgroundFillStyleList return new FillStyleListContext( *this, mrTheme.getBgFillStyleList() ); } return 0; diff --git a/oox/source/drawingml/themefragmenthandler.cxx b/oox/source/drawingml/themefragmenthandler.cxx index 160db1881a25..3cae10e40b4f 100644 --- a/oox/source/drawingml/themefragmenthandler.cxx +++ b/oox/source/drawingml/themefragmenthandler.cxx @@ -56,23 +56,23 @@ ContextHandlerRef ThemeFragmentHandler::onCreateContext( sal_Int32 nElement, con case XML_ROOT_CONTEXT: switch( nElement ) { - case NMSP_DRAWINGML|XML_theme: + case A_TOKEN( theme ): return this; } break; - case NMSP_DRAWINGML|XML_theme: + case A_TOKEN( theme ): switch( nElement ) { - case NMSP_DRAWINGML|XML_themeElements: // CT_BaseStyles + case A_TOKEN( themeElements ): // CT_BaseStyles return new ThemeElementsContext( *this, mrTheme ); - case NMSP_DRAWINGML|XML_objectDefaults: // CT_ObjectStyleDefaults + case A_TOKEN( objectDefaults ): // CT_ObjectStyleDefaults return new objectDefaultContext( *this, mrTheme ); - case NMSP_DRAWINGML|XML_extraClrSchemeLst: // CT_ColorSchemeList + case A_TOKEN( extraClrSchemeLst ): // CT_ColorSchemeList return 0; - case NMSP_DRAWINGML|XML_custClrLst: // CustomColorList + case A_TOKEN( custClrLst ): // CustomColorList return 0; - case NMSP_DRAWINGML|XML_ext: // CT_OfficeArtExtension + case A_TOKEN( ext ): // CT_OfficeArtExtension return 0; } break; diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx index 43748bd1089a..c686feed165c 100644 --- a/oox/source/drawingml/transform2dcontext.cxx +++ b/oox/source/drawingml/transform2dcontext.cxx @@ -26,7 +26,6 @@ ************************************************************************/ #include "oox/drawingml/transform2dcontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" #include "oox/drawingml/shape.hxx" @@ -58,15 +57,15 @@ Reference< XFastContextHandler > Transform2DContext::createFastChildContext( sal { switch( aElementToken ) { - case NMSP_DRAWINGML|XML_off: // horz/vert translation + case A_TOKEN( off ): // horz/vert translation mrShape.setPosition( Point( xAttribs->getOptionalValue( XML_x ).toInt32(), xAttribs->getOptionalValue( XML_y ).toInt32() ) ); break; - case NMSP_DRAWINGML|XML_ext: // horz/vert size + case A_TOKEN( ext ): // horz/vert size mrShape.setSize( Size( xAttribs->getOptionalValue( XML_cx ).toInt32(), xAttribs->getOptionalValue( XML_cy ).toInt32() ) ); break; /* todo: what to do? - case NMSP_DRAWINGML|XML_chOff: // horz/vert translation of children - case NMSP_DRAWINGML|XML_chExt: // horz/vert size of children + case A_TOKEN( chOff ): // horz/vert translation of children + case A_TOKEN( chExt ): // horz/vert size of children break; */ } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 5aeb56883d2d..85ef2519f029 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -25,7 +25,6 @@ * ************************************************************************/ -#include "tokens.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/export/drawingml.hxx" #include "oox/export/utils.hxx" diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index d33572230f1d..0d07e6cf5226 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -25,7 +25,6 @@ * ************************************************************************/ -#include "tokens.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/export/shapes.hxx" #include "oox/export/utils.hxx" diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx index dc95cf71ee35..abd8ae826243 100644 --- a/oox/source/helper/graphichelper.cxx +++ b/oox/source/helper/graphichelper.cxx @@ -36,8 +36,8 @@ #include #include #include -#include "tokens.hxx" #include "oox/helper/containerhelper.hxx" +#include "oox/token/tokens.hxx" namespace oox { diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx index 49a3547682b4..0c4e2cb07549 100644 --- a/oox/source/helper/propertymap.cxx +++ b/oox/source/helper/propertymap.cxx @@ -32,8 +32,7 @@ #include #include #include -#include "properties.hxx" -#include "oox/token/propertylist.hxx" +#include "oox/token/propertynames.hxx" namespace oox { @@ -50,19 +49,14 @@ using ::rtl::OUString; namespace { -/** Thread-save singleton of a vector of all supported property names. */ -struct StaticPropertyList : public ::rtl::Static< PropertyList, StaticPropertyList > {}; - -// ---------------------------------------------------------------------------- - -typedef ::cppu::WeakImplHelper2< XPropertySet, XPropertySetInfo > GenericPropertySetImplBase; +typedef ::cppu::WeakImplHelper2< XPropertySet, XPropertySetInfo > GenericPropertySetBase; /** This class implements a generic XPropertySet. Properties of all names and types can be set and later retrieved. TODO: move this to comphelper or better find an existing implementation */ -class GenericPropertySet : public GenericPropertySetImplBase, private ::osl::Mutex +class GenericPropertySet : public GenericPropertySetBase, private ::osl::Mutex { public: explicit GenericPropertySet(); @@ -95,7 +89,7 @@ GenericPropertySet::GenericPropertySet() GenericPropertySet::GenericPropertySet( const PropertyMap& rPropMap ) { - const PropertyList& rPropNames = StaticPropertyList::get(); + const PropertyNameVector& rPropNames = StaticPropertyNameVector::get(); for( PropertyMap::const_iterator aIt = rPropMap.begin(), aEnd = rPropMap.end(); aIt != aEnd; ++aIt ) maPropMap[ rPropNames[ aIt->first ] ] = aIt->second; } @@ -163,7 +157,7 @@ sal_Bool SAL_CALL GenericPropertySet::hasPropertyByName( const OUString& rProper // ============================================================================ PropertyMap::PropertyMap() : - mpPropNames( &StaticPropertyList::get() ) + mpPropNames( &StaticPropertyNameVector::get() ) // pointer instead reference to get compiler generated copy c'tor and operator= { } @@ -174,7 +168,7 @@ PropertyMap::~PropertyMap() /*static*/ const OUString& PropertyMap::getPropertyName( sal_Int32 nPropId ) { OSL_ENSURE( (0 <= nPropId) && (nPropId < PROP_COUNT), "PropertyMap::getPropertyName - invalid property identifier" ); - return StaticPropertyList::get()[ nPropId ]; + return StaticPropertyNameVector::get()[ nPropId ]; } const Any* PropertyMap::getProperty( sal_Int32 nPropId ) const diff --git a/oox/source/ole/axbinaryreader.cxx b/oox/source/ole/axbinaryreader.cxx old mode 100755 new mode 100644 index 0c4743be9e31..493d6b68c6ff --- a/oox/source/ole/axbinaryreader.cxx +++ b/oox/source/ole/axbinaryreader.cxx @@ -26,15 +26,18 @@ ************************************************************************/ #include "oox/ole/axbinaryreader.hxx" -#include "oox/ole/olehelper.hxx" -using ::rtl::OUString; +#include "oox/ole/olehelper.hxx" namespace oox { namespace ole { // ============================================================================ +using ::rtl::OUString; + +// ============================================================================ + namespace { const sal_uInt32 AX_STRING_SIZEMASK = 0x7FFFFFFF; @@ -343,4 +346,3 @@ bool AxBinaryPropertyReader::startNextProperty() } // namespace ole } // namespace oox - diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index a0d3d7340f57..105f5deea225 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -59,8 +59,6 @@ #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace ole { diff --git a/oox/source/ole/axcontrolfragment.cxx b/oox/source/ole/axcontrolfragment.cxx index 8eed69b125bb..f45e8e2590c9 100644 --- a/oox/source/ole/axcontrolfragment.cxx +++ b/oox/source/ole/axcontrolfragment.cxx @@ -26,23 +26,27 @@ ************************************************************************/ #include "oox/ole/axcontrolfragment.hxx" + +#include "oox/core/xmlfilterbase.hxx" #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/binaryoutputstream.hxx" -#include "oox/core/xmlfilterbase.hxx" #include "oox/ole/axcontrol.hxx" #include "oox/ole/olehelper.hxx" #include "oox/ole/olestorage.hxx" -using ::rtl::OUString; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::uno::Reference; +namespace oox { +namespace ole { + +// ============================================================================ + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + using ::oox::core::ContextHandler2; using ::oox::core::ContextHandlerRef; using ::oox::core::FragmentHandler2; using ::oox::core::XmlFilterBase; - -namespace oox { -namespace ole { +using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx index 8952350c8589..8dfe02283cb0 100644 --- a/oox/source/ole/olehelper.cxx +++ b/oox/source/ole/olehelper.cxx @@ -26,19 +26,22 @@ ************************************************************************/ #include "oox/ole/olehelper.hxx" + #include -#include "tokens.hxx" #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/graphichelper.hxx" - -using ::rtl::OUString; -using ::rtl::OUStringBuffer; +#include "oox/token/tokens.hxx" namespace oox { namespace ole { // ============================================================================ +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +// ============================================================================ + namespace { const sal_uInt32 OLE_COLORTYPE_MASK = 0xFF000000; @@ -308,4 +311,3 @@ StdFontInfo::StdFontInfo( const ::rtl::OUString& rName, sal_uInt32 nHeight, } // namespace ole } // namespace oox - diff --git a/oox/source/ole/oleobjecthelper.cxx b/oox/source/ole/oleobjecthelper.cxx index 5ef65fe2292e..396cd6b53874 100644 --- a/oox/source/ole/oleobjecthelper.cxx +++ b/oox/source/ole/oleobjecthelper.cxx @@ -26,34 +26,32 @@ ************************************************************************/ #include "oox/ole/oleobjecthelper.hxx" -#include -#include -#include -#include + #include #include +#include #include #include -#include "properties.hxx" +#include +#include +#include #include "oox/helper/propertymap.hxx" -using ::rtl::OUString; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::container::XNameAccess; -using ::com::sun::star::lang::XComponent; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::io::XOutputStream; -using ::com::sun::star::awt::Rectangle; -using ::com::sun::star::awt::Size; - namespace oox { namespace ole { // ============================================================================ +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + OleObjectInfo::OleObjectInfo() : mbLinked( false ), mbShowAsIcon( false ), @@ -138,4 +136,3 @@ bool OleObjectHelper::importOleObject( PropertyMap& rPropMap, const OleObjectInf } // namespace ole } // namespace oox - diff --git a/oox/source/ole/olestorage.cxx b/oox/source/ole/olestorage.cxx old mode 100755 new mode 100644 index 0ca2992d47ad..e9aa8f6a9ae8 --- a/oox/source/ole/olestorage.cxx +++ b/oox/source/ole/olestorage.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "oox/ole/olestorage.hxx" + #include #include #include @@ -35,38 +36,26 @@ #include #include #include -#include "oox/helper/helper.hxx" #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/binaryoutputstream.hxx" - -using ::rtl::OUString; -using ::com::sun::star::container::XNameContainer; -using ::com::sun::star::beans::PropertyValue; -using ::com::sun::star::embed::XStorage; -using ::com::sun::star::embed::XTransactedObject; -using ::com::sun::star::io::BufferSizeExceededException; -using ::com::sun::star::io::IOException; -using ::com::sun::star::io::NotConnectedException; -using ::com::sun::star::io::XInputStream; -using ::com::sun::star::io::XOutputStream; -using ::com::sun::star::io::XSeekable; -using ::com::sun::star::io::XStream; -using ::com::sun::star::lang::IllegalArgumentException; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; +#include "oox/helper/helper.hxx" namespace oox { namespace ole { // ============================================================================ +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::embed; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; + +// ============================================================================ + namespace { typedef ::cppu::WeakImplHelper2< XSeekable, XOutputStream > OleOutputStreamBase; diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx index 684b40d1ad19..dc86c2dd82e5 100644 --- a/oox/source/ole/vbacontrol.cxx +++ b/oox/source/ole/vbacontrol.cxx @@ -43,8 +43,6 @@ #include "oox/helper/storagebase.hxx" #include "oox/helper/textinputstream.hxx" #include "oox/ole/vbahelper.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace ole { diff --git a/oox/source/ole/vbahelper.cxx b/oox/source/ole/vbahelper.cxx index 3bf72d30bfa5..82d38d83610c 100644 --- a/oox/source/ole/vbahelper.cxx +++ b/oox/source/ole/vbahelper.cxx @@ -32,9 +32,12 @@ namespace oox { namespace ole { +// ============================================================================ + +using namespace ::com::sun::star::uno; + using ::rtl::OUString; using ::rtl::OUStringBuffer; -using namespace ::com::sun::star::uno; // ============================================================================ diff --git a/oox/source/ole/vbainputstream.cxx b/oox/source/ole/vbainputstream.cxx index b2c8d5c64859..e56e8b5fbc89 100644 --- a/oox/source/ole/vbainputstream.cxx +++ b/oox/source/ole/vbainputstream.cxx @@ -31,6 +31,8 @@ namespace oox { namespace ole { +// ============================================================================ + namespace { const sal_uInt8 VBASTREAM_SIGNATURE = 1; diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index 0136a223ff6a..f51193fe30ba 100644 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -50,8 +50,6 @@ #include "oox/ole/vbahelper.hxx" #include "oox/ole/vbainputstream.hxx" #include "oox/ole/vbamodule.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace ole { diff --git a/oox/source/ppt/animationspersist.cxx b/oox/source/ppt/animationspersist.cxx index 456b0616af1c..fdee865251af 100644 --- a/oox/source/ppt/animationspersist.cxx +++ b/oox/source/ppt/animationspersist.cxx @@ -25,8 +25,6 @@ * ************************************************************************/ - - #include "oox/ppt/animationspersist.hxx" #include @@ -38,8 +36,6 @@ #include "oox/drawingml/shape.hxx" -#include "tokens.hxx" - using rtl::OUString; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::presentation; diff --git a/oox/source/ppt/animationtypes.cxx b/oox/source/ppt/animationtypes.cxx index 80d87dd49ad2..6346a8058c5d 100644 --- a/oox/source/ppt/animationtypes.cxx +++ b/oox/source/ppt/animationtypes.cxx @@ -32,8 +32,6 @@ #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" - using namespace ::com::sun::star::uno; using namespace ::com::sun::star::animations; using namespace ::com::sun::star::xml::sax; diff --git a/oox/source/ppt/animvariantcontext.cxx b/oox/source/ppt/animvariantcontext.cxx index e2eca9a36dca..449c4ef73d11 100644 --- a/oox/source/ppt/animvariantcontext.cxx +++ b/oox/source/ppt/animvariantcontext.cxx @@ -35,12 +35,10 @@ #include #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/fragmenthandler.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/colorchoicecontext.hxx" #include "pptfilterhelpers.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -80,29 +78,29 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_boolVal: + case PPT_TOKEN( boolVal ): { bool val = attribs.getBool( XML_val, false ); maValue = makeAny( val ); break; } - case NMSP_PPT|XML_clrVal: + case PPT_TOKEN( clrVal ): xRet.set( new ::oox::drawingml::ColorContext( *this, maColor ) ); // we'll defer setting the Any until the end. break; - case NMSP_PPT|XML_fltVal: + case PPT_TOKEN( fltVal ): { double val = attribs.getDouble( XML_val, 0.0 ); maValue = makeAny( val ); break; } - case NMSP_PPT|XML_intVal: + case PPT_TOKEN( intVal ): { sal_Int32 val = attribs.getInteger( XML_val, 0 ); maValue = makeAny( val ); break; } - case NMSP_PPT|XML_strVal: + case PPT_TOKEN( strVal ): { OUString val = attribs.getString( XML_val, OUString() ); convertMeasure( val ); // ignore success or failure if it fails, use as is diff --git a/oox/source/ppt/backgroundproperties.cxx b/oox/source/ppt/backgroundproperties.cxx index 5b6fc4076a80..65664bdd3691 100644 --- a/oox/source/ppt/backgroundproperties.cxx +++ b/oox/source/ppt/backgroundproperties.cxx @@ -28,8 +28,6 @@ #include "oox/ppt/backgroundproperties.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/drawingmltypes.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using ::rtl::OUString; using namespace ::oox::core; @@ -51,7 +49,7 @@ Reference< XFastContextHandler > BackgroundPropertiesContext::createFastChildCon switch( aElementToken ) { - case NMSP_PPT|XML_fill: // a:CT_FillEffect + case PPT_TOKEN( fill ): // a:CT_FillEffect break; } diff --git a/oox/source/ppt/buildlistcontext.cxx b/oox/source/ppt/buildlistcontext.cxx index 61148265dfbe..3352e202e057 100644 --- a/oox/source/ppt/buildlistcontext.cxx +++ b/oox/source/ppt/buildlistcontext.cxx @@ -28,7 +28,6 @@ #include "buildlistcontext.hxx" #include #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" using namespace ::oox::core; @@ -56,7 +55,7 @@ namespace oox { namespace ppt { { switch( aElement ) { - case NMSP_PPT|XML_bldGraphic: + case PPT_TOKEN( bldGraphic ): mbInBldGraphic = false; break; default: @@ -72,18 +71,18 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_bldAsOne: + case PPT_TOKEN( bldAsOne ): if( mbInBldGraphic ) { mbBuildAsOne = true; } break; - case NMSP_PPT|XML_bldSub: + case PPT_TOKEN( bldSub ): if( mbInBldGraphic ) { } break; - case NMSP_PPT|XML_bldGraphic: + case PPT_TOKEN( bldGraphic ): { mbInBldGraphic = true; AttributeList attribs( xAttribs ); @@ -94,9 +93,9 @@ namespace oox { namespace ppt { // sal_uInt32 nGroupId = attribs.getUnsignedInteger( XML_grpId, 0 ); break; } - case NMSP_DRAWINGML|XML_bldDgm: - case NMSP_DRAWINGML|XML_bldOleChart: - case NMSP_DRAWINGML|XML_bldP: + case A_TOKEN( bldDgm ): + case A_TOKEN( bldOleChart ): + case A_TOKEN( bldP ): break; default: diff --git a/oox/source/ppt/commonbehaviorcontext.cxx b/oox/source/ppt/commonbehaviorcontext.cxx index 36841bab5aae..a4e3951228ae 100644 --- a/oox/source/ppt/commonbehaviorcontext.cxx +++ b/oox/source/ppt/commonbehaviorcontext.cxx @@ -34,14 +34,12 @@ #include #include -#include "oox/core/namespaces.hxx" #include "oox/core/fragmenthandler.hxx" #include "commonbehaviorcontext.hxx" #include "commontimenodecontext.hxx" #include "timetargetelementcontext.hxx" #include "pptfilterhelpers.hxx" -#include "tokens.hxx" #include @@ -57,7 +55,7 @@ namespace oox { namespace ppt { CommonBehaviorContext::CommonBehaviorContext( ContextHandler& rParent, const Reference< XFastAttributeList >& xAttribs, const TimeNodePtr & pNode ) - : TimeNodeContext( rParent, NMSP_PPT|XML_cBhvr, xAttribs, pNode ) + : TimeNodeContext( rParent, PPT_TOKEN( cBhvr ), xAttribs, pNode ) , mbInAttrList( false ) , mbIsInAttrName( false ) { @@ -75,7 +73,7 @@ namespace oox { namespace ppt { { switch( aElement ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): { if( !maAttributes.empty() ) { @@ -94,10 +92,10 @@ namespace oox { namespace ppt { } break; } - case NMSP_PPT|XML_attrNameLst: + case PPT_TOKEN( attrNameLst ): mbInAttrList = false; break; - case NMSP_PPT|XML_attrName: + case PPT_TOKEN( attrName ): if( mbIsInAttrName ) { const ImplAttributeNameConversion *attrConv = gImplConversionList; @@ -145,16 +143,16 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cTn: + case PPT_TOKEN( cTn ): xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_tgtEl: + case PPT_TOKEN( tgtEl ): xRet.set( new TimeTargetElementContext( *this, mpNode->getTarget() ) ); break; - case NMSP_PPT|XML_attrNameLst: + case PPT_TOKEN( attrNameLst ): mbInAttrList = true; break; - case NMSP_PPT|XML_attrName: + case PPT_TOKEN( attrName ): { if( mbInAttrList ) { diff --git a/oox/source/ppt/commontimenodecontext.cxx b/oox/source/ppt/commontimenodecontext.cxx index d7de40255298..1057deb70c5d 100644 --- a/oox/source/ppt/commontimenodecontext.cxx +++ b/oox/source/ppt/commontimenodecontext.cxx @@ -42,13 +42,11 @@ #include #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/fragmenthandler.hxx" #include "oox/ppt/pptimport.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "animationtypes.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -619,7 +617,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId void SAL_CALL CommonTimeNodeContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException) { - if( aElement == ( NMSP_PPT|XML_iterate ) ) + if( aElement == ( PPT_TOKEN( iterate ) ) ) { mbIterate = false; } @@ -632,22 +630,22 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId switch ( aElementToken ) { - case NMSP_PPT|XML_childTnLst: - case NMSP_PPT|XML_subTnLst: + case PPT_TOKEN( childTnLst ): + case PPT_TOKEN( subTnLst ): xRet.set( new TimeNodeListContext( *this, mpNode->getChildren() ) ); break; - case NMSP_PPT|XML_stCondLst: + case PPT_TOKEN( stCondLst ): xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getStartCondition() ) ); break; - case NMSP_PPT|XML_endCondLst: + case PPT_TOKEN( endCondLst ): xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getEndCondition() ) ); break; - case NMSP_PPT|XML_endSync: + case PPT_TOKEN( endSync ): xRet.set( new CondContext( *this, xAttribs, mpNode, mpNode->getEndSyncValue() ) ); break; - case NMSP_PPT|XML_iterate: + case PPT_TOKEN( iterate ): { sal_Int32 nVal = xAttribs->getOptionalValueToken( XML_type, XML_el ); if( nVal != 0 ) @@ -680,7 +678,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId mbIterate = true; break; } - case NMSP_PPT|XML_tmAbs: + case PPT_TOKEN( tmAbs ): if( mbIterate ) { AttributeList attribs( xAttribs ); @@ -689,7 +687,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fTime; } break; - case NMSP_PPT|XML_tmPct: + case PPT_TOKEN( tmPct ): if( mbIterate ) { AttributeList attribs( xAttribs ); diff --git a/oox/source/ppt/conditioncontext.cxx b/oox/source/ppt/conditioncontext.cxx index e52d8b27a464..5b622b6ef602 100644 --- a/oox/source/ppt/conditioncontext.cxx +++ b/oox/source/ppt/conditioncontext.cxx @@ -37,13 +37,11 @@ #include #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/contexthandler.hxx" #include "oox/ppt/animationspersist.hxx" #include "animationtypes.hxx" #include "timetargetelementcontext.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -54,7 +52,7 @@ namespace oox { namespace ppt { CondContext::CondContext( ContextHandler& rParent, const Reference< XFastAttributeList >& xAttribs, const TimeNodePtr & pNode, AnimationCondition & aValue ) - : TimeNodeContext( rParent, NMSP_PPT|XML_cond, xAttribs, pNode ) + : TimeNodeContext( rParent, PPT_TOKEN( cond ), xAttribs, pNode ) , maCond( aValue ) { maEvent.Trigger = EventTrigger::NONE; @@ -123,7 +121,7 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_rtn: + case PPT_TOKEN( rtn ): { // ST_TLTriggerRuntimeNode { first, last, all } sal_Int32 aTok; @@ -147,7 +145,7 @@ namespace oox { namespace ppt { maCond.maValue = makeAny( nEnum ); break; } - case NMSP_PPT|XML_tn: + case PPT_TOKEN( tn ): { maCond.mnType = aElementToken; AttributeList attribs( xAttribs ); @@ -155,7 +153,7 @@ namespace oox { namespace ppt { maCond.maValue = makeAny( nId ); break; } - case NMSP_PPT|XML_tgtEl: + case PPT_TOKEN( tgtEl ): // CT_TLTimeTargetElement xRet.set( new TimeTargetElementContext( *this, maCond.getTarget() ) ); break; @@ -194,7 +192,7 @@ namespace oox { namespace ppt { switch( aElement ) { - case NMSP_PPT|XML_cond: + case PPT_TOKEN( cond ): // add a condition to the list maConditions.push_back( AnimationCondition() ); xRet.set( new CondContext( *this, xAttribs, mpNode, maConditions.back() ) ); diff --git a/oox/source/ppt/customshowlistcontext.cxx b/oox/source/ppt/customshowlistcontext.cxx index 613000d07d41..f66ccb0f6084 100644 --- a/oox/source/ppt/customshowlistcontext.cxx +++ b/oox/source/ppt/customshowlistcontext.cxx @@ -26,9 +26,6 @@ ************************************************************************/ #include "customshowlistcontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" - using namespace ::oox::core; using namespace ::com::sun::star::uno; @@ -71,8 +68,8 @@ Reference< XFastContextHandler > SAL_CALL CustomShowContext::createFastChildCont Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_PPT|XML_sld : - mrCustomShow.maSldLst.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS | XML_id ) ); + case PPT_TOKEN( sld ) : + mrCustomShow.maSldLst.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) ); default: break; } @@ -102,7 +99,7 @@ Reference< XFastContextHandler > SAL_CALL CustomShowListContext::createFastChild Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_PPT|XML_custShow : + case PPT_TOKEN( custShow ) : { CustomShow aCustomShow; mrCustomShowList.push_back( aCustomShow ); diff --git a/oox/source/ppt/headerfootercontext.cxx b/oox/source/ppt/headerfootercontext.cxx index 69f23b77c0da..2089b019c58c 100644 --- a/oox/source/ppt/headerfootercontext.cxx +++ b/oox/source/ppt/headerfootercontext.cxx @@ -26,9 +26,7 @@ ************************************************************************/ #include "headerfootercontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" -#include "tokens.hxx" using namespace ::oox::core; using namespace ::com::sun::star::uno; diff --git a/oox/source/ppt/layoutfragmenthandler.cxx b/oox/source/ppt/layoutfragmenthandler.cxx index d291550ac321..152beb280bd7 100644 --- a/oox/source/ppt/layoutfragmenthandler.cxx +++ b/oox/source/ppt/layoutfragmenthandler.cxx @@ -34,8 +34,6 @@ #include "headerfootercontext.hxx" #include "oox/ppt/layoutfragmenthandler.hxx" #include "oox/drawingml/shapegroupcontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; @@ -67,10 +65,10 @@ Reference< XFastContextHandler > LayoutFragmentHandler::createFastChildContext( Reference< XFastContextHandler > xRet = getFastContextHandler(); switch( aElementToken ) { - case NMSP_PPT|XML_sldLayout: // CT_SlideLayout + case PPT_TOKEN( sldLayout ): // CT_SlideLayout mpSlidePersistPtr->setLayoutValueToken( xAttribs->getOptionalValueToken( XML_type, 0 ) ); // CT_SlideLayoutType break; - case NMSP_PPT|XML_hf: // CT_HeaderFooter + case PPT_TOKEN( hf ): // CT_HeaderFooter xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) ); break; default: diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index 249db6c09426..625e4e662e3c 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -75,9 +75,9 @@ bool PowerPointImport::importDocument() throw() file:////source/dump/pptxdumper.ini. */ OOX_DUMP_FILE( ::oox::dump::pptx::Dumper ); - OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "officeDocument" ) ); + OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "officeDocument" ) ); FragmentHandlerRef xPresentationFragmentHandler( new PresentationFragmentHandler( *this, aFragmentPath ) ); - maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "tableStyles" ) ); + maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "tableStyles" ) ); return importFragment( xPresentationFragmentHandler ); diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index 60144bbbe79d..7437b378b324 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -26,10 +26,8 @@ ************************************************************************/ #include "oox/ppt/pptshape.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/textbody.hxx" -#include "tokens.hxx" #include #include diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx index c59638553018..7df41ac3d714 100644 --- a/oox/source/ppt/pptshapecontext.cxx +++ b/oox/source/ppt/pptshapecontext.cxx @@ -37,14 +37,11 @@ #include "oox/ppt/pptshapepropertiescontext.hxx" #include "oox/ppt/slidepersist.hxx" #include "oox/drawingml/shapestylecontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" -#include "tokens.hxx" -#include "properties.hxx" using rtl::OUString; using namespace oox::core; @@ -102,9 +99,9 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In switch( aElementToken ) { // nvSpPr CT_ShapeNonVisual begin - // case NMSP_PPT|XML_drElemPr: + // case PPT_TOKEN( drElemPr ): // break; - case NMSP_PPT|XML_cNvPr: + case PPT_TOKEN( cNvPr ): { AttributeList aAttribs( xAttribs ); mpShapePtr->setHidden( aAttribs.getBool( XML_hidden, false ) ); @@ -112,7 +109,7 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In mpShapePtr->setName( xAttribs->getOptionalValue( XML_name ) ); break; } - case NMSP_PPT|XML_ph: + case PPT_TOKEN( ph ): { sal_Int32 nSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) ); mpShapePtr->setSubType( nSubType ); @@ -191,15 +188,15 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In // nvSpPr CT_ShapeNonVisual end - case NMSP_PPT|XML_spPr: + case PPT_TOKEN( spPr ): xRet = new PPTShapePropertiesContext( *this, *mpShapePtr ); break; - case NMSP_PPT|XML_style: + case PPT_TOKEN( style ): xRet = new oox::drawingml::ShapeStyleContext( *this, *mpShapePtr ); break; - case NMSP_PPT|XML_txBody: + case PPT_TOKEN( txBody ): { oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody ); xTextBody->getTextProperties().maPropertyMap[ PROP_FontIndependentLineSpacing ] <<= static_cast< sal_Bool >( sal_True ); diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx index 074393874264..0ba36ee99417 100644 --- a/oox/source/ppt/pptshapegroupcontext.cxx +++ b/oox/source/ppt/pptshapegroupcontext.cxx @@ -39,8 +39,6 @@ #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" #include "oox/drawingml/connectorshapecontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace oox::core; @@ -71,7 +69,7 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s switch( aElementToken ) { - case NMSP_PPT|XML_cNvPr: + case PPT_TOKEN( cNvPr ): { AttributeList aAttribs( xAttribs ); mpGroupShapePtr->setHidden( aAttribs.getBool( XML_hidden, false ) ); @@ -79,36 +77,36 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s mpGroupShapePtr->setName( xAttribs->getOptionalValue( XML_name ) ); break; } - case NMSP_PPT|XML_ph: + case PPT_TOKEN( ph ): mpGroupShapePtr->setSubType( xAttribs->getOptionalValueToken( XML_type, FastToken::DONTKNOW ) ); mpGroupShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() ); break; // nvSpPr CT_ShapeNonVisual end - case NMSP_PPT|XML_grpSpPr: + case PPT_TOKEN( grpSpPr ): xRet = new oox::drawingml::ShapePropertiesContext( *this, *mpGroupShapePtr ); break; - case NMSP_PPT|XML_spPr: + case PPT_TOKEN( spPr ): xRet = new oox::drawingml::ShapePropertiesContext( *this, *mpGroupShapePtr ); break; /* - case NMSP_PPT|XML_style: + case PPT_TOKEN( style ): xRet = new ShapeStyleContext( getParser() ); break; */ - case NMSP_PPT|XML_cxnSp: // connector shape + case PPT_TOKEN( cxnSp ): // connector shape xRet.set( new oox::drawingml::ConnectorShapeContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.ConnectorShape" ) ) ) ); break; - case NMSP_PPT|XML_grpSp: // group shape + case PPT_TOKEN( grpSp ): // group shape xRet.set( new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) ) ); break; - case NMSP_PPT|XML_sp: // Shape + case PPT_TOKEN( sp ): // Shape xRet.set( new PPTShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.CustomShape" ) ) ) ); break; - case NMSP_PPT|XML_pic: // CT_Picture + case PPT_TOKEN( pic ): // CT_Picture xRet.set( new oox::drawingml::GraphicShapeContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GraphicObjectShape" ) ) ) ); break; - case NMSP_PPT|XML_graphicFrame: // CT_GraphicalObjectFrame + case PPT_TOKEN( graphicFrame ): // CT_GraphicalObjectFrame xRet.set( new oox::drawingml::GraphicalObjectFrameContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.OLE2Shape" ) ), true ) ); break; diff --git a/oox/source/ppt/pptshapepropertiescontext.cxx b/oox/source/ppt/pptshapepropertiescontext.cxx index b4af0f08a555..bddd74f4837a 100644 --- a/oox/source/ppt/pptshapepropertiescontext.cxx +++ b/oox/source/ppt/pptshapepropertiescontext.cxx @@ -35,14 +35,11 @@ #include "oox/ppt/pptshapepropertiescontext.hxx" #include "oox/ppt/slidepersist.hxx" #include "oox/drawingml/shapestylecontext.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" -#include "properties.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace oox::core; @@ -68,7 +65,7 @@ Reference< XFastContextHandler > PPTShapePropertiesContext::createFastChildConte switch( aElementToken ) { - case NMSP_DRAWINGML | XML_xfrm: + case A_TOKEN( xfrm ): { mrShape.getShapeProperties()[ PROP_IsPlaceholderDependent ] <<= sal_False; diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 786836fbc554..6976c965ad83 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -46,8 +46,6 @@ #include "oox/ppt/slidefragmenthandler.hxx" #include "oox/ppt/layoutfragmenthandler.hxx" #include "oox/ppt/pptimport.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; @@ -182,12 +180,12 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce FragmentHandlerRef xSlideFragmentHandler( new SlideFragmentHandler( rFilter, aSlideFragmentPath, pSlidePersistPtr, Slide ) ); // importing the corresponding masterpage/layout - OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "slideLayout" ) ); + OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideLayout" ) ); if ( aLayoutFragmentPath.getLength() > 0 ) { // importing layout RelationsRef xLayoutRelations = rFilter.importRelations( aLayoutFragmentPath ); - OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "slideMaster" ) ); + OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideMaster" ) ); if( aMasterFragmentPath.getLength() ) { // check if the corresponding masterpage+layout has already been imported @@ -221,7 +219,7 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, aMasterFragmentPath, pMasterPersistPtr, Master ) ); // set the correct theme - OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "theme" ) ); + OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "theme" ) ); if( aThemeFragmentPath.getLength() > 0 ) { std::map< OUString, oox::drawingml::ThemePtr >& rThemes( rFilter.getThemes() ); @@ -259,7 +257,7 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce pSlidePersistPtr->createXShapes( rFilter ); // now importing the notes page - OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "notesSlide" ) ); + OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "notesSlide" ) ); if( aNotesFragmentPath.getLength() > 0 ) { Reference< XPresentationPage > xPresentationPage( xSlide, UNO_QUERY ); @@ -305,30 +303,30 @@ Reference< XFastContextHandler > PresentationFragmentHandler::createFastChildCon Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_PPT|XML_presentation: - case NMSP_PPT|XML_sldMasterIdLst: - case NMSP_PPT|XML_notesMasterIdLst: - case NMSP_PPT|XML_sldIdLst: + case PPT_TOKEN( presentation ): + case PPT_TOKEN( sldMasterIdLst ): + case PPT_TOKEN( notesMasterIdLst ): + case PPT_TOKEN( sldIdLst ): break; - case NMSP_PPT|XML_sldMasterId: - maSlideMasterVector.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_id ) ); + case PPT_TOKEN( sldMasterId ): + maSlideMasterVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) ); break; - case NMSP_PPT|XML_sldId: - maSlidesVector.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_id ) ); + case PPT_TOKEN( sldId ): + maSlidesVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) ); break; - case NMSP_PPT|XML_notesMasterId: - maNotesMasterVector.push_back( xAttribs->getOptionalValue(NMSP_RELATIONSHIPS|XML_id ) ); + case PPT_TOKEN( notesMasterId ): + maNotesMasterVector.push_back( xAttribs->getOptionalValue(R_TOKEN( id ) ) ); break; - case NMSP_PPT|XML_sldSz: + case PPT_TOKEN( sldSz ): maSlideSize = GetSize2D( xAttribs ); break; - case NMSP_PPT|XML_notesSz: + case PPT_TOKEN( notesSz ): maNotesSize = GetSize2D( xAttribs ); break; - case NMSP_PPT|XML_custShowLst: + case PPT_TOKEN( custShowLst ): xRet.set( new CustomShowListContext( *this, maCustomShowList ) ); break; - case NMSP_PPT|XML_defaultTextStyle: + case PPT_TOKEN( defaultTextStyle ): xRet.set( new TextListStyleContext( *this, *mpTextListStyle ) ); break; } diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx index 69f32e01e7eb..cfbb2db2bece 100644 --- a/oox/source/ppt/slidefragmenthandler.cxx +++ b/oox/source/ppt/slidefragmenthandler.cxx @@ -31,10 +31,7 @@ #include #include -#include "tokens.hxx" -#include "properties.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "headerfootercontext.hxx" #include "oox/ppt/backgroundproperties.hxx" @@ -65,7 +62,7 @@ SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& rFilter, const OUStri , mpSlidePersistPtr( pPersistPtr ) , meShapeLocation( eShapeLocation ) { - OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "vmlDrawing" ) ); + OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "vmlDrawing" ) ); if( aVMLDrawingFragmentPath.getLength() > 0 ) getFilter().importFragment( new oox::vml::DrawingFragment( getFilter(), aVMLDrawingFragmentPath, *pPersistPtr->getDrawing() ) ); @@ -84,9 +81,9 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s switch( aElementToken ) { - case NMSP_PPT|XML_sldMaster: // CT_SlideMaster - case NMSP_PPT|XML_handoutMaster: // CT_HandoutMaster - case NMSP_PPT|XML_sld: // CT_CommonSlideData + case PPT_TOKEN( sldMaster ): // CT_SlideMaster + case PPT_TOKEN( handoutMaster ): // CT_HandoutMaster + case PPT_TOKEN( sld ): // CT_CommonSlideData { AttributeList attribs( xAttribs ); @@ -99,14 +96,14 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s break; } - case NMSP_PPT|XML_notes: // CT_NotesSlide - case NMSP_PPT|XML_notesMaster: // CT_NotesMaster + case PPT_TOKEN( notes ): // CT_NotesSlide + case PPT_TOKEN( notesMaster ): // CT_NotesMaster break; - case NMSP_PPT|XML_cSld: // CT_CommonSlideData + case PPT_TOKEN( cSld ): // CT_CommonSlideData maSlideName = xAttribs->getOptionalValue(XML_name); break; - case NMSP_PPT|XML_spTree: // CT_GroupShape + case PPT_TOKEN( spTree ): // CT_GroupShape { xRet.set( new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpSlidePersistPtr->getShapes(), @@ -114,10 +111,10 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s } break; - case NMSP_PPT|XML_controls: + case PPT_TOKEN( controls ): xRet = getFastContextHandler(); break; - case NMSP_PPT|XML_control: + case PPT_TOKEN( control ): { ::oox::vml::ControlInfo aInfo; aInfo.setShapeId( aAttribs.getInteger( XML_spid, 0 ) ); @@ -127,42 +124,42 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s } return xRet; - case NMSP_PPT|XML_timing: // CT_SlideTiming + case PPT_TOKEN( timing ): // CT_SlideTiming xRet.set( new SlideTimingContext( *this, mpSlidePersistPtr->getTimeNodeList() ) ); break; - case NMSP_PPT|XML_transition: // CT_SlideTransition + case PPT_TOKEN( transition ): // CT_SlideTransition xRet.set( new SlideTransitionContext( *this, xAttribs, maSlideProperties ) ); break; - case NMSP_PPT|XML_hf: + case PPT_TOKEN( hf ): xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) ); break; // BackgroundGroup - case NMSP_PPT|XML_bgPr: // CT_BackgroundProperties + case PPT_TOKEN( bgPr ): // CT_BackgroundProperties { FillPropertiesPtr pFillPropertiesPtr( new FillProperties ); xRet.set( new BackgroundPropertiesContext( *this, *pFillPropertiesPtr ) ); mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr ); } break; - case NMSP_PPT|XML_bgRef: // a:CT_StyleMatrixReference + case PPT_TOKEN( bgRef ): // a:CT_StyleMatrixReference break; - case NMSP_PPT|XML_clrMap: // CT_ColorMapping + case PPT_TOKEN( clrMap ): // CT_ColorMapping { oox::drawingml::ClrMapPtr pClrMapPtr( new oox::drawingml::ClrMap() ); xRet.set( new oox::drawingml::clrMapContext( *this, xAttribs, *pClrMapPtr ) ); mpSlidePersistPtr->setClrMap( pClrMapPtr ); } break; - case NMSP_PPT|XML_clrMapOvr: // CT_ColorMappingOverride - case NMSP_PPT|XML_sldLayoutIdLst: // CT_SlideLayoutIdList + case PPT_TOKEN( clrMapOvr ): // CT_ColorMappingOverride + case PPT_TOKEN( sldLayoutIdLst ): // CT_SlideLayoutIdList break; - case NMSP_PPT|XML_txStyles: // CT_SlideMasterTextStyles + case PPT_TOKEN( txStyles ): // CT_SlideMasterTextStyles xRet.set( new SlideMasterTextStylesContext( *this, mpSlidePersistPtr ) ); break; - case NMSP_PPT|XML_custDataLst: // CT_CustomerDataList - case NMSP_PPT|XML_tagLst: // CT_TagList + case PPT_TOKEN( custDataLst ): // CT_CustomerDataList + case PPT_TOKEN( tagLst ): // CT_TagList break; } diff --git a/oox/source/ppt/slidemastertextstylescontext.cxx b/oox/source/ppt/slidemastertextstylescontext.cxx index 773730417a27..d4c777102a0a 100644 --- a/oox/source/ppt/slidemastertextstylescontext.cxx +++ b/oox/source/ppt/slidemastertextstylescontext.cxx @@ -28,8 +28,6 @@ #include "oox/drawingml/textliststyle.hxx" #include "oox/drawingml/textliststylecontext.hxx" #include "oox/ppt/slidemastertextstylescontext.hxx" -#include "oox/core/namespaces.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; @@ -54,22 +52,22 @@ Reference< XFastContextHandler > SlideMasterTextStylesContext::createFastChildCo Reference< XFastContextHandler > xRet; switch( aElementToken ) { - case NMSP_PPT|XML_titleStyle: + case PPT_TOKEN( titleStyle ): { aTextListStylePtr = mpSlidePersistPtr->getTitleTextStyle(); break; } - case NMSP_PPT|XML_bodyStyle: + case PPT_TOKEN( bodyStyle ): { aTextListStylePtr = mpSlidePersistPtr->getBodyTextStyle(); break; } - case NMSP_PPT|XML_notesStyle: + case PPT_TOKEN( notesStyle ): { aTextListStylePtr = mpSlidePersistPtr->getNotesTextStyle(); break; } - case NMSP_PPT|XML_otherStyle: + case PPT_TOKEN( otherStyle ): { aTextListStylePtr = mpSlidePersistPtr->getOtherTextStyle(); break; diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index f4dee1216937..6f1ba8757d21 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -31,9 +31,7 @@ #include "oox/ppt/slidepersist.hxx" #include "oox/drawingml/fillproperties.hxx" #include "oox/vml/vmldrawing.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" -#include "tokens.hxx" #include #include diff --git a/oox/source/ppt/slidetimingcontext.cxx b/oox/source/ppt/slidetimingcontext.cxx index b64d79c949cf..4357e14ea08e 100644 --- a/oox/source/ppt/slidetimingcontext.cxx +++ b/oox/source/ppt/slidetimingcontext.cxx @@ -34,10 +34,8 @@ #include "oox/ppt/slidefragmenthandler.hxx" #include "oox/drawingml/shapegroupcontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/ppt/timenodelistcontext.hxx" #include "buildlistcontext.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; @@ -72,12 +70,12 @@ Reference< XFastContextHandler > SlideTimingContext::createFastChildContext( sal switch( aElementToken ) { - case NMSP_PPT|XML_bldLst: + case PPT_TOKEN( bldLst ): xRet.set( new BuildListContext( *this, xAttribs, maTimeNodeList ) ); break; - case NMSP_PPT|XML_extLst: + case PPT_TOKEN( extLst ): return xRet; - case NMSP_PPT|XML_tnLst: + case PPT_TOKEN( tnLst ): // timing nodes { xRet.set( new TimeNodeListContext( *this, maTimeNodeList ) ); diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx index ee889e13d840..a380a4d945e1 100644 --- a/oox/source/ppt/slidetransition.cxx +++ b/oox/source/ppt/slidetransition.cxx @@ -35,10 +35,9 @@ #include "oox/helper/helper.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/core/namespaces.hxx" +#include "oox/token/namespaces.hxx" +#include "oox/token/tokens.hxx" #include "pptfilterhelpers.hxx" -#include "properties.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star::uno; @@ -256,11 +255,11 @@ namespace oox { namespace ppt { { switch( OoxType ) { - case NMSP_PPT|XML_blinds: + case PPT_TOKEN( blinds ): mnTransitionType = TransitionType::BLINDSWIPE; mnTransitionSubType = ooxToOdpDirection( param1 ); break; - case NMSP_PPT|XML_checker: + case PPT_TOKEN( checker ): mnTransitionType = TransitionType::CHECKERBOARDWIPE; switch ( param1 ) { @@ -274,7 +273,7 @@ namespace oox { namespace ppt { break; } break; - case NMSP_PPT|XML_comb: + case PPT_TOKEN( comb ): mnTransitionType = TransitionType::PUSHWIPE; switch( param1 ) { @@ -288,16 +287,16 @@ namespace oox { namespace ppt { break; } break; - case NMSP_PPT|XML_cover: + case PPT_TOKEN( cover ): mnTransitionType = TransitionType::SLIDEWIPE; mnTransitionSubType = ooxToOdpEightDirections( param1 ); break; - case NMSP_PPT|XML_pull: // uncover + case PPT_TOKEN( pull ): // uncover mnTransitionType = TransitionType::SLIDEWIPE; mnTransitionSubType = ooxToOdpEightDirections( param1 ); mbTransitionDirectionNormal = false; break; - case NMSP_PPT|XML_cut: + case PPT_TOKEN( cut ): // The binfilter seems to ignore this transition. // Fade to black instead if thrBlk is true. if( param1 ) @@ -307,7 +306,7 @@ namespace oox { namespace ppt { } OSL_TRACE( "OOX: cut transition fallback." ); break; - case NMSP_PPT|XML_fade: + case PPT_TOKEN( fade ): mnTransitionType = TransitionType::FADE; if( param1 ) { @@ -318,16 +317,16 @@ namespace oox { namespace ppt { mnTransitionSubType = TransitionSubType::CROSSFADE; } break; - case NMSP_PPT|XML_push: + case PPT_TOKEN( push ): mnTransitionType = TransitionType::PUSHWIPE; mnTransitionSubType = ooxToOdpBorderDirections( param1 ); break; - case NMSP_PPT|XML_wipe: + case PPT_TOKEN( wipe ): mnTransitionType = TransitionType::BARWIPE; mnTransitionSubType = ooxToOdpSideDirections( param1 ); mbTransitionDirectionNormal = ooxToOdpSideDirectionsDirectionNormal( param1 ); break; - case NMSP_PPT|XML_split: + case PPT_TOKEN( split ): mnTransitionType = TransitionType::BARNDOORWIPE; mnTransitionSubType = ooxToOdpDirection( param1 ); if( param2 == XML_in ) @@ -336,7 +335,7 @@ namespace oox { namespace ppt { mbTransitionDirectionNormal = false; } break; - case NMSP_PPT|XML_wheel: + case PPT_TOKEN( wheel ): mnTransitionType = TransitionType::PINWHEELWIPE; switch( param1 ) { @@ -372,40 +371,40 @@ namespace oox { namespace ppt { break; } break; - case NMSP_PPT|XML_randomBar: + case PPT_TOKEN( randomBar ): mnTransitionType = TransitionType::RANDOMBARWIPE; mnTransitionSubType = ooxToOdpDirection( param1 ); break; - case NMSP_PPT|XML_circle: + case PPT_TOKEN( circle ): mnTransitionType = TransitionType::ELLIPSEWIPE; mnTransitionSubType = TransitionSubType::CIRCLE; break; - case NMSP_PPT|XML_diamond: + case PPT_TOKEN( diamond ): mnTransitionType = TransitionType::IRISWIPE; mnTransitionSubType = TransitionSubType::DIAMOND; break; - case NMSP_PPT|XML_dissolve: + case PPT_TOKEN( dissolve ): mnTransitionType = TransitionType::DISSOLVE; mnTransitionSubType = TransitionSubType::DEFAULT; break; - case NMSP_PPT|XML_newsflash: + case PPT_TOKEN( newsflash ): // this is what the PPT binary filter does.... not sure I agree. mnTransitionType = TransitionType::FOURBOXWIPE; mnTransitionSubType = TransitionSubType::CORNERSOUT; break; - case NMSP_PPT|XML_plus: + case PPT_TOKEN( plus ): mnTransitionType = TransitionType::FOURBOXWIPE; mnTransitionSubType = TransitionSubType::CORNERSOUT; break; - case NMSP_PPT|XML_random: + case PPT_TOKEN( random ): mnTransitionType = TransitionType::RANDOM; mnTransitionSubType = TransitionSubType::DEFAULT; break; - case NMSP_PPT|XML_wedge: + case PPT_TOKEN( wedge ): mnTransitionType = TransitionType::FANWIPE; mnTransitionSubType = TransitionSubType::CENTERTOP; break; - case NMSP_PPT|XML_zoom: + case PPT_TOKEN( zoom ): mnTransitionType = TransitionType::ZOOM; mnTransitionSubType = TransitionSubType::DEFAULT; break; diff --git a/oox/source/ppt/slidetransitioncontext.cxx b/oox/source/ppt/slidetransitioncontext.cxx index 92993d754ada..4c5ae7dcc65f 100644 --- a/oox/source/ppt/slidetransitioncontext.cxx +++ b/oox/source/ppt/slidetransitioncontext.cxx @@ -38,9 +38,6 @@ #include "oox/ppt/soundactioncontext.hxx" #include "oox/drawingml/shapegroupcontext.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" - -#include "tokens.hxx" using rtl::OUString; using namespace ::com::sun::star; @@ -86,10 +83,10 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( switch( aElementToken ) { - case NMSP_PPT|XML_blinds: - case NMSP_PPT|XML_checker: - case NMSP_PPT|XML_comb: - case NMSP_PPT|XML_randomBar: + case PPT_TOKEN( blinds ): + case PPT_TOKEN( checker ): + case PPT_TOKEN( comb ): + case PPT_TOKEN( randomBar ): if (!mbHasTransition) { mbHasTransition = true; @@ -97,8 +94,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // ST_Direction { XML_horz, XML_vert } } break; - case NMSP_PPT|XML_cover: - case NMSP_PPT|XML_pull: + case PPT_TOKEN( cover ): + case PPT_TOKEN( pull ): if (!mbHasTransition) { mbHasTransition = true; @@ -109,8 +106,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // XML_ld, XML_lu, XML_rd, XML_ru } } break; - case NMSP_PPT|XML_cut: - case NMSP_PPT|XML_fade: + case PPT_TOKEN( cut ): + case PPT_TOKEN( fade ): if (!mbHasTransition) { mbHasTransition = true; @@ -119,8 +116,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( maTransition.setOoxTransitionType( aElementToken, attribs.getBool( XML_thruBlk, false ), 0); } break; - case NMSP_PPT|XML_push: - case NMSP_PPT|XML_wipe: + case PPT_TOKEN( push ): + case PPT_TOKEN( wipe ): if (!mbHasTransition) { mbHasTransition = true; @@ -128,7 +125,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // ST_TransitionSideDirectionType { XML_d, XML_l, XML_r, XML_u } } break; - case NMSP_PPT|XML_split: + case PPT_TOKEN( split ): if (!mbHasTransition) { mbHasTransition = true; @@ -137,7 +134,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // ST_TransitionInOutDirectionType { XML_out, XML_in } } break; - case NMSP_PPT|XML_zoom: + case PPT_TOKEN( zoom ): if (!mbHasTransition) { mbHasTransition = true; @@ -145,7 +142,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // ST_TransitionInOutDirectionType { XML_out, XML_in } } break; - case NMSP_PPT|XML_wheel: + case PPT_TOKEN( wheel ): if (!mbHasTransition) { mbHasTransition = true; @@ -154,13 +151,13 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( // unsignedInt } break; - case NMSP_PPT|XML_circle: - case NMSP_PPT|XML_diamond: - case NMSP_PPT|XML_dissolve: - case NMSP_PPT|XML_newsflash: - case NMSP_PPT|XML_plus: - case NMSP_PPT|XML_random: - case NMSP_PPT|XML_wedge: + case PPT_TOKEN( circle ): + case PPT_TOKEN( diamond ): + case PPT_TOKEN( dissolve ): + case PPT_TOKEN( newsflash ): + case PPT_TOKEN( plus ): + case PPT_TOKEN( random ): + case PPT_TOKEN( wedge ): // CT_Empty if (!mbHasTransition) { @@ -170,11 +167,11 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( break; - case NMSP_PPT|XML_sndAc: // CT_TransitionSoundAction + case PPT_TOKEN( sndAc ): // CT_TransitionSoundAction //"Sound" xRet.set( new SoundActionContext ( *this, maSlideProperties ) ); break; - case NMSP_PPT|XML_extLst: // CT_OfficeArtExtensionList + case PPT_TOKEN( extLst ): // CT_OfficeArtExtensionList return xRet; default: break; @@ -188,7 +185,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( void SlideTransitionContext::endFastElement( sal_Int32 aElement ) throw (::com::sun::star::xml::sax::SAXException, RuntimeException) { - if( aElement == (NMSP_PPT|XML_transition) ) + if( aElement == (PPT_TOKEN( transition )) ) { if( mbHasTransition ) { diff --git a/oox/source/ppt/soundactioncontext.cxx b/oox/source/ppt/soundactioncontext.cxx index 281eb848629c..e9b955a73e15 100644 --- a/oox/source/ppt/soundactioncontext.cxx +++ b/oox/source/ppt/soundactioncontext.cxx @@ -32,10 +32,7 @@ #include "oox/helper/attributelist.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/embeddedwavaudiofile.hxx" -#include "properties.hxx" -#include "tokens.hxx" using rtl::OUString; using namespace ::oox::core; @@ -63,7 +60,7 @@ namespace oox { namespace ppt { void SoundActionContext::endFastElement( sal_Int32 aElement ) throw (SAXException, RuntimeException) { - if ( aElement == ( NMSP_PPT|XML_sndAc ) ) + if ( aElement == PPT_TOKEN( sndAc ) ) { if( mbHasStartSound ) { @@ -106,7 +103,7 @@ namespace oox { namespace ppt { switch( aElement ) { - case NMSP_PPT|XML_snd: + case PPT_TOKEN( snd ): if( mbHasStartSound ) { drawingml::EmbeddedWAVAudioFile aAudio; @@ -115,11 +112,11 @@ namespace oox { namespace ppt { msSndName = ( aAudio.mbBuiltIn ? aAudio.msName : aAudio.msEmbed ); } break; - case NMSP_PPT|XML_endSnd: + case PPT_TOKEN( endSnd ): // CT_Empty mbStopSound = true; break; - case NMSP_PPT|XML_stSnd: + case PPT_TOKEN( stSnd ): mbHasStartSound = true; mbLoopSound = attribs.getBool( XML_loop, false ); default: diff --git a/oox/source/ppt/timeanimvaluecontext.cxx b/oox/source/ppt/timeanimvaluecontext.cxx index 5699d8a44cc3..185897f2e101 100644 --- a/oox/source/ppt/timeanimvaluecontext.cxx +++ b/oox/source/ppt/timeanimvaluecontext.cxx @@ -27,12 +27,8 @@ #include "timeanimvaluecontext.hxx" -#include "oox/core/namespaces.hxx" #include "animvariantcontext.hxx" -#include "tokens.hxx" - - using namespace ::oox::core; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; @@ -57,7 +53,7 @@ namespace oox { namespace ppt { void SAL_CALL TimeAnimValueListContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException) { - if( aElement == ( NMSP_PPT|XML_tav ) ) + if( aElement == PPT_TOKEN( tav ) ) { mbInValue = false; } @@ -72,7 +68,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_tav: + case PPT_TOKEN( tav ): { mbInValue = true; TimeAnimationValue val; @@ -81,7 +77,7 @@ namespace oox { namespace ppt { maTavList.push_back( val ); break; } - case NMSP_PPT|XML_val: + case PPT_TOKEN( val ): if( mbInValue ) { // CT_TLAnimVariant diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx index 7e40e3be4db4..6a82dc29c1de 100644 --- a/oox/source/ppt/timenodelistcontext.cxx +++ b/oox/source/ppt/timenodelistcontext.cxx @@ -47,12 +47,10 @@ #include #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/colorchoicecontext.hxx" #include "oox/ppt/slidetransition.hxx" -#include "tokens.hxx" #include "animvariantcontext.hxx" #include "commonbehaviorcontext.hxx" @@ -129,10 +127,10 @@ namespace oox { namespace ppt { switch( aElement ) { - case NMSP_PPT|XML_audio: + case PPT_TOKEN( audio ): mbIsNarration = attribs.getBool( XML_isNarration, false ); break; - case NMSP_PPT|XML_video: + case PPT_TOKEN( video ): mbFullScrn = attribs.getBool( XML_fullScrn, false ); break; default: @@ -143,11 +141,11 @@ namespace oox { namespace ppt { virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException) { - if( aElement == ( NMSP_PPT|XML_audio ) ) + if( aElement == PPT_TOKEN( audio ) ) { // TODO deal with mbIsNarration } - else if( aElement == ( NMSP_PPT|XML_video ) ) + else if( aElement == PPT_TOKEN( video ) ) { // TODO deal with mbFullScrn } @@ -161,7 +159,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; default: @@ -227,10 +225,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_to: + case PPT_TOKEN( to ): // CT_TLAnimVariant xRet.set( new AnimVariantContext( *this, aElementToken, maTo ) ); break; @@ -261,7 +259,7 @@ namespace oox { namespace ppt { { switch ( aElement ) { - case NMSP_PPT|XML_cmd: + case PPT_TOKEN( cmd ): msCommand = xAttribs->getOptionalValue( XML_cmd ); maType = xAttribs->getOptionalValueToken( XML_type, 0 ); break; @@ -277,7 +275,7 @@ namespace oox { namespace ppt { virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException) { - if( aElement == ( NMSP_PPT|XML_cmd ) ) + if( aElement == PPT_TOKEN( cmd ) ) { try { // see sd/source/filter/ppt/pptinanimations.cxx @@ -356,7 +354,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; default: @@ -409,14 +407,14 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cTn: + case PPT_TOKEN( cTn ): xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_nextCondLst: + case PPT_TOKEN( nextCondLst ): xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getNextCondition() ) ); break; - case NMSP_PPT|XML_prevCondLst: + case PPT_TOKEN( prevCondLst ): xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getPrevCondition() ) ); break; @@ -457,7 +455,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cTn: + case PPT_TOKEN( cTn ): xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) ); break; default: @@ -521,7 +519,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_hsl: + case PPT_TOKEN( hsl ): // CT_TLByHslColorTransform { if( mbHasByColor ) @@ -534,7 +532,7 @@ namespace oox { namespace ppt { xRet.set(this); break; } - case NMSP_PPT|XML_rgb: + case PPT_TOKEN( rgb ): { if( mbHasByColor ) { @@ -547,19 +545,19 @@ namespace oox { namespace ppt { xRet.set(this); break; } - case NMSP_PPT|XML_by: + case PPT_TOKEN( by ): // CT_TLByAnimateColorTransform mbHasByColor = true; xRet.set(this); break; - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_to: + case PPT_TOKEN( to ): // CT_Color xRet.set( new ColorContext( *this, maToClr ) ); break; - case NMSP_PPT|XML_from: + case PPT_TOKEN( from ): // CT_Color xRet.set( new ColorContext( *this, maFromClr ) ); break; @@ -678,10 +676,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_tavLst: + case PPT_TOKEN( tavLst ): xRet.set( new TimeAnimValueListContext ( *this, xAttribs, maTavList ) ); break; default: @@ -748,10 +746,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_to: + case PPT_TOKEN( to ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -759,7 +757,7 @@ namespace oox { namespace ppt { maTo <<= p.Y; break; } - case NMSP_PPT|XML_from: + case PPT_TOKEN( from ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -767,7 +765,7 @@ namespace oox { namespace ppt { maFrom <<= p.Y; break; } - case NMSP_PPT|XML_by: + case PPT_TOKEN( by ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -834,7 +832,7 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; default: @@ -902,10 +900,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_to: + case PPT_TOKEN( to ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -915,7 +913,7 @@ namespace oox { namespace ppt { mpNode->setTo( rAny ); break; } - case NMSP_PPT|XML_from: + case PPT_TOKEN( from ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -925,7 +923,7 @@ namespace oox { namespace ppt { mpNode->setFrom( rAny ); break; } - case NMSP_PPT|XML_by: + case PPT_TOKEN( by ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -935,7 +933,7 @@ namespace oox { namespace ppt { mpNode->setBy( rAny ); break; } - case NMSP_PPT|XML_rCtr: + case PPT_TOKEN( rCtr ): { // CT_TLPoint Point p = GetPointPercent( xAttribs ); @@ -993,10 +991,10 @@ namespace oox { namespace ppt { switch ( aElementToken ) { - case NMSP_PPT|XML_cBhvr: + case PPT_TOKEN( cBhvr ): xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) ); break; - case NMSP_PPT|XML_progress: + case PPT_TOKEN( progress ): xRet.set( new AnimVariantContext( *this, aElementToken, maProgress ) ); // TODO handle it. break; @@ -1025,41 +1023,41 @@ namespace oox { namespace ppt { TimeNodeContext *pCtx = NULL; switch( aElement ) { - case NMSP_PPT|XML_animClr: + case PPT_TOKEN( animClr ): pCtx = new AnimColorContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_par: + case PPT_TOKEN( par ): pCtx = new ParallelExclTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_seq: + case PPT_TOKEN( seq ): pCtx = new SequenceTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_excl: + case PPT_TOKEN( excl ): pCtx = new ParallelExclTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_anim: + case PPT_TOKEN( anim ): pCtx = new AnimContext ( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_animEffect: + case PPT_TOKEN( animEffect ): pCtx = new AnimEffectContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_animMotion: + case PPT_TOKEN( animMotion ): pCtx = new AnimMotionContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_animRot: + case PPT_TOKEN( animRot ): pCtx = new AnimRotContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_animScale: + case PPT_TOKEN( animScale ): pCtx = new AnimScaleContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_cmd: + case PPT_TOKEN( cmd ): pCtx = new CmdTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_set: + case PPT_TOKEN( set ): pCtx = new SetTimeNodeContext( rParent, aElement, xAttribs, pNode ); break; - case NMSP_PPT|XML_audio: - case NMSP_PPT|XML_video: + case PPT_TOKEN( audio ): + case PPT_TOKEN( video ): pCtx = new MediaNodeContext( rParent, aElement, xAttribs, pNode ); break; default: @@ -1106,43 +1104,43 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_par: + case PPT_TOKEN( par ): nNodeType = AnimationNodeType::PAR; break; - case NMSP_PPT|XML_seq: + case PPT_TOKEN( seq ): nNodeType = AnimationNodeType::SEQ; break; - case NMSP_PPT|XML_excl: + case PPT_TOKEN( excl ): // TODO pick the right type. We choose parallel for now as // there does not seem to be an "Exclusive" nNodeType = AnimationNodeType::PAR; break; - case NMSP_PPT|XML_anim: + case PPT_TOKEN( anim ): nNodeType = AnimationNodeType::ANIMATE; break; - case NMSP_PPT|XML_animClr: + case PPT_TOKEN( animClr ): nNodeType = AnimationNodeType::ANIMATECOLOR; break; - case NMSP_PPT|XML_animEffect: + case PPT_TOKEN( animEffect ): nNodeType = AnimationNodeType::TRANSITIONFILTER; break; - case NMSP_PPT|XML_animMotion: + case PPT_TOKEN( animMotion ): nNodeType = AnimationNodeType::ANIMATEMOTION; break; - case NMSP_PPT|XML_animRot: - case NMSP_PPT|XML_animScale: + case PPT_TOKEN( animRot ): + case PPT_TOKEN( animScale ): nNodeType = AnimationNodeType::ANIMATETRANSFORM; break; - case NMSP_PPT|XML_cmd: + case PPT_TOKEN( cmd ): nNodeType = AnimationNodeType::COMMAND; break; - case NMSP_PPT|XML_set: + case PPT_TOKEN( set ): nNodeType = AnimationNodeType::SET; break; - case NMSP_PPT|XML_audio: + case PPT_TOKEN( audio ): nNodeType = AnimationNodeType::AUDIO; break; - case NMSP_PPT|XML_video: + case PPT_TOKEN( video ): nNodeType = AnimationNodeType::AUDIO; OSL_TRACE( "OOX: video requested, gave Audio instead" ); break; diff --git a/oox/source/ppt/timetargetelementcontext.cxx b/oox/source/ppt/timetargetelementcontext.cxx index 884b6d30fa61..81320bef5e89 100644 --- a/oox/source/ppt/timetargetelementcontext.cxx +++ b/oox/source/ppt/timetargetelementcontext.cxx @@ -34,9 +34,7 @@ #include #include "oox/helper/attributelist.hxx" -#include "oox/core/namespaces.hxx" #include "oox/drawingml/embeddedwavaudiofile.hxx" -#include "tokens.hxx" using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; @@ -67,29 +65,29 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_bg: + case PPT_TOKEN( bg ): bTargetSet = true; maShapeTarget.mnType = XML_bg; break; - case NMSP_PPT|XML_txEl: + case PPT_TOKEN( txEl ): bTargetSet = true; maShapeTarget.mnType = XML_txEl; break; - case NMSP_PPT|XML_subSp: + case PPT_TOKEN( subSp ): bTargetSet = true; maShapeTarget.mnType = XML_subSp; maShapeTarget.msSubShapeId = xAttribs->getOptionalValue( XML_spid ); break; - case NMSP_PPT|XML_graphicEl: - case NMSP_PPT|XML_oleChartEl: + case PPT_TOKEN( graphicEl ): + case PPT_TOKEN( oleChartEl ): bTargetSet = true; // TODO break; - case NMSP_PPT|XML_charRg: - case NMSP_PPT|XML_pRg: + case PPT_TOKEN( charRg ): + case PPT_TOKEN( pRg ): if( bTargetSet && maShapeTarget.mnType == XML_txEl ) { - maShapeTarget.mnRangeType = getToken( aElementToken ); + maShapeTarget.mnRangeType = getBaseToken( aElementToken ); maShapeTarget.maRange = drawingml::GetIndexRange( xAttribs ); } break; @@ -130,7 +128,7 @@ namespace oox { namespace ppt { switch( aElementToken ) { - case NMSP_PPT|XML_inkTgt: + case PPT_TOKEN( inkTgt ): { mpTarget->mnType = XML_inkTgt; OUString aId = xAttribs->getOptionalValue( XML_spid ); @@ -140,10 +138,10 @@ namespace oox { namespace ppt { } break; } - case NMSP_PPT|XML_sldTgt: + case PPT_TOKEN( sldTgt ): mpTarget->mnType = XML_sldTgt; break; - case NMSP_PPT|XML_sndTgt: + case PPT_TOKEN( sndTgt ): { mpTarget->mnType = XML_sndTgt; drawingml::EmbeddedWAVAudioFile aAudio; @@ -153,7 +151,7 @@ namespace oox { namespace ppt { mpTarget->msValue = sSndName; break; } - case NMSP_PPT|XML_spTgt: + case PPT_TOKEN( spTgt ): { mpTarget->mnType = XML_spTgt; OUString aId = xAttribs->getOptionalValue( XML_spid ); @@ -162,7 +160,7 @@ namespace oox { namespace ppt { break; } default: - OSL_TRACE( "OOX: unhandled tag %ld in TL_TimeTargetElement.", getToken( aElementToken ) ); + OSL_TRACE( "OOX: unhandled tag %ld in TL_TimeTargetElement.", getBaseToken( aElementToken ) ); break; } diff --git a/oox/source/shape/FastTokenHandlerService.cxx b/oox/source/shape/FastTokenHandlerService.cxx deleted file mode 100644 index 292f64548363..000000000000 --- a/oox/source/shape/FastTokenHandlerService.cxx +++ /dev/null @@ -1,118 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "FastTokenHandlerService.hxx" - -#include -#include "oox/helper/helper.hxx" - -namespace oox { -namespace shape { - -// ============================================================================ - -using namespace ::com::sun::star::uno; - -using ::rtl::OUString; - -// ============================================================================ - -OUString SAL_CALL FastTokenHandlerService_getImplementationName() -{ - return CREATE_OUSTRING( "com.sun.star.comp.oox.FastTokenHandlerService" ); -} - -Sequence< OUString > SAL_CALL FastTokenHandlerService_getSupportedServiceNames() -{ - Sequence< OUString > s( 1 ); - s[ 0 ] = CREATE_OUSTRING( "com.sun.star.xml.sax.FastTokenHandler" ); - return s; -} - -Reference< XInterface > SAL_CALL FastTokenHandlerService_createInstance( const Reference< XComponentContext >& rxContext ) throw (Exception) -{ - return static_cast< ::cppu::OWeakObject* >( new FastTokenHandlerService( rxContext ) ); -} - -// ============================================================================ - -FastTokenHandlerService::FastTokenHandlerService( const Reference< XComponentContext >& rxContext ) : - m_xContext( rxContext ) -{ -} - -FastTokenHandlerService::~FastTokenHandlerService() -{ -} - -// com.sun.star.uno.XServiceInfo: -OUString SAL_CALL FastTokenHandlerService::getImplementationName() throw (RuntimeException) -{ - return FastTokenHandlerService_getImplementationName(); -} - -sal_Bool SAL_CALL FastTokenHandlerService::supportsService( const OUString& serviceName ) throw (RuntimeException) -{ - Sequence< OUString > serviceNames = FastTokenHandlerService_getSupportedServiceNames(); - for( sal_Int32 i = 0; i < serviceNames.getLength(); ++i ) - { - if( serviceNames[ i ] == serviceName ) - return sal_True; - } - return sal_False; -} - -Sequence< OUString > SAL_CALL FastTokenHandlerService::getSupportedServiceNames() throw (RuntimeException) -{ - return FastTokenHandlerService_getSupportedServiceNames(); -} - -// ::com::sun::star::xml::sax::XFastTokenHandler: -sal_Int32 SAL_CALL FastTokenHandlerService::getToken( const OUString& Identifier ) throw (RuntimeException) -{ - return mFastTokenHandler.getToken(Identifier); -} - -OUString SAL_CALL FastTokenHandlerService::getIdentifier( sal_Int32 Token ) throw (RuntimeException) -{ - return mFastTokenHandler.getIdentifier(Token); -} - -Sequence< sal_Int8 > SAL_CALL FastTokenHandlerService::getUTF8Identifier( sal_Int32 Token ) throw (RuntimeException) -{ - return mFastTokenHandler.getUTF8Identifier(Token); -} - -sal_Int32 SAL_CALL FastTokenHandlerService::getTokenFromUTF8( const Sequence< sal_Int8 >& Identifier ) throw (RuntimeException) -{ - return mFastTokenHandler.getTokenFromUTF8(Identifier); -} - -// ============================================================================ - -} // namspace shape -} // namspace oox diff --git a/oox/source/shape/FastTokenHandlerService.hxx b/oox/source/shape/FastTokenHandlerService.hxx deleted file mode 100644 index 09c7c2044922..000000000000 --- a/oox/source/shape/FastTokenHandlerService.hxx +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef OOX_SHAPE_FASTTOKENHANDLERSERVICE_HXX -#define OOX_SHAPE_FASTTOKENHANDLERSERVICE_HXX - -#include -#include -#include -#include "oox/core/fasttokenhandler.hxx" - -namespace oox { -namespace shape { - -// ============================================================================ - -typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::xml::sax::XFastTokenHandler > FastTokenHandlerServiceBase; - -class FastTokenHandlerService : public FastTokenHandlerServiceBase -{ -public: - explicit FastTokenHandlerService( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxCcontext ); - virtual ~FastTokenHandlerService(); - - // ::com::sun::star::lang::XServiceInfo: - virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString & ServiceName) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); - - // ::com::sun::star::xml::sax::XFastTokenHandler: - virtual ::sal_Int32 SAL_CALL getToken(const ::rtl::OUString & Identifier) throw (::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getIdentifier(::sal_Int32 Token) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getUTF8Identifier( ::sal_Int32 Token ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getTokenFromUTF8(const ::com::sun::star::uno::Sequence< ::sal_Int8 > & Identifier) throw (::com::sun::star::uno::RuntimeException); - -private: - FastTokenHandlerService(FastTokenHandlerService &); // not defined - void operator =(FastTokenHandlerService &); // not defined - - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; - ::oox::core::FastTokenHandler mFastTokenHandler; -}; - -// ============================================================================ - -} // namspace shape -} // namspace oox - -#endif diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index 86d36268b1d8..31ab343e0ebc 100644 --- a/oox/source/shape/ShapeContextHandler.cxx +++ b/oox/source/shape/ShapeContextHandler.cxx @@ -29,7 +29,6 @@ #include "oox/vml/vmldrawingfragment.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" -#include "tokens.hxx" namespace oox { namespace shape { @@ -124,10 +123,10 @@ ShapeContextHandler::getContextHandler() { uno::Reference xResult; - switch (mnStartToken & NMSP_MASK) + switch (getNamespace( mnStartToken )) { - case NMSP_DOC: - case NMSP_VML: + case NMSP_doc: + case NMSP_vml: xResult.set(getDrawingShapeContext()); break; default: diff --git a/oox/source/shape/makefile.mk b/oox/source/shape/makefile.mk index f5a3af5542c0..c6534b3a8a6f 100644 --- a/oox/source/shape/makefile.mk +++ b/oox/source/shape/makefile.mk @@ -42,8 +42,7 @@ ENABLE_EXCEPTIONS=TRUE SLOFILES = \ $(SLO)$/ShapeContextHandler.obj \ - $(SLO)$/ShapeFilterBase.obj \ - $(SLO)$/FastTokenHandlerService.obj + $(SLO)$/ShapeFilterBase.obj # --- Targets ------------------------------------------------------- diff --git a/oox/source/token/gennamespaces.pl b/oox/source/token/gennamespaces.pl deleted file mode 100644 index 2a7f2e2423bb..000000000000 --- a/oox/source/token/gennamespaces.pl +++ /dev/null @@ -1,66 +0,0 @@ -$ARGV0 = shift @ARGV; -$ARGV1 = shift @ARGV; - -open ( NAMESPACES, $ARGV0 ) || die "can't open namespaces file: $!"; - - -open ( HXX, ">$ARGV1" ) or die "can't open namespaces.hxx file: $!"; - -print ( HXX "#ifndef OOX_NAMESPACES_HXX\n" ); -print ( HXX "#define OOX_NAMESPACES_HXX\n\n" ); -print ( HXX "#include \n\n" ); -print ( HXX "namespace oox {\n\n" ); - -$group = 0; -$i = 1; -while ( ) -{ - chomp( $_ ); - $_ =~ s/\s*//g; - if ( $_ =~ m/^$/ ) - { - # Start a new group - print ( HXX "\n" ); - $i = 0; - $group++; - } - elsif ( $_ =~ m/^[^#]/ ) - { - # Neither an empty line nor a comment - $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Invalid namespace token $_"; - $id = "NMSP_$_"; - $id =~ s/-/_/g; - $no = $group*10 + $i; - print ( HXX "const sal_Int32 $id = $no << 16;\n" ); - ++$i; - } -} -close ( NAMESPACES ); - -print ( HXX "\nconst sal_Int32 TOKEN_MASK = SAL_MAX_UINT16;\n" ); -print ( HXX "const sal_Int32 NMSP_MASK = SAL_MAX_INT16 << 16;\n" ); - -print ( HXX "/** Returns the token identifier of the passed element without namespace. */\n" ); -print ( HXX "inline sal_Int32 getToken( sal_Int32 nElement ) { return nElement & TOKEN_MASK; }\n\n" ); - -print ( HXX "/** Returns the namespace of the passed element without token identifier. */\n" ); -print ( HXX "inline sal_Int32 getNamespace( sal_Int32 nElement ) { return nElement & NMSP_MASK; }\n\n" ); - -print ( HXX "// defines for tokens with specific namespaces, can be used in switch/cases\n\n" ); -print ( HXX "#define A_TOKEN( token ) (::oox::NMSP_DRAWINGML | XML_##token)\n" ); -print ( HXX "#define AX_TOKEN( token ) (::oox::NMSP_AX | XML_##token)\n" ); -print ( HXX "#define C_TOKEN( token ) (::oox::NMSP_CHART | XML_##token)\n" ); -print ( HXX "#define CDR_TOKEN( token ) (::oox::NMSP_CDR | XML_##token)\n" ); -print ( HXX "#define O_TOKEN( token ) (::oox::NMSP_OFFICE | XML_##token)\n" ); -print ( HXX "#define PPT_TOKEN( token ) (::oox::NMSP_PPT | XML_##token)\n" ); -print ( HXX "#define R_TOKEN( token ) (::oox::NMSP_RELATIONSHIPS | XML_##token)\n" ); -print ( HXX "#define VML_TOKEN( token ) (::oox::NMSP_VML | XML_##token)\n" ); -print ( HXX "#define VMLX_TOKEN( token ) (::oox::NMSP_VML_XLS | XML_##token)\n" ); -print ( HXX "#define XDR_TOKEN( token ) (::oox::NMSP_XDR | XML_##token)\n" ); -print ( HXX "#define XLS_TOKEN( token ) (::oox::NMSP_XLS | XML_##token)\n" ); -print ( HXX "#define XM_TOKEN( token ) (::oox::NMSP_XM | XML_##token)\n" ); -print ( HXX "#define XML_TOKEN( token ) (::oox::NMSP_XML | XML_##token)\n" ); - - -print ( HXX "} // namespace oox\n\n" ); -print ( HXX "#endif // OOX_NAMESPACES_HXX\n" ); diff --git a/oox/source/token/genproperties.pl b/oox/source/token/genproperties.pl deleted file mode 100644 index 9dbe15c8ac12..000000000000 --- a/oox/source/token/genproperties.pl +++ /dev/null @@ -1,46 +0,0 @@ -$ARGV0 = shift @ARGV; -$ARGV1 = shift @ARGV; -$ARGV2 = shift @ARGV; - -open ( PROPS, $ARGV0 ) || die "can't open properties source file: $!"; -my %props; - -while ( ) -{ - chomp( $_ ); - $_ =~ s/\s*//g; - $_ =~ /^[A-Z][a-zA-Z0-9]*$/ or die "invalid character in property '$_'"; - $id = "PROP_$_"; - $props{$_} = $id; -} -close ( TOKENS ); - -open ( HXX, ">$ARGV1" ) or die "can't open properties.hxx file: $!"; -open ( WORDS, ">$ARGV2" ) or die "can't open propertynames.inc file: $!"; - -print ( HXX "#ifndef OOX_PROPERTIES_HXX\n" ); -print ( HXX "#define OOX_PROPERTIES_HXX\n\n" ); -print ( HXX "#include \n" ); -print ( HXX "namespace oox {\n\n" ); - -print ( WORDS "static const sal_Char* propertywordlist[] = {\n" ); - -$i = 0; -foreach( sort( keys( %props ) ) ) -{ - print ( HXX "const sal_Int32 $props{$_} = $i;\n" ); - print ( WORDS " \"$_\",\n" ); - ++$i; -} - -print ( HXX "const sal_Int32 PROP_COUNT = $i;\n" ); -print ( HXX "const sal_Int32 PROP_INVALID = -1;\n\n" ); -print ( HXX "} // namespace oox\n" ); -print ( HXX "#endif\n" ); - -print ( WORDS " \"\"\n" ); -print ( WORDS "};\n" ); - -close ( HXX ); -close ( WORDS ); - diff --git a/oox/source/token/gentoken.pl b/oox/source/token/gentoken.pl deleted file mode 100644 index 196ac37ebb5c..000000000000 --- a/oox/source/token/gentoken.pl +++ /dev/null @@ -1,61 +0,0 @@ -$ARGV0 = shift @ARGV; -$ARGV1 = shift @ARGV; -$ARGV2 = shift @ARGV; -$ARGV3 = shift @ARGV; - -open ( TOKENS, $ARGV0 ) || die "can't open $ARGV0 file: $!"; -my %tokens; - -while ( ) -{ - chomp( $_ ); - $_ =~ s/\s*//g; - $_ =~ /^[a-zA-Z0-9-_]+$/ or die "invalid character in token '$_'"; - $id = "XML_$_"; - $id =~ s/-/_/g; - $tokens{$_} = $id; -} -close ( TOKENS ); - -open ( HXX, ">$ARGV1" ) or die "can't open $ARGV1 file: $!"; -open ( WORDS, ">$ARGV2" ) or die "can't open $ARGV2 file: $!"; -open ( GPERF, ">$ARGV3" ) or die "can't open $ARGV3 file: $!"; - -print ( HXX "#ifndef OOX_TOKENS_HXX\n" ); -print ( HXX "#define OOX_TOKENS_HXX\n\n" ); -print ( HXX "#include \n" ); - -print ( WORDS "static const sal_Char* xmltokenwordlist[] = {\n" ); - -print ( GPERF "%language=C++\n" ); -print ( GPERF "%global-table\n" ); -print ( GPERF "%null-strings\n" ); -print ( GPERF "%struct-type\n" ); -print ( GPERF "struct xmltoken {\n" ); -print ( GPERF " const sal_Char *name;\n" ); -print ( GPERF " sal_Int32 nToken;\n" ); -print ( GPERF "};\n" ); -print ( GPERF "%%\n" ); - -$i = 0; -foreach( sort( keys( %tokens ) ) ) -{ - print ( HXX "const sal_Int32 $tokens{$_} = $i;\n" ); - print ( WORDS " \"$_\",\n" ); - print ( GPERF "$_,$tokens{$_}\n" ); - ++$i; -} - -print ( HXX "const sal_Int32 XML_TOKEN_COUNT = $i;\n" ); -print ( HXX "const sal_Int32 XML_TOKEN_INVALID = ::com::sun::star::xml::sax::FastToken::DONTKNOW;\n\n" ); -print ( HXX "const sal_Int32 XML_ROOT_CONTEXT = SAL_MAX_INT32;\n\n" ); -print ( HXX "#endif\n" ); - -print ( WORDS " \"\"\n" ); -print ( WORDS "};\n" ); - -print ( GPERF "%%\n" ); - -close ( HXX ); -close ( WORDS ); -close ( GPERF ); diff --git a/oox/source/token/makefile.mk b/oox/source/token/makefile.mk index 7884c375fde6..ff42967f0bb1 100644 --- a/oox/source/token/makefile.mk +++ b/oox/source/token/makefile.mk @@ -39,40 +39,40 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- -SLOFILES = \ - $(SLO)$/propertylist.obj \ - $(SLO)$/tokenmap.obj +SLOFILES = \ + $(SLO)$/namespacemap.obj \ + $(SLO)$/propertynames.obj \ + $(SLO)$/tokenmap.obj # --- Targets ------------------------------------------------------- .INCLUDE : target.mk -$(MISC)$/tokens.gperf $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx $(INCCOM)$/propertywords.inc $(INCCOM)$/properties.hxx $(INCCOM)$/oox$/core$/namespaces.hxx : - @@noop $(assign do_phony:=.PHONY) +GENHEADERPATH = $(INCCOM)$/oox$/token -$(MISC)$/do_tokens $(do_phony) : tokens.txt gentoken.pl $(MISC)$/tokens.gperf $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx - @@-$(RM) $@ - $(PERL) gentoken.pl tokens.txt $(INCCOM)$/tokens.hxx $(INCCOM)$/tokenwords.inc $(MISC)$/tokens.gperf && $(TOUCH) $@ +$(MISC)$/tokenhash.gperf $(INCCOM)$/tokennames.inc $(GENHEADERPATH)$/tokens.hxx $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt $(GENHEADERPATH)$/namespaces.hxx $(INCCOM)$/propertynames.inc $(GENHEADERPATH)$/properties.hxx : + @@noop $(assign do_phony:=.PHONY) -$(INCCOM)$/oox: - $(MKDIR) $(INCCOM)$/oox +$(SLO)$/tokenmap.obj : $(INCCOM)$/tokenhash.inc $(INCCOM)$/tokennames.inc $(GENHEADERPATH)$/tokens.hxx $(MISC)$/do_tokens -$(INCCOM)$/oox$/core: $(INCCOM)$/oox - $(MKDIR) $(INCCOM)$/oox$/core +$(INCCOM)$/tokenhash.inc : $(MISC)$/tokenhash.gperf $(MISC)$/do_tokens + $(AUGMENT_LIBRARY_PATH) gperf --compare-strncmp $(MISC)$/tokenhash.gperf | $(SED) -e "s/(char\*)0/(char\*)0, 0/g" | $(GREP) -v "^#line" >$(INCCOM)$/tokenhash.inc -$(MISC)$/do_namespaces $(do_phony) : namespaces.txt gennamespaces.pl +$(MISC)$/do_tokens $(do_phony) : tokens.txt tokens.pl tokens.hxx.head tokens.hxx.tail $(GENHEADERPATH)$/tokens.hxx $(INCCOM)$/tokennames.inc $(MISC)$/tokenhash.gperf @@-$(RM) $@ - $(MKDIRHIER) $(INCCOM)$/oox$/core - $(PERL) gennamespaces.pl namespaces.txt $(INCCOM)$/oox$/core$/namespaces.hxx && $(TOUCH) $@ + $(MKDIRHIER) $(GENHEADERPATH) + $(PERL) tokens.pl tokens.txt $(MISC)$/tokenids.inc $(INCCOM)$/tokennames.inc $(MISC)$/tokenhash.gperf && $(TYPE) tokens.hxx.head $(MISC)$/tokenids.inc tokens.hxx.tail > $(GENHEADERPATH)$/tokens.hxx && $(TOUCH) $@ -$(INCCOM)$/tokens.inc : $(MISC)$/tokens.gperf $(MISC)$/do_tokens - $(AUGMENT_LIBRARY_PATH) gperf --compare-strncmp $(MISC)$/tokens.gperf | $(SED) -e "s/(char\*)0/(char\*)0, 0/g" | $(GREP) -v "^#line" >$(INCCOM)$/tokens.inc +$(SLO)$/namespacemap.obj : $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt $(GENHEADERPATH)$/namespaces.hxx $(MISC)$/do_namespaces -$(SLO)$/tokenmap.obj : $(INCCOM)$/tokens.inc $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx $(INCCOM)$/oox$/core$/namespaces.hxx $(MISC)$/do_tokens $(MISC)$/do_namespaces - -$(MISC)$/do_properties $(do_phony) : properties.txt genproperties.pl $(INCCOM)$/properties.hxx $(INCCOM)$/propertywords.inc +$(MISC)$/do_namespaces $(do_phony) : namespaces.txt namespaces.pl namespaces.hxx.head namespaces.hxx.tail $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt $(GENHEADERPATH)$/namespaces.hxx @@-$(RM) $@ - $(PERL) genproperties.pl properties.txt $(INCCOM)$/properties.hxx $(INCCOM)$/propertywords.inc && $(TOUCH) $@ + $(MKDIRHIER) $(GENHEADERPATH) + $(PERL) namespaces.pl namespaces.txt $(MISC)$/namespaceids.inc $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt && $(TYPE) namespaces.hxx.head $(MISC)$/namespaceids.inc namespaces.hxx.tail > $(GENHEADERPATH)$/namespaces.hxx && $(TOUCH) $@ -$(SLO)$/propertylist.obj : $(INCCOM)$/propertywords.inc $(INCCOM)$/properties.hxx $(MISC)$/do_properties +$(SLO)$/propertynames.obj : $(INCCOM)$/propertynames.inc $(GENHEADERPATH)$/properties.hxx $(MISC)$/do_properties +$(MISC)$/do_properties $(do_phony) : properties.txt properties.pl properties.hxx.head properties.hxx.tail $(INCCOM)$/propertynames.inc $(GENHEADERPATH)$/properties.hxx + @@-$(RM) $@ + $(MKDIRHIER) $(GENHEADERPATH) + $(PERL) properties.pl properties.txt $(MISC)$/propertyids.inc $(INCCOM)$/propertynames.inc && $(TYPE) properties.hxx.head $(MISC)$/propertyids.inc properties.hxx.tail > $(GENHEADERPATH)$/properties.hxx && $(TOUCH) $@ diff --git a/oox/source/token/namespacemap.cxx b/oox/source/token/namespacemap.cxx new file mode 100755 index 000000000000..6d5e437f5b31 --- /dev/null +++ b/oox/source/token/namespacemap.cxx @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "oox/token/namespacemap.hxx" + +namespace oox { + +// ============================================================================ + +NamespaceMap::NamespaceMap() +{ + static const struct NamespaceUrl { sal_Int32 mnId; sal_Char* mpcUrl; } spNamespaceUrls[] = + { +// include auto-generated C array with namespace URLs as C strings +#include "namespacenames.inc" + { -1, "" } + }; + + for( const NamespaceUrl* pNamespaceUrl = spNamespaceUrls; pNamespaceUrl->mnId != -1; ++pNamespaceUrl ) + operator[]( pNamespaceUrl->mnId ) = ::rtl::OUString::createFromAscii( pNamespaceUrl->mpcUrl ); +} + +// ============================================================================ + +} // namespace oox diff --git a/oox/source/token/namespaces.hxx.head b/oox/source/token/namespaces.hxx.head new file mode 100755 index 000000000000..351bf2558303 --- /dev/null +++ b/oox/source/token/namespaces.hxx.head @@ -0,0 +1,36 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_TOKEN_NAMESPACES_HXX +#define OOX_TOKEN_NAMESPACES_HXX + +#include + +namespace oox { + +// ============================================================================ + diff --git a/oox/source/token/namespaces.hxx.tail b/oox/source/token/namespaces.hxx.tail new file mode 100755 index 000000000000..651fc38511d4 --- /dev/null +++ b/oox/source/token/namespaces.hxx.tail @@ -0,0 +1,35 @@ + +// ============================================================================ + +const sal_Int32 TOKEN_MASK = static_cast< sal_Int32 >( (1 << NMSP_SHIFT) - 1 ); +const sal_Int32 NMSP_MASK = static_cast< sal_Int32 >( SAL_MAX_INT16 & ~TOKEN_MASK ); + +/** Returns the raw token identifier without namespace of the passed token. */ +inline sal_Int32 getBaseToken( sal_Int32 nToken ) { return nToken & TOKEN_MASK; } + +/** Returns the namespace without token identifier of the passed token. */ +inline sal_Int32 getNamespace( sal_Int32 nToken ) { return nToken & NMSP_MASK; } + +// defines for tokens with specific namespaces +#define A_TOKEN( token ) (::oox::NMSP_dml | XML_##token) +#define AX_TOKEN( token ) (::oox::NMSP_ax | XML_##token) +#define C_TOKEN( token ) (::oox::NMSP_dmlChart | XML_##token) +#define CDR_TOKEN( token ) (::oox::NMSP_dmlChartDr | XML_##token) +#define DGM_TOKEN( token ) (::oox::NMSP_dmlDiagram | XML_##token) +#define O_TOKEN( token ) (::oox::NMSP_vmlOffice | XML_##token) +#define PC_TOKEN( token ) (::oox::NMSP_packageContentTypes | XML_##token) +#define PPT_TOKEN( token ) (::oox::NMSP_ppt | XML_##token) +#define PR_TOKEN( token ) (::oox::NMSP_packageRel | XML_##token) +#define R_TOKEN( token ) (::oox::NMSP_officeRel | XML_##token) +#define VML_TOKEN( token ) (::oox::NMSP_vml | XML_##token) +#define VMLX_TOKEN( token ) (::oox::NMSP_vmlExcel | XML_##token) +#define XDR_TOKEN( token ) (::oox::NMSP_dmlSpreadDr | XML_##token) +#define XLS_TOKEN( token ) (::oox::NMSP_xls | XML_##token) +#define XM_TOKEN( token ) (::oox::NMSP_xm | XML_##token) +#define XML_TOKEN( token ) (::oox::NMSP_xml | XML_##token) + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/source/token/namespaces.pl b/oox/source/token/namespaces.pl new file mode 100644 index 000000000000..3c741fa7b2af --- /dev/null +++ b/oox/source/token/namespaces.pl @@ -0,0 +1,79 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$ARGV0 = shift @ARGV; +$ARGV1 = shift @ARGV; +$ARGV2 = shift @ARGV; +$ARGV3 = shift @ARGV; + +# parse input file + +open( INFILE, $ARGV0 ) or die "cannot open input file: $!"; +my %namespaces; +while( ) +{ + # trim newline + chomp( $_ ); + # trim leading/trailing whitespace + $_ =~ s/^\s*//g; + $_ =~ s/\s*$//g; + # trim comments + $_ =~ s/^#.*//; + # skip empty lines + if( $_ ) + { + # check for valid characters + $_ =~ /^([a-zA-Z]+)\s+([a-zA-Z0-9-.:\/]+)\s*$/ or die "Error: invalid character in input data"; + $namespaces{$1} = $2; + } +} +close( INFILE ); + +# generate output files + +open( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!"; +open( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!"; +open( TXTFILE, ">$ARGV3" ) or die "Error: cannot open output file: $!"; + +# number of bits to shift the namespace identifier +$shift = 16; + +print ( IDFILE "const size_t NMSP_SHIFT = $shift;\n" ); + +$i = 1; +foreach( keys( %namespaces ) ) +{ + print( IDFILE "const sal_Int32 NMSP_$_ = $i << NMSP_SHIFT;\n" ); + $id = $i << $shift; + print( NAMEFILE "{ $id, \"$namespaces{$_}\" },\n" ); + print( TXTFILE "$id $_ $namespaces{$_}\n" ); + ++$i; +} + +close( IDFILE ); +close( nameFILE ); +close( TXTFILE ); diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt index 45bb59541b1b..81b568067470 100644 --- a/oox/source/token/namespaces.txt +++ b/oox/source/token/namespaces.txt @@ -1,49 +1,52 @@ -# Relations, XML -XML -PACKAGE_RELATIONSHIPS -RELATIONSHIPS -CONTENT_TYPES - -# Office global -THEME -ACTIVATION -MATH - -#DrawingML -DRAWINGML -PICTURE -DIAGRAM -CHART -CDR -DOC_DRAWINGML - -# VML -VML -OFFICE -VML_DOC -VML_XLS -VML_PPT -AX - -#SpreadsheetML -XLS -XDR -XM - -#PresentationML -PPT - -#WordprocessingML -DOC -SML - -# Document properties -COREPR -DC -DCTERMS -EXTPR -CUSTPR -VT - -# Other elements: used by writerfilter -SPRM + +# generic XML ----------------------------------------------------------------- + +xml http://www.w3.org/XML/1998/namespace +schema http://schemas.openxmlformats.org/schemaLibrary/2006/main + +# package --------------------------------------------------------------------- + +packageContentTypes http://schemas.openxmlformats.org/package/2006/content-types +packageMetaCorePr http://schemas.openxmlformats.org/package/2006/metadata/core-properties +packageRel http://schemas.openxmlformats.org/package/2006/relationships + +# office shared --------------------------------------------------------------- + +officeCustomPr http://schemas.openxmlformats.org/officeDocument/2006/custom-properties +officeDocPropsVT http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes +officeExtPr http://schemas.openxmlformats.org/officeDocument/2006/extended-properties +officeMath http://schemas.openxmlformats.org/officeDocument/2006/math +officeRel http://schemas.openxmlformats.org/officeDocument/2006/relationships +officeRelTheme http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme + +# applications ---------------------------------------------------------------- + +doc http://schemas.openxmlformats.org/wordprocessingml/2006/main +xls http://schemas.openxmlformats.org/spreadsheetml/2006/main +ppt http://schemas.openxmlformats.org/presentationml/2006/main + +# drawing --------------------------------------------------------------------- + +dml http://schemas.openxmlformats.org/drawingml/2006/main +dmlChart http://schemas.openxmlformats.org/drawingml/2006/chart +dmlChartDr http://schemas.openxmlformats.org/drawingml/2006/chartDrawing +dmlDiagram http://schemas.openxmlformats.org/drawingml/2006/diagram +dmlPicture http://schemas.openxmlformats.org/drawingml/2006/picture +dmlSpreadDr http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing +dmlWordDr http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing + +# VML ------------------------------------------------------------------------- + +vml urn:schemas-microsoft-com:vml +vmlExcel urn:schemas-microsoft-com:office:excel +vmlOffice urn:schemas-microsoft-com:office:office +vmlPowerpoint urn:schemas-microsoft-com:office:powerpoint +vmlWord urn:schemas-microsoft-com:office:word + +# other ----------------------------------------------------------------------- + +ax http://schemas.microsoft.com/office/2006/activeX +dc http://purl.org/dc/elements/1.1/ +dcTerms http://purl.org/dc/terms/ +xm http://schemas.microsoft.com/office/excel/2006/main +sprm http://sprm diff --git a/oox/source/token/parsexsd.pl b/oox/source/token/parsexsd.pl index 3b6745121e4c..8fed059bbc44 100644 --- a/oox/source/token/parsexsd.pl +++ b/oox/source/token/parsexsd.pl @@ -1,3 +1,30 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + $ARGV = shift @ARGV; my %tokens; diff --git a/oox/source/token/properties.hxx.head b/oox/source/token/properties.hxx.head new file mode 100755 index 000000000000..25817b5e72f3 --- /dev/null +++ b/oox/source/token/properties.hxx.head @@ -0,0 +1,36 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_TOKEN_PROPERTIES_HXX +#define OOX_TOKEN_PROPERTIES_HXX + +#include + +namespace oox { + +// ============================================================================ + diff --git a/oox/source/token/properties.hxx.tail b/oox/source/token/properties.hxx.tail new file mode 100755 index 000000000000..f647337e529c --- /dev/null +++ b/oox/source/token/properties.hxx.tail @@ -0,0 +1,6 @@ + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/source/token/properties.pl b/oox/source/token/properties.pl new file mode 100644 index 000000000000..f341924bbb90 --- /dev/null +++ b/oox/source/token/properties.pl @@ -0,0 +1,67 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$ARGV0 = shift @ARGV; +$ARGV1 = shift @ARGV; +$ARGV2 = shift @ARGV; + +# parse input file + +open( INFILE, $ARGV0 ) or die "Error: cannot open input file: $!"; +my %props; +while( ) +{ + # trim newline + chomp( $_ ); + # trim leading/trailing whitespace + $_ =~ s/^\s*//g; + $_ =~ s/\s*$//g; + # check for valid characters + $_ =~ /^[A-Z][a-zA-Z0-9]*$/ or die "Error: invalid character in property '$_'"; + $id = "PROP_$_"; + $props{$_} = $id; +} +close( INFILE ); + +# generate output files + +open( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!"; +open( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!"; + +$i = 0; +foreach( sort( keys( %props ) ) ) +{ + print( IDFILE "const sal_Int32 $props{$_} = $i;\n" ); + print( NAMEFILE "/* $i */ \"$_\",\n" ); + ++$i; +} + +print( IDFILE "const sal_Int32 PROP_COUNT = $i;\n" ); +print( IDFILE "const sal_Int32 PROP_INVALID = -1;\n" ); + +close( IDFILE ); +close( NAMEFILE ); diff --git a/oox/source/token/propertylist.cxx b/oox/source/token/propertylist.cxx deleted file mode 100644 index 0ffc902fcdc0..000000000000 --- a/oox/source/token/propertylist.cxx +++ /dev/null @@ -1,56 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "oox/token/propertylist.hxx" -#include "properties.hxx" - -namespace oox { - -namespace { - -// include auto-generated property name lists -#include "propertywords.inc" - -} // namespace - -// ============================================================================ - -PropertyList::PropertyList() -{ - reserve( static_cast< size_t >( PROP_COUNT ) ); - for( sal_Int32 nIdx = 0; nIdx < PROP_COUNT; ++nIdx ) - push_back( ::rtl::OUString::createFromAscii( propertywordlist[ nIdx ] ) ); -} - -PropertyList::~PropertyList() -{ -} - -// ============================================================================ - -} // namespace oox - diff --git a/oox/source/token/propertynames.cxx b/oox/source/token/propertynames.cxx new file mode 100644 index 000000000000..401d168fe696 --- /dev/null +++ b/oox/source/token/propertynames.cxx @@ -0,0 +1,51 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "oox/token/propertynames.hxx" + +namespace oox { + +// ============================================================================ + +PropertyNameVector::PropertyNameVector() +{ + static const sal_Char* sppcPropertyNames[] = + { + // include auto-generated C array with property names as C strings +#include "propertynames.inc" + "" + }; + + size_t nArraySize = (sizeof( sppcPropertyNames ) / sizeof( *sppcPropertyNames )) - 1; + reserve( nArraySize ); + for( size_t nIndex = 0; nIndex < nArraySize; ++nIndex ) + push_back( ::rtl::OUString::createFromAscii( sppcPropertyNames[ nIndex ] ) ); +} + +// ============================================================================ + +} // namespace oox diff --git a/oox/source/token/tokenmap.cxx b/oox/source/token/tokenmap.cxx index b5ed8e9a9323..dcd354ea84ed 100644 --- a/oox/source/token/tokenmap.cxx +++ b/oox/source/token/tokenmap.cxx @@ -26,28 +26,26 @@ ************************************************************************/ #include "oox/token/tokenmap.hxx" + #include #include #include -#include "tokens.hxx" #include "oox/helper/containerhelper.hxx" +#include "oox/token/tokens.hxx" -#include +namespace oox { +// ============================================================================ + +using ::com::sun::star::uno::Sequence; using ::rtl::OString; using ::rtl::OUString; -using ::com::sun::star::uno::Sequence; - -namespace oox { // ============================================================================ namespace { - -// include auto-generated token lists -#include "tokens.inc" -#include "tokenwords.inc" - +// include auto-generated Perfect_Hash +#include "tokenhash.inc" } // namespace // ============================================================================ @@ -55,10 +53,17 @@ namespace { TokenMap::TokenMap() : maTokenNames( static_cast< size_t >( XML_TOKEN_COUNT ) ) { - const sal_Char* const* ppcTokenWord = xmltokenwordlist; - for( TokenNameVector::iterator aIt = maTokenNames.begin(), aEnd = maTokenNames.end(); aIt != aEnd; ++aIt, ++ppcTokenWord ) + static const sal_Char* sppcTokenNames[] = { - OString aUtf8Token( *ppcTokenWord ); +// include auto-generated C array with token names as C strings +#include "tokennames.inc" + "" + }; + + const sal_Char* const* ppcTokenName = sppcTokenNames; + for( TokenNameVector::iterator aIt = maTokenNames.begin(), aEnd = maTokenNames.end(); aIt != aEnd; ++aIt, ++ppcTokenName ) + { + OString aUtf8Token( *ppcTokenName ); aIt->maUniName = OStringToOUString( aUtf8Token, RTL_TEXTENCODING_UTF8 ); aIt->maUtf8Name = Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aUtf8Token.getStr() ), aUtf8Token.getLength() ); } @@ -72,7 +77,7 @@ TokenMap::TokenMap() : OString aUtf8Name = OUStringToOString( maTokenNames[ nToken ].maUniName, RTL_TEXTENCODING_UTF8 ); struct xmltoken* pToken = Perfect_Hash::in_word_set( aUtf8Name.getStr(), aUtf8Name.getLength() ); bOk = pToken && (pToken->nToken == nToken); - OSL_ENSURE( bOk, ::rtl::OStringBuffer( "FastTokenHandler::FastTokenHandler - token list broken, #" ). + OSL_ENSURE( bOk, ::rtl::OStringBuffer( "TokenMap::TokenMap - token list broken, #" ). append( nToken ).append( ", '" ).append( aUtf8Name ).append( '\'' ).getStr() ); } #endif @@ -111,4 +116,3 @@ sal_Int32 TokenMap::getTokenFromUtf8( const Sequence< sal_Int8 >& rUtf8Name ) co // ============================================================================ } // namespace oox - diff --git a/oox/source/token/tokens.hxx.head b/oox/source/token/tokens.hxx.head new file mode 100755 index 000000000000..dd201caeb1d9 --- /dev/null +++ b/oox/source/token/tokens.hxx.head @@ -0,0 +1,36 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_TOKEN_TOKENS_HXX +#define OOX_TOKEN_TOKENS_HXX + +#include + +namespace oox { + +// ============================================================================ + diff --git a/oox/source/token/tokens.hxx.tail b/oox/source/token/tokens.hxx.tail new file mode 100755 index 000000000000..df4b5ef1a955 --- /dev/null +++ b/oox/source/token/tokens.hxx.tail @@ -0,0 +1,8 @@ + +const sal_Int32 XML_TOKEN_INVALID = ::com::sun::star::xml::sax::FastToken::DONTKNOW; + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/source/token/tokens.pl b/oox/source/token/tokens.pl new file mode 100644 index 000000000000..a951cee80db2 --- /dev/null +++ b/oox/source/token/tokens.pl @@ -0,0 +1,80 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$ARGV0 = shift @ARGV; +$ARGV1 = shift @ARGV; +$ARGV2 = shift @ARGV; +$ARGV3 = shift @ARGV; + +open( INFILE, $ARGV0 ) or die "Error: cannot open input file: $!"; +my %tokens; +while ( ) +{ + # trim newline + chomp( $_ ); + # trim leading/trailing whitespace + $_ =~ s/^\s*//g; + $_ =~ s/\s*$//g; + # check for valid characters + $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Error: invalid character in token '$_'"; + $id = "XML_$_"; + $id =~ s/-/_/g; + $tokens{$_} = $id; +} +close ( INFILE ); + +# generate output files + +open ( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!"; +open ( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!"; +open ( GPERFFILE, ">$ARGV3" ) or die "Error: cannot open output file: $!"; + +print( GPERFFILE "%language=C++\n" ); +print( GPERFFILE "%global-table\n" ); +print( GPERFFILE "%null-strings\n" ); +print( GPERFFILE "%struct-type\n" ); +print( GPERFFILE "struct xmltoken {\n" ); +print( GPERFFILE " const sal_Char *name;\n" ); +print( GPERFFILE " sal_Int32 nToken;\n" ); +print( GPERFFILE "};\n" ); +print( GPERFFILE "%%\n" ); + +$i = 0; +foreach( sort( keys( %tokens ) ) ) +{ + print( IDFILE "const sal_Int32 $tokens{$_} = $i;\n" ); + print( NAMEFILE "\"$_\",\n" ); + print( GPERFFILE "$_,$tokens{$_}\n" ); + ++$i; +} + +print( IDFILE "const sal_Int32 XML_TOKEN_COUNT = $i;\n" ); +print( GPERFFILE "%%\n" ); + +close( IDFILE ); +close( NAMEFILE ); +close( GPERFFILE ); diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index 065558d68c9f..c53dd2896395 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -35,7 +35,6 @@ #include "oox/ole/axcontrol.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" -#include "tokens.hxx" namespace oox { namespace vml { diff --git a/oox/source/vml/vmldrawingfragment.cxx b/oox/source/vml/vmldrawingfragment.cxx index aaa4532e5328..dc5c82515691 100644 --- a/oox/source/vml/vmldrawingfragment.cxx +++ b/oox/source/vml/vmldrawingfragment.cxx @@ -38,10 +38,8 @@ namespace vml { using namespace ::com::sun::star::io; using namespace ::com::sun::star::uno; +using namespace ::oox::core; -using ::oox::core::ContextHandlerRef; -using ::oox::core::FragmentHandler2; -using ::oox::core::XmlFilterBase; using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index 9aa91597dcc9..cd280d041eb9 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -35,7 +35,6 @@ #include "oox/helper/attributelist.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" -#include "tokens.hxx" namespace oox { namespace vml { diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 5603d1b541b1..93301357984f 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -45,7 +45,6 @@ #include "oox/vml/vmldrawing.hxx" #include "oox/vml/vmlshapecontainer.hxx" #include "oox/vml/vmltextbox.hxx" -#include "properties.hxx" namespace oox { namespace vml { diff --git a/oox/source/vml/vmltextbox.cxx b/oox/source/vml/vmltextbox.cxx index e684490f39af..f56eb387d5b2 100755 --- a/oox/source/vml/vmltextbox.cxx +++ b/oox/source/vml/vmltextbox.cxx @@ -28,7 +28,6 @@ #include "oox/vml/vmltextbox.hxx" #include -#include "tokens.hxx" namespace oox { namespace vml { diff --git a/oox/source/xls/autofilterbuffer.cxx b/oox/source/xls/autofilterbuffer.cxx index 15cb2f726327..9017fefa9e9c 100755 --- a/oox/source/xls/autofilterbuffer.cxx +++ b/oox/source/xls/autofilterbuffer.cxx @@ -34,15 +34,12 @@ #include #include #include -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/propertyset.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/defnamesbuffer.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/chartsheetfragment.cxx b/oox/source/xls/chartsheetfragment.cxx index 5a8a3774c9c5..ca5c9c77b2d7 100644 --- a/oox/source/xls/chartsheetfragment.cxx +++ b/oox/source/xls/chartsheetfragment.cxx @@ -40,8 +40,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/commentsfragment.cxx b/oox/source/xls/commentsfragment.cxx index 7df1269be8e0..9346686c79fb 100644 --- a/oox/source/xls/commentsfragment.cxx +++ b/oox/source/xls/commentsfragment.cxx @@ -34,8 +34,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/condformatbuffer.cxx b/oox/source/xls/condformatbuffer.cxx index e79684012d92..066b8188ddae 100644 --- a/oox/source/xls/condformatbuffer.cxx +++ b/oox/source/xls/condformatbuffer.cxx @@ -48,7 +48,6 @@ #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/stylesbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/connectionsbuffer.cxx b/oox/source/xls/connectionsbuffer.cxx index 12df30fe493f..30472d7dd919 100755 --- a/oox/source/xls/connectionsbuffer.cxx +++ b/oox/source/xls/connectionsbuffer.cxx @@ -27,11 +27,9 @@ #include "oox/xls/connectionsbuffer.hxx" -#include "oox/core/namespaces.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" -#include "tokens.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/connectionsfragment.cxx b/oox/source/xls/connectionsfragment.cxx index f83f9028faa8..1d60a954a8a8 100644 --- a/oox/source/xls/connectionsfragment.cxx +++ b/oox/source/xls/connectionsfragment.cxx @@ -36,9 +36,9 @@ namespace xls { // ============================================================================ +using namespace ::oox::core; + using ::rtl::OUString; -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; // ============================================================================ diff --git a/oox/source/xls/defnamesbuffer.cxx b/oox/source/xls/defnamesbuffer.cxx index 94ca1fb321bf..360281143d88 100644 --- a/oox/source/xls/defnamesbuffer.cxx +++ b/oox/source/xls/defnamesbuffer.cxx @@ -42,7 +42,6 @@ #include "oox/xls/externallinkbuffer.hxx" #include "oox/xls/formulaparser.hxx" #include "oox/xls/worksheetbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx index ce99f1f7060f..5ba60ffeb4d3 100644 --- a/oox/source/xls/drawingfragment.cxx +++ b/oox/source/xls/drawingfragment.cxx @@ -44,7 +44,6 @@ #include "oox/xls/stylesbuffer.hxx" #include "oox/xls/themebuffer.hxx" #include "oox/xls/unitconverter.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/excelfilter.cxx b/oox/source/xls/excelfilter.cxx index 030b9cf203c1..13d4cbd14fcc 100644 --- a/oox/source/xls/excelfilter.cxx +++ b/oox/source/xls/excelfilter.cxx @@ -121,7 +121,7 @@ bool ExcelFilter::importDocument() throw() this variable (nonpro only). */ OOX_DUMP_FILE( ::oox::dump::xlsb::Dumper ); - OUString aWorkbookPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "officeDocument" ) ); + OUString aWorkbookPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "officeDocument" ) ); if( aWorkbookPath.getLength() == 0 ) return false; diff --git a/oox/source/xls/excelvbaproject.cxx b/oox/source/xls/excelvbaproject.cxx index c21a65b75961..7fc8115cc680 100755 --- a/oox/source/xls/excelvbaproject.cxx +++ b/oox/source/xls/excelvbaproject.cxx @@ -38,7 +38,6 @@ #include #include "oox/helper/helper.hxx" #include "oox/helper/propertyset.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/externallinkbuffer.cxx b/oox/source/xls/externallinkbuffer.cxx index 73264f338850..36c5dc984cb2 100644 --- a/oox/source/xls/externallinkbuffer.cxx +++ b/oox/source/xls/externallinkbuffer.cxx @@ -46,7 +46,6 @@ #include "oox/xls/excelhandlers.hxx" #include "oox/xls/formulaparser.hxx" #include "oox/xls/worksheetbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { @@ -812,8 +811,8 @@ ExternalNameRef ExternalLink::getNameByIndex( sal_Int32 nIndex ) const // private -------------------------------------------------------------------- -#define OOX_TARGETTYPE_EXTLINK CREATE_OFFICEDOC_RELATIONSTYPE( "externalLinkPath" ) -#define OOX_TARGETTYPE_LIBRARY CREATE_MSOFFICE_RELATIONSTYPE( "xlExternalLinkPath/xlLibrary" ) +#define OOX_TARGETTYPE_EXTLINK CREATE_OFFICEDOC_RELATION_TYPE( "externalLinkPath" ) +#define OOX_TARGETTYPE_LIBRARY CREATE_MSOFFICE_RELATION_TYPE( "xlExternalLinkPath/xlLibrary" ) void ExternalLink::setExternalTargetUrl( const OUString& rTargetUrl, const OUString& rTargetType ) { diff --git a/oox/source/xls/externallinkfragment.cxx b/oox/source/xls/externallinkfragment.cxx index d519e27e1506..9d984c918145 100644 --- a/oox/source/xls/externallinkfragment.cxx +++ b/oox/source/xls/externallinkfragment.cxx @@ -42,10 +42,8 @@ namespace xls { using namespace ::com::sun::star::sheet; using namespace ::com::sun::star::table; using namespace ::com::sun::star::uno; +using namespace ::oox::core; -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; -using ::oox::core::Relation; using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx index da7dc78e954a..21dd049c0515 100644 --- a/oox/source/xls/formulabase.cxx +++ b/oox/source/xls/formulabase.cxx @@ -45,7 +45,6 @@ #include "oox/core/filterbase.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/formulaparser.cxx b/oox/source/xls/formulaparser.cxx index 89b88915d162..7ab32981a6ba 100644 --- a/oox/source/xls/formulaparser.cxx +++ b/oox/source/xls/formulaparser.cxx @@ -41,7 +41,6 @@ #include "oox/xls/externallinkbuffer.hxx" #include "oox/xls/tablebuffer.hxx" #include "oox/xls/worksheethelper.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/numberformatsbuffer.cxx b/oox/source/xls/numberformatsbuffer.cxx index 36b51c03cfe8..f610167e5edd 100644 --- a/oox/source/xls/numberformatsbuffer.cxx +++ b/oox/source/xls/numberformatsbuffer.cxx @@ -42,7 +42,6 @@ #include "oox/helper/propertymap.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/pagesettings.cxx b/oox/source/xls/pagesettings.cxx index 7509552ffc09..b50a23989356 100644 --- a/oox/source/xls/pagesettings.cxx +++ b/oox/source/xls/pagesettings.cxx @@ -49,7 +49,6 @@ #include "oox/xls/excelhandlers.hxx" #include "oox/xls/stylesbuffer.hxx" #include "oox/xls/unitconverter.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/pivotcachebuffer.cxx b/oox/source/xls/pivotcachebuffer.cxx index e0c3cec9c193..76fd48dc3ab1 100644 --- a/oox/source/xls/pivotcachebuffer.cxx +++ b/oox/source/xls/pivotcachebuffer.cxx @@ -47,7 +47,6 @@ #include "oox/xls/tablebuffer.hxx" #include "oox/xls/unitconverter.hxx" #include "oox/xls/worksheetbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/pivotcachefragment.cxx b/oox/source/xls/pivotcachefragment.cxx index 8c4f56c7c820..68e24c03c3d7 100644 --- a/oox/source/xls/pivotcachefragment.cxx +++ b/oox/source/xls/pivotcachefragment.cxx @@ -39,9 +39,8 @@ namespace xls { // ============================================================================ using namespace ::com::sun::star::uno; +using namespace ::oox::core; -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/pivottablebuffer.cxx b/oox/source/xls/pivottablebuffer.cxx index df611b0cb3c4..be48e63f001f 100644 --- a/oox/source/xls/pivottablebuffer.cxx +++ b/oox/source/xls/pivottablebuffer.cxx @@ -51,7 +51,6 @@ #include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/pivottablefragment.cxx b/oox/source/xls/pivottablefragment.cxx index 1ed95b141b61..7c16eb7c5b51 100644 --- a/oox/source/xls/pivottablefragment.cxx +++ b/oox/source/xls/pivottablefragment.cxx @@ -35,8 +35,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/querytablebuffer.cxx b/oox/source/xls/querytablebuffer.cxx index 2a4df73287ca..26f677f1bbc3 100644 --- a/oox/source/xls/querytablebuffer.cxx +++ b/oox/source/xls/querytablebuffer.cxx @@ -37,7 +37,6 @@ #include "oox/xls/biffinputstream.hxx" #include "oox/xls/connectionsbuffer.hxx" #include "oox/xls/defnamesbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/querytablefragment.cxx b/oox/source/xls/querytablefragment.cxx index 2f4b2d06ff11..a6ed80af2194 100644 --- a/oox/source/xls/querytablefragment.cxx +++ b/oox/source/xls/querytablefragment.cxx @@ -35,8 +35,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/scenariobuffer.cxx b/oox/source/xls/scenariobuffer.cxx index 2c55d2fab4e5..697b74889dad 100644 --- a/oox/source/xls/scenariobuffer.cxx +++ b/oox/source/xls/scenariobuffer.cxx @@ -38,7 +38,6 @@ #include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/sharedformulabuffer.cxx b/oox/source/xls/sharedformulabuffer.cxx index 748a0c0576ae..0cf616646722 100644 --- a/oox/source/xls/sharedformulabuffer.cxx +++ b/oox/source/xls/sharedformulabuffer.cxx @@ -34,7 +34,6 @@ #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/formulaparser.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/sharedstringsfragment.cxx b/oox/source/xls/sharedstringsfragment.cxx index 041e87f52980..a356e9b29d7e 100644 --- a/oox/source/xls/sharedstringsfragment.cxx +++ b/oox/source/xls/sharedstringsfragment.cxx @@ -35,8 +35,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx index 36e5741818f3..13c4bb6612a6 100644 --- a/oox/source/xls/stylesbuffer.cxx +++ b/oox/source/xls/stylesbuffer.cxx @@ -54,7 +54,6 @@ #include "oox/xls/excelhandlers.hxx" #include "oox/xls/themebuffer.hxx" #include "oox/xls/unitconverter.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/stylesfragment.cxx b/oox/source/xls/stylesfragment.cxx index 1014cece5210..2ea01a8a84e2 100644 --- a/oox/source/xls/stylesfragment.cxx +++ b/oox/source/xls/stylesfragment.cxx @@ -34,8 +34,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/tablebuffer.cxx b/oox/source/xls/tablebuffer.cxx index 53408f366ae5..b3dac5e85eed 100644 --- a/oox/source/xls/tablebuffer.cxx +++ b/oox/source/xls/tablebuffer.cxx @@ -32,7 +32,6 @@ #include "oox/helper/propertyset.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/tablefragment.cxx b/oox/source/xls/tablefragment.cxx index 853a3d73ecd0..027a37eb4dcc 100644 --- a/oox/source/xls/tablefragment.cxx +++ b/oox/source/xls/tablefragment.cxx @@ -36,8 +36,8 @@ namespace xls { // ============================================================================ -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; +using namespace ::oox::core; + using ::rtl::OUString; // ============================================================================ diff --git a/oox/source/xls/themebuffer.cxx b/oox/source/xls/themebuffer.cxx index 0884dfcb0b56..c3e016327133 100644 --- a/oox/source/xls/themebuffer.cxx +++ b/oox/source/xls/themebuffer.cxx @@ -28,7 +28,6 @@ #include "oox/xls/themebuffer.hxx" #include "oox/xls/stylesbuffer.hxx" -#include "tokens.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/unitconverter.cxx b/oox/source/xls/unitconverter.cxx index 8aa9ee35a718..1b5f1e9b072c 100644 --- a/oox/source/xls/unitconverter.cxx +++ b/oox/source/xls/unitconverter.cxx @@ -37,7 +37,6 @@ #include "oox/core/filterbase.hxx" #include "oox/helper/propertyset.hxx" #include "oox/xls/stylesbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/viewsettings.cxx b/oox/source/xls/viewsettings.cxx index 6d6ae85055df..b86ec1fe7612 100644 --- a/oox/source/xls/viewsettings.cxx +++ b/oox/source/xls/viewsettings.cxx @@ -45,7 +45,6 @@ #include "oox/xls/unitconverter.hxx" #include "oox/xls/workbooksettings.hxx" #include "oox/xls/worksheetbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/workbookfragment.cxx b/oox/source/xls/workbookfragment.cxx index 60e77c60c6bd..042acc50dcbb 100644 --- a/oox/source/xls/workbookfragment.cxx +++ b/oox/source/xls/workbookfragment.cxx @@ -59,11 +59,8 @@ namespace xls { using namespace ::com::sun::star::io; using namespace ::com::sun::star::table; using namespace ::com::sun::star::uno; +using namespace ::oox::core; -using ::oox::core::ContextHandlerRef; -using ::oox::core::FragmentHandlerRef; -using ::oox::core::RecordInfo; -using ::oox::core::Relation; using ::oox::drawingml::ThemeFragmentHandler; using ::rtl::OUString; @@ -200,25 +197,25 @@ void WorkbookFragment::finalizeImport() ISegmentProgressBarRef xGlobalSegment = getProgressBar().createSegment( PROGRESS_LENGTH_GLOBALS ); // read the theme substream - OUString aThemeFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "theme" ) ); + OUString aThemeFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "theme" ) ); if( aThemeFragmentPath.getLength() > 0 ) importOoxFragment( new ThemeFragmentHandler( getFilter(), aThemeFragmentPath, getTheme() ) ); xGlobalSegment->setPosition( 0.25 ); // read the styles substream (requires finalized theme buffer) - OUString aStylesFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "styles" ) ); + OUString aStylesFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "styles" ) ); if( aStylesFragmentPath.getLength() > 0 ) importOoxFragment( new StylesFragment( *this, aStylesFragmentPath ) ); xGlobalSegment->setPosition( 0.5 ); // read the shared string table substream (requires finalized styles buffer) - OUString aSstFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "sharedStrings" ) ); + OUString aSstFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "sharedStrings" ) ); if( aSstFragmentPath.getLength() > 0 ) importOoxFragment( new SharedStringsFragment( *this, aSstFragmentPath ) ); xGlobalSegment->setPosition( 0.75 ); // read the connections substream - OUString aConnFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "connections" ) ); + OUString aConnFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "connections" ) ); if( aConnFragmentPath.getLength() > 0 ) importOoxFragment( new ConnectionsFragment( *this, aConnFragmentPath ) ); xGlobalSegment->setPosition( 1.0 ); @@ -247,20 +244,20 @@ void WorkbookFragment::finalizeImport() ISegmentProgressBarRef xSheetSegment = getProgressBar().createSegment( fSegmentLength ); // create the fragment according to the sheet type - if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "worksheet" ) ) + if( pRelation->maType == CREATE_OFFICEDOC_RELATION_TYPE( "worksheet" ) ) { xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_WORKSHEET, nCalcSheet ) ); } - else if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "chartsheet" ) ) + else if( pRelation->maType == CREATE_OFFICEDOC_RELATION_TYPE( "chartsheet" ) ) { xFragment.set( new ChartsheetFragment( *this, aFragmentPath, xSheetSegment, nCalcSheet ) ); } - else if( (pRelation->maType == CREATE_MSOFFICE_RELATIONSTYPE( "xlMacrosheet" )) || - (pRelation->maType == CREATE_MSOFFICE_RELATIONSTYPE( "xlIntlMacrosheet" )) ) + else if( (pRelation->maType == CREATE_MSOFFICE_RELATION_TYPE( "xlMacrosheet" )) || + (pRelation->maType == CREATE_MSOFFICE_RELATION_TYPE( "xlIntlMacrosheet" )) ) { xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_MACROSHEET, nCalcSheet ) ); } - else if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "dialogsheet" ) ) + else if( pRelation->maType == CREATE_OFFICEDOC_RELATION_TYPE( "dialogsheet" ) ) { xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_DIALOGSHEET, nCalcSheet ) ); } @@ -288,7 +285,7 @@ void WorkbookFragment::finalizeImport() } // open the VBA project storage - OUString aVbaFragmentPath = getFragmentPathFromFirstType( CREATE_MSOFFICE_RELATIONSTYPE( "vbaProject" ) ); + OUString aVbaFragmentPath = getFragmentPathFromFirstType( CREATE_MSOFFICE_RELATION_TYPE( "vbaProject" ) ); if( aVbaFragmentPath.getLength() > 0 ) { Reference< XInputStream > xInStrm = getBaseFilter().openInputStream( aVbaFragmentPath ); diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx index e523d6e42111..8cd2748101d7 100644 --- a/oox/source/xls/workbookhelper.cxx +++ b/oox/source/xls/workbookhelper.cxx @@ -65,7 +65,6 @@ #include "oox/xls/viewsettings.hxx" #include "oox/xls/workbooksettings.hxx" #include "oox/xls/worksheetbuffer.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/workbooksettings.cxx b/oox/source/xls/workbooksettings.cxx index 526bb375a7cf..e54628a6143f 100644 --- a/oox/source/xls/workbooksettings.cxx +++ b/oox/source/xls/workbooksettings.cxx @@ -37,7 +37,6 @@ #include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/unitconverter.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/worksheetbuffer.cxx b/oox/source/xls/worksheetbuffer.cxx index fbfaef8daed5..12903a4b3c27 100644 --- a/oox/source/xls/worksheetbuffer.cxx +++ b/oox/source/xls/worksheetbuffer.cxx @@ -40,7 +40,6 @@ #include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/excelhandlers.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/worksheetfragment.cxx b/oox/source/xls/worksheetfragment.cxx index dc51981fe230..1008a67af9b5 100644 --- a/oox/source/xls/worksheetfragment.cxx +++ b/oox/source/xls/worksheetfragment.cxx @@ -57,11 +57,8 @@ namespace xls { using namespace ::com::sun::star::table; using namespace ::com::sun::star::uno; +using namespace ::oox::core; -using ::oox::core::ContextHandlerRef; -using ::oox::core::RecordInfo; -using ::oox::core::Relations; -using ::oox::core::RelationsRef; using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -237,12 +234,12 @@ WorksheetFragment::WorksheetFragment( const WorkbookHelper& rHelper, WorksheetFragmentBase( rHelper, rFragmentPath, rxProgressBar, eSheetType, nSheet ) { // import data tables related to this worksheet - RelationsRef xTableRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "table" ) ); + RelationsRef xTableRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATION_TYPE( "table" ) ); for( Relations::const_iterator aIt = xTableRels->begin(), aEnd = xTableRels->end(); aIt != aEnd; ++aIt ) importOoxFragment( new TableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) ); // import comments related to this worksheet - OUString aCommentsFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "comments" ) ); + OUString aCommentsFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "comments" ) ); if( aCommentsFragmentPath.getLength() > 0 ) importOoxFragment( new CommentsFragment( *this, aCommentsFragmentPath ) ); } @@ -492,12 +489,12 @@ void WorksheetFragment::initializeImport() initializeWorksheetImport(); // import query table fragments related to this worksheet - RelationsRef xQueryRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "queryTable" ) ); + RelationsRef xQueryRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATION_TYPE( "queryTable" ) ); for( Relations::const_iterator aIt = xQueryRels->begin(), aEnd = xQueryRels->end(); aIt != aEnd; ++aIt ) importOoxFragment( new QueryTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) ); // import pivot table fragments related to this worksheet - RelationsRef xPivotRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "pivotTable" ) ); + RelationsRef xPivotRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATION_TYPE( "pivotTable" ) ); for( Relations::const_iterator aIt = xPivotRels->begin(), aEnd = xPivotRels->end(); aIt != aEnd; ++aIt ) importOoxFragment( new PivotTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) ); } diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx index de3b540df0a8..b4f8a4459234 100644 --- a/oox/source/xls/worksheethelper.cxx +++ b/oox/source/xls/worksheethelper.cxx @@ -74,8 +74,6 @@ #include "oox/xls/workbooksettings.hxx" #include "oox/xls/worksheetbuffer.hxx" #include "oox/xls/worksheetsettings.hxx" -#include "properties.hxx" -#include "tokens.hxx" namespace oox { namespace xls { diff --git a/oox/source/xls/worksheetsettings.cxx b/oox/source/xls/worksheetsettings.cxx index 7a4dc07d7b5e..b81f7fb6b841 100644 --- a/oox/source/xls/worksheetsettings.cxx +++ b/oox/source/xls/worksheetsettings.cxx @@ -34,7 +34,6 @@ #include "oox/xls/biffinputstream.hxx" #include "oox/xls/pagesettings.hxx" #include "oox/xls/workbooksettings.hxx" -#include "properties.hxx" namespace oox { namespace xls { diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index b7046a495bd8..b00fd433c884 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -1,18 +1,18 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/writerfilter/source/ooxml/namespaceids.xsl b/writerfilter/source/ooxml/namespaceids.xsl index 45828761da0c..4a1f3b2ba381 100644 --- a/writerfilter/source/ooxml/namespaceids.xsl +++ b/writerfilter/source/ooxml/namespaceids.xsl @@ -67,7 +67,7 @@ const sal_uInt32 = - << 16; +; diff --git a/writerfilter/source/resourcemodel/namespace_preprocess.pl b/writerfilter/source/resourcemodel/namespace_preprocess.pl index 22c172329f61..66644b70fd47 100644 --- a/writerfilter/source/resourcemodel/namespace_preprocess.pl +++ b/writerfilter/source/resourcemodel/namespace_preprocess.pl @@ -30,31 +30,16 @@ EOF # print the mapping open ( NAMESPACES, $ARGV0 ) || die "can't open namespace file: $!"; -$group = 0; -$i = 1; while ( ) { chomp( $_ ); - $_ =~ s/\s*//g; - if ( $_ =~ m/^$/ ) - { - # Start a new group - $i = 0; - $group++; - } - elsif ( $_ =~ m/^[^#]/ ) - { - # Neither an empty line nor a comment - $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Invalid namespace token $_"; - $_ =~ s/-/_/g; - $no = $group*10 + $i; - print < - $no + # line format is: numeric-id short-name namespace-URL + $_ =~ /^([0-9]+)\s+([a-zA-Z]+)\s+([a-zA-Z0-9-.:\/]+)\s*$/ or die "Error: invalid character in input data"; + print < + $1 EOF - ++$i; - } } print < Date: Mon, 8 Nov 2010 13:47:01 +0100 Subject: dr77: optimizations in generation of XML tokens, XML namespaces, property names; code cleanup --- sc/source/filter/excel/excdoc.cxx | 3 +-- sc/source/filter/excel/excrecds.cxx | 4 +--- sc/source/filter/excel/xecontent.cxx | 2 +- sc/source/filter/excel/xeescher.cxx | 2 +- sc/source/filter/excel/xename.cxx | 3 ++- sc/source/filter/excel/xepage.cxx | 2 +- sc/source/filter/excel/xepivot.cxx | 2 +- sc/source/filter/excel/xerecord.cxx | 2 +- sc/source/filter/excel/xestream.cxx | 4 ++-- sc/source/filter/excel/xestring.cxx | 2 +- sc/source/filter/excel/xestyle.cxx | 2 +- sc/source/filter/excel/xetable.cxx | 2 +- sc/source/filter/excel/xeview.cxx | 2 +- sc/source/filter/inc/xestream.hxx | 1 + sc/source/filter/xcl97/xcl97rec.cxx | 2 +- 15 files changed, 17 insertions(+), 18 deletions(-) diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index 8bc0424b114c..5623da885daa 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -84,8 +84,7 @@ #include -#include - +using namespace ::oox; using ::rtl::OString; static String lcl_GetVbaTabName( SCTAB n ) diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 9a66325db419..91758c9affce 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -96,11 +96,9 @@ #include "xcl97rec.hxx" -#include +using namespace ::oox; using ::com::sun::star::uno::Sequence; - - using ::rtl::OString; //--------------------------------------------------------- class ExcDummy_00 - diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 7bfd57be7290..516f4c3bdee2 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -55,7 +55,7 @@ #include "xestyle.hxx" #include "xename.hxx" -#include +using namespace ::oox; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Any; diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 0509f2afa5fa..0af966b626fe 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -64,7 +64,7 @@ #include "xename.hxx" #include "xestyle.hxx" -#include +using namespace ::oox; using ::rtl::OString; using ::rtl::OUString; diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx index af275bef7eef..2ba4d1327f92 100644 --- a/sc/source/filter/excel/xename.cxx +++ b/sc/source/filter/excel/xename.cxx @@ -41,9 +41,10 @@ // for filter manager #include "excrecds.hxx" -#include #include +using namespace ::oox; + using ::rtl::OString; // ============================================================================ diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx index 6194a04c27f6..65be5b535d98 100644 --- a/sc/source/filter/excel/xepage.cxx +++ b/sc/source/filter/excel/xepage.cxx @@ -48,7 +48,7 @@ #include #include -#include +using namespace ::oox; using ::rtl::OString; using ::std::set; diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index ddcdb3243167..3f2e3f506f51 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -51,7 +51,7 @@ #include "xestring.hxx" #include "xelink.hxx" -#include +using namespace ::oox; using ::com::sun::star::sheet::DataPilotFieldOrientation; using ::com::sun::star::sheet::DataPilotFieldOrientation_HIDDEN; diff --git a/sc/source/filter/excel/xerecord.cxx b/sc/source/filter/excel/xerecord.cxx index fed58411aa5c..b596234fe2e4 100644 --- a/sc/source/filter/excel/xerecord.cxx +++ b/sc/source/filter/excel/xerecord.cxx @@ -30,7 +30,7 @@ #include "xerecord.hxx" #include "xeroot.hxx" -#include +using namespace ::oox; // Base classes to export Excel records ======================================= diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 4afd5f4ca722..d8b3823c5f11 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -45,7 +45,6 @@ #include "rangelst.hxx" #include "compiler.hxx" -#include #include #include @@ -64,7 +63,8 @@ using ::utl::OStreamWrapper; using ::std::vector; using namespace ::com::sun::star::uno; -using namespace formula; +using namespace ::formula; +using namespace ::oox; // ============================================================================ diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx index cd0b083aa208..1c3270015981 100644 --- a/sc/source/filter/excel/xestring.cxx +++ b/sc/source/filter/excel/xestring.cxx @@ -35,7 +35,7 @@ #include "xestyle.hxx" #include "xestring.hxx" -#include +using namespace ::oox; using ::rtl::OString; using ::rtl::OUString; diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index ccebe9a4280f..da937e405080 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -55,7 +55,7 @@ #include "globstr.hrc" #include "xestring.hxx" -#include +using namespace ::oox; using ::rtl::OString; using ::rtl::OUString; diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index b5ca318a91b4..b5896a352c5b 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -43,7 +43,7 @@ #include "xecontent.hxx" #include "xeescher.hxx" -#include +using namespace ::oox; using ::rtl::OString; using ::rtl::OUString; diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx index 035afd0a5830..2abd807e8872 100644 --- a/sc/source/filter/excel/xeview.cxx +++ b/sc/source/filter/excel/xeview.cxx @@ -34,7 +34,7 @@ #include "xelink.hxx" #include "xestyle.hxx" -#include +using namespace ::oox; using ::rtl::OString; diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx index 3f16fc602495..88a45ea5774f 100644 --- a/sc/source/filter/inc/xestream.hxx +++ b/sc/source/filter/inc/xestream.hxx @@ -35,6 +35,7 @@ #include #include +#include #include #include "xlstream.hxx" diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index df6bdcbbe671..43be8a7f6275 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -77,7 +77,7 @@ #include "patattr.hxx" #include "tabprotection.hxx" -#include +using namespace ::oox; using ::rtl::OString; using ::rtl::OUString; -- cgit From e423e3b90dd04a70ab40f10b95d3cde7e835541f Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Mon, 8 Nov 2010 13:47:01 +0100 Subject: dr77: optimizations in generation of XML tokens, XML namespaces, property names; code cleanup --- sw/source/filter/ww8/docxattributeoutput.cxx | 3 ++- sw/source/filter/ww8/docxexport.cxx | 3 ++- sw/source/filter/ww8/docxfootnotes.hxx | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 0a6151b98388..0ab613730948 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -32,7 +32,7 @@ #include "wrtww8.hxx" #include "ww8par.hxx" -#include +#include #include #include #include @@ -128,6 +128,7 @@ using rtl::OUString; using rtl::OUStringBuffer; using rtl::OUStringToOString; +using namespace oox; using namespace docx; using namespace sax_fastparser; using namespace nsSwDocInfoSubType; diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 0962edd65085..6394ce6636dc 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include @@ -62,6 +62,7 @@ using namespace ::comphelper; using namespace ::com::sun::star; +using namespace ::oox; using oox::vml::VMLExport; diff --git a/sw/source/filter/ww8/docxfootnotes.hxx b/sw/source/filter/ww8/docxfootnotes.hxx index b9d49f78f560..ec91731bc6dd 100644 --- a/sw/source/filter/ww8/docxfootnotes.hxx +++ b/sw/source/filter/ww8/docxfootnotes.hxx @@ -30,7 +30,6 @@ #include -#include #include #include #include -- cgit From 1fc75ad6800275b23242e0b82e52dc2327cf16b3 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 8 Nov 2010 14:43:10 +0100 Subject: vcl117: #i115477# remove unused methods --- sfx2/inc/sfx2/printer.hxx | 6 ------ sfx2/source/view/printer.cxx | 30 ------------------------------ 2 files changed, 36 deletions(-) diff --git a/sfx2/inc/sfx2/printer.hxx b/sfx2/inc/sfx2/printer.hxx index a96033835a84..7aa79a8a2c30 100644 --- a/sfx2/inc/sfx2/printer.hxx +++ b/sfx2/inc/sfx2/printer.hxx @@ -125,10 +125,6 @@ public: const SfxItemSet& GetOptions() const { return *pOptions; } void SetOptions( const SfxItemSet &rNewOptions ); - void EnableRange( USHORT nRange ); - void DisableRange( USHORT nRange ); - BOOL IsRangeEnabled( USHORT nRange ) const; - BOOL IsKnown() const { return bKnown; } BOOL IsOriginal() const { return bKnown; } @@ -136,8 +132,6 @@ public: USHORT GetFontCount(); const SfxFont* GetFont( USHORT nNo ) const; const SfxFont* GetFontByName( const String &rFontName ); - - BOOL InitJob( Window* pUIParent, BOOL bAskAboutTransparentObjects ); }; #endif diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index fb8f60241b8e..243e3c508966 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -334,28 +334,6 @@ void SfxPrinter::SetOptions( const SfxItemSet &rNewOptions ) //-------------------------------------------------------------------- -void SfxPrinter::EnableRange( USHORT ) -{ - OSL_ENSURE( 0, "dead code !" ); -} - -//-------------------------------------------------------------------- - -void SfxPrinter::DisableRange( USHORT ) -{ - OSL_ENSURE( 0, "dead code !" ); -} - -//-------------------------------------------------------------------- - -BOOL SfxPrinter::IsRangeEnabled( USHORT ) const -{ - OSL_ENSURE( 0, "dead code !" ); - return TRUE; -} - -//-------------------------------------------------------------------- - SV_IMPL_PTRARR(SfxFontArr_Impl,SfxFont*) //-------------------------------------------------------------------- @@ -452,14 +430,6 @@ const SfxFont* SfxPrinter::GetFontByName( const String &rFontName ) //-------------------------------------------------------------------- -BOOL SfxPrinter::InitJob( Window*, BOOL ) -{ - OSL_ENSURE( 0, "dead code !" ); - return FALSE; -} - -//-------------------------------------------------------------------- - SfxPrintOptionsDialog::SfxPrintOptionsDialog( Window *pParent, SfxViewShell *pViewShell, const SfxItemSet *pSet ) : -- cgit From 0304fc8ab143e4fa0a700cb8858fea4ef1b9fdf5 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 8 Nov 2010 14:43:10 +0100 Subject: vcl117: #i115477# remove unused methods --- sc/source/ui/docshell/docsh4.cxx | 91 +++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 48 deletions(-) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 44fd347e5aed..d6386d040d0c 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2093,64 +2093,59 @@ void ScDocShell::Print( SfxProgress& rProgress, } } - BOOL bContinue = pPrinter->InitJob( pDialogParent, !bIsAPI && bHasTransp ); - - if ( bContinue ) + for ( USHORT n=0; nGetTableSelect( nTab ) ) { - if ( bAllTabs || !pMarkData || pMarkData->GetTableSelect( nTab ) ) - { - FmFormView* pDrawView = NULL; - Rectangle aFull( 0, 0, LONG_MAX, LONG_MAX ); + FmFormView* pDrawView = NULL; + Rectangle aFull( 0, 0, LONG_MAX, LONG_MAX ); - // #114135# - ScDrawLayer* pModel = aDocument.GetDrawLayer(); // ist nicht NULL + // #114135# + ScDrawLayer* pModel = aDocument.GetDrawLayer(); // ist nicht NULL - if(pModel) - { - pDrawView = new FmFormView( pModel, pPrinter ); - pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab)); - pDrawView->SetPrintPreview( TRUE ); - } + if(pModel) + { + pDrawView = new FmFormView( pModel, pPrinter ); + pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab)); + pDrawView->SetPrintPreview( TRUE ); + } - ScPrintFunc aPrintFunc( this, pPrinter, nTab, nAttrPage, nTotalPages, pMarkedRange, &aOptions ); - aPrintFunc.SetDrawView( pDrawView ); - nPrinted += aPrintFunc.DoPrint( aPageRanges, nTabStart, nDisplayStart, TRUE, &rProgress, NULL ); + ScPrintFunc aPrintFunc( this, pPrinter, nTab, nAttrPage, nTotalPages, pMarkedRange, &aOptions ); + aPrintFunc.SetDrawView( pDrawView ); + nPrinted += aPrintFunc.DoPrint( aPageRanges, nTabStart, nDisplayStart, TRUE, &rProgress, NULL ); - nTabStart += aPageArr[nTab]; - if ( aDocument.NeedPageResetAfterTab(nTab) ) - nDisplayStart = 0; - else - nDisplayStart += aPageArr[nTab]; - nAttrPage = aPrintFunc.GetFirstPageNo(); // behalten oder aus Vorlage + nTabStart += aPageArr[nTab]; + if ( aDocument.NeedPageResetAfterTab(nTab) ) + nDisplayStart = 0; + else + nDisplayStart += aPageArr[nTab]; + nAttrPage = aPrintFunc.GetFirstPageNo(); // behalten oder aus Vorlage - delete pDrawView; - } + delete pDrawView; } + } - if ( n+1 < nCollateCopies && - (pPrinter->GetDuplexMode() == DUPLEX_SHORTEDGE || pPrinter->GetDuplexMode() == DUPLEX_LONGEDGE) && - ( nPrinted % 2 ) == 1 ) - { - // #105584# when several collated copies are printed in duplex mode, and there is - // an odd number of pages, print an empty page between copies, so the first page of - // the second copy isn't printed on the back of the last page of the first copy. - // (same as in Writer ViewShell::Prt) - - // FIXME: needs to be adapted to XRenderable interface - #if 0 - pPrinter->StartPage(); - pPrinter->EndPage(); - #endif - } + if ( n+1 < nCollateCopies && + (pPrinter->GetDuplexMode() == DUPLEX_SHORTEDGE || pPrinter->GetDuplexMode() == DUPLEX_LONGEDGE) && + ( nPrinted % 2 ) == 1 ) + { + // #105584# when several collated copies are printed in duplex mode, and there is + // an odd number of pages, print an empty page between copies, so the first page of + // the second copy isn't printed on the back of the last page of the first copy. + // (same as in Writer ViewShell::Prt) + + // FIXME: needs to be adapted to XRenderable interface + #if 0 + pPrinter->StartPage(); + pPrinter->EndPage(); + #endif } } -- cgit From bf9cd246dc431e20181cfec8107e3b7c59866281 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Mon, 8 Nov 2010 16:21:47 +0100 Subject: dr77: unx compiler warnings --- oox/source/core/xmlfilterbase.cxx | 2 +- oox/source/docprop/ooxmldocpropimport.cxx | 1 - oox/source/token/namespacemap.cxx | 2 +- oox/source/xls/autofilterbuffer.cxx | 2 +- oox/source/xls/drawingfragment.cxx | 1 - oox/source/xls/excelfilter.cxx | 2 -- 6 files changed, 3 insertions(+), 7 deletions(-) diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index f678bb17b1b2..fe13d9322346 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -97,7 +97,7 @@ struct XmlFilterBaseImpl // ---------------------------------------------------------------------------- -XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) : +XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : maFastParser( rxContext ), maBinSuffix( CREATE_OUSTRING( ".bin" ) ), maVmlSuffix( CREATE_OUSTRING( ".vml" ) ) diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx index 794950e0fbf3..26e26daad3ad 100644 --- a/oox/source/docprop/ooxmldocpropimport.cxx +++ b/oox/source/docprop/ooxmldocpropimport.cxx @@ -83,7 +83,6 @@ Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxSto Sequence< Sequence< StringPair > > aPropsInfo = xRelation->getRelationshipsByType( rStreamType ); - sal_Int32 nLength = 0; ::std::vector< InputSource > aResult; for( sal_Int32 nIndex = 0, nLength = aPropsInfo.getLength(); nIndex < nLength; ++nIndex ) diff --git a/oox/source/token/namespacemap.cxx b/oox/source/token/namespacemap.cxx index 6d5e437f5b31..0f4373d2dc59 100755 --- a/oox/source/token/namespacemap.cxx +++ b/oox/source/token/namespacemap.cxx @@ -33,7 +33,7 @@ namespace oox { NamespaceMap::NamespaceMap() { - static const struct NamespaceUrl { sal_Int32 mnId; sal_Char* mpcUrl; } spNamespaceUrls[] = + static const struct NamespaceUrl { sal_Int32 mnId; const sal_Char* mpcUrl; } spNamespaceUrls[] = { // include auto-generated C array with namespace URLs as C strings #include "namespacenames.inc" diff --git a/oox/source/xls/autofilterbuffer.cxx b/oox/source/xls/autofilterbuffer.cxx index 9017fefa9e9c..edee85dc3583 100755 --- a/oox/source/xls/autofilterbuffer.cxx +++ b/oox/source/xls/autofilterbuffer.cxx @@ -574,7 +574,7 @@ ApiFilterSettings CustomFilter::finalizeImport( sal_Int32 /*nMaxCount*/ ) else if( aIt->maValue.has< double >() ) { // floating-point argument - double fValue; + double fValue = 0.0; aIt->maValue >>= fValue; aSettings.appendField( mbAnd, nOperator, fValue ); } diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx index 5ba60ffeb4d3..e50883ec4fbc 100644 --- a/oox/source/xls/drawingfragment.cxx +++ b/oox/source/xls/drawingfragment.cxx @@ -776,7 +776,6 @@ Reference< XShape > VmlDrawing::createAndInsertClientXShape( const ::oox::vml::S if( (aShapeName.getLength() > 0) && pClientData ) { Rectangle aShapeRect = rShapeRect; - const GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper(); const ::oox::vml::TextBox* pTextBox = rShape.getTextBox(); EmbeddedControl aControl( aShapeName ); switch( pClientData->mnObjType ) diff --git a/oox/source/xls/excelfilter.cxx b/oox/source/xls/excelfilter.cxx index 13d4cbd14fcc..aeac1494c338 100644 --- a/oox/source/xls/excelfilter.cxx +++ b/oox/source/xls/excelfilter.cxx @@ -278,8 +278,6 @@ ExcelVbaProjectFilter::ExcelVbaProjectFilter( const Reference< XComponentContext bool ExcelVbaProjectFilter::importDocument() throw() { - bool bRet = false; - // detect BIFF version and workbook stream name OUString aWorkbookName; BiffType eBiff = BiffDetector::detectStorageBiffVersion( aWorkbookName, getStorage() ); -- cgit From 32bb320ed0e4c52a7adf84d13a8066877adceb54 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 9 Nov 2010 10:52:14 +0100 Subject: dr77: more cleanup: remove RecordInputStream, cleanup ContainerHelper --- oox/inc/oox/core/contexthandler.hxx | 6 +- oox/inc/oox/core/contexthandler2.hxx | 18 +- oox/inc/oox/core/fragmenthandler2.hxx | 8 +- oox/inc/oox/drawingml/chart/modelbase.hxx | 3 +- oox/inc/oox/drawingml/chart/objectformatter.hxx | 1 - oox/inc/oox/drawingml/textbody.hxx | 1 - oox/inc/oox/drawingml/textliststyle.hxx | 2 +- oox/inc/oox/drawingml/textparagraph.hxx | 1 - oox/inc/oox/drawingml/theme.hxx | 1 - oox/inc/oox/dump/xlsbdumper.hxx | 5 +- oox/inc/oox/helper/containerhelper.hxx | 472 ++++------------------ oox/inc/oox/helper/modelobjecthelper.hxx | 54 ++- oox/inc/oox/helper/recordinputstream.hxx | 57 --- oox/inc/oox/helper/refmap.hxx | 181 +++++++++ oox/inc/oox/helper/refvector.hxx | 201 +++++++++ oox/inc/oox/helper/storagebase.hxx | 4 +- oox/inc/oox/ole/axbinaryreader.hxx | 2 +- oox/inc/oox/ole/vbaproject.hxx | 1 + oox/inc/oox/token/tokenmap.hxx | 1 - oox/inc/oox/vml/vmlshapecontainer.hxx | 3 +- oox/inc/oox/xls/addressconverter.hxx | 12 +- oox/inc/oox/xls/autofilterbuffer.hxx | 17 +- oox/inc/oox/xls/autofiltercontext.hxx | 12 +- oox/inc/oox/xls/biffhelper.hxx | 18 +- oox/inc/oox/xls/chartsheetfragment.hxx | 4 +- oox/inc/oox/xls/commentsbuffer.hxx | 2 +- oox/inc/oox/xls/commentsfragment.hxx | 4 +- oox/inc/oox/xls/condformatbuffer.hxx | 9 +- oox/inc/oox/xls/condformatcontext.hxx | 4 +- oox/inc/oox/xls/connectionsbuffer.hxx | 9 +- oox/inc/oox/xls/connectionsfragment.hxx | 6 +- oox/inc/oox/xls/defnamesbuffer.hxx | 8 +- oox/inc/oox/xls/externallinkbuffer.hxx | 40 +- oox/inc/oox/xls/externallinkfragment.hxx | 14 +- oox/inc/oox/xls/formulabase.hxx | 6 +- oox/inc/oox/xls/formulaparser.hxx | 4 +- oox/inc/oox/xls/numberformatsbuffer.hxx | 3 +- oox/inc/oox/xls/pagesettings.hxx | 12 +- oox/inc/oox/xls/pivotcachebuffer.hxx | 42 +- oox/inc/oox/xls/pivotcachefragment.hxx | 12 +- oox/inc/oox/xls/pivottablebuffer.hxx | 27 +- oox/inc/oox/xls/pivottablefragment.hxx | 10 +- oox/inc/oox/xls/querytablebuffer.hxx | 2 +- oox/inc/oox/xls/querytablefragment.hxx | 2 +- oox/inc/oox/xls/richstring.hxx | 16 +- oox/inc/oox/xls/scenariobuffer.hxx | 9 +- oox/inc/oox/xls/scenariocontext.hxx | 8 +- oox/inc/oox/xls/sharedformulabuffer.hxx | 2 +- oox/inc/oox/xls/sharedstringsbuffer.hxx | 1 - oox/inc/oox/xls/sharedstringsfragment.hxx | 2 +- oox/inc/oox/xls/sheetdatacontext.hxx | 30 +- oox/inc/oox/xls/stylesbuffer.hxx | 65 +-- oox/inc/oox/xls/stylesfragment.hxx | 4 +- oox/inc/oox/xls/tablebuffer.hxx | 3 +- oox/inc/oox/xls/tablefragment.hxx | 2 +- oox/inc/oox/xls/viewsettings.hxx | 13 +- oox/inc/oox/xls/workbookfragment.hxx | 6 +- oox/inc/oox/xls/workbookhelper.hxx | 2 +- oox/inc/oox/xls/workbooksettings.hxx | 6 +- oox/inc/oox/xls/worksheetbuffer.hxx | 5 +- oox/inc/oox/xls/worksheetfragment.hxx | 26 +- oox/inc/oox/xls/worksheetsettings.hxx | 10 +- oox/source/core/contexthandler.cxx | 4 +- oox/source/core/contexthandler2.cxx | 12 +- oox/source/core/fragmenthandler2.cxx | 8 +- oox/source/core/recordparser.cxx | 3 +- oox/source/drawingml/chart/seriesconverter.cxx | 1 + oox/source/drawingml/chart/titleconverter.cxx | 1 + oox/source/drawingml/chart/typegroupconverter.cxx | 1 + oox/source/drawingml/lineproperties.cxx | 1 + oox/source/dump/xlsbdumper.cxx | 4 +- oox/source/helper/containerhelper.cxx | 58 --- oox/source/helper/modelobjecthelper.cxx | 60 +++ oox/source/helper/recordinputstream.cxx | 72 ---- oox/source/ole/axcontrol.cxx | 1 + oox/source/ole/olestorage.cxx | 1 + oox/source/ole/vbacontrol.cxx | 1 + oox/source/token/tokenmap.cxx | 11 +- oox/source/vml/vmldrawing.cxx | 1 + oox/source/vml/vmlshape.cxx | 1 + oox/source/xls/addressconverter.cxx | 7 +- oox/source/xls/autofilterbuffer.cxx | 20 +- oox/source/xls/autofiltercontext.cxx | 12 +- oox/source/xls/biffhelper.cxx | 31 ++ oox/source/xls/chartsheetfragment.cxx | 7 +- oox/source/xls/commentsbuffer.cxx | 3 +- oox/source/xls/commentsfragment.cxx | 6 +- oox/source/xls/condformatbuffer.cxx | 10 +- oox/source/xls/condformatcontext.cxx | 4 +- oox/source/xls/connectionsbuffer.cxx | 15 +- oox/source/xls/connectionsfragment.cxx | 6 +- oox/source/xls/defnamesbuffer.cxx | 9 +- oox/source/xls/excelchartconverter.cxx | 1 + oox/source/xls/externallinkbuffer.cxx | 54 +-- oox/source/xls/externallinkfragment.cxx | 16 +- oox/source/xls/formulabase.cxx | 6 +- oox/source/xls/formulaparser.cxx | 147 ++++--- oox/source/xls/numberformatsbuffer.cxx | 5 +- oox/source/xls/pagesettings.cxx | 15 +- oox/source/xls/pivotcachebuffer.cxx | 52 +-- oox/source/xls/pivotcachefragment.cxx | 13 +- oox/source/xls/pivottablebuffer.cxx | 28 +- oox/source/xls/pivottablefragment.cxx | 10 +- oox/source/xls/querytablebuffer.cxx | 3 +- oox/source/xls/querytablefragment.cxx | 2 +- oox/source/xls/richstring.cxx | 19 +- oox/source/xls/scenariobuffer.cxx | 8 +- oox/source/xls/scenariocontext.cxx | 8 +- oox/source/xls/sharedformulabuffer.cxx | 3 +- oox/source/xls/sharedstringsfragment.cxx | 2 +- oox/source/xls/sheetdatacontext.cxx | 31 +- oox/source/xls/stylesbuffer.cxx | 68 ++-- oox/source/xls/stylesfragment.cxx | 4 +- oox/source/xls/tablebuffer.cxx | 4 +- oox/source/xls/tablefragment.cxx | 2 +- oox/source/xls/viewsettings.cxx | 13 +- oox/source/xls/workbookfragment.cxx | 9 +- oox/source/xls/workbooksettings.cxx | 7 +- oox/source/xls/worksheetbuffer.cxx | 4 +- oox/source/xls/worksheetfragment.cxx | 37 +- oox/source/xls/worksheetsettings.cxx | 11 +- 121 files changed, 1245 insertions(+), 1219 deletions(-) delete mode 100644 oox/inc/oox/helper/recordinputstream.hxx create mode 100755 oox/inc/oox/helper/refmap.hxx create mode 100755 oox/inc/oox/helper/refvector.hxx delete mode 100644 oox/source/helper/recordinputstream.cxx diff --git a/oox/inc/oox/core/contexthandler.hxx b/oox/inc/oox/core/contexthandler.hxx index 10de170f9e40..b1f24d051c70 100644 --- a/oox/inc/oox/core/contexthandler.hxx +++ b/oox/inc/oox/core/contexthandler.hxx @@ -39,7 +39,7 @@ namespace com { namespace sun { namespace star { namespace xml { namespace sax { class XLocator; } } } } } -namespace oox { class RecordInputStream; } +namespace oox { class SequenceInputStream; } namespace oox { namespace core { @@ -93,8 +93,8 @@ public: // record context interface ----------------------------------------------- - virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void startRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual void endRecord( sal_Int32 nRecId ); protected: diff --git a/oox/inc/oox/core/contexthandler2.hxx b/oox/inc/oox/core/contexthandler2.hxx index 314a0886b866..0c9ac794e94b 100644 --- a/oox/inc/oox/core/contexthandler2.hxx +++ b/oox/inc/oox/core/contexthandler2.hxx @@ -31,7 +31,7 @@ #include #include #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" +#include "oox/helper/binaryinputstream.hxx" #include "oox/core/contexthandler.hxx" namespace oox { @@ -124,7 +124,7 @@ public: Usually 'this' can be returned to improve performance by reusing the same instance to process several records. Used by BIFF import only. */ - virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) = 0; + virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) = 0; /** Will be called when a new record block in a binary stream has been started. @@ -132,7 +132,7 @@ public: The current record identifier can be accessed with getCurrentElement() or isCurrentElement(). Used by BIFF import only. */ - virtual void onStartRecord( RecordInputStream& rStrm ) = 0; + virtual void onStartRecord( SequenceInputStream& rStrm ) = 0; /** Will be called when the current record block is about to be left. @@ -189,10 +189,10 @@ protected: void implEndElement( sal_Int32 nElement ); /** Must be called from createRecordContext() in derived classes. */ - ContextHandlerRef implCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + ContextHandlerRef implCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Must be called from startRecord() in derived classes. */ - void implStartRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + void implStartRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Must be called from endRecord() in derived classes. */ void implEndRecord( sal_Int32 nRecId ); @@ -250,8 +250,8 @@ public: // oox.core.ContextHandler interface -------------------------------------- - virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void startRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual void endRecord( sal_Int32 nRecId ); // oox.core.ContextHandler2Helper interface ------------------------------- @@ -261,8 +261,8 @@ public: virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onEndElement(); - virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); virtual void onEndRecord(); }; diff --git a/oox/inc/oox/core/fragmenthandler2.hxx b/oox/inc/oox/core/fragmenthandler2.hxx index 2473b9e91436..51408005ecdd 100644 --- a/oox/inc/oox/core/fragmenthandler2.hxx +++ b/oox/inc/oox/core/fragmenthandler2.hxx @@ -84,8 +84,8 @@ public: // oox.core.ContextHandler interface -------------------------------------- - virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void startRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual void endRecord( sal_Int32 nRecId ); // oox.core.ContextHandler2Helper interface ------------------------------- @@ -95,8 +95,8 @@ public: virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onEndElement(); - virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); virtual void onEndRecord(); // oox.core.FragmentHandler2 interface ------------------------------------ diff --git a/oox/inc/oox/drawingml/chart/modelbase.hxx b/oox/inc/oox/drawingml/chart/modelbase.hxx index f29374bd6c69..278a8af9fed3 100644 --- a/oox/inc/oox/drawingml/chart/modelbase.hxx +++ b/oox/inc/oox/drawingml/chart/modelbase.hxx @@ -28,8 +28,9 @@ #ifndef OOX_DRAWINGML_CHART_MODELBASE_HXX #define OOX_DRAWINGML_CHART_MODELBASE_HXX -#include "oox/helper/containerhelper.hxx" #include "oox/helper/helper.hxx" +#include "oox/helper/refmap.hxx" +#include "oox/helper/refvector.hxx" namespace oox { class AttributeList; } diff --git a/oox/inc/oox/drawingml/chart/objectformatter.hxx b/oox/inc/oox/drawingml/chart/objectformatter.hxx index 1b0f5f781044..c35cd66f65e1 100644 --- a/oox/inc/oox/drawingml/chart/objectformatter.hxx +++ b/oox/inc/oox/drawingml/chart/objectformatter.hxx @@ -28,7 +28,6 @@ #ifndef OOX_DRAWINGML_CHART_OBJECTFORMATTER_HXX #define OOX_DRAWINGML_CHART_OBJECTFORMATTER_HXX -#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/chart/modelbase.hxx" diff --git a/oox/inc/oox/drawingml/textbody.hxx b/oox/inc/oox/drawingml/textbody.hxx index a2eb6106e651..ce747c62bdbb 100644 --- a/oox/inc/oox/drawingml/textbody.hxx +++ b/oox/inc/oox/drawingml/textbody.hxx @@ -28,7 +28,6 @@ #ifndef OOX_DRAWINGML_TEXTBODY_HXX #define OOX_DRAWINGML_TEXTBODY_HXX -#include "oox/helper/containerhelper.hxx" #include "oox/drawingml/textbodyproperties.hxx" #include "oox/drawingml/textliststyle.hxx" diff --git a/oox/inc/oox/drawingml/textliststyle.hxx b/oox/inc/oox/drawingml/textliststyle.hxx index 6ba4cdf1d62a..cafcc951504b 100644 --- a/oox/inc/oox/drawingml/textliststyle.hxx +++ b/oox/inc/oox/drawingml/textliststyle.hxx @@ -28,8 +28,8 @@ #ifndef OOX_DRAWINGML_TEXTLISTSTYLE_HXX #define OOX_DRAWINGML_TEXTLISTSTYLE_HXX -#include "oox/helper/containerhelper.hxx" #include "oox/drawingml/textparagraphproperties.hxx" +#include "oox/helper/refvector.hxx" namespace oox { namespace drawingml { diff --git a/oox/inc/oox/drawingml/textparagraph.hxx b/oox/inc/oox/drawingml/textparagraph.hxx index d8c97cbfa114..c059edc73f43 100644 --- a/oox/inc/oox/drawingml/textparagraph.hxx +++ b/oox/inc/oox/drawingml/textparagraph.hxx @@ -31,7 +31,6 @@ #include #include -#include "oox/helper/containerhelper.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/textrun.hxx" #include "oox/drawingml/textliststyle.hxx" diff --git a/oox/inc/oox/drawingml/theme.hxx b/oox/inc/oox/drawingml/theme.hxx index 15f5ce82ce12..7f982a1eec71 100644 --- a/oox/inc/oox/drawingml/theme.hxx +++ b/oox/inc/oox/drawingml/theme.hxx @@ -28,7 +28,6 @@ #ifndef OOX_DRAWINGML_THEME_HXX #define OOX_DRAWINGML_THEME_HXX -#include "oox/helper/containerhelper.hxx" #include "oox/drawingml/clrscheme.hxx" #include "oox/drawingml/shape.hxx" #include "oox/drawingml/textfont.hxx" diff --git a/oox/inc/oox/dump/xlsbdumper.hxx b/oox/inc/oox/dump/xlsbdumper.hxx index 345202f67a4a..6fa1c9bd7e45 100644 --- a/oox/inc/oox/dump/xlsbdumper.hxx +++ b/oox/inc/oox/dump/xlsbdumper.hxx @@ -29,7 +29,6 @@ #define OOX_DUMP_XLSBDUMPER_HXX #include "oox/dump/dumperbase.hxx" -#include "oox/helper/recordinputstream.hxx" #if OOX_INCLUDE_DUMPER @@ -96,9 +95,9 @@ private: bool readCompressedInt( BinaryInputStream& rStrm, sal_Int32& ornValue ); private: - typedef ::boost::shared_ptr< RecordInputStream > RecordInputStreamRef; + typedef ::boost::shared_ptr< SequenceInputStream > SequenceInputStreamRef; - RecordInputStreamRef mxBiffStrm; + SequenceInputStreamRef mxBiffStrm; NameListRef mxErrCodes; }; diff --git a/oox/inc/oox/helper/containerhelper.hxx b/oox/inc/oox/helper/containerhelper.hxx index ba93dc9ad60c..96b9feeffe07 100644 --- a/oox/inc/oox/helper/containerhelper.hxx +++ b/oox/inc/oox/helper/containerhelper.hxx @@ -30,8 +30,6 @@ #include #include -#include -#include #include #include @@ -49,304 +47,6 @@ namespace oox { // ============================================================================ -/** Template for a vector of ref-counted objects with additional accessor functions. - - An instance of the class RefVector< Type > stores elements of the type - ::boost::shared_ptr< Type >. The new accessor functions has() and get() - work correctly for indexes out of the current range, there is no need to - check the passed index before. - */ -template< typename ObjType > -class RefVector : public ::std::vector< ::boost::shared_ptr< ObjType > > -{ -public: - typedef ::std::vector< ::boost::shared_ptr< ObjType > > container_type; - typedef typename container_type::value_type value_type; - typedef typename container_type::size_type size_type; - -public: - /** Returns true, if the object with the passed index exists. Returns - false, if the vector element exists but is an empty reference. */ - inline bool has( sal_Int32 nIndex ) const - { - const value_type* pxRef = getRef( nIndex ); - return pxRef && pxRef->get(); - } - - /** Returns a reference to the object with the passed index, or 0 on error. */ - inline value_type get( sal_Int32 nIndex ) const - { - if( const value_type* pxRef = getRef( nIndex ) ) return *pxRef; - return value_type(); - } - - /** Returns the index of the last element, or -1, if the vector is empty. - Does *not* check whether the last element is an empty reference. */ - inline sal_Int32 getLastIndex() const { return static_cast< sal_Int32 >( this->size() ) - 1; } - - /** Calls the passed functor for every contained object, automatically - skips all elements that are empty references. */ - template< typename FunctorType > - inline void forEach( FunctorType aFunctor ) const - { - ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( aFunctor ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType > - inline void forEachMem( FuncType pFunc ) const - { - forEach( ::boost::bind( pFunc, _1 ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType > - inline void forEachMem( FuncType pFunc, ParamType aParam ) const - { - forEach( ::boost::bind( pFunc, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType1, typename ParamType2 > - inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const - { - forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > - inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const - { - forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) ); - } - - /** Calls the passed functor for every contained object. Passes the index as - first argument and the object reference as second argument to rFunctor. */ - template< typename FunctorType > - inline void forEachWithIndex( const FunctorType& rFunctor ) const - { - ::std::for_each( this->begin(), this->end(), ForEachFunctorWithIndex< FunctorType >( rFunctor ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the vector index to the member function. */ - template< typename FuncType > - inline void forEachMemWithIndex( FuncType pFunc ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1 ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the vector index as first argument to the member function. */ - template< typename FuncType, typename ParamType > - inline void forEachMemWithIndex( FuncType pFunc, ParamType aParam ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the vector index as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2 > - inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the vector index as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > - inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) ); - } - - /** Searches for an element by using the passed functor that takes a - constant reference of the object type (const ObjType&). */ - template< typename FunctorType > - inline value_type findIf( const FunctorType& rFunctor ) const - { - typename container_type::const_iterator aIt = ::std::find_if( this->begin(), this->end(), FindFunctor< FunctorType >( rFunctor ) ); - return (aIt == this->end()) ? value_type() : *aIt; - } - -private: - template< typename FunctorType > - struct ForEachFunctor - { - FunctorType maFunctor; - inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} - inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( *rxValue ); } - }; - - template< typename FunctorType > - struct ForEachFunctorWithIndex - { - FunctorType maFunctor; - sal_Int32 mnIndex; - inline explicit ForEachFunctorWithIndex( const FunctorType& rFunctor ) : maFunctor( rFunctor ), mnIndex( 0 ) {} - inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( mnIndex, *rxValue ); ++mnIndex; } - }; - - template< typename FunctorType > - struct FindFunctor - { - FunctorType maFunctor; - inline explicit FindFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} - inline bool operator()( const value_type& rxValue ) { return rxValue.get() && maFunctor( *rxValue ); } - }; - - inline const value_type* getRef( sal_Int32 nIndex ) const - { - return ((0 <= nIndex) && (static_cast< size_type >( nIndex ) < this->size())) ? - &(*this)[ static_cast< size_type >( nIndex ) ] : 0; - } -}; - -// ============================================================================ - -/** Template for a map of ref-counted objects with additional accessor functions. - - An instance of the class RefMap< Type > stores elements of the type - ::boost::shared_ptr< Type >. The new accessor functions has() and get() - work correctly for nonexisting keys, there is no need to check the passed - key before. - */ -template< typename KeyType, typename ObjType, typename CompType = ::std::less< KeyType > > -class RefMap : public ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType > -{ -public: - typedef ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType > container_type; - typedef typename container_type::key_type key_type; - typedef typename container_type::mapped_type mapped_type; - typedef typename container_type::value_type value_type; - typedef typename container_type::key_compare key_compare; - -public: - /** Returns true, if the object accossiated to the passed key exists. - Returns false, if the key exists but points to an empty reference. */ - inline bool has( key_type nKey ) const - { - const mapped_type* pxRef = getRef( nKey ); - return pxRef && pxRef->get(); - } - - /** Returns a reference to the object accossiated to the passed key, or an - empty reference on error. */ - inline mapped_type get( key_type nKey ) const - { - if( const mapped_type* pxRef = getRef( nKey ) ) return *pxRef; - return mapped_type(); - } - - /** Calls the passed functor for every contained object, automatically - skips all elements that are empty references. */ - template< typename FunctorType > - inline void forEach( const FunctorType& rFunctor ) const - { - ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( rFunctor ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType > - inline void forEachMem( FuncType pFunc ) const - { - forEach( ::boost::bind( pFunc, _1 ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType > - inline void forEachMem( FuncType pFunc, ParamType aParam ) const - { - forEach( ::boost::bind( pFunc, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType1, typename ParamType2 > - inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const - { - forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > - inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const - { - forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) ); - } - /** Calls the passed functor for every contained object. Passes the key as - first argument and the object reference as second argument to rFunctor. */ - template< typename FunctorType > - inline void forEachWithKey( const FunctorType& rFunctor ) const - { - ::std::for_each( this->begin(), this->end(), ForEachFunctorWithKey< FunctorType >( rFunctor ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as argument to the member function. */ - template< typename FuncType > - inline void forEachMemWithKey( FuncType pFunc ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1 ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as first argument to the member function. */ - template< typename FuncType, typename ParamType > - inline void forEachMemWithKey( FuncType pFunc, ParamType aParam ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2 > - inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > - inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) ); - } - -private: - template< typename FunctorType > - struct ForEachFunctor - { - FunctorType maFunctor; - inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} - inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( *rValue.second ); } - }; - - template< typename FunctorType > - struct ForEachFunctorWithKey - { - FunctorType maFunctor; - inline explicit ForEachFunctorWithKey( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} - inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( rValue.first, *rValue.second ); } - }; - - inline const mapped_type* getRef( key_type nKey ) const - { - typename container_type::const_iterator aIt = find( nKey ); - return (aIt == this->end()) ? 0 : &aIt->second; - } -}; - -// ============================================================================ - /** Template for a 2-dimensional array of objects. This class template provides a similar interface to the ::std::vector @@ -518,45 +218,53 @@ public: /** Returns the pointer to an existing element of the passed vector, or a null pointer, if the passed index is out of bounds. */ - template< typename Type > - static const Type* getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex ); + template< typename VectorType > + static const typename VectorType::value_type* + getVectorElement( const VectorType& rVector, sal_Int32 nIndex ); /** Returns the pointer to an existing element of the passed vector, or a null pointer, if the passed index is out of bounds. */ - template< typename Type > - static Type* getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex ); + template< typename VectorType > + static typename VectorType::value_type* + getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex ); /** Returns the reference to an existing element of the passed vector, or the passed default value, if the passed index is out of bounds. */ - template< typename Type > - static const Type& getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex, const Type& rDefault ); + template< typename VectorType > + static const typename VectorType::value_type& + getVectorElement( const VectorType& rVector, sal_Int32 nIndex, const typename VectorType::value_type& rDefault ); /** Returns the reference to an existing element of the passed vector, or the passed default value, if the passed index is out of bounds. */ - template< typename Type > - static Type& getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex, Type& rDefault ); + template< typename VectorType > + static typename VectorType::value_type& + getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault ); /** Returns the pointer to an existing element of the passed map, or a null pointer, if an element with the passed key does not exist. */ - template< typename Type, typename KeyType > - static const Type* getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey ); + template< typename MapType > + static const typename MapType::mapped_type* + getMapElement( const MapType& rMap, const typename MapType::key_type& rKey ); /** Returns the pointer to an existing element of the passed map, or a null pointer, if an element with the passed key does not exist. */ - template< typename Type, typename KeyType > - static Type* getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey ); + template< typename MapType > + static typename MapType::mapped_type* + getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey ); /** Returns the reference to an existing element of the passed map, or the passed default value, if an element with the passed key does not exist. */ - template< typename Type, typename KeyType > - static const Type& getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey, const Type& rDefault ); + template< typename MapType > + static const typename MapType::mapped_type& + getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault ); /** Returns the reference to an existing element of the passed map, or the passed default value, if an element with the passed key does not exist. */ - template< typename Type, typename KeyType > - static Type& getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey, Type& rDefault ); + template< typename MapType > + static typename MapType::mapped_type& + getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault ); - // vector/matrix to Sequence ---------------------------------------------- + // vector/map/matrix to UNO sequence -------------------------------------- /** Creates a UNO sequence from a std::vector with copies of all elements. @@ -565,9 +273,20 @@ public: @return A com.sun.star.uno.Sequence object with copies of all objects contained in the passed vector. */ - template< typename Type > - static ::com::sun::star::uno::Sequence< Type > - vectorToSequence( const ::std::vector< Type >& rVector ); + template< typename VectorType > + static ::com::sun::star::uno::Sequence< typename VectorType::value_type > + vectorToSequence( const VectorType& rVector ); + + /** Creates a UNO sequence from a std::map with copies of all elements. + + @param rMap The map to be converted to a sequence. + + @return A com.sun.star.uno.Sequence object with copies of all objects + contained in the passed map. + */ + template< typename MapType > + static ::com::sun::star::uno::Sequence< typename MapType::mapped_type > + mapToSequence( const MapType& rMap ); /** Creates a UNO sequence of sequences from a matrix with copies of all elements. @@ -577,125 +296,104 @@ public: com.sun.star.uno.Sequence objects with copies of all objects contained in the passed matrix. */ - template< typename Type > - static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Type > > - matrixToSequenceSequence( const Matrix< Type >& rMatrix ); + template< typename MatrixType > + static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< typename MatrixType::value_type > > + matrixToSequenceSequence( const MatrixType& rMatrix ); }; // ---------------------------------------------------------------------------- -template< typename Type > -const Type* ContainerHelper::getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex ) +template< typename VectorType > +/*static*/ const typename VectorType::value_type* ContainerHelper::getVectorElement( const VectorType& rVector, sal_Int32 nIndex ) { return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? &rVector[ static_cast< size_t >( nIndex ) ] : 0; } -template< typename Type > -Type* ContainerHelper::getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex ) +template< typename VectorType > +/*static*/ typename VectorType::value_type* ContainerHelper::getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex ) { return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? &rVector[ static_cast< size_t >( nIndex ) ] : 0; } -template< typename Type > -const Type& ContainerHelper::getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex, const Type& rDefault ) +template< typename VectorType > +/*static*/ const typename VectorType::value_type& ContainerHelper::getVectorElement( const VectorType& rVector, sal_Int32 nIndex, const typename VectorType::value_type& rDefault ) { return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault; } -template< typename Type > -Type& ContainerHelper::getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex, Type& rDefault ) +template< typename VectorType > +/*static*/ typename VectorType::value_type& ContainerHelper::getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault ) { return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault; } -template< typename Type, typename KeyType > -const Type* ContainerHelper::getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey ) +template< typename MapType > +/*static*/ const typename MapType::mapped_type* ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey ) { - typename ::std::map< KeyType, Type >::const_iterator aIt = rMap.find( nKey ); + typename MapType::const_iterator aIt = rMap.find( rKey ); return (aIt == rMap.end()) ? 0 : &aIt->second; } -template< typename Type, typename KeyType > -Type* ContainerHelper::getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey ) +template< typename MapType > +/*static*/ typename MapType::mapped_type* ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey ) { - typename ::std::map< KeyType, Type >::iterator aIt = rMap.find( nKey ); + typename MapType::iterator aIt = rMap.find( rKey ); return (aIt == rMap.end()) ? 0 : &aIt->second; } -template< typename Type, typename KeyType > -const Type& ContainerHelper::getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey, const Type& rDefault ) +template< typename MapType > +/*static*/ const typename MapType::mapped_type& ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault ) { - typename ::std::map< KeyType, Type >::const_iterator aIt = rMap.find( nKey ); + typename MapType::const_iterator aIt = rMap.find( rKey ); return (aIt == rMap.end()) ? rDefault : aIt->second; } -template< typename Type, typename KeyType > -Type& ContainerHelper::getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey, Type& rDefault ) +template< typename MapType > +/*static*/ typename MapType::mapped_type& ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault ) { - typename ::std::map< KeyType, Type >::iterator aIt = rMap.find( nKey ); + typename MapType::iterator aIt = rMap.find( rKey ); return (aIt == rMap.end()) ? rDefault : aIt->second; } -template< typename Type > -::com::sun::star::uno::Sequence< Type > ContainerHelper::vectorToSequence( const ::std::vector< Type >& rVector ) +template< typename VectorType > +/*static*/ ::com::sun::star::uno::Sequence< typename VectorType::value_type > ContainerHelper::vectorToSequence( const VectorType& rVector ) { + typedef typename VectorType::value_type ValueType; if( rVector.empty() ) - return ::com::sun::star::uno::Sequence< Type >(); - return ::com::sun::star::uno::Sequence< Type >( &rVector.front(), static_cast< sal_Int32 >( rVector.size() ) ); + return ::com::sun::star::uno::Sequence< ValueType >(); + return ::com::sun::star::uno::Sequence< ValueType >( &rVector.front(), static_cast< sal_Int32 >( rVector.size() ) ); } -template< typename Type > -::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Type > > ContainerHelper::matrixToSequenceSequence( const Matrix< Type >& rMatrix ) +template< typename MapType > +/*static*/ ::com::sun::star::uno::Sequence< typename MapType::mapped_type > ContainerHelper::mapToSequence( const MapType& rMap ) +{ + typedef typename MapType::mapped_type ValueType; + if( rMap.empty() ) + return ::com::sun::star::uno::Sequence< ValueType >(); + ::com::sun::star::uno::Sequence< ValueType > aSeq( static_cast< sal_Int32 >( rMap.size() ) ); + sal_Int32 nIndex = 0; + for( typename MapType::const_iterator aIt = rMap.begin(), aEnd = rMap.end(); aIt != aEnd; ++aIt, ++nIndex ) + aSeq[ nIndex ] = *aIt; + return aSeq; +} + +template< typename MatrixType > +/*static*/ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< typename MatrixType::value_type > > ContainerHelper::matrixToSequenceSequence( const MatrixType& rMatrix ) { - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Type > > aSeq; + typedef typename MatrixType::value_type ValueType; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ValueType > > aSeq; if( !rMatrix.empty() ) { aSeq.realloc( static_cast< sal_Int32 >( rMatrix.height() ) ); for( size_t nRow = 0, nHeight = rMatrix.height(); nRow < nHeight; ++nRow ) aSeq[ static_cast< sal_Int32 >( nRow ) ] = - ::com::sun::star::uno::Sequence< Type >( &rMatrix.row_front( nRow ), static_cast< sal_Int32 >( rMatrix.width() ) ); + ::com::sun::star::uno::Sequence< ValueType >( &rMatrix.row_front( nRow ), static_cast< sal_Int32 >( rMatrix.width() ) ); } return aSeq; } // ============================================================================ -/** This helper manages named objects in a container, which is created on demand. - */ -class ObjectContainer -{ -public: - explicit ObjectContainer( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory, - const ::rtl::OUString& rServiceName ); - ~ObjectContainer(); - - /** Returns true, if the object with the passed name exists in the container. */ - bool hasObject( const ::rtl::OUString& rObjName ) const; - - /** Returns the object with the passed name from the container. */ - ::com::sun::star::uno::Any getObject( const ::rtl::OUString& rObjName ) const; - - /** Inserts the passed object into the container, returns its final name. */ - ::rtl::OUString insertObject( - const ::rtl::OUString& rObjName, - const ::com::sun::star::uno::Any& rObj, - bool bInsertByUnusedName ); - -private: - void createContainer() const; - -private: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > - mxFactory; /// Factory to create the container. - mutable ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > - mxContainer; /// Container for the objects. - ::rtl::OUString maServiceName; /// Service name to create the container. - sal_Int32 mnIndex; /// Index to create unique identifiers. -}; - -// ============================================================================ - } // namespace oox #endif diff --git a/oox/inc/oox/helper/modelobjecthelper.hxx b/oox/inc/oox/helper/modelobjecthelper.hxx index 82d06bac1109..e36e7001e613 100644 --- a/oox/inc/oox/helper/modelobjecthelper.hxx +++ b/oox/inc/oox/helper/modelobjecthelper.hxx @@ -29,19 +29,55 @@ #define OOX_HELPER_MODELOBJECTHELPER_HXX #include -#include "oox/helper/containerhelper.hxx" namespace com { namespace sun { namespace star { - namespace lang { class XMultiServiceFactory; } namespace awt { struct Gradient; } + namespace container { class XNameContainer; } namespace drawing { struct LineDash; } namespace drawing { struct PolyPolygonBezierCoords; } + namespace lang { class XMultiServiceFactory; } } } } namespace oox { // ============================================================================ +/** This helper manages named objects in a container, which is created on demand. + */ +class ObjectContainer +{ +public: + explicit ObjectContainer( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory, + const ::rtl::OUString& rServiceName ); + ~ObjectContainer(); + + /** Returns true, if the object with the passed name exists in the container. */ + bool hasObject( const ::rtl::OUString& rObjName ) const; + + /** Returns the object with the passed name from the container. */ + ::com::sun::star::uno::Any getObject( const ::rtl::OUString& rObjName ) const; + + /** Inserts the passed object into the container, returns its final name. */ + ::rtl::OUString insertObject( + const ::rtl::OUString& rObjName, + const ::com::sun::star::uno::Any& rObj, + bool bInsertByUnusedName ); + +private: + void createContainer() const; + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > + mxFactory; /// Factory to create the container. + mutable ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > + mxContainer; /// Container for the objects. + ::rtl::OUString maServiceName; /// Service name to create the container. + sal_Int32 mnIndex; /// Index to create unique identifiers. +}; + +// ============================================================================ + /** Contains tables for named drawing objects for a document model. Contains tables for named line markers, line dashes, fill gradients, and @@ -77,13 +113,13 @@ public: ::rtl::OUString insertFillBitmap( const ::rtl::OUString& rGraphicUrl ); private: - ObjectContainer maMarkerContainer; - ObjectContainer maDashContainer; - ObjectContainer maGradientContainer; - ObjectContainer maBitmapContainer; - const ::rtl::OUString maDashNameBase; - const ::rtl::OUString maGradientNameBase; - const ::rtl::OUString maBitmapNameBase; + ObjectContainer maMarkerContainer; /// Contains all named line markers (line end polygons). + ObjectContainer maDashContainer; /// Contains all named line dsahes. + ObjectContainer maGradientContainer; /// Contains all named fill gradients. + ObjectContainer maBitmapContainer; /// Contains all named fill bitmaps. + const ::rtl::OUString maDashNameBase; /// Base name for all named line dashes. + const ::rtl::OUString maGradientNameBase; /// Base name for all named fill gradients. + const ::rtl::OUString maBitmapNameBase; /// Base name for all named fill bitmaps. }; // ============================================================================ diff --git a/oox/inc/oox/helper/recordinputstream.hxx b/oox/inc/oox/helper/recordinputstream.hxx deleted file mode 100644 index 3cf8514897ec..000000000000 --- a/oox/inc/oox/helper/recordinputstream.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef OOX_HELPER_RECORDINPUTSTREAM_HXX -#define OOX_HELPER_RECORDINPUTSTREAM_HXX - -#include "oox/helper/binaryinputstream.hxx" - -namespace oox { - -// ============================================================================ - -/** Reads the contents of a record from a BIFF stream. */ -class RecordInputStream : public SequenceInputStream -{ -public: - explicit RecordInputStream( const StreamDataSequence& rData ); - - /** Reads a string with leading 16-bit or 32-bit length field. */ - ::rtl::OUString readString( bool b32BitLen = true ); - - /** Stream operator for integral types. */ - template< typename Type > - inline RecordInputStream& operator>>( Type& ornValue ) { readValue( ornValue ); return *this; } - /** Stream operator for an ::rtl::OUString, reads 32-bit string length and Unicode array. */ - inline RecordInputStream& operator>>( ::rtl::OUString& orString ) { orString = readString(); return *this; } -}; - -// ============================================================================ - -} // namespace oox - -#endif diff --git a/oox/inc/oox/helper/refmap.hxx b/oox/inc/oox/helper/refmap.hxx new file mode 100755 index 000000000000..e833e1196c81 --- /dev/null +++ b/oox/inc/oox/helper/refmap.hxx @@ -0,0 +1,181 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_HELPER_REFMAP_HXX +#define OOX_HELPER_REFMAP_HXX + +#include +#include +#include +#include + +namespace oox { + +// ============================================================================ + +/** Template for a map of ref-counted objects with additional accessor functions. + + An instance of the class RefMap< Type > stores elements of the type + ::boost::shared_ptr< Type >. The new accessor functions has() and get() + work correctly for nonexisting keys, there is no need to check the passed + key before. + */ +template< typename KeyType, typename ObjType, typename CompType = ::std::less< KeyType > > +class RefMap : public ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType > +{ +public: + typedef ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType > container_type; + typedef typename container_type::key_type key_type; + typedef typename container_type::mapped_type mapped_type; + typedef typename container_type::value_type value_type; + typedef typename container_type::key_compare key_compare; + +public: + /** Returns true, if the object accossiated to the passed key exists. + Returns false, if the key exists but points to an empty reference. */ + inline bool has( key_type nKey ) const + { + const mapped_type* pxRef = getRef( nKey ); + return pxRef && pxRef->get(); + } + + /** Returns a reference to the object accossiated to the passed key, or an + empty reference on error. */ + inline mapped_type get( key_type nKey ) const + { + if( const mapped_type* pxRef = getRef( nKey ) ) return *pxRef; + return mapped_type(); + } + + /** Calls the passed functor for every contained object, automatically + skips all elements that are empty references. */ + template< typename FunctorType > + inline void forEach( const FunctorType& rFunctor ) const + { + ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( rFunctor ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType > + inline void forEachMem( FuncType pFunc ) const + { + forEach( ::boost::bind( pFunc, _1 ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType > + inline void forEachMem( FuncType pFunc, ParamType aParam ) const + { + forEach( ::boost::bind( pFunc, _1, aParam ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType1, typename ParamType2 > + inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const + { + forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > + inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const + { + forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) ); + } + /** Calls the passed functor for every contained object. Passes the key as + first argument and the object reference as second argument to rFunctor. */ + template< typename FunctorType > + inline void forEachWithKey( const FunctorType& rFunctor ) const + { + ::std::for_each( this->begin(), this->end(), ForEachFunctorWithKey< FunctorType >( rFunctor ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the object key as argument to the member function. */ + template< typename FuncType > + inline void forEachMemWithKey( FuncType pFunc ) const + { + forEachWithKey( ::boost::bind( pFunc, _2, _1 ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the object key as first argument to the member function. */ + template< typename FuncType, typename ParamType > + inline void forEachMemWithKey( FuncType pFunc, ParamType aParam ) const + { + forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the object key as first argument to the member function. */ + template< typename FuncType, typename ParamType1, typename ParamType2 > + inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const + { + forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the object key as first argument to the member function. */ + template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > + inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const + { + forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) ); + } + +private: + template< typename FunctorType > + struct ForEachFunctor + { + FunctorType maFunctor; + inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} + inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( *rValue.second ); } + }; + + template< typename FunctorType > + struct ForEachFunctorWithKey + { + FunctorType maFunctor; + inline explicit ForEachFunctorWithKey( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} + inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( rValue.first, *rValue.second ); } + }; + + inline const mapped_type* getRef( key_type nKey ) const + { + typename container_type::const_iterator aIt = find( nKey ); + return (aIt == this->end()) ? 0 : &aIt->second; + } +}; + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/inc/oox/helper/refvector.hxx b/oox/inc/oox/helper/refvector.hxx new file mode 100755 index 000000000000..0a2d8be62e2f --- /dev/null +++ b/oox/inc/oox/helper/refvector.hxx @@ -0,0 +1,201 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_HELPER_REFVECTOR_HXX +#define OOX_HELPER_REFVECTOR_HXX + +#include +#include +#include +#include + +namespace oox { + +// ============================================================================ + +/** Template for a vector of ref-counted objects with additional accessor functions. + + An instance of the class RefVector< Type > stores elements of the type + ::boost::shared_ptr< Type >. The new accessor functions has() and get() + work correctly for indexes out of the current range, there is no need to + check the passed index before. + */ +template< typename ObjType > +class RefVector : public ::std::vector< ::boost::shared_ptr< ObjType > > +{ +public: + typedef ::std::vector< ::boost::shared_ptr< ObjType > > container_type; + typedef typename container_type::value_type value_type; + typedef typename container_type::size_type size_type; + +public: + /** Returns true, if the object with the passed index exists. Returns + false, if the vector element exists but is an empty reference. */ + inline bool has( sal_Int32 nIndex ) const + { + const value_type* pxRef = getRef( nIndex ); + return pxRef && pxRef->get(); + } + + /** Returns a reference to the object with the passed index, or 0 on error. */ + inline value_type get( sal_Int32 nIndex ) const + { + if( const value_type* pxRef = getRef( nIndex ) ) return *pxRef; + return value_type(); + } + + /** Returns the index of the last element, or -1, if the vector is empty. + Does *not* check whether the last element is an empty reference. */ + inline sal_Int32 getLastIndex() const { return static_cast< sal_Int32 >( this->size() ) - 1; } + + /** Calls the passed functor for every contained object, automatically + skips all elements that are empty references. */ + template< typename FunctorType > + inline void forEach( FunctorType aFunctor ) const + { + ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( aFunctor ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType > + inline void forEachMem( FuncType pFunc ) const + { + forEach( ::boost::bind( pFunc, _1 ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType > + inline void forEachMem( FuncType pFunc, ParamType aParam ) const + { + forEach( ::boost::bind( pFunc, _1, aParam ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType1, typename ParamType2 > + inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const + { + forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) ); + } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > + inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const + { + forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) ); + } + + /** Calls the passed functor for every contained object. Passes the index as + first argument and the object reference as second argument to rFunctor. */ + template< typename FunctorType > + inline void forEachWithIndex( const FunctorType& rFunctor ) const + { + ::std::for_each( this->begin(), this->end(), ForEachFunctorWithIndex< FunctorType >( rFunctor ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the vector index to the member function. */ + template< typename FuncType > + inline void forEachMemWithIndex( FuncType pFunc ) const + { + forEachWithIndex( ::boost::bind( pFunc, _2, _1 ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the vector index as first argument to the member function. */ + template< typename FuncType, typename ParamType > + inline void forEachMemWithIndex( FuncType pFunc, ParamType aParam ) const + { + forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the vector index as first argument to the member function. */ + template< typename FuncType, typename ParamType1, typename ParamType2 > + inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const + { + forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) ); + } + + /** Calls the passed member function of ObjType on every contained object. + Passes the vector index as first argument to the member function. */ + template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > + inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const + { + forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) ); + } + + /** Searches for an element by using the passed functor that takes a + constant reference of the object type (const ObjType&). */ + template< typename FunctorType > + inline value_type findIf( const FunctorType& rFunctor ) const + { + typename container_type::const_iterator aIt = ::std::find_if( this->begin(), this->end(), FindFunctor< FunctorType >( rFunctor ) ); + return (aIt == this->end()) ? value_type() : *aIt; + } + +private: + template< typename FunctorType > + struct ForEachFunctor + { + FunctorType maFunctor; + inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} + inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( *rxValue ); } + }; + + template< typename FunctorType > + struct ForEachFunctorWithIndex + { + FunctorType maFunctor; + sal_Int32 mnIndex; + inline explicit ForEachFunctorWithIndex( const FunctorType& rFunctor ) : maFunctor( rFunctor ), mnIndex( 0 ) {} + inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( mnIndex, *rxValue ); ++mnIndex; } + }; + + template< typename FunctorType > + struct FindFunctor + { + FunctorType maFunctor; + inline explicit FindFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {} + inline bool operator()( const value_type& rxValue ) { return rxValue.get() && maFunctor( *rxValue ); } + }; + + inline const value_type* getRef( sal_Int32 nIndex ) const + { + return ((0 <= nIndex) && (static_cast< size_type >( nIndex ) < this->size())) ? + &(*this)[ static_cast< size_type >( nIndex ) ] : 0; + } +}; + +// ============================================================================ + +} // namespace oox + +#endif diff --git a/oox/inc/oox/helper/storagebase.hxx b/oox/inc/oox/helper/storagebase.hxx index 5a179e73cf75..d48e5fdd1844 100644 --- a/oox/inc/oox/helper/storagebase.hxx +++ b/oox/inc/oox/helper/storagebase.hxx @@ -28,8 +28,10 @@ #ifndef OOX_HELPER_STORAGEBASE_HXX #define OOX_HELPER_STORAGEBASE_HXX +#include +#include +#include "oox/helper/refmap.hxx" #include "oox/dllapi.h" -#include "oox/helper/containerhelper.hxx" namespace com { namespace sun { namespace star { namespace embed { class XStorage; } diff --git a/oox/inc/oox/ole/axbinaryreader.hxx b/oox/inc/oox/ole/axbinaryreader.hxx index 36346402a0e3..f26075ff52eb 100644 --- a/oox/inc/oox/ole/axbinaryreader.hxx +++ b/oox/inc/oox/ole/axbinaryreader.hxx @@ -30,7 +30,7 @@ #include #include "oox/helper/binaryinputstream.hxx" -#include "oox/helper/containerhelper.hxx" +#include "oox/helper/refvector.hxx" namespace oox { namespace ole { diff --git a/oox/inc/oox/ole/vbaproject.hxx b/oox/inc/oox/ole/vbaproject.hxx index 58d0029fcce3..40e81c923d25 100644 --- a/oox/inc/oox/ole/vbaproject.hxx +++ b/oox/inc/oox/ole/vbaproject.hxx @@ -30,6 +30,7 @@ #include #include +#include "oox/helper/refvector.hxx" #include "oox/helper/storagebase.hxx" #include "oox/dllapi.h" diff --git a/oox/inc/oox/token/tokenmap.hxx b/oox/inc/oox/token/tokenmap.hxx index 108feee9a2e8..b197c491ac51 100644 --- a/oox/inc/oox/token/tokenmap.hxx +++ b/oox/inc/oox/token/tokenmap.hxx @@ -66,7 +66,6 @@ private: typedef ::std::vector< TokenName > TokenNameVector; TokenNameVector maTokenNames; - }; // ============================================================================ diff --git a/oox/inc/oox/vml/vmlshapecontainer.hxx b/oox/inc/oox/vml/vmlshapecontainer.hxx index e1df24a9a6f8..7b13763e0e40 100644 --- a/oox/inc/oox/vml/vmlshapecontainer.hxx +++ b/oox/inc/oox/vml/vmlshapecontainer.hxx @@ -29,7 +29,8 @@ #define OOX_VML_VMLSHAPECONTAINER_HXX #include -#include "oox/helper/containerhelper.hxx" +#include "oox/helper/refmap.hxx" +#include "oox/helper/refvector.hxx" namespace com { namespace sun { namespace star { namespace drawing { class XShapes; } diff --git a/oox/inc/oox/xls/addressconverter.hxx b/oox/inc/oox/xls/addressconverter.hxx index 8ce4388db2f2..11b5e74ccd5c 100644 --- a/oox/inc/oox/xls/addressconverter.hxx +++ b/oox/inc/oox/xls/addressconverter.hxx @@ -69,7 +69,7 @@ struct BinAddress inline void set( sal_Int32 nCol, sal_Int32 nRow ) { mnCol = nCol; mnRow = nRow; } inline void set( const ::com::sun::star::table::CellAddress& rAddr ) { mnCol = rAddr.Column; mnRow = rAddr.Row; } - void read( RecordInputStream& rStrm ); + void read( SequenceInputStream& rStrm ); void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ); void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const; }; @@ -86,7 +86,7 @@ inline bool operator<( const BinAddress& rL, const BinAddress& rR ) return (rL.mnCol < rR.mnCol) || ((rL.mnCol == rR.mnCol) && (rL.mnRow < rR.mnRow)); } -inline RecordInputStream& operator>>( RecordInputStream& rStrm, BinAddress& orPos ) +inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, BinAddress& orPos ) { orPos.read( rStrm ); return rStrm; @@ -134,7 +134,7 @@ struct BinRange inline sal_Int32 getRowCount() const { return maLast.mnRow - maFirst.mnRow + 1; } bool contains( const BinAddress& rAddr ) const; - void read( RecordInputStream& rStrm ); + void read( SequenceInputStream& rStrm ); void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ); void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const; }; @@ -151,7 +151,7 @@ inline bool operator<( const BinRange& rL, const BinRange& rR ) return (rL.maFirst < rR.maFirst) || ((rL.maFirst == rR.maFirst) && (rL.maLast < rR.maLast)); } -inline RecordInputStream& operator>>( RecordInputStream& rStrm, BinRange& orRange ) +inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, BinRange& orRange ) { orRange.read( rStrm ); return rStrm; @@ -179,7 +179,7 @@ public: BinRange getEnclosingRange() const; - void read( RecordInputStream& rStrm ); + void read( SequenceInputStream& rStrm ); void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ); void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const; void writeSubList( BiffOutputStream& rStrm, @@ -188,7 +188,7 @@ public: // ---------------------------------------------------------------------------- -inline RecordInputStream& operator>>( RecordInputStream& rStrm, BinRangeList& orRanges ) +inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, BinRangeList& orRanges ) { orRanges.read( rStrm ); return rStrm; diff --git a/oox/inc/oox/xls/autofilterbuffer.hxx b/oox/inc/oox/xls/autofilterbuffer.hxx index 31aeca252414..ddf083c2ea98 100755 --- a/oox/inc/oox/xls/autofilterbuffer.hxx +++ b/oox/inc/oox/xls/autofilterbuffer.hxx @@ -29,6 +29,7 @@ #define OOX_XLS_AUTOFILTERBUFFER_HXX #include +#include "oox/helper/refvector.hxx" #include "oox/xls/workbookhelper.hxx" namespace com { namespace sun { namespace star { @@ -68,7 +69,7 @@ public: /** Derived classes import filter settings from the passed attribute list. */ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Derived classes import filter settings from the passed record. */ - virtual void importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Derived classes import filter settings from the FILTERCOLUMN record. */ virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ); @@ -91,7 +92,7 @@ public: /** Imports filter settings from the filters and filter elements. */ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports filter settings from the FILTERS and FILTER records. */ - virtual void importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Returns converted UNO API filter settings representing all filter settings. */ virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount ); @@ -115,7 +116,7 @@ public: /** Imports filter settings from the filters and filter elements. */ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports filter settings from the FILTERS and FILTER records. */ - virtual void importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Imports filter settings from the FILTERCOLUMN record. */ virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ); @@ -144,7 +145,7 @@ struct FilterCriterionModel void setBiffOperator( sal_uInt8 nOperator ); /** Imports the criterion model from the passed BIFF12 stream. */ - void readBiffData( RecordInputStream& rStrm ); + void readBiffData( SequenceInputStream& rStrm ); /** Imports the initial criterion data from the passed BIFF5/BIFF8 stream. */ void readBiffData( BiffInputStream& rStrm ); /** Imports the trailing string data from the passed BIFF5/BIFF8 stream. */ @@ -164,7 +165,7 @@ public: /** Imports filter settings from the filters and filter elements. */ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports filter settings from the FILTERS and FILTER records. */ - virtual void importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Imports filter settings from the FILTERCOLUMN record. */ virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags ); @@ -195,7 +196,7 @@ public: /** Imports auto filter column settings from the filterColumn element. */ void importFilterColumn( const AttributeList& rAttribs ); /** Imports auto filter column settings from the FILTERCOLUMN record. */ - void importFilterColumn( RecordInputStream& rStrm ); + void importFilterColumn( SequenceInputStream& rStrm ); /** Imports auto filter column settings from the FILTERCOLUMN record. */ void importFilterColumn( BiffInputStream& rStrm ); @@ -228,10 +229,10 @@ public: /** Imports auto filter settings from the autoFilter element. */ void importAutoFilter( const AttributeList& rAttribs, sal_Int16 nSheet ); /** Imports auto filter settings from the AUTOFILTER record. */ - void importAutoFilter( RecordInputStream& rStrm, sal_Int16 nSheet ); + void importAutoFilter( SequenceInputStream& rStrm, sal_Int16 nSheet ); /** Creates a new auto filter column and stores it internally. */ - FilterColumn& createFilterColumn(); + FilterColumn& createFilterColumn(); /** Applies the filter to the passed filter descriptor. */ void finalizeImport( const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor2 >& rxFilterDesc ); diff --git a/oox/inc/oox/xls/autofiltercontext.hxx b/oox/inc/oox/xls/autofiltercontext.hxx index 6deb40bedd9c..13508bbf5e63 100644 --- a/oox/inc/oox/xls/autofiltercontext.hxx +++ b/oox/inc/oox/xls/autofiltercontext.hxx @@ -48,8 +48,8 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: FilterSettingsBase& mrFilterSettings; @@ -66,8 +66,8 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: FilterColumn& mrFilterColumn; @@ -84,8 +84,8 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: AutoFilter& mrAutoFilter; diff --git a/oox/inc/oox/xls/biffhelper.hxx b/oox/inc/oox/xls/biffhelper.hxx index dd93621ba130..9c0a57a83c04 100644 --- a/oox/inc/oox/xls/biffhelper.hxx +++ b/oox/inc/oox/xls/biffhelper.hxx @@ -30,6 +30,8 @@ #include "oox/helper/binarystreambase.hxx" +namespace oox { class SequenceInputStream; } + namespace oox { namespace xls { @@ -615,7 +617,12 @@ public: /** Returns a Windows code page from a text encoding. */ static sal_uInt16 calcCodePageFromTextEncoding( rtl_TextEncoding eTextEnc ); - // import ----------------------------------------------------------------- + // BIFF12 import ---------------------------------------------------------- + + /** Reads a BIFF12 string with leading 16-bit or 32-bit length field. */ + static ::rtl::OUString readString( SequenceInputStream& rStrm, bool b32BitLen = true ); + + // BIFF2-BIFF8 import ----------------------------------------------------- /** Returns true, if the current record of the stream is a BOF record. */ static bool isBofRecord( BiffInputStream& rStrm ); @@ -644,6 +651,15 @@ private: ~BiffHelper(); // not implemented }; +// ---------------------------------------------------------------------------- + +/** BIFF12 stream operator for an ::rtl::OUString, reads 32-bit string length and Unicode array. */ +inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, ::rtl::OUString& orString ) +{ + orString = BiffHelper::readString( rStrm ); + return rStrm; +} + // ============================================================================ } // namespace xls diff --git a/oox/inc/oox/xls/chartsheetfragment.hxx b/oox/inc/oox/xls/chartsheetfragment.hxx index 6609618a8b7d..8dfedc5ba48e 100644 --- a/oox/inc/oox/xls/chartsheetfragment.hxx +++ b/oox/inc/oox/xls/chartsheetfragment.hxx @@ -48,7 +48,7 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void initializeImport(); @@ -58,7 +58,7 @@ private: /** Imports the the relation identifier for the DrawingML part. */ void importDrawing( const AttributeList& rAttribs ); /** Imports the DRAWING record containing the relation identifier for the DrawingML part. */ - void importDrawing( RecordInputStream& rStrm ); + void importDrawing( SequenceInputStream& rStrm ); }; // ============================================================================ diff --git a/oox/inc/oox/xls/commentsbuffer.hxx b/oox/inc/oox/xls/commentsbuffer.hxx index bc03fcdc1c0c..e87d52ff03a2 100644 --- a/oox/inc/oox/xls/commentsbuffer.hxx +++ b/oox/inc/oox/xls/commentsbuffer.hxx @@ -56,7 +56,7 @@ public: /** Imports a cell comment from the passed attributes of the comment element. */ void importComment( const AttributeList& rAttribs ); /** Imports a cell comment from the passed stream of a COMMENT record. */ - void importComment( RecordInputStream& rStrm ); + void importComment( SequenceInputStream& rStrm ); /** Creates and returns a new rich-string object for the comment text. */ RichStringRef createText(); diff --git a/oox/inc/oox/xls/commentsfragment.hxx b/oox/inc/oox/xls/commentsfragment.hxx index ba0870f85503..3751cde764f4 100644 --- a/oox/inc/oox/xls/commentsfragment.hxx +++ b/oox/inc/oox/xls/commentsfragment.hxx @@ -47,7 +47,7 @@ protected: virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onEndElement(); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual void onEndRecord(); virtual const ::oox::core::RecordInfo* getRecordInfos() const; @@ -56,7 +56,7 @@ private: /** Imports comment data from the comment element. */ void importComment( const AttributeList& rAttribs ); /** Imports comment data from the COMMENT record. */ - void importComment( RecordInputStream& rStrm ); + void importComment( SequenceInputStream& rStrm ); private: CommentRef mxComment; diff --git a/oox/inc/oox/xls/condformatbuffer.hxx b/oox/inc/oox/xls/condformatbuffer.hxx index da844f8c3669..fae6381f6402 100644 --- a/oox/inc/oox/xls/condformatbuffer.hxx +++ b/oox/inc/oox/xls/condformatbuffer.hxx @@ -29,7 +29,6 @@ #define OOX_XLS_CONDFORMATBUFFER_HXX #include -#include "oox/helper/containerhelper.hxx" #include "oox/xls/formulaparser.hxx" #include "oox/xls/worksheethelper.hxx" @@ -87,7 +86,7 @@ public: void appendFormula( const ::rtl::OUString& rFormula ); /** Imports rule settings from a CFRULE record. */ - void importCfRule( RecordInputStream& rStrm ); + void importCfRule( SequenceInputStream& rStrm ); /** Imports rule settings from a CFRULE record. */ void importCfRule( BiffInputStream& rStrm, sal_Int32 nPriority ); @@ -131,9 +130,9 @@ public: CondFormatRuleRef importCfRule( const AttributeList& rAttribs ); /** Imports settings from the CONDFORMATTING record. */ - void importCondFormatting( RecordInputStream& rStrm ); + void importCondFormatting( SequenceInputStream& rStrm ); /** Imports a conditional formatting rule from the CFRULE record. */ - void importCfRule( RecordInputStream& rStrm ); + void importCfRule( SequenceInputStream& rStrm ); /** Imports settings from the CFHEADER record. */ void importCfHeader( BiffInputStream& rStrm ); @@ -167,7 +166,7 @@ public: /** Imports settings from the conditionalFormatting element. */ CondFormatRef importConditionalFormatting( const AttributeList& rAttribs ); /** Imports settings from the CONDFORMATTING record. */ - CondFormatRef importCondFormatting( RecordInputStream& rStrm ); + CondFormatRef importCondFormatting( SequenceInputStream& rStrm ); /** Imports settings from the CFHEADER record. */ void importCfHeader( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/condformatcontext.hxx b/oox/inc/oox/xls/condformatcontext.hxx index 72953bffe423..44c9fe592250 100644 --- a/oox/inc/oox/xls/condformatcontext.hxx +++ b/oox/inc/oox/xls/condformatcontext.hxx @@ -46,8 +46,8 @@ protected: virtual void onStartElement( const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: CondFormatRef mxCondFmt; diff --git a/oox/inc/oox/xls/connectionsbuffer.hxx b/oox/inc/oox/xls/connectionsbuffer.hxx index 69d609993864..98a5bea17bc6 100755 --- a/oox/inc/oox/xls/connectionsbuffer.hxx +++ b/oox/inc/oox/xls/connectionsbuffer.hxx @@ -28,6 +28,7 @@ #ifndef OOX_XLS_CONNECTIONSBUFFER_HXX #define OOX_XLS_CONNECTIONSBUFFER_HXX +#include "oox/helper/refvector.hxx" #include "oox/xls/workbookhelper.hxx" namespace oox { @@ -120,13 +121,13 @@ public: void importTable( const AttributeList& rAttribs, sal_Int32 nElement ); /** Imports connection settings from the CONNECTION record. */ - void importConnection( RecordInputStream& rStrm ); + void importConnection( SequenceInputStream& rStrm ); /** Imports web query settings from the WEBPR record. */ - void importWebPr( RecordInputStream& rStrm ); + void importWebPr( SequenceInputStream& rStrm ); /** Imports web query table settings from the WEBPRTABLES record. */ - void importWebPrTables( RecordInputStream& rStrm ); + void importWebPrTables( SequenceInputStream& rStrm ); /** Imports a web query table identifier from the PCITEM_MISSING, PCITEM_STRING, or PCITEM_INDEX record. */ - void importWebPrTable( RecordInputStream& rStrm, sal_Int32 nRecId ); + void importWebPrTable( SequenceInputStream& rStrm, sal_Int32 nRecId ); /** Imports connection settings from the DBQUERY record. */ void importDbQuery( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/connectionsfragment.hxx b/oox/inc/oox/xls/connectionsfragment.hxx index 8c4a608de7d1..5a9a9085c6c5 100644 --- a/oox/inc/oox/xls/connectionsfragment.hxx +++ b/oox/inc/oox/xls/connectionsfragment.hxx @@ -46,8 +46,8 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: Connection& mrConnection; @@ -64,7 +64,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void finalizeImport(); diff --git a/oox/inc/oox/xls/defnamesbuffer.hxx b/oox/inc/oox/xls/defnamesbuffer.hxx index 15d7db41832d..5374c47f6a07 100644 --- a/oox/inc/oox/xls/defnamesbuffer.hxx +++ b/oox/inc/oox/xls/defnamesbuffer.hxx @@ -28,8 +28,6 @@ #ifndef OOX_XLS_DEFINEDNAMESBUFFER_HXX #define OOX_XLS_DEFINEDNAMESBUFFER_HXX -#include "oox/helper/containerhelper.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/formulabase.hxx" namespace com { namespace sun { namespace star { @@ -99,7 +97,7 @@ protected: /** Imports the OOXML formula string, using the passed formula context. */ void importOoxFormula( FormulaContext& rContext, sal_Int16 nBaseSheet ); /** Imports the BIFF12 formula, using the passed formula context. */ - void importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, RecordInputStream& rStrm ); + void importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, SequenceInputStream& rStrm ); /** Imports the BIFF formula, using the passed formula context. */ void importBiffFormula( FormulaContext& rContext, sal_Int16 nBaseSheet, BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize = 0 ); @@ -125,7 +123,7 @@ public: /** Sets the formula string from the body of the definedName element. */ void setFormula( const ::rtl::OUString& rFormula ); /** Imports the defined name from a DEFINEDNAME record in the passed stream. */ - void importDefinedName( RecordInputStream& rStrm ); + void importDefinedName( SequenceInputStream& rStrm ); /** Imports the defined name from a DEFINEDNAME record in the passed BIFF stream. */ void importDefinedName( BiffInputStream& rStrm, sal_Int16 nCalcSheet ); @@ -187,7 +185,7 @@ public: /** Imports a defined name from the passed attribute set. */ DefinedNameRef importDefinedName( const AttributeList& rAttribs ); /** Imports a defined name from a DEFINEDNAME record in the passed stream. */ - void importDefinedName( RecordInputStream& rStrm ); + void importDefinedName( SequenceInputStream& rStrm ); /** Imports a defined name from a DEFINEDNAME record in the passed BIFF stream. */ void importDefinedName( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/externallinkbuffer.hxx b/oox/inc/oox/xls/externallinkbuffer.hxx index efa99440594f..c616a2b97e97 100644 --- a/oox/inc/oox/xls/externallinkbuffer.hxx +++ b/oox/inc/oox/xls/externallinkbuffer.hxx @@ -84,19 +84,19 @@ public: void importOleItem( const AttributeList& rAttribs ); /** Imports the EXTERNALNAME record containing the name (only). */ - void importExternalName( RecordInputStream& rStrm ); + void importExternalName( SequenceInputStream& rStrm ); /** Imports the EXTERNALNAMEFLAGS record containing the settings of an external name. */ - void importExternalNameFlags( RecordInputStream& rStrm ); + void importExternalNameFlags( SequenceInputStream& rStrm ); /** Imports the DDEITEMVALUES record containing the size of the DDE result matrix. */ - void importDdeItemValues( RecordInputStream& rStrm ); + void importDdeItemValues( SequenceInputStream& rStrm ); /** Imports the DDEITEM_BOOL record containing a boolean value in a link result. */ - void importDdeItemBool( RecordInputStream& rStrm ); + void importDdeItemBool( SequenceInputStream& rStrm ); /** Imports the DDEITEM_DOUBLE record containing a double value in a link result. */ - void importDdeItemDouble( RecordInputStream& rStrm ); + void importDdeItemDouble( SequenceInputStream& rStrm ); /** Imports the DDEITEM_ERROR record containing an error code in a link result. */ - void importDdeItemError( RecordInputStream& rStrm ); + void importDdeItemError( SequenceInputStream& rStrm ); /** Imports the DDEITEM_STRING record containing a string in a link result. */ - void importDdeItemString( RecordInputStream& rStrm ); + void importDdeItemString( SequenceInputStream& rStrm ); /** Imports the EXTERNALNAME record from the passed stream. */ void importExternalName( BiffInputStream& rStrm ); @@ -227,19 +227,19 @@ public: ExternalNameRef importOleItem( const AttributeList& rAttribs ); /** Imports the EXTERNALBOOK record describing an externally linked document, DDE link, or OLE link. */ - void importExternalBook( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm ); + void importExternalBook( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm ); /** Imports the EXTSHEETNAMES record containing the sheet names in an externally linked document. */ - void importExtSheetNames( RecordInputStream& rStrm ); + void importExtSheetNames( SequenceInputStream& rStrm ); /** Imports the EXTERNALNAME record describing an external name. */ - ExternalNameRef importExternalName( RecordInputStream& rStrm ); + ExternalNameRef importExternalName( SequenceInputStream& rStrm ); /** Imports the EXTERNALREF record from the passed stream. */ - void importExternalRef( RecordInputStream& rStrm ); + void importExternalRef( SequenceInputStream& rStrm ); /** Imports the EXTERNALSELF record from the passed stream. */ - void importExternalSelf( RecordInputStream& rStrm ); + void importExternalSelf( SequenceInputStream& rStrm ); /** Imports the EXTERNALSAME record from the passed stream. */ - void importExternalSame( RecordInputStream& rStrm ); + void importExternalSame( SequenceInputStream& rStrm ); /** Imports the EXTERNALADDIN record from the passed stream. */ - void importExternalAddin( RecordInputStream& rStrm ); + void importExternalAddin( SequenceInputStream& rStrm ); /** Imports the EXTERNSHEET record from the passed stream. */ void importExternSheet( BiffInputStream& rStrm ); @@ -332,7 +332,7 @@ struct RefSheetsModel explicit RefSheetsModel(); - void readBiff12Data( RecordInputStream& rStrm ); + void readBiff12Data( SequenceInputStream& rStrm ); void readBiff8Data( BiffInputStream& rStrm ); }; @@ -347,15 +347,15 @@ public: ExternalLinkRef importExternalReference( const AttributeList& rAttribs ); /** Imports the EXTERNALREF record from the passed stream. */ - ExternalLinkRef importExternalRef( RecordInputStream& rStrm ); + ExternalLinkRef importExternalRef( SequenceInputStream& rStrm ); /** Imports the EXTERNALSELF record from the passed stream. */ - void importExternalSelf( RecordInputStream& rStrm ); + void importExternalSelf( SequenceInputStream& rStrm ); /** Imports the EXTERNALSAME record from the passed stream. */ - void importExternalSame( RecordInputStream& rStrm ); + void importExternalSame( SequenceInputStream& rStrm ); /** Imports the EXTERNALADDIN record from the passed stream. */ - void importExternalAddin( RecordInputStream& rStrm ); + void importExternalAddin( SequenceInputStream& rStrm ); /** Imports the EXTERNALSHEETS record from the passed stream. */ - void importExternalSheets( RecordInputStream& rStrm ); + void importExternalSheets( SequenceInputStream& rStrm ); /** Imports the EXTERNSHEET record from the passed stream. */ ExternalLinkRef importExternSheet( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/externallinkfragment.hxx b/oox/inc/oox/xls/externallinkfragment.hxx index 1a89e17c96a4..0e1f293d2444 100644 --- a/oox/inc/oox/xls/externallinkfragment.hxx +++ b/oox/inc/oox/xls/externallinkfragment.hxx @@ -55,22 +55,22 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); private: /** Imports cell settings from a c element. */ void importCell( const AttributeList& rAttribs ); /** Imports the EXTCELL_BLANK from the passed stream. */ - void importExtCellBlank( RecordInputStream& rStrm ); + void importExtCellBlank( SequenceInputStream& rStrm ); /** Imports the EXTCELL_BOOL from the passed stream. */ - void importExtCellBool( RecordInputStream& rStrm ); + void importExtCellBool( SequenceInputStream& rStrm ); /** Imports the EXTCELL_DOUBLE from the passed stream. */ - void importExtCellDouble( RecordInputStream& rStrm ); + void importExtCellDouble( SequenceInputStream& rStrm ); /** Imports the EXTCELL_ERROR from the passed stream. */ - void importExtCellError( RecordInputStream& rStrm ); + void importExtCellError( SequenceInputStream& rStrm ); /** Imports the EXTCELL_STRING from the passed stream. */ - void importExtCellString( RecordInputStream& rStrm ); + void importExtCellString( SequenceInputStream& rStrm ); /** Sets the passed cell value to the current position in the sheet cache. */ void setCellValue( const ::com::sun::star::uno::Any& rValue ); @@ -97,7 +97,7 @@ protected: virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onEndElement(); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; diff --git a/oox/inc/oox/xls/formulabase.hxx b/oox/inc/oox/xls/formulabase.hxx index d9fdf34cfbbb..013e63f3bf30 100644 --- a/oox/inc/oox/xls/formulabase.hxx +++ b/oox/inc/oox/xls/formulabase.hxx @@ -33,8 +33,8 @@ #include #include #include -#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" +#include "oox/helper/refvector.hxx" #include "oox/xls/addressconverter.hxx" namespace com { namespace sun { namespace star { @@ -232,7 +232,7 @@ struct BinSingleRef2d void setBiff2Data( sal_uInt8 nCol, sal_uInt16 nRow, bool bRelativeAsOffset ); void setBiff8Data( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelativeAsOffset ); - void readBiff12Data( RecordInputStream& rStrm, bool bRelativeAsOffset ); + void readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset ); void readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset ); void readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffset ); }; @@ -245,7 +245,7 @@ struct BinComplexRef2d BinSingleRef2d maRef1; /// Start (top-left) cell address. BinSingleRef2d maRef2; /// End (bottom-right) cell address. - void readBiff12Data( RecordInputStream& rStrm, bool bRelativeAsOffset ); + void readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset ); void readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset ); void readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffset ); }; diff --git a/oox/inc/oox/xls/formulaparser.hxx b/oox/inc/oox/xls/formulaparser.hxx index 6368606282b6..c595993264d9 100644 --- a/oox/inc/oox/xls/formulaparser.hxx +++ b/oox/inc/oox/xls/formulaparser.hxx @@ -120,7 +120,7 @@ public: /** Imports and converts a BIFF12 token array from the passed stream. */ void importFormula( FormulaContext& rContext, - RecordInputStream& rStrm ) const; + SequenceInputStream& rStrm ) const; /** Imports and converts a BIFF2-BIFF8 token array from the passed stream. @param pnFmlaSize Size of the token array. If null is passed, reads @@ -150,7 +150,7 @@ public: ::rtl::OUString importOleTargetLink( const ::rtl::OUString& rFormulaString ); /** Imports and converts an OLE link target from the passed stream. */ - ::rtl::OUString importOleTargetLink( RecordInputStream& rStrm ); + ::rtl::OUString importOleTargetLink( SequenceInputStream& rStrm ); /** Imports and converts an OLE link target from the passed stream. */ ::rtl::OUString importOleTargetLink( diff --git a/oox/inc/oox/xls/numberformatsbuffer.hxx b/oox/inc/oox/xls/numberformatsbuffer.hxx index 4db4bddafc09..768572a5839c 100644 --- a/oox/inc/oox/xls/numberformatsbuffer.hxx +++ b/oox/inc/oox/xls/numberformatsbuffer.hxx @@ -29,7 +29,6 @@ #define OOX_XLS_NUMBERFORMATSBUFFER_HXX #include -#include "oox/helper/containerhelper.hxx" #include "oox/xls/workbookhelper.hxx" namespace com { namespace sun { namespace star { @@ -109,7 +108,7 @@ public: /** Inserts a new number format code. */ NumberFormatRef importNumFmt( const AttributeList& rAttribs ); /** Inserts a new number format code from a NUMFMT record. */ - void importNumFmt( RecordInputStream& rStrm ); + void importNumFmt( SequenceInputStream& rStrm ); /** Inserts a new number format code from a FORMAT record. */ void importFormat( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/pagesettings.hxx b/oox/inc/oox/xls/pagesettings.hxx index cbb92aa01244..6ff896b1bb51 100644 --- a/oox/inc/oox/xls/pagesettings.hxx +++ b/oox/inc/oox/xls/pagesettings.hxx @@ -110,17 +110,17 @@ public: void importPicture( const ::oox::core::Relations& rRelations, const AttributeList& rAttribs ); /** Imports the PRINTOPTIONS record from the passed stream. */ - void importPrintOptions( RecordInputStream& rStrm ); + void importPrintOptions( SequenceInputStream& rStrm ); /** Imports the PAGEMARGINS record from the passed stream. */ - void importPageMargins( RecordInputStream& rStrm ); + void importPageMargins( SequenceInputStream& rStrm ); /** Imports the PAGESETUP record from the passed stream. */ - void importPageSetup( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm ); + void importPageSetup( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm ); /** Imports the CHARTPAGESETUP record from the passed stream. */ - void importChartPageSetup( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm ); + void importChartPageSetup( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm ); /** Imports the HEADERFOOTER record from the passed stream. */ - void importHeaderFooter( RecordInputStream& rStrm ); + void importHeaderFooter( SequenceInputStream& rStrm ); /** Imports the PICTURE record from the passed stream. */ - void importPicture( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm ); + void importPicture( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm ); /** Imports the LEFTMARGIN record from the passed BIFF stream. */ void importLeftMargin( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/pivotcachebuffer.hxx b/oox/inc/oox/xls/pivotcachebuffer.hxx index 0c33516746ca..2e32d0faa7e5 100644 --- a/oox/inc/oox/xls/pivotcachebuffer.hxx +++ b/oox/inc/oox/xls/pivotcachebuffer.hxx @@ -31,7 +31,7 @@ #include #include #include -#include "oox/helper/containerhelper.hxx" +#include "oox/helper/refvector.hxx" #include "oox/xls/workbookhelper.hxx" namespace com { namespace sun { namespace star { @@ -66,17 +66,17 @@ public: void readIndex( const AttributeList& rAttribs ); /** Reads the string value from a pivot cache item. */ - void readString( RecordInputStream& rStrm ); + void readString( SequenceInputStream& rStrm ); /** Reads the double value from a pivot cache item. */ - void readDouble( RecordInputStream& rStrm ); + void readDouble( SequenceInputStream& rStrm ); /** Reads the date/time value from a pivot cache item. */ - void readDate( RecordInputStream& rStrm ); + void readDate( SequenceInputStream& rStrm ); /** Reads the boolean value from a pivot cache item. */ - void readBool( RecordInputStream& rStrm ); + void readBool( SequenceInputStream& rStrm ); /** Reads the error code value from a pivot cache item. */ - void readError( RecordInputStream& rStrm ); + void readError( SequenceInputStream& rStrm ); /** Reads the index of a shared item. */ - void readIndex( RecordInputStream& rStrm ); + void readIndex( SequenceInputStream& rStrm ); /** Reads the string value from a pivot cache item. */ void readString( BiffInputStream& rStrm, const WorkbookHelper& rHelper ); @@ -113,7 +113,7 @@ public: /** Imports the item from the passed attribute list. */ void importItem( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports the item from the passed stream and record. */ - void importItem( sal_Int32 nRecId, RecordInputStream& rStrm ); + void importItem( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Imports a complete item list from the passed stream. */ void importItemList( BiffInputStream& rStrm, sal_uInt16 nCount ); @@ -131,7 +131,7 @@ private: /** Creates and returns a new item at the end of the items list. */ PivotCacheItem& createItem(); /** Imports an array of items from the PCITEM_ARRAY record */ - void importArray( RecordInputStream& rStrm ); + void importArray( SequenceInputStream& rStrm ); private: typedef ::std::vector< PivotCacheItem > CacheItemVector; @@ -237,19 +237,19 @@ public: void importGroupItem( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports pivot cache field settings from the PCDFIELD record. */ - void importPCDField( RecordInputStream& rStrm ); + void importPCDField( SequenceInputStream& rStrm ); /** Imports shared items settings from the PCDFSHAREDITEMS record. */ - void importPCDFSharedItems( RecordInputStream& rStrm ); + void importPCDFSharedItems( SequenceInputStream& rStrm ); /** Imports one or more shared items from the passed record. */ - void importPCDFSharedItem( sal_Int32 nRecId, RecordInputStream& rStrm ); + void importPCDFSharedItem( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Imports grouping settings from the PCDFIELDGROUP record. */ - void importPCDFieldGroup( RecordInputStream& rStrm ); + void importPCDFieldGroup( SequenceInputStream& rStrm ); /** Imports numeric grouping settings from the PCDFRANGEPR record. */ - void importPCDFRangePr( RecordInputStream& rStrm ); + void importPCDFRangePr( SequenceInputStream& rStrm ); /** Imports an item of the mapping between group items and base items from the passed record. */ - void importPCDFDiscretePrItem( sal_Int32 nRecId, RecordInputStream& rStrm ); + void importPCDFDiscretePrItem( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Imports one or more group items from the passed record. */ - void importPCDFGroupItem( sal_Int32 nRecId, RecordInputStream& rStrm ); + void importPCDFGroupItem( sal_Int32 nRecId, SequenceInputStream& rStrm ); /** Imports pivot cache field settings from the PCDFIELD record. */ void importPCDField( BiffInputStream& rStrm ); @@ -304,7 +304,7 @@ public: const PivotCacheItem& rItem ) const; /** Reads an item from the PCRECORD record and writes it to the passed sheet. */ - void importPCRecordItem( RecordInputStream& rStrm, + void importPCRecordItem( SequenceInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow ) const; /** Reads an item index from the PCITEM_INDEXLIST record and writes the item to the passed sheet. */ void importPCItemIndex( BiffInputStream& rStrm, @@ -392,11 +392,11 @@ public: void importWorksheetSource( const AttributeList& rAttribs, const ::oox::core::Relations& rRelations ); /** Reads pivot cache global settings from the PCDEFINITION record. */ - void importPCDefinition( RecordInputStream& rStrm ); + void importPCDefinition( SequenceInputStream& rStrm ); /** Reads cache source settings from the PCDSOURCE record. */ - void importPCDSource( RecordInputStream& rStrm ); + void importPCDSource( SequenceInputStream& rStrm ); /** Reads sheet source settings from the PCDSHEETSOURCE record. */ - void importPCDSheetSource( RecordInputStream& rStrm, const ::oox::core::Relations& rRelations ); + void importPCDSheetSource( SequenceInputStream& rStrm, const ::oox::core::Relations& rRelations ); /** Reads cache source settings from the PCDSOURCE record. */ void importPCDSource( BiffInputStream& rStrm ); @@ -434,7 +434,7 @@ public: const PivotCacheItem& rItem ) const; /** Reads a PCRECORD record and writes all item values to the passed sheet. */ - void importPCRecord( RecordInputStream& rStrm, + void importPCRecord( SequenceInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const; /** Reads a PCITEM_INDEXLIST record and writes all item values to the passed sheet. */ void importPCItemIndexList( BiffInputStream& rStrm, diff --git a/oox/inc/oox/xls/pivotcachefragment.hxx b/oox/inc/oox/xls/pivotcachefragment.hxx index 4521fc8c0859..34a833e26525 100644 --- a/oox/inc/oox/xls/pivotcachefragment.hxx +++ b/oox/inc/oox/xls/pivotcachefragment.hxx @@ -48,8 +48,8 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: PivotCacheField& mrCacheField; @@ -67,7 +67,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void finalizeImport(); @@ -87,13 +87,13 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; private: void startCacheRecord(); - void importPCRecord( RecordInputStream& rStrm ); - void importPCRecordItem( sal_Int32 nRecId, RecordInputStream& rStrm ); + void importPCRecord( SequenceInputStream& rStrm ); + void importPCRecordItem( sal_Int32 nRecId, SequenceInputStream& rStrm ); private: const PivotCache& mrPivotCache; diff --git a/oox/inc/oox/xls/pivottablebuffer.hxx b/oox/inc/oox/xls/pivottablebuffer.hxx index cd62c6fb0a8b..7732037bd579 100644 --- a/oox/inc/oox/xls/pivottablebuffer.hxx +++ b/oox/inc/oox/xls/pivottablebuffer.hxx @@ -29,7 +29,6 @@ #define OOX_XLS_PIVOTTABLEBUFFER_HXX #include -#include "oox/helper/containerhelper.hxx" #include "oox/xls/pivotcachebuffer.hxx" #include "oox/xls/stylesbuffer.hxx" @@ -145,13 +144,13 @@ public: void importReferenceItem( const AttributeList& rAttribs ); /** Imports pivot field settings from the PTFIELD record. */ - void importPTField( RecordInputStream& rStrm ); + void importPTField( SequenceInputStream& rStrm ); /** Imports settings of an item in this pivot field from the PTFITEM record. */ - void importPTFItem( RecordInputStream& rStrm ); + void importPTFItem( SequenceInputStream& rStrm ); /** Imports pivot field reference settings from the PTREFERENCE record. */ - void importPTReference( RecordInputStream& rStrm ); + void importPTReference( SequenceInputStream& rStrm ); /** Imports pivot field item reference settings from the PTREFERENCEITEM record. */ - void importPTReferenceItem( RecordInputStream& rStrm ); + void importPTReferenceItem( SequenceInputStream& rStrm ); /** Imports pivot field settings from the PTFIELD and following records. */ void importPTField( BiffInputStream& rStrm ); @@ -235,9 +234,9 @@ public: void importTop10( const AttributeList& rAttribs ); /** Reads the settings of a field filter from the PTFILTER record. */ - void importPTFilter( RecordInputStream& rStrm ); + void importPTFilter( SequenceInputStream& rStrm ); /** Reads additional settings of a field filter from the TOP10FILTER record. */ - void importTop10Filter( RecordInputStream& rStrm ); + void importTop10Filter( SequenceInputStream& rStrm ); /** Applies the filter to the associated pivot table field if possible. */ void finalizeImport(); @@ -334,17 +333,17 @@ public: void importDataField( const AttributeList& rAttribs ); /** Reads global pivot table settings from the PTDEFINITION record. */ - void importPTDefinition( RecordInputStream& rStrm ); + void importPTDefinition( SequenceInputStream& rStrm ); /** Reads the location of the pivot table from the PTLOCATION record. */ - void importPTLocation( RecordInputStream& rStrm, sal_Int16 nSheet ); + void importPTLocation( SequenceInputStream& rStrm, sal_Int16 nSheet ); /** Reads the indexes of all fields located in the row dimension from a PTROWFIELDS record. */ - void importPTRowFields( RecordInputStream& rStrm ); + void importPTRowFields( SequenceInputStream& rStrm ); /** Reads the indexes of all fields located in the column dimension from a PTCOLFIELDS record. */ - void importPTColFields( RecordInputStream& rStrm ); + void importPTColFields( SequenceInputStream& rStrm ); /** Reads the settings of a field located in the page dimension from the PTPAGEFIELD record. */ - void importPTPageField( RecordInputStream& rStrm ); + void importPTPageField( SequenceInputStream& rStrm ); /** Reads the settings of a field located in the data dimension from the PTDATAFIELD record. */ - void importPTDataField( RecordInputStream& rStrm ); + void importPTDataField( SequenceInputStream& rStrm ); /** Reads global pivot table settings from the PTDEFINITION record. */ void importPTDefinition( BiffInputStream& rStrm, sal_Int16 nSheet ); @@ -404,7 +403,7 @@ private: /** Reads a field index for the row or column dimension. */ static void importField( IndexVector& orFields, const AttributeList& rAttribs ); /** Reads an array of field indexes for the row or column dimension. */ - static void importFields( IndexVector& orFields, RecordInputStream& rStrm ); + static void importFields( IndexVector& orFields, SequenceInputStream& rStrm ); /** Reads an array of field indexes for the row or column dimension. */ static void importFields( IndexVector& orFields, BiffInputStream& rStrm, sal_Int32 nCount ); diff --git a/oox/inc/oox/xls/pivottablefragment.hxx b/oox/inc/oox/xls/pivottablefragment.hxx index 039adc36134f..aafae063990c 100644 --- a/oox/inc/oox/xls/pivottablefragment.hxx +++ b/oox/inc/oox/xls/pivottablefragment.hxx @@ -50,8 +50,8 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: PivotTableField& mrTableField; @@ -69,8 +69,8 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: PivotTableFilter& mrTableFilter; @@ -87,7 +87,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; private: diff --git a/oox/inc/oox/xls/querytablebuffer.hxx b/oox/inc/oox/xls/querytablebuffer.hxx index 0034a3b44c82..fa67ca8874c0 100644 --- a/oox/inc/oox/xls/querytablebuffer.hxx +++ b/oox/inc/oox/xls/querytablebuffer.hxx @@ -67,7 +67,7 @@ public: /** Imports query table settings from the queryTable element. */ void importQueryTable( const AttributeList& rAttribs ); /** Imports query table settings from the QUERYTABLE record. */ - void importQueryTable( RecordInputStream& rStrm ); + void importQueryTable( SequenceInputStream& rStrm ); /** Imports query table settings from the QUERYTABLE record. */ void importQueryTable( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/querytablefragment.hxx b/oox/inc/oox/xls/querytablefragment.hxx index 9aafdd15684e..6eb561aa5a5e 100644 --- a/oox/inc/oox/xls/querytablefragment.hxx +++ b/oox/inc/oox/xls/querytablefragment.hxx @@ -46,7 +46,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; diff --git a/oox/inc/oox/xls/richstring.hxx b/oox/inc/oox/xls/richstring.hxx index 8bf371ed448d..f21e2a021111 100644 --- a/oox/inc/oox/xls/richstring.hxx +++ b/oox/inc/oox/xls/richstring.hxx @@ -28,7 +28,7 @@ #ifndef OOX_XLS_RICHSTRING_HXX #define OOX_XLS_RICHSTRING_HXX -#include "oox/helper/containerhelper.hxx" +#include "oox/helper/refvector.hxx" #include "oox/xls/stylesbuffer.hxx" namespace com { namespace sun { namespace star { @@ -110,7 +110,7 @@ struct FontPortionModel explicit inline FontPortionModel( sal_Int32 nPos, sal_Int32 nFontId ) : mnPos( nPos ), mnFontId( nFontId ) {} - void read( RecordInputStream& rStrm ); + void read( SequenceInputStream& rStrm ); void read( BiffInputStream& rStrm, BiffFontPortionMode eMode ); }; @@ -125,7 +125,7 @@ public: /** Appends a rich-string font identifier. */ void appendPortion( const FontPortionModel& rPortion ); /** Reads count and font identifiers from the passed stream. */ - void importPortions( RecordInputStream& rStrm ); + void importPortions( SequenceInputStream& rStrm ); /** Reads nCount font identifiers from the passed stream. */ void importPortions( BiffInputStream& rStrm, sal_uInt16 nCount, BiffFontPortionMode eMode ); /** Reads count and font identifiers from the passed stream. */ @@ -156,12 +156,12 @@ public: /** Imports phonetic settings from the phoneticPr element. */ void importPhoneticPr( const AttributeList& rAttribs ); /** Imports phonetic settings from the PHONETICPR record. */ - void importPhoneticPr( RecordInputStream& rStrm ); + void importPhoneticPr( SequenceInputStream& rStrm ); /** Imports phonetic settings from the PHONETICPR record. */ void importPhoneticPr( BiffInputStream& rStrm ); /** Imports phonetic settings from a rich string. */ - void importStringData( RecordInputStream& rStrm ); + void importStringData( SequenceInputStream& rStrm ); /** Imports phonetic settings from a rich string. */ void importStringData( BiffInputStream& rStrm ); @@ -206,7 +206,7 @@ struct PhoneticPortionModel explicit inline PhoneticPortionModel( sal_Int32 nPos, sal_Int32 nBasePos, sal_Int32 nBaseLen ) : mnPos( nPos ), mnBasePos( nBasePos ), mnBaseLen( nBaseLen ) {} - void read( RecordInputStream& rStrm ); + void read( SequenceInputStream& rStrm ); void read( BiffInputStream& rStrm ); }; @@ -221,7 +221,7 @@ public: /** Appends a rich-string phonetic portion. */ void appendPortion( const PhoneticPortionModel& rPortion ); /** Reads all phonetic portions from the passed stream. */ - void importPortions( RecordInputStream& rStrm ); + void importPortions( SequenceInputStream& rStrm ); /** Reads phonetic portion data from the passed stream. */ ::rtl::OUString importPortions( BiffInputStream& rStrm, sal_Int32 nPhoneticSize ); }; @@ -244,7 +244,7 @@ public: void importPhoneticPr( const AttributeList& rAttribs ); /** Imports a Unicode rich-string from the passed record stream. */ - void importString( RecordInputStream& rStrm, bool bRich ); + void importString( SequenceInputStream& rStrm, bool bRich ); /** Imports a byte string from the passed BIFF stream. */ void importByteString( BiffInputStream& rStrm, rtl_TextEncoding eDefaultTextEnc, BiffStringFlags nFlags = BIFF_STR_DEFAULT ); diff --git a/oox/inc/oox/xls/scenariobuffer.hxx b/oox/inc/oox/xls/scenariobuffer.hxx index 390844f6a706..ed8d4e919bd2 100644 --- a/oox/inc/oox/xls/scenariobuffer.hxx +++ b/oox/inc/oox/xls/scenariobuffer.hxx @@ -29,7 +29,8 @@ #define OOX_XLS_SCENARIOBUFFER_HXX #include -#include "oox/helper/containerhelper.hxx" +#include "oox/helper/refmap.hxx" +#include "oox/helper/refvector.hxx" #include "oox/xls/workbookhelper.hxx" namespace oox { @@ -73,9 +74,9 @@ public: void importInputCells( const AttributeList& rAttribs ); /** Imports a scenario definition from a SCENARIO record. */ - void importScenario( RecordInputStream& rStrm ); + void importScenario( SequenceInputStream& rStrm ); /** Imports a new cell for this scenario from a INPUTCELLS record. */ - void importInputCells( RecordInputStream& rStrm ); + void importInputCells( SequenceInputStream& rStrm ); /** Imports a scenario definition from a SCENARIO record. */ void importScenario( BiffInputStream& rStrm ); @@ -111,7 +112,7 @@ public: /** Imports sheet scenario settings from a scenarios element. */ void importScenarios( const AttributeList& rAttribs ); /** Imports sheet scenario settings from a SCENARIOS record. */ - void importScenarios( RecordInputStream& rStrm ); + void importScenarios( SequenceInputStream& rStrm ); /** Imports sheet scenario settings from a SCENARIOS record. */ void importScenarios( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/scenariocontext.hxx b/oox/inc/oox/xls/scenariocontext.hxx index 00570ad23016..3e6ccc5c22d6 100644 --- a/oox/inc/oox/xls/scenariocontext.hxx +++ b/oox/inc/oox/xls/scenariocontext.hxx @@ -47,8 +47,8 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: Scenario& mrScenario; @@ -65,8 +65,8 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); - virtual void onStartRecord( RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); + virtual void onStartRecord( SequenceInputStream& rStrm ); private: SheetScenarios& mrSheetScenarios; diff --git a/oox/inc/oox/xls/sharedformulabuffer.hxx b/oox/inc/oox/xls/sharedformulabuffer.hxx index 455fa781a41d..94b7572dcfd9 100644 --- a/oox/inc/oox/xls/sharedformulabuffer.hxx +++ b/oox/inc/oox/xls/sharedformulabuffer.hxx @@ -66,7 +66,7 @@ public: const ::rtl::OUString& rSharedRange, sal_Int32 nId, const ::com::sun::star::table::CellAddress& rBaseAddr ); /** Imports a shared formula from a SHAREDFORMULA record in the passed stream */ - void importSharedFmla( RecordInputStream& rStrm, + void importSharedFmla( SequenceInputStream& rStrm, const ::com::sun::star::table::CellAddress& rBaseAddr ); /** Imports a shared formula from a SHAREDFMLA record in the passed stream. */ void importSharedFmla( BiffInputStream& rStrm, diff --git a/oox/inc/oox/xls/sharedstringsbuffer.hxx b/oox/inc/oox/xls/sharedstringsbuffer.hxx index d5ec04c956a3..eff8ab4e7738 100644 --- a/oox/inc/oox/xls/sharedstringsbuffer.hxx +++ b/oox/inc/oox/xls/sharedstringsbuffer.hxx @@ -28,7 +28,6 @@ #ifndef OOX_XLS_SHAREDSTRINGSBUFFER_HXX #define OOX_XLS_SHAREDSTRINGSBUFFER_HXX -#include "oox/helper/containerhelper.hxx" #include "oox/xls/richstring.hxx" namespace oox { diff --git a/oox/inc/oox/xls/sharedstringsfragment.hxx b/oox/inc/oox/xls/sharedstringsfragment.hxx index 30b5e341866a..bc3a23122d19 100644 --- a/oox/inc/oox/xls/sharedstringsfragment.hxx +++ b/oox/inc/oox/xls/sharedstringsfragment.hxx @@ -44,7 +44,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void finalizeImport(); diff --git a/oox/inc/oox/xls/sheetdatacontext.hxx b/oox/inc/oox/xls/sheetdatacontext.hxx index 6a267db28214..fdbc0ba21231 100644 --- a/oox/inc/oox/xls/sheetdatacontext.hxx +++ b/oox/inc/oox/xls/sheetdatacontext.hxx @@ -55,7 +55,7 @@ protected: virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onEndElement(); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); private: /** Different types of cell records. */ @@ -69,35 +69,35 @@ private: void importFormula( const AttributeList& rAttribs ); /** Imports a cell address and the following XF identifier. */ - void importCellHeader( RecordInputStream& rStrm, CellType eCellType ); + void importCellHeader( SequenceInputStream& rStrm, CellType eCellType ); /** Imports an empty cell from a CELL_BLANK or MULTCELL_BLANK record. */ - void importCellBlank( RecordInputStream& rStrm, CellType eCellType ); + void importCellBlank( SequenceInputStream& rStrm, CellType eCellType ); /** Imports a boolean cell from a CELL_BOOL, MULTCELL_BOOL, or FORMULA_BOOL record. */ - void importCellBool( RecordInputStream& rStrm, CellType eCellType ); + void importCellBool( SequenceInputStream& rStrm, CellType eCellType ); /** Imports a numeric cell from a CELL_DOUBLE, MULTCELL_DOUBLE, or FORMULA_DOUBLE record. */ - void importCellDouble( RecordInputStream& rStrm, CellType eCellType ); + void importCellDouble( SequenceInputStream& rStrm, CellType eCellType ); /** Imports an error code cell from a CELL_ERROR, MULTCELL_ERROR, or FORMULA_ERROR record. */ - void importCellError( RecordInputStream& rStrm, CellType eCellType ); + void importCellError( SequenceInputStream& rStrm, CellType eCellType ); /** Imports an encoded numeric cell from a CELL_RK or MULTCELL_RK record. */ - void importCellRk( RecordInputStream& rStrm, CellType eCellType ); + void importCellRk( SequenceInputStream& rStrm, CellType eCellType ); /** Imports a rich-string cell from a CELL_RSTRING or MULTCELL_RSTRING record. */ - void importCellRString( RecordInputStream& rStrm, CellType eCellType ); + void importCellRString( SequenceInputStream& rStrm, CellType eCellType ); /** Imports a string cell from a CELL_SI or MULTCELL_SI record. */ - void importCellSi( RecordInputStream& rStrm, CellType eCellType ); + void importCellSi( SequenceInputStream& rStrm, CellType eCellType ); /** Imports a string cell from a CELL_STRING, MULTCELL_STRING, or FORMULA_STRING record. */ - void importCellString( RecordInputStream& rStrm, CellType eCellType ); + void importCellString( SequenceInputStream& rStrm, CellType eCellType ); /** Imports a cell formula for the current cell. */ - void importCellFormula( RecordInputStream& rStrm ); + void importCellFormula( SequenceInputStream& rStrm ); /** Imports row settings from a ROW record. */ - void importRow( RecordInputStream& rStrm ); + void importRow( SequenceInputStream& rStrm ); /** Imports an array formula from an ARRAY record. */ - void importArray( RecordInputStream& rStrm ); + void importArray( SequenceInputStream& rStrm ); /** Imports a shared formula from a SHAREDFORMULA record. */ - void importSharedFmla( RecordInputStream& rStrm ); + void importSharedFmla( SequenceInputStream& rStrm ); /** Imports table operation from a DATATABLE record. */ - void importDataTable( RecordInputStream& rStrm ); + void importDataTable( SequenceInputStream& rStrm ); private: CellModel maCurrCell; /// Position and formatting of current imported cell. diff --git a/oox/inc/oox/xls/stylesbuffer.hxx b/oox/inc/oox/xls/stylesbuffer.hxx index 59279749994f..64a56968aa37 100644 --- a/oox/inc/oox/xls/stylesbuffer.hxx +++ b/oox/inc/oox/xls/stylesbuffer.hxx @@ -35,8 +35,9 @@ #include #include #include "oox/drawingml/color.hxx" -#include "oox/helper/containerhelper.hxx" #include "oox/helper/graphichelper.hxx" +#include "oox/helper/refmap.hxx" +#include "oox/helper/refvector.hxx" #include "oox/xls/numberformatsbuffer.hxx" namespace com { namespace sun { namespace star { @@ -111,11 +112,11 @@ public: void importColor( const AttributeList& rAttribs ); /** Imports a 64-bit color from the passed binary stream. */ - void importColor( RecordInputStream& rStrm ); + void importColor( SequenceInputStream& rStrm ); /** Imports a 32-bit palette color identifier from the passed BIFF12 stream. */ - void importColorId( RecordInputStream& rStrm ); + void importColorId( SequenceInputStream& rStrm ); /** Imports a 32-bit RGBA color value from the passed BIFF12 stream. */ - void importColorRgb( RecordInputStream& rStrm ); + void importColorRgb( SequenceInputStream& rStrm ); /** Imports an 8-bit or 16-bit palette color identifier from the passed BIFF stream. */ void importColorId( BiffInputStream& rStrm, bool b16Bit = true ); @@ -128,7 +129,7 @@ public: // ---------------------------------------------------------------------------- -RecordInputStream& operator>>( RecordInputStream& rStrm, Color& orColor ); +SequenceInputStream& operator>>( SequenceInputStream& rStrm, Color& orColor ); // ============================================================================ @@ -142,7 +143,7 @@ public: /** Appends a new color from the passed attributes. */ void importPaletteColor( const AttributeList& rAttribs ); /** Appends a new color from the passed RGBCOLOR record. */ - void importPaletteColor( RecordInputStream& rStrm ); + void importPaletteColor( SequenceInputStream& rStrm ); /** Imports the PALETTE record from the passed stream. */ void importPalette( BiffInputStream& rStrm ); /** Imports a color palette from a UNO sequence in the passed any. */ @@ -261,23 +262,23 @@ public: void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports the FONT record from the passed stream. */ - void importFont( RecordInputStream& rStrm ); + void importFont( SequenceInputStream& rStrm ); /** Imports the font name from a DXF record. */ - void importDxfName( RecordInputStream& rStrm ); + void importDxfName( SequenceInputStream& rStrm ); /** Imports the font color from a DXF record. */ - void importDxfColor( RecordInputStream& rStrm ); + void importDxfColor( SequenceInputStream& rStrm ); /** Imports the font scheme from a DXF record. */ - void importDxfScheme( RecordInputStream& rStrm ); + void importDxfScheme( SequenceInputStream& rStrm ); /** Imports the font height from a DXF record. */ - void importDxfHeight( RecordInputStream& rStrm ); + void importDxfHeight( SequenceInputStream& rStrm ); /** Imports the font weight from a DXF record. */ - void importDxfWeight( RecordInputStream& rStrm ); + void importDxfWeight( SequenceInputStream& rStrm ); /** Imports the font underline style from a DXF record. */ - void importDxfUnderline( RecordInputStream& rStrm ); + void importDxfUnderline( SequenceInputStream& rStrm ); /** Imports the font escapement style from a DXF record. */ - void importDxfEscapement( RecordInputStream& rStrm ); + void importDxfEscapement( SequenceInputStream& rStrm ); /** Imports a font style flag from a DXF record. */ - void importDxfFlag( sal_Int32 nElement, RecordInputStream& rStrm ); + void importDxfFlag( sal_Int32 nElement, SequenceInputStream& rStrm ); /** Imports the FONT record from the passed stream. */ void importFont( BiffInputStream& rStrm ); @@ -550,9 +551,9 @@ public: void importColor( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports the BORDER record from the passed stream. */ - void importBorder( RecordInputStream& rStrm ); + void importBorder( SequenceInputStream& rStrm ); /** Imports a border from a DXF record from the passed stream. */ - void importDxfBorder( sal_Int32 nElement, RecordInputStream& rStrm ); + void importDxfBorder( sal_Int32 nElement, SequenceInputStream& rStrm ); /** Sets the border attributes from the passed BIFF2 XF record data. */ void setBiff2Data( sal_uInt8 nFlags ); @@ -631,9 +632,9 @@ struct GradientFillModel explicit GradientFillModel(); /** Reads BIFF12 gradient settings from a FILL or DXF record. */ - void readGradient( RecordInputStream& rStrm ); + void readGradient( SequenceInputStream& rStrm ); /** Reads BIFF12 gradient stop settings from a FILL or DXF record. */ - void readGradientStop( RecordInputStream& rStrm, bool bDxf ); + void readGradientStop( SequenceInputStream& rStrm, bool bDxf ); }; // ---------------------------------------------------------------------------- @@ -670,17 +671,17 @@ public: void importColor( const AttributeList& rAttribs, double fPosition ); /** Imports the FILL record from the passed stream. */ - void importFill( RecordInputStream& rStrm ); + void importFill( SequenceInputStream& rStrm ); /** Imports the fill pattern from a DXF record. */ - void importDxfPattern( RecordInputStream& rStrm ); + void importDxfPattern( SequenceInputStream& rStrm ); /** Imports the pattern color from a DXF record. */ - void importDxfFgColor( RecordInputStream& rStrm ); + void importDxfFgColor( SequenceInputStream& rStrm ); /** Imports the background color from a DXF record. */ - void importDxfBgColor( RecordInputStream& rStrm ); + void importDxfBgColor( SequenceInputStream& rStrm ); /** Imports gradient settings from a DXF record. */ - void importDxfGradient( RecordInputStream& rStrm ); + void importDxfGradient( SequenceInputStream& rStrm ); /** Imports gradient stop settings from a DXF record. */ - void importDxfStop( RecordInputStream& rStrm ); + void importDxfStop( SequenceInputStream& rStrm ); /** Sets the fill attributes from the passed BIFF2 XF record data. */ void setBiff2Data( sal_uInt8 nFlags ); @@ -764,7 +765,7 @@ public: void importProtection( const AttributeList& rAttribs ); /** Imports the XF record from the passed stream. */ - void importXf( RecordInputStream& rStrm, bool bCellXf ); + void importXf( SequenceInputStream& rStrm, bool bCellXf ); /** Imports the XF record from the passed stream. */ void importXf( BiffInputStream& rStrm ); @@ -825,7 +826,7 @@ public: void importProtection( const AttributeList& rAttribs ); /** Imports the DXF record from the passed stream. */ - void importDxf( RecordInputStream& rStrm ); + void importDxf( SequenceInputStream& rStrm ); /** Imports font, border, and fill settings from the CFRULE record. */ void importCfRule( BiffInputStream& rStrm, sal_uInt32 nFlags ); @@ -880,7 +881,7 @@ public: /** Imports passed attributes from the cellStyle element. */ void importCellStyle( const AttributeList& rAttribs ); /** Imports style settings from a CELLSTYLE record. */ - void importCellStyle( RecordInputStream& rStrm ); + void importCellStyle( SequenceInputStream& rStrm ); /** Imports style settings from a STYLE record. */ void importStyle( BiffInputStream& rStrm ); @@ -913,7 +914,7 @@ public: /** Appends and returns a new named cell style object. */ CellStyleRef importCellStyle( const AttributeList& rAttribs ); /** Imports the CELLSTYLE record from the passed stream. */ - CellStyleRef importCellStyle( RecordInputStream& rStrm ); + CellStyleRef importCellStyle( SequenceInputStream& rStrm ); /** Imports the STYLE record from the passed stream. */ CellStyleRef importStyle( BiffInputStream& rStrm ); @@ -994,11 +995,11 @@ public: CellStyleRef importCellStyle( const AttributeList& rAttribs ); /** Appends a new color to the color palette. */ - void importPaletteColor( RecordInputStream& rStrm ); + void importPaletteColor( SequenceInputStream& rStrm ); /** Imports the NUMFMT record from the passed stream. */ - void importNumFmt( RecordInputStream& rStrm ); + void importNumFmt( SequenceInputStream& rStrm ); /** Imports the CELLSTYLE record from the passed stream. */ - void importCellStyle( RecordInputStream& rStrm ); + void importCellStyle( SequenceInputStream& rStrm ); /** Imports the PALETTE record from the passed stream. */ void importPalette( BiffInputStream& rStrm ); diff --git a/oox/inc/oox/xls/stylesfragment.hxx b/oox/inc/oox/xls/stylesfragment.hxx index 4ab7ee78ae15..eb1af53d9cdb 100644 --- a/oox/inc/oox/xls/stylesfragment.hxx +++ b/oox/inc/oox/xls/stylesfragment.hxx @@ -43,7 +43,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); }; // ============================================================================ @@ -141,7 +141,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void finalizeImport(); diff --git a/oox/inc/oox/xls/tablebuffer.hxx b/oox/inc/oox/xls/tablebuffer.hxx index 4e9cb9824df0..d643fbc40728 100644 --- a/oox/inc/oox/xls/tablebuffer.hxx +++ b/oox/inc/oox/xls/tablebuffer.hxx @@ -29,7 +29,6 @@ #define OOX_XLS_TABLEBUFFER_HXX #include -#include "oox/helper/containerhelper.hxx" #include "oox/xls/autofilterbuffer.hxx" #include "oox/xls/workbookhelper.hxx" @@ -62,7 +61,7 @@ public: /** Imports a table definition from the passed attributes. */ void importTable( const AttributeList& rAttribs, sal_Int16 nSheet ); /** Imports a table definition from a TABLE record. */ - void importTable( RecordInputStream& rStrm, sal_Int16 nSheet ); + void importTable( SequenceInputStream& rStrm, sal_Int16 nSheet ); /** Creates a new auto filter and stores it internally. */ inline AutoFilter& createAutoFilter() { return maAutoFilters.createAutoFilter(); } diff --git a/oox/inc/oox/xls/tablefragment.hxx b/oox/inc/oox/xls/tablefragment.hxx index 40b9cca3a8fd..9c2678405ee5 100644 --- a/oox/inc/oox/xls/tablefragment.hxx +++ b/oox/inc/oox/xls/tablefragment.hxx @@ -46,7 +46,7 @@ public: protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; diff --git a/oox/inc/oox/xls/viewsettings.hxx b/oox/inc/oox/xls/viewsettings.hxx index c9c751b5066b..c5880bf077fe 100644 --- a/oox/inc/oox/xls/viewsettings.hxx +++ b/oox/inc/oox/xls/viewsettings.hxx @@ -30,7 +30,6 @@ #include #include -#include "oox/helper/containerhelper.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/stylesbuffer.hxx" #include "oox/xls/worksheethelper.hxx" @@ -119,13 +118,13 @@ public: void importChartSheetView( const AttributeList& rAttribs ); /** Imports the SHEETVIEW record containing sheet view settings. */ - void importSheetView( RecordInputStream& rStrm ); + void importSheetView( SequenceInputStream& rStrm ); /** Imports the PANE record containing sheet pane settings. */ - void importPane( RecordInputStream& rStrm ); + void importPane( SequenceInputStream& rStrm ); /** Imports the SELECTION record containing selection settings for a pane. */ - void importSelection( RecordInputStream& rStrm ); + void importSelection( SequenceInputStream& rStrm ); /** Imports the CHARTSHEETVIEW record containing view settings of a chart sheet. */ - void importChartSheetView( RecordInputStream& rStrm ); + void importChartSheetView( SequenceInputStream& rStrm ); /** Imports the WINDOW2 record containing sheet view settings. */ void importWindow2( BiffInputStream& rStrm ); @@ -185,9 +184,9 @@ public: /** Imports the oleSize element containing the visible size of the workbook. */ void importOleSize( const AttributeList& rAttribs ); /** Imports the WORKBOOKVIEW record containing workbook view settings. */ - void importWorkbookView( RecordInputStream& rStrm ); + void importWorkbookView( SequenceInputStream& rStrm ); /** Imports the OLESIZE record containing the visible size of the workbook. */ - void importOleSize( RecordInputStream& rStrm ); + void importOleSize( SequenceInputStream& rStrm ); /** Imports the WINDOW1 record containing workbook view settings. */ void importWindow1( BiffInputStream& rStrm ); /** Imports the OLESIZE record containing the visible size of the workbook. */ diff --git a/oox/inc/oox/xls/workbookfragment.hxx b/oox/inc/oox/xls/workbookfragment.hxx index 8c354dca1840..d0b0cadd416b 100644 --- a/oox/inc/oox/xls/workbookfragment.hxx +++ b/oox/inc/oox/xls/workbookfragment.hxx @@ -49,7 +49,7 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void finalizeImport(); @@ -59,8 +59,8 @@ private: void importDefinedName( const AttributeList& rAttribs ); void importPivotCache( const AttributeList& rAttribs ); - void importExternalRef( RecordInputStream& rStrm ); - void importPivotCache( RecordInputStream& rStrm ); + void importExternalRef( SequenceInputStream& rStrm ); + void importPivotCache( SequenceInputStream& rStrm ); void importExternalLinkFragment( ExternalLink& rExtLink ); void importPivotCacheDefFragment( const ::rtl::OUString& rRelId, sal_Int32 nCacheId ); diff --git a/oox/inc/oox/xls/workbookhelper.hxx b/oox/inc/oox/xls/workbookhelper.hxx index ee5b2f12cea5..ecf824076ef5 100644 --- a/oox/inc/oox/xls/workbookhelper.hxx +++ b/oox/inc/oox/xls/workbookhelper.hxx @@ -50,8 +50,8 @@ namespace com { namespace sun { namespace star { namespace oox { class AttributeList; - class RecordInputStream; class SegmentProgressBar; + class SequenceInputStream; } namespace oox { namespace core { diff --git a/oox/inc/oox/xls/workbooksettings.hxx b/oox/inc/oox/xls/workbooksettings.hxx index bbdbefac17ff..858e886df778 100644 --- a/oox/inc/oox/xls/workbooksettings.hxx +++ b/oox/inc/oox/xls/workbooksettings.hxx @@ -101,11 +101,11 @@ public: void importCalcPr( const AttributeList& rAttribs ); /** Imports the FILESHARING record containing write protection settings. */ - void importFileSharing( RecordInputStream& rStrm ); + void importFileSharing( SequenceInputStream& rStrm ); /** Imports the WORKBOOKPR record containing global workbook settings. */ - void importWorkbookPr( RecordInputStream& rStrm ); + void importWorkbookPr( SequenceInputStream& rStrm ); /** Imports the CALCPR record containing workbook calculation settings. */ - void importCalcPr( RecordInputStream& rStrm ); + void importCalcPr( SequenceInputStream& rStrm ); /** Sets the save external linked values flag, e.g. from the WSBOOL record. */ void setSaveExtLinkValues( bool bSaveExtLinks ); diff --git a/oox/inc/oox/xls/worksheetbuffer.hxx b/oox/inc/oox/xls/worksheetbuffer.hxx index d32012c48cff..7c59cce988dd 100644 --- a/oox/inc/oox/xls/worksheetbuffer.hxx +++ b/oox/inc/oox/xls/worksheetbuffer.hxx @@ -29,7 +29,8 @@ #define OOX_XLS_WORKSHEETBUFFER_HXX #include -#include "oox/helper/containerhelper.hxx" +#include "oox/helper/refmap.hxx" +#include "oox/helper/refvector.hxx" #include "oox/xls/workbookhelper.hxx" namespace com { namespace sun { namespace star { @@ -75,7 +76,7 @@ public: /** Imports the attributes of a sheet element. */ void importSheet( const AttributeList& rAttribs ); /** Imports the SHEET record from the passed BIFF12 stream. */ - void importSheet( RecordInputStream& rStrm ); + void importSheet( SequenceInputStream& rStrm ); /** Imports the SHEET record from the passed BIFF stream. */ void importSheet( BiffInputStream& rStrm ); /** Inserts a new empty sheet into the document. Looks for an unused name. diff --git a/oox/inc/oox/xls/worksheetfragment.hxx b/oox/inc/oox/xls/worksheetfragment.hxx index 96d8f1229f23..4fe3bf4240dd 100644 --- a/oox/inc/oox/xls/worksheetfragment.hxx +++ b/oox/inc/oox/xls/worksheetfragment.hxx @@ -45,13 +45,13 @@ protected: virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onEndElement(); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); private: /** Imports the dataValidation element containing data validation settings. */ void importDataValidation( const AttributeList& rAttribs ); /** Imports the DATAVALIDATION record containing data validation settings. */ - void importDataValidation( RecordInputStream& rStrm ); + void importDataValidation( SequenceInputStream& rStrm ); private: ::std::auto_ptr< ValidationModel > mxValModel; @@ -73,7 +73,7 @@ protected: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); - virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ); + virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual const ::oox::core::RecordInfo* getRecordInfos() const; virtual void initializeImport(); @@ -104,25 +104,25 @@ private: void importControl( const AttributeList& rAttribs ); /** Imports the DIMENSION record containing the used area of the sheet. */ - void importDimension( RecordInputStream& rStrm ); + void importDimension( SequenceInputStream& rStrm ); /** Imports sheet format properties from a SHEETFORMATPR record. */ - void importSheetFormatPr( RecordInputStream& rStrm ); + void importSheetFormatPr( SequenceInputStream& rStrm ); /** Imports column settings from a COL record. */ - void importCol( RecordInputStream& rStrm ); + void importCol( SequenceInputStream& rStrm ); /** Imports a merged cell range from a MERGECELL record. */ - void importMergeCell( RecordInputStream& rStrm ); + void importMergeCell( SequenceInputStream& rStrm ); /** Imports a hyperlink for a cell range from a HYPERLINK record. */ - void importHyperlink( RecordInputStream& rStrm ); + void importHyperlink( SequenceInputStream& rStrm ); /** Imports the BRK record for an individual row or column page break. */ - void importBrk( RecordInputStream& rStrm, bool bRowBreak ); + void importBrk( SequenceInputStream& rStrm, bool bRowBreak ); /** Imports the DRAWING record containing the relation identifier for the DrawingML part. */ - void importDrawing( RecordInputStream& rStrm ); + void importDrawing( SequenceInputStream& rStrm ); /** Imports the LEGACYDRAWING record containing the relation identifier for the VML drawing part. */ - void importLegacyDrawing( RecordInputStream& rStrm ); + void importLegacyDrawing( SequenceInputStream& rStrm ); /** Imports additional data for an OLE object. */ - void importOleObject( RecordInputStream& rStrm ); + void importOleObject( SequenceInputStream& rStrm ); /** Imports additional data for an OCX form control. */ - void importControl( RecordInputStream& rStrm ); + void importControl( SequenceInputStream& rStrm ); /** Imports the binary data of an embedded OLE object from the fragment with the passed ID. */ void importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const ::rtl::OUString& rRelId ); diff --git a/oox/inc/oox/xls/worksheetsettings.hxx b/oox/inc/oox/xls/worksheetsettings.hxx index de58fa3e1355..6d6c8a4912d2 100644 --- a/oox/inc/oox/xls/worksheetsettings.hxx +++ b/oox/inc/oox/xls/worksheetsettings.hxx @@ -98,15 +98,15 @@ public: void importPhoneticPr( const AttributeList& rAttribs ); /** Imports sheet properties from the SHEETPR record. */ - void importSheetPr( RecordInputStream& rStrm ); + void importSheetPr( SequenceInputStream& rStrm ); /** Imports sheet properties from the CHARTSHEETPR record. */ - void importChartSheetPr( RecordInputStream& rStrm ); + void importChartSheetPr( SequenceInputStream& rStrm ); /** Imports sheet protection settings from the SHEETPROTECTION record. */ - void importSheetProtection( RecordInputStream& rStrm ); + void importSheetProtection( SequenceInputStream& rStrm ); /** Imports chart sheet protection settings from the CHARTPROTECTION record. */ - void importChartProtection( RecordInputStream& rStrm ); + void importChartProtection( SequenceInputStream& rStrm ); /** Imports phonetic settings from the PHONETICPR record. */ - void importPhoneticPr( RecordInputStream& rStrm ); + void importPhoneticPr( SequenceInputStream& rStrm ); /** Imports sheet properties from a SHEETEXT record. */ void importSheetExt( BiffInputStream& rStrm ); diff --git a/oox/source/core/contexthandler.cxx b/oox/source/core/contexthandler.cxx index c2d6fa928576..8bf2c4eadfeb 100644 --- a/oox/source/core/contexthandler.cxx +++ b/oox/source/core/contexthandler.cxx @@ -133,12 +133,12 @@ void ContextHandler::processingInstruction( const OUString&, const OUString& ) t // record context interface --------------------------------------------------- -ContextHandlerRef ContextHandler::createRecordContext( sal_Int32, RecordInputStream& ) +ContextHandlerRef ContextHandler::createRecordContext( sal_Int32, SequenceInputStream& ) { return 0; } -void ContextHandler::startRecord( sal_Int32, RecordInputStream& ) +void ContextHandler::startRecord( sal_Int32, SequenceInputStream& ) { } diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx index 8ba5dd65cd9b..48f5718f9149 100644 --- a/oox/source/core/contexthandler2.cxx +++ b/oox/source/core/contexthandler2.cxx @@ -126,12 +126,12 @@ void ContextHandler2Helper::implEndElement( sal_Int32 nElement ) } } -ContextHandlerRef ContextHandler2Helper::implCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ContextHandler2Helper::implCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { return onCreateRecordContext( nRecId, rStrm ); } -void ContextHandler2Helper::implStartRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +void ContextHandler2Helper::implStartRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) { pushElementInfo( nRecId ); onStartRecord( rStrm ); @@ -215,12 +215,12 @@ void SAL_CALL ContextHandler2::endFastElement( sal_Int32 nElement ) throw( SAXEx // oox.core.RecordContext interface ------------------------------------------- -ContextHandlerRef ContextHandler2::createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ContextHandler2::createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { return implCreateRecordContext( nRecId, rStrm ); } -void ContextHandler2::startRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +void ContextHandler2::startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) { implStartRecord( nRecId, rStrm ); } @@ -249,12 +249,12 @@ void ContextHandler2::onEndElement() { } -ContextHandlerRef ContextHandler2::onCreateRecordContext( sal_Int32, RecordInputStream& ) +ContextHandlerRef ContextHandler2::onCreateRecordContext( sal_Int32, SequenceInputStream& ) { return 0; } -void ContextHandler2::onStartRecord( RecordInputStream& ) +void ContextHandler2::onStartRecord( SequenceInputStream& ) { } diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx index e01d2af65113..7771b89747b9 100644 --- a/oox/source/core/fragmenthandler2.cxx +++ b/oox/source/core/fragmenthandler2.cxx @@ -87,12 +87,12 @@ void SAL_CALL FragmentHandler2::endFastElement( sal_Int32 nElement ) throw( SAXE // oox.core.ContextHandler interface ------------------------------------------ -ContextHandlerRef FragmentHandler2::createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef FragmentHandler2::createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { return implCreateRecordContext( nRecId, rStrm ); } -void FragmentHandler2::startRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +void FragmentHandler2::startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) { implStartRecord( nRecId, rStrm ); } @@ -121,12 +121,12 @@ void FragmentHandler2::onEndElement() { } -ContextHandlerRef FragmentHandler2::onCreateRecordContext( sal_Int32, RecordInputStream& ) +ContextHandlerRef FragmentHandler2::onCreateRecordContext( sal_Int32, SequenceInputStream& ) { return 0; } -void FragmentHandler2::onStartRecord( RecordInputStream& ) +void FragmentHandler2::onStartRecord( SequenceInputStream& ) { } diff --git a/oox/source/core/recordparser.cxx b/oox/source/core/recordparser.cxx index 1fea7c85a88b..aef73ceed86c 100644 --- a/oox/source/core/recordparser.cxx +++ b/oox/source/core/recordparser.cxx @@ -32,7 +32,6 @@ #include #include #include "oox/core/fragmenthandler.hxx" -#include "oox/helper/recordinputstream.hxx" namespace oox { namespace core { @@ -274,7 +273,7 @@ void RecordParser::parseStream( const RecordInputSource& rInputSource ) throw( S while( lclReadNextRecord( nRecId, aRecData, *maSource.mxInStream ) ) { // create record stream object from imported record data - RecordInputStream aRecStrm( aRecData ); + SequenceInputStream aRecStrm( aRecData ); // try to leave a context, there may be other incomplete contexts on the stack if( const RecordInfo* pEndRecInfo = getEndRecordInfo( nRecId ) ) { diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index f901506f555c..b9eaee5c01be 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -39,6 +39,7 @@ #include "oox/drawingml/chart/titleconverter.hxx" #include "oox/drawingml/chart/typegroupconverter.hxx" #include "oox/drawingml/chart/typegroupmodel.hxx" +#include "oox/helper/containerhelper.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx index 1baefdc641e4..fdc4969f7c5e 100644 --- a/oox/source/drawingml/chart/titleconverter.cxx +++ b/oox/source/drawingml/chart/titleconverter.cxx @@ -38,6 +38,7 @@ #include "oox/drawingml/textparagraph.hxx" #include "oox/drawingml/chart/datasourceconverter.hxx" #include "oox/drawingml/chart/titlemodel.hxx" +#include "oox/helper/containerhelper.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx index 6b0975f26260..6c0d3660a670 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -40,6 +40,7 @@ #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/chart/seriesconverter.hxx" #include "oox/drawingml/chart/typegroupmodel.hxx" +#include "oox/helper/containerhelper.hxx" namespace oox { namespace drawingml { diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx index 38b6eb2d82a3..2eb1ef8b4cdf 100644 --- a/oox/source/drawingml/lineproperties.cxx +++ b/oox/source/drawingml/lineproperties.cxx @@ -35,6 +35,7 @@ #include #include #include +#include "oox/helper/containerhelper.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/modelobjecthelper.hxx" #include "oox/helper/propertymap.hxx" diff --git a/oox/source/dump/xlsbdumper.cxx b/oox/source/dump/xlsbdumper.cxx index bee33566bba8..3dc2974420a6 100644 --- a/oox/source/dump/xlsbdumper.cxx +++ b/oox/source/dump/xlsbdumper.cxx @@ -80,7 +80,7 @@ RecordObjectBase::~RecordObjectBase() void RecordObjectBase::construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName ) { - mxBiffStrm.reset( new RecordInputStream( getRecordDataSequence() ) ); + mxBiffStrm.reset( new SequenceInputStream( getRecordDataSequence() ) ); SequenceRecordObjectBase::construct( rParent, rxStrm, rSysFileName, mxBiffStrm, "RECORD-NAMES", "SIMPLE-RECORDS" ); if( SequenceRecordObjectBase::implIsValid() ) mxErrCodes = cfg().getNameList( "ERRORCODES" ); @@ -198,7 +198,7 @@ OUString RecordObjectBase::dumpString( const String& rName, bool bRich, bool b32 { sal_uInt8 nFlags = bRich ? dumpHex< sal_uInt8 >( "flags", "STRING-FLAGS" ) : 0; - OUString aString = mxBiffStrm->readString( b32BitLen ); + OUString aString = BiffHelper::readString( *mxBiffStrm, b32BitLen ); writeStringItem( rName( "text" ), aString ); // --- formatting --- diff --git a/oox/source/helper/containerhelper.cxx b/oox/source/helper/containerhelper.cxx index 4d41d9924326..e7f322ff10e3 100644 --- a/oox/source/helper/containerhelper.cxx +++ b/oox/source/helper/containerhelper.cxx @@ -160,62 +160,4 @@ OUString ContainerHelper::insertByUnusedName( // ============================================================================ -ObjectContainer::ObjectContainer( const Reference< XMultiServiceFactory >& rxFactory, const OUString& rServiceName ) : - mxFactory( rxFactory ), - maServiceName( rServiceName ), - mnIndex( 0 ) -{ - OSL_ENSURE( mxFactory.is(), "ObjectContainer::ObjectContainer - missing service factory" ); -} - -ObjectContainer::~ObjectContainer() -{ -} - -bool ObjectContainer::hasObject( const OUString& rObjName ) const -{ - createContainer(); - return mxContainer.is() && mxContainer->hasByName( rObjName ); -} - -Any ObjectContainer::getObject( const OUString& rObjName ) const -{ - createContainer(); - if( mxContainer.is() ) try - { - return mxContainer->getByName( rObjName ); - } - catch( Exception& ) - { - } - return Any(); -} - -OUString ObjectContainer::insertObject( const OUString& rObjName, const Any& rObj, bool bInsertByUnusedName ) -{ - createContainer(); - if( mxContainer.is() ) - { - if( bInsertByUnusedName ) - return ContainerHelper::insertByUnusedName( mxContainer, rObjName + OUString::valueOf( ++mnIndex ), ' ', rObj ); - if( ContainerHelper::insertByName( mxContainer, rObjName, rObj ) ) - return rObjName; - } - return OUString(); -} - -void ObjectContainer::createContainer() const -{ - if( !mxContainer.is() && mxFactory.is() ) try - { - mxContainer.set( mxFactory->createInstance( maServiceName ), UNO_QUERY_THROW ); - } - catch( Exception& ) - { - } - OSL_ENSURE( mxContainer.is(), "ObjectContainer::createContainer - container not found" ); -} - -// ============================================================================ - } // namespace oox diff --git a/oox/source/helper/modelobjecthelper.cxx b/oox/source/helper/modelobjecthelper.cxx index f9b6b066230a..7fdbe4b38134 100644 --- a/oox/source/helper/modelobjecthelper.cxx +++ b/oox/source/helper/modelobjecthelper.cxx @@ -28,9 +28,11 @@ #include "oox/helper/modelobjecthelper.hxx" #include +#include #include #include #include +#include "oox/helper/containerhelper.hxx" #include "oox/helper/helper.hxx" namespace oox { @@ -46,6 +48,64 @@ using ::rtl::OUString; // ============================================================================ +ObjectContainer::ObjectContainer( const Reference< XMultiServiceFactory >& rxFactory, const OUString& rServiceName ) : + mxFactory( rxFactory ), + maServiceName( rServiceName ), + mnIndex( 0 ) +{ + OSL_ENSURE( mxFactory.is(), "ObjectContainer::ObjectContainer - missing service factory" ); +} + +ObjectContainer::~ObjectContainer() +{ +} + +bool ObjectContainer::hasObject( const OUString& rObjName ) const +{ + createContainer(); + return mxContainer.is() && mxContainer->hasByName( rObjName ); +} + +Any ObjectContainer::getObject( const OUString& rObjName ) const +{ + createContainer(); + if( mxContainer.is() ) try + { + return mxContainer->getByName( rObjName ); + } + catch( Exception& ) + { + } + return Any(); +} + +OUString ObjectContainer::insertObject( const OUString& rObjName, const Any& rObj, bool bInsertByUnusedName ) +{ + createContainer(); + if( mxContainer.is() ) + { + if( bInsertByUnusedName ) + return ContainerHelper::insertByUnusedName( mxContainer, rObjName + OUString::valueOf( ++mnIndex ), ' ', rObj ); + if( ContainerHelper::insertByName( mxContainer, rObjName, rObj ) ) + return rObjName; + } + return OUString(); +} + +void ObjectContainer::createContainer() const +{ + if( !mxContainer.is() && mxFactory.is() ) try + { + mxContainer.set( mxFactory->createInstance( maServiceName ), UNO_QUERY_THROW ); + } + catch( Exception& ) + { + } + OSL_ENSURE( mxContainer.is(), "ObjectContainer::createContainer - container not found" ); +} + +// ============================================================================ + ModelObjectHelper::ModelObjectHelper( const Reference< XMultiServiceFactory >& rxModelFactory ) : maMarkerContainer( rxModelFactory, CREATE_OUSTRING( "com.sun.star.drawing.MarkerTable" ) ), maDashContainer( rxModelFactory, CREATE_OUSTRING( "com.sun.star.drawing.DashTable" ) ), diff --git a/oox/source/helper/recordinputstream.cxx b/oox/source/helper/recordinputstream.cxx deleted file mode 100644 index a746eef47d73..000000000000 --- a/oox/source/helper/recordinputstream.cxx +++ /dev/null @@ -1,72 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "oox/helper/recordinputstream.hxx" - -#include - -namespace oox { - -// ============================================================================ - -using ::rtl::OUString; - -// ============================================================================ - -RecordInputStream::RecordInputStream( const StreamDataSequence& rData ) : - SequenceInputStream( rData ) -{ -} - -OUString RecordInputStream::readString( bool b32BitLen ) -{ - OUString aString; - if( !isEof() ) - { - sal_Int32 nCharCount = b32BitLen ? readValue< sal_Int32 >() : readValue< sal_Int16 >(); - // string length -1 is often used to indicate a missing string - OSL_ENSURE( !isEof() && (nCharCount >= -1), "RecordInputStream::readString - invalid string length" ); - if( !isEof() && (nCharCount > 0) ) - { - ::std::vector< sal_Unicode > aBuffer; - aBuffer.reserve( getLimitedValue< size_t, sal_Int32 >( nCharCount + 1, 0, 0xFFFF ) ); - for( sal_Int32 nCharIdx = 0; !isEof() && (nCharIdx < nCharCount); ++nCharIdx ) - { - sal_uInt16 nChar; - readValue( nChar ); - aBuffer.push_back( static_cast< sal_Unicode >( nChar ) ); - } - aBuffer.push_back( 0 ); - aString = OUString( &aBuffer.front() ); - } - } - return aString; -} - -// ============================================================================ - -} // namespace oox diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index 105f5deea225..86cc55df3127 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -57,6 +57,7 @@ #include #include "oox/helper/attributelist.hxx" #include "oox/helper/binaryinputstream.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" diff --git a/oox/source/ole/olestorage.cxx b/oox/source/ole/olestorage.cxx index e9aa8f6a9ae8..cf55d6463778 100644 --- a/oox/source/ole/olestorage.cxx +++ b/oox/source/ole/olestorage.cxx @@ -38,6 +38,7 @@ #include #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/binaryoutputstream.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/helper.hxx" namespace oox { diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx index dc86c2dd82e5..39deb77576d9 100644 --- a/oox/source/ole/vbacontrol.cxx +++ b/oox/source/ole/vbacontrol.cxx @@ -38,6 +38,7 @@ #include #include "oox/helper/attributelist.hxx" #include "oox/helper/binaryinputstream.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" #include "oox/helper/storagebase.hxx" diff --git a/oox/source/token/tokenmap.cxx b/oox/source/token/tokenmap.cxx index dcd354ea84ed..a5189269c3c8 100644 --- a/oox/source/token/tokenmap.cxx +++ b/oox/source/token/tokenmap.cxx @@ -30,7 +30,6 @@ #include #include #include -#include "oox/helper/containerhelper.hxx" #include "oox/token/tokens.hxx" namespace oox { @@ -89,8 +88,9 @@ TokenMap::~TokenMap() OUString TokenMap::getUnicodeTokenName( sal_Int32 nToken ) const { - const TokenName* pTokenName = ContainerHelper::getVectorElement( maTokenNames, nToken ); - return pTokenName ? pTokenName->maUniName : OUString(); + if( (0 <= nToken) && (static_cast< size_t >( nToken ) < maTokenNames.size()) ) + return maTokenNames[ static_cast< size_t >( nToken ) ].maUniName; + return OUString(); } sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const @@ -102,8 +102,9 @@ sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const Sequence< sal_Int8 > TokenMap::getUtf8TokenName( sal_Int32 nToken ) const { - const TokenName* pTokenName = ContainerHelper::getVectorElement( maTokenNames, nToken ); - return pTokenName ? pTokenName->maUtf8Name : Sequence< sal_Int8 >(); + if( (0 <= nToken) && (static_cast< size_t >( nToken ) < maTokenNames.size()) ) + return maTokenNames[ static_cast< size_t >( nToken ) ].maUtf8Name; + return Sequence< sal_Int8 >(); } sal_Int32 TokenMap::getTokenFromUtf8( const Sequence< sal_Int8 >& rUtf8Name ) const diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index c53dd2896395..ccf0fe567235 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -32,6 +32,7 @@ #include #include #include "oox/core/xmlfilterbase.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/ole/axcontrol.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshapecontainer.hxx" diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 93301357984f..db12f3d91e0b 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -36,6 +36,7 @@ #include #include #include "oox/core/xmlfilterbase.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" diff --git a/oox/source/xls/addressconverter.cxx b/oox/source/xls/addressconverter.cxx index 0f9828b8e0f4..6d53be0c155b 100644 --- a/oox/source/xls/addressconverter.cxx +++ b/oox/source/xls/addressconverter.cxx @@ -34,7 +34,6 @@ #include #include #include "oox/core/filterbase.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/biffoutputstream.hxx" @@ -123,7 +122,7 @@ CellAddress ApiCellRangeList::getBaseAddress() const // ============================================================================ -void BinAddress::read( RecordInputStream& rStrm ) +void BinAddress::read( SequenceInputStream& rStrm ) { rStrm >> mnRow >> mnCol; } @@ -154,7 +153,7 @@ bool BinRange::contains( const BinAddress& rAddr ) const (maFirst.mnRow <= rAddr.mnRow) && (rAddr.mnRow <= maLast.mnRow); } -void BinRange::read( RecordInputStream& rStrm ) +void BinRange::read( SequenceInputStream& rStrm ) { rStrm >> maFirst.mnRow >> maLast.mnRow >> maFirst.mnCol >> maLast.mnCol; } @@ -199,7 +198,7 @@ BinRange BinRangeList::getEnclosingRange() const return aRange; } -void BinRangeList::read( RecordInputStream& rStrm ) +void BinRangeList::read( SequenceInputStream& rStrm ) { sal_Int32 nCount = rStrm.readInt32(); resize( getLimitedValue< size_t, sal_Int64 >( nCount, 0, rStrm.getRemaining() / 16 ) ); diff --git a/oox/source/xls/autofilterbuffer.cxx b/oox/source/xls/autofilterbuffer.cxx index edee85dc3583..7cf359f6d3c9 100755 --- a/oox/source/xls/autofilterbuffer.cxx +++ b/oox/source/xls/autofilterbuffer.cxx @@ -35,8 +35,8 @@ #include #include #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/defnamesbuffer.hxx" @@ -197,7 +197,7 @@ void FilterSettingsBase::importAttribs( sal_Int32 /*nElement*/, const AttributeL { } -void FilterSettingsBase::importRecord( sal_Int32 /*nRecId*/, RecordInputStream& /*rStrm*/ ) +void FilterSettingsBase::importRecord( sal_Int32 /*nRecId*/, SequenceInputStream& /*rStrm*/ ) { } @@ -238,7 +238,7 @@ void DiscreteFilter::importAttribs( sal_Int32 nElement, const AttributeList& rAt } } -void DiscreteFilter::importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +void DiscreteFilter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( nRecId ) { @@ -257,7 +257,7 @@ void DiscreteFilter::importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) case BIFF12_ID_DISCRETEFILTER: { - OUString aValue = rStrm.readString(); + OUString aValue = BiffHelper::readString( rStrm ); if( aValue.getLength() > 0 ) maValues.push_back( aValue ); } @@ -308,7 +308,7 @@ void Top10Filter::importAttribs( sal_Int32 nElement, const AttributeList& rAttri } } -void Top10Filter::importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +void Top10Filter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) { if( nRecId == BIFF12_ID_TOP10FILTER ) { @@ -352,7 +352,7 @@ void FilterCriterionModel::setBiffOperator( sal_uInt8 nOperator ) mnOperator = STATIC_ARRAY_SELECT( spnOperators, nOperator, XML_TOKEN_INVALID ); } -void FilterCriterionModel::readBiffData( RecordInputStream& rStrm ) +void FilterCriterionModel::readBiffData( SequenceInputStream& rStrm ) { sal_uInt8 nOperator; rStrm >> mnDataType >> nOperator; @@ -366,7 +366,7 @@ void FilterCriterionModel::readBiffData( RecordInputStream& rStrm ) case BIFF_FILTER_DATATYPE_STRING: { rStrm.skip( 8 ); - OUString aValue = rStrm.readString().trim(); + OUString aValue = BiffHelper::readString( rStrm ).trim(); if( aValue.getLength() > 0 ) maValue <<= aValue; } @@ -485,7 +485,7 @@ void CustomFilter::importAttribs( sal_Int32 nElement, const AttributeList& rAttr } } -void CustomFilter::importRecord( sal_Int32 nRecId, RecordInputStream& rStrm ) +void CustomFilter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( nRecId ) { @@ -606,7 +606,7 @@ void FilterColumn::importFilterColumn( const AttributeList& rAttribs ) mbShowButton = rAttribs.getBool( XML_showButton, true ); } -void FilterColumn::importFilterColumn( RecordInputStream& rStrm ) +void FilterColumn::importFilterColumn( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; rStrm >> mnColId >> nFlags; @@ -654,7 +654,7 @@ void AutoFilter::importAutoFilter( const AttributeList& rAttribs, sal_Int16 nShe getAddressConverter().convertToCellRangeUnchecked( maRange, aRangeStr, nSheet ); } -void AutoFilter::importAutoFilter( RecordInputStream& rStrm, sal_Int16 nSheet ) +void AutoFilter::importAutoFilter( SequenceInputStream& rStrm, sal_Int16 nSheet ) { BinRange aBinRange; rStrm >> aBinRange; diff --git a/oox/source/xls/autofiltercontext.cxx b/oox/source/xls/autofiltercontext.cxx index d88e7026b80f..81327944fc05 100644 --- a/oox/source/xls/autofiltercontext.cxx +++ b/oox/source/xls/autofiltercontext.cxx @@ -63,7 +63,7 @@ void FilterSettingsContext::onStartElement( const AttributeList& rAttribs ) mrFilterSettings.importAttribs( getCurrentElement(), rAttribs ); } -ContextHandlerRef FilterSettingsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& /*rStrm*/ ) +ContextHandlerRef FilterSettingsContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ ) { switch( getCurrentElement() ) { @@ -77,7 +77,7 @@ ContextHandlerRef FilterSettingsContext::onCreateRecordContext( sal_Int32 nRecId return 0; } -void FilterSettingsContext::onStartRecord( RecordInputStream& rStrm ) +void FilterSettingsContext::onStartRecord( SequenceInputStream& rStrm ) { mrFilterSettings.importRecord( getCurrentElement(), rStrm ); } @@ -109,7 +109,7 @@ void FilterColumnContext::onStartElement( const AttributeList& rAttribs ) mrFilterColumn.importFilterColumn( rAttribs ); } -ContextHandlerRef FilterColumnContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& /*rStrm*/ ) +ContextHandlerRef FilterColumnContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ ) { if( getCurrentElement() == BIFF12_ID_FILTERCOLUMN ) switch( nRecId ) { @@ -123,7 +123,7 @@ ContextHandlerRef FilterColumnContext::onCreateRecordContext( sal_Int32 nRecId, return 0; } -void FilterColumnContext::onStartRecord( RecordInputStream& rStrm ) +void FilterColumnContext::onStartRecord( SequenceInputStream& rStrm ) { mrFilterColumn.importFilterColumn( rStrm ); } @@ -148,14 +148,14 @@ void AutoFilterContext::onStartElement( const AttributeList& rAttribs ) mrAutoFilter.importAutoFilter( rAttribs, getSheetIndex() ); } -ContextHandlerRef AutoFilterContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& /*rStrm*/ ) +ContextHandlerRef AutoFilterContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ ) { if( (getCurrentElement() == BIFF12_ID_AUTOFILTER) && (nRecId == BIFF12_ID_FILTERCOLUMN) ) return new FilterColumnContext( *this, mrAutoFilter.createFilterColumn() ); return 0; } -void AutoFilterContext::onStartRecord( RecordInputStream& rStrm ) +void AutoFilterContext::onStartRecord( SequenceInputStream& rStrm ) { mrAutoFilter.importAutoFilter( rStrm, getSheetIndex() ); } diff --git a/oox/source/xls/biffhelper.cxx b/oox/source/xls/biffhelper.cxx index 5989777456e0..55839043865e 100644 --- a/oox/source/xls/biffhelper.cxx +++ b/oox/source/xls/biffhelper.cxx @@ -189,6 +189,8 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, // ============================================================================ +// conversion ----------------------------------------------------------------- + /*static*/ double BiffHelper::calcDoubleFromRk( sal_Int32 nRkValue ) { DecodedDouble aDecDbl( 0.0 ); @@ -265,6 +267,35 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, return static_cast< sal_uInt16 >( (nCodePage == 0) ? 1252 : nCodePage ); } +// BIFF12 import -------------------------------------------------------------- + +/*static*/ OUString BiffHelper::readString( SequenceInputStream& rStrm, bool b32BitLen ) +{ + OUString aString; + if( !rStrm.isEof() ) + { + sal_Int32 nCharCount = b32BitLen ? rStrm.readValue< sal_Int32 >() : rStrm.readValue< sal_Int16 >(); + // string length -1 is often used to indicate a missing string + OSL_ENSURE( !rStrm.isEof() && (nCharCount >= -1), "BiffHelper::readString - invalid string length" ); + if( !rStrm.isEof() && (nCharCount > 0) ) + { + ::std::vector< sal_Unicode > aBuffer; + aBuffer.reserve( getLimitedValue< size_t, sal_Int32 >( nCharCount + 1, 0, 0xFFFF ) ); + for( sal_Int32 nCharIdx = 0; !rStrm.isEof() && (nCharIdx < nCharCount); ++nCharIdx ) + { + sal_uInt16 nChar; + rStrm.readValue( nChar ); + aBuffer.push_back( static_cast< sal_Unicode >( nChar ) ); + } + aBuffer.push_back( 0 ); + aString = OUString( &aBuffer.front() ); + } + } + return aString; +} + +// BIFF2-BIFF8 import --------------------------------------------------------- + /*static*/ bool BiffHelper::isBofRecord( BiffInputStream& rStrm ) { return diff --git a/oox/source/xls/chartsheetfragment.cxx b/oox/source/xls/chartsheetfragment.cxx index ca5c9c77b2d7..c67768ef2f22 100644 --- a/oox/source/xls/chartsheetfragment.cxx +++ b/oox/source/xls/chartsheetfragment.cxx @@ -28,7 +28,6 @@ #include "oox/xls/chartsheetfragment.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/pagesettings.hxx" #include "oox/xls/viewsettings.hxx" @@ -109,7 +108,7 @@ void ChartsheetFragment::onCharacters( const OUString& rChars ) } } -ContextHandlerRef ChartsheetFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ChartsheetFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -173,9 +172,9 @@ void ChartsheetFragment::importDrawing( const AttributeList& rAttribs ) setDrawingPath( getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ) ); } -void ChartsheetFragment::importDrawing( RecordInputStream& rStrm ) +void ChartsheetFragment::importDrawing( SequenceInputStream& rStrm ) { - setDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) ); + setDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) ); } // ============================================================================ diff --git a/oox/source/xls/commentsbuffer.cxx b/oox/source/xls/commentsbuffer.cxx index 264656eb7063..78d5fe044fe8 100644 --- a/oox/source/xls/commentsbuffer.cxx +++ b/oox/source/xls/commentsbuffer.cxx @@ -32,7 +32,6 @@ #include #include #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/vml/vmlshape.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/drawingfragment.hxx" @@ -70,7 +69,7 @@ void Comment::importComment( const AttributeList& rAttribs ) getAddressConverter().convertToCellRangeUnchecked( maModel.maRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex() ); } -void Comment::importComment( RecordInputStream& rStrm ) +void Comment::importComment( SequenceInputStream& rStrm ) { BinRange aBinRange; rStrm >> maModel.mnAuthorId >> aBinRange; diff --git a/oox/source/xls/commentsfragment.cxx b/oox/source/xls/commentsfragment.cxx index 9346686c79fb..b37860c4553e 100644 --- a/oox/source/xls/commentsfragment.cxx +++ b/oox/source/xls/commentsfragment.cxx @@ -82,7 +82,7 @@ void CommentsFragment::onEndElement() mxComment.reset(); } -ContextHandlerRef CommentsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef CommentsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -94,7 +94,7 @@ ContextHandlerRef CommentsFragment::onCreateRecordContext( sal_Int32 nRecId, Rec if( nRecId == BIFF12_ID_COMMENTLIST ) return this; break; case BIFF12_ID_COMMENTAUTHORS: - if( nRecId == BIFF12_ID_COMMENTAUTHOR ) getComments().appendAuthor( rStrm.readString() ); + if( nRecId == BIFF12_ID_COMMENTAUTHOR ) getComments().appendAuthor( BiffHelper::readString( rStrm ) ); break; case BIFF12_ID_COMMENTLIST: if( nRecId == BIFF12_ID_COMMENT ) { importComment( rStrm ); return this; } @@ -134,7 +134,7 @@ void CommentsFragment::importComment( const AttributeList& rAttribs ) mxComment->importComment( rAttribs ); } -void CommentsFragment::importComment( RecordInputStream& rStrm ) +void CommentsFragment::importComment( SequenceInputStream& rStrm ) { mxComment = getComments().createComment(); mxComment->importComment( rStrm ); diff --git a/oox/source/xls/condformatbuffer.cxx b/oox/source/xls/condformatbuffer.cxx index 066b8188ddae..51d9170e1794 100644 --- a/oox/source/xls/condformatbuffer.cxx +++ b/oox/source/xls/condformatbuffer.cxx @@ -43,8 +43,8 @@ #include #include #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/stylesbuffer.hxx" @@ -199,7 +199,7 @@ void CondFormatRule::appendFormula( const OUString& rFormula ) maModel.maFormulas.push_back( aContext ); } -void CondFormatRule::importCfRule( RecordInputStream& rStrm ) +void CondFormatRule::importCfRule( SequenceInputStream& rStrm ) { sal_Int32 nType, nSubType, nOperator, nFmla1Size, nFmla2Size, nFmla3Size; sal_uInt16 nFlags; @@ -647,7 +647,7 @@ CondFormatRuleRef CondFormat::importCfRule( const AttributeList& rAttribs ) return xRule; } -void CondFormat::importCondFormatting( RecordInputStream& rStrm ) +void CondFormat::importCondFormatting( SequenceInputStream& rStrm ) { BinRangeList aRanges; rStrm.skip( 8 ); @@ -655,7 +655,7 @@ void CondFormat::importCondFormatting( RecordInputStream& rStrm ) getAddressConverter().convertToCellRangeList( maModel.maRanges, aRanges, getSheetIndex(), true ); } -void CondFormat::importCfRule( RecordInputStream& rStrm ) +void CondFormat::importCfRule( SequenceInputStream& rStrm ) { CondFormatRuleRef xRule = createRule(); xRule->importCfRule( rStrm ); @@ -725,7 +725,7 @@ CondFormatRef CondFormatBuffer::importConditionalFormatting( const AttributeList return xCondFmt; } -CondFormatRef CondFormatBuffer::importCondFormatting( RecordInputStream& rStrm ) +CondFormatRef CondFormatBuffer::importCondFormatting( SequenceInputStream& rStrm ) { CondFormatRef xCondFmt = createCondFormat(); xCondFmt->importCondFormatting( rStrm ); diff --git a/oox/source/xls/condformatcontext.cxx b/oox/source/xls/condformatcontext.cxx index 23f32262cb07..091dc11fb614 100644 --- a/oox/source/xls/condformatcontext.cxx +++ b/oox/source/xls/condformatcontext.cxx @@ -73,7 +73,7 @@ void CondFormatContext::onCharacters( const OUString& rChars ) mxRule->appendFormula( rChars ); } -ContextHandlerRef CondFormatContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& ) +ContextHandlerRef CondFormatContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& ) { switch( getCurrentElement() ) { @@ -83,7 +83,7 @@ ContextHandlerRef CondFormatContext::onCreateRecordContext( sal_Int32 nRecId, Re return 0; } -void CondFormatContext::onStartRecord( RecordInputStream& rStrm ) +void CondFormatContext::onStartRecord( SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/connectionsbuffer.cxx b/oox/source/xls/connectionsbuffer.cxx index 30472d7dd919..6d0fcd65122f 100755 --- a/oox/source/xls/connectionsbuffer.cxx +++ b/oox/source/xls/connectionsbuffer.cxx @@ -28,7 +28,6 @@ #include "oox/xls/connectionsbuffer.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" namespace oox { @@ -285,7 +284,7 @@ void Connection::importTable( const AttributeList& rAttribs, sal_Int32 nElement } } -void Connection::importConnection( RecordInputStream& rStrm ) +void Connection::importConnection( SequenceInputStream& rStrm ) { sal_uInt16 nFlags, nStrFlags; sal_uInt8 nSavePassword, nCredentials; @@ -319,7 +318,7 @@ void Connection::importConnection( RecordInputStream& rStrm ) maModel.mbSavePassword = nSavePassword == BIFF12_CONNECTION_SAVEPASSWORD_ON; } -void Connection::importWebPr( RecordInputStream& rStrm ) +void Connection::importWebPr( SequenceInputStream& rStrm ) { WebPrModel& rWebPr = maModel.createWebPr(); @@ -348,7 +347,7 @@ void Connection::importWebPr( RecordInputStream& rStrm ) rWebPr.mbHtmlTables = getFlag( nFlags, BIFF12_WEBPR_HTMLTABLES ); } -void Connection::importWebPrTables( RecordInputStream& /*rStrm*/ ) +void Connection::importWebPrTables( SequenceInputStream& /*rStrm*/ ) { if( maModel.mxWebPr.get() ) { @@ -357,16 +356,16 @@ void Connection::importWebPrTables( RecordInputStream& /*rStrm*/ ) } } -void Connection::importWebPrTable( RecordInputStream& rStrm, sal_Int32 nRecId ) +void Connection::importWebPrTable( SequenceInputStream& rStrm, sal_Int32 nRecId ) { if( maModel.mxWebPr.get() ) { Any aTableAny; switch( nRecId ) { - case BIFF12_ID_PCITEM_MISSING: break; - case BIFF12_ID_PCITEM_STRING: aTableAny <<= rStrm.readString(); break; - case BIFF12_ID_PCITEM_INDEX: aTableAny <<= rStrm.readInt32(); break; + case BIFF12_ID_PCITEM_MISSING: break; + case BIFF12_ID_PCITEM_STRING: aTableAny <<= BiffHelper::readString( rStrm ); break; + case BIFF12_ID_PCITEM_INDEX: aTableAny <<= rStrm.readInt32(); break; default: OSL_ENSURE( false, "Connection::importWebPrTable - unexpected record" ); return; diff --git a/oox/source/xls/connectionsfragment.cxx b/oox/source/xls/connectionsfragment.cxx index 1d60a954a8a8..7aafcd84cd7e 100644 --- a/oox/source/xls/connectionsfragment.cxx +++ b/oox/source/xls/connectionsfragment.cxx @@ -81,7 +81,7 @@ void ConnectionContext::onStartElement( const AttributeList& rAttribs ) mrConnection.importConnection( rAttribs ); } -ContextHandlerRef ConnectionContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ConnectionContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -108,7 +108,7 @@ ContextHandlerRef ConnectionContext::onCreateRecordContext( sal_Int32 nRecId, Re return 0; } -void ConnectionContext::onStartRecord( RecordInputStream& rStrm ) +void ConnectionContext::onStartRecord( SequenceInputStream& rStrm ) { if( getCurrentElement() == BIFF12_ID_CONNECTION ) mrConnection.importConnection( rStrm ); @@ -138,7 +138,7 @@ ContextHandlerRef ConnectionsFragment::onCreateContext( sal_Int32 nElement, cons return 0; } -ContextHandlerRef ConnectionsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& /*rStrm*/ ) +ContextHandlerRef ConnectionsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/defnamesbuffer.cxx b/oox/source/xls/defnamesbuffer.cxx index 360281143d88..96fcec0042f5 100644 --- a/oox/source/xls/defnamesbuffer.cxx +++ b/oox/source/xls/defnamesbuffer.cxx @@ -36,6 +36,7 @@ #include #include #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" @@ -286,7 +287,7 @@ void DefinedNameBase::importOoxFormula( FormulaContext& rContext, sal_Int16 nBas getFormulaParser().convertErrorToFormula( rContext, BIFF_ERR_NAME ); } -void DefinedNameBase::importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, RecordInputStream& rStrm ) +void DefinedNameBase::importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, SequenceInputStream& rStrm ) { rContext.setBaseAddress( CellAddress( nBaseSheet, 0, 0 ) ); getFormulaParser().importFormula( rContext, rStrm ); @@ -338,7 +339,7 @@ void DefinedName::setFormula( const OUString& rFormula ) maModel.maFormula = rFormula; } -void DefinedName::importDefinedName( RecordInputStream& rStrm ) +void DefinedName::importDefinedName( SequenceInputStream& rStrm ) { sal_uInt32 nFlags; rStrm >> nFlags; @@ -596,7 +597,7 @@ void DefinedName::implImportOoxFormula( FormulaContext& rContext ) { if( mxFormula.get() ) { - RecordInputStream aStrm( *mxFormula ); + SequenceInputStream aStrm( *mxFormula ); importBiff12Formula( rContext, mnCalcSheet, aStrm ); } else @@ -634,7 +635,7 @@ DefinedNameRef DefinedNamesBuffer::importDefinedName( const AttributeList& rAttr return xDefName; } -void DefinedNamesBuffer::importDefinedName( RecordInputStream& rStrm ) +void DefinedNamesBuffer::importDefinedName( SequenceInputStream& rStrm ) { createDefinedName()->importDefinedName( rStrm ); } diff --git a/oox/source/xls/excelchartconverter.cxx b/oox/source/xls/excelchartconverter.cxx index af0a445223ad..53c0a3b83bf2 100644 --- a/oox/source/xls/excelchartconverter.cxx +++ b/oox/source/xls/excelchartconverter.cxx @@ -31,6 +31,7 @@ #include #include #include "oox/drawingml/chart/datasourcemodel.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/xls/formulaparser.hxx" namespace oox { diff --git a/oox/source/xls/externallinkbuffer.cxx b/oox/source/xls/externallinkbuffer.cxx index 36c5dc984cb2..683ac3582071 100644 --- a/oox/source/xls/externallinkbuffer.cxx +++ b/oox/source/xls/externallinkbuffer.cxx @@ -141,13 +141,13 @@ void ExternalName::importOleItem( const AttributeList& rAttribs ) maExtNameModel.mbIconified = rAttribs.getBool( XML_icon, false ); } -void ExternalName::importExternalName( RecordInputStream& rStrm ) +void ExternalName::importExternalName( SequenceInputStream& rStrm ) { rStrm >> maModel.maName; OSL_ENSURE( maModel.maName.getLength() > 0, "ExternalName::importExternalName - empty name" ); } -void ExternalName::importExternalNameFlags( RecordInputStream& rStrm ) +void ExternalName::importExternalNameFlags( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; sal_Int32 nSheetId; @@ -164,31 +164,31 @@ void ExternalName::importExternalNameFlags( RecordInputStream& rStrm ) "ExternalName::importExternalNameFlags - wrong OLE flag in external name" ); } -void ExternalName::importDdeItemValues( RecordInputStream& rStrm ) +void ExternalName::importDdeItemValues( SequenceInputStream& rStrm ) { sal_Int32 nRows, nCols; rStrm >> nRows >> nCols; setResultSize( nCols, nRows ); } -void ExternalName::importDdeItemBool( RecordInputStream& rStrm ) +void ExternalName::importDdeItemBool( SequenceInputStream& rStrm ) { appendResultValue< double >( (rStrm.readuInt8() == 0) ? 0.0 : 1.0 ); } -void ExternalName::importDdeItemDouble( RecordInputStream& rStrm ) +void ExternalName::importDdeItemDouble( SequenceInputStream& rStrm ) { appendResultValue( rStrm.readDouble() ); } -void ExternalName::importDdeItemError( RecordInputStream& rStrm ) +void ExternalName::importDdeItemError( SequenceInputStream& rStrm ) { appendResultValue( BiffHelper::calcDoubleFromError( rStrm.readuInt8() ) ); } -void ExternalName::importDdeItemString( RecordInputStream& rStrm ) +void ExternalName::importDdeItemString( SequenceInputStream& rStrm ) { - appendResultValue( rStrm.readString() ); + appendResultValue( BiffHelper::readString( rStrm ) ); } void ExternalName::importExternalName( BiffInputStream& rStrm ) @@ -543,32 +543,32 @@ ExternalNameRef ExternalLink::importOleItem( const AttributeList& rAttribs ) return xExtName; } -void ExternalLink::importExternalRef( RecordInputStream& rStrm ) +void ExternalLink::importExternalRef( SequenceInputStream& rStrm ) { rStrm >> maRelId; } -void ExternalLink::importExternalSelf( RecordInputStream& ) +void ExternalLink::importExternalSelf( SequenceInputStream& ) { meLinkType = LINKTYPE_SELF; } -void ExternalLink::importExternalSame( RecordInputStream& ) +void ExternalLink::importExternalSame( SequenceInputStream& ) { meLinkType = LINKTYPE_SAME; } -void ExternalLink::importExternalAddin( RecordInputStream& ) +void ExternalLink::importExternalAddin( SequenceInputStream& ) { meLinkType = LINKTYPE_UNKNOWN; } -void ExternalLink::importExternalBook( const Relations& rRelations, RecordInputStream& rStrm ) +void ExternalLink::importExternalBook( const Relations& rRelations, SequenceInputStream& rStrm ) { switch( rStrm.readuInt16() ) { case BIFF12_EXTERNALBOOK_BOOK: - parseExternalReference( rRelations, rStrm.readString() ); + parseExternalReference( rRelations, BiffHelper::readString( rStrm ) ); break; case BIFF12_EXTERNALBOOK_DDE: { @@ -579,8 +579,8 @@ void ExternalLink::importExternalBook( const Relations& rRelations, RecordInputS break; case BIFF12_EXTERNALBOOK_OLE: { - OUString aTargetUrl = rRelations.getExternalTargetFromRelId( rStrm.readString() ); - OUString aProgId = rStrm.readString(); + OUString aTargetUrl = rRelations.getExternalTargetFromRelId( BiffHelper::readString( rStrm ) ); + OUString aProgId = BiffHelper::readString( rStrm ); setDdeOleTargetUrl( aProgId, aTargetUrl, LINKTYPE_OLE ); } break; @@ -589,17 +589,17 @@ void ExternalLink::importExternalBook( const Relations& rRelations, RecordInputS } } -void ExternalLink::importExtSheetNames( RecordInputStream& rStrm ) +void ExternalLink::importExtSheetNames( SequenceInputStream& rStrm ) { // load external sheet names and create the sheet caches in the Calc document OSL_ENSURE( (meLinkType == LINKTYPE_EXTERNAL) || (meLinkType == LINKTYPE_LIBRARY), "ExternalLink::importExtSheetNames - invalid link type" ); if( meLinkType == LINKTYPE_EXTERNAL ) // ignore sheets of external libraries for( sal_Int32 nSheet = 0, nCount = rStrm.readInt32(); !rStrm.isEof() && (nSheet < nCount); ++nSheet ) - insertExternalSheet( rStrm.readString() ); + insertExternalSheet( BiffHelper::readString( rStrm ) ); } -ExternalNameRef ExternalLink::importExternalName( RecordInputStream& rStrm ) +ExternalNameRef ExternalLink::importExternalName( SequenceInputStream& rStrm ) { ExternalNameRef xExtName = createExternalName(); xExtName->importExternalName( rStrm ); @@ -718,7 +718,7 @@ sal_Int16 ExternalLink::getCalcSheetIndex( sal_Int32 nTabId ) const OSL_ENSURE( meLinkType == LINKTYPE_INTERNAL, "ExternalLink::getCalcSheetIndex - invalid link type" ); OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOXML) || (getBiff() == BIFF8), "ExternalLink::getCalcSheetIndex - invalid sheet index" ); - return ContainerHelper::getVectorElement< sal_Int16 >( maCalcSheets, nTabId, -1 ); + return ContainerHelper::getVectorElement( maCalcSheets, nTabId, -1 ); } sal_Int32 ExternalLink::getDocumentLinkIndex() const @@ -732,7 +732,7 @@ sal_Int32 ExternalLink::getSheetCacheIndex( sal_Int32 nTabId ) const OSL_ENSURE( meLinkType == LINKTYPE_EXTERNAL, "ExternalLink::getSheetCacheIndex - invalid link type" ); OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOXML) || (getBiff() == BIFF8), "ExternalLink::getSheetCacheIndex - invalid sheet index" ); - return ContainerHelper::getVectorElement< sal_Int32 >( maSheetCaches, nTabId, -1 ); + return ContainerHelper::getVectorElement( maSheetCaches, nTabId, -1 ); } Reference< XExternalSheetCache > ExternalLink::getSheetCache( sal_Int32 nTabId ) const @@ -926,7 +926,7 @@ RefSheetsModel::RefSheetsModel() : { } -void RefSheetsModel::readBiff12Data( RecordInputStream& rStrm ) +void RefSheetsModel::readBiff12Data( SequenceInputStream& rStrm ) { rStrm >> mnExtRefId >> mnTabId1 >> mnTabId2; } @@ -956,7 +956,7 @@ ExternalLinkRef ExternalLinkBuffer::importExternalReference( const AttributeList return xExtLink; } -ExternalLinkRef ExternalLinkBuffer::importExternalRef( RecordInputStream& rStrm ) +ExternalLinkRef ExternalLinkBuffer::importExternalRef( SequenceInputStream& rStrm ) { mbUseRefSheets = true; ExternalLinkRef xExtLink = createExternalLink(); @@ -965,25 +965,25 @@ ExternalLinkRef ExternalLinkBuffer::importExternalRef( RecordInputStream& rStrm return xExtLink; } -void ExternalLinkBuffer::importExternalSelf( RecordInputStream& rStrm ) +void ExternalLinkBuffer::importExternalSelf( SequenceInputStream& rStrm ) { mbUseRefSheets = true; createExternalLink()->importExternalSelf( rStrm ); } -void ExternalLinkBuffer::importExternalSame( RecordInputStream& rStrm ) +void ExternalLinkBuffer::importExternalSame( SequenceInputStream& rStrm ) { mbUseRefSheets = true; createExternalLink()->importExternalSame( rStrm ); } -void ExternalLinkBuffer::importExternalAddin( RecordInputStream& rStrm ) +void ExternalLinkBuffer::importExternalAddin( SequenceInputStream& rStrm ) { mbUseRefSheets = true; createExternalLink()->importExternalAddin( rStrm ); } -void ExternalLinkBuffer::importExternalSheets( RecordInputStream& rStrm ) +void ExternalLinkBuffer::importExternalSheets( SequenceInputStream& rStrm ) { OSL_ENSURE( mbUseRefSheets, "ExternalLinkBuffer::importExternalSheets - missing EXTERNALREFS records" ); mbUseRefSheets = true; diff --git a/oox/source/xls/externallinkfragment.cxx b/oox/source/xls/externallinkfragment.cxx index 9d984c918145..094b192b817c 100644 --- a/oox/source/xls/externallinkfragment.cxx +++ b/oox/source/xls/externallinkfragment.cxx @@ -95,7 +95,7 @@ void ExternalSheetDataContext::onCharacters( const OUString& rChars ) } } -ContextHandlerRef ExternalSheetDataContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ExternalSheetDataContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -126,35 +126,35 @@ void ExternalSheetDataContext::importCell( const AttributeList& rAttribs ) mnCurrType = XML_TOKEN_INVALID; } -void ExternalSheetDataContext::importExtCellBlank( RecordInputStream& rStrm ) +void ExternalSheetDataContext::importExtCellBlank( SequenceInputStream& rStrm ) { maCurrPos.Column = rStrm.readInt32(); setCellValue( Any( OUString() ) ); } -void ExternalSheetDataContext::importExtCellBool( RecordInputStream& rStrm ) +void ExternalSheetDataContext::importExtCellBool( SequenceInputStream& rStrm ) { maCurrPos.Column = rStrm.readInt32(); double fValue = (rStrm.readuInt8() == 0) ? 0.0 : 1.0; setCellValue( Any( fValue ) ); } -void ExternalSheetDataContext::importExtCellDouble( RecordInputStream& rStrm ) +void ExternalSheetDataContext::importExtCellDouble( SequenceInputStream& rStrm ) { maCurrPos.Column = rStrm.readInt32(); setCellValue( Any( rStrm.readDouble() ) ); } -void ExternalSheetDataContext::importExtCellError( RecordInputStream& rStrm ) +void ExternalSheetDataContext::importExtCellError( SequenceInputStream& rStrm ) { maCurrPos.Column = rStrm.readInt32(); setCellValue( Any( BiffHelper::calcDoubleFromError( rStrm.readuInt8() ) ) ); } -void ExternalSheetDataContext::importExtCellString( RecordInputStream& rStrm ) +void ExternalSheetDataContext::importExtCellString( SequenceInputStream& rStrm ) { maCurrPos.Column = rStrm.readInt32(); - setCellValue( Any( rStrm.readString() ) ); + setCellValue( Any( BiffHelper::readString( rStrm ) ) ); } void ExternalSheetDataContext::setCellValue( const Any& rValue ) @@ -280,7 +280,7 @@ void ExternalLinkFragment::onEndElement() } } -ContextHandlerRef ExternalLinkFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ExternalLinkFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx index 21dd049c0515..c0ad5d513709 100644 --- a/oox/source/xls/formulabase.cxx +++ b/oox/source/xls/formulabase.cxx @@ -43,7 +43,7 @@ #include #include #include "oox/core/filterbase.hxx" -#include "oox/helper/recordinputstream.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/xls/biffinputstream.hxx" namespace oox { @@ -109,7 +109,7 @@ void BinSingleRef2d::setBiff8Data( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelat mnRow -= 0x10000; } -void BinSingleRef2d::readBiff12Data( RecordInputStream& rStrm, bool bRelativeAsOffset ) +void BinSingleRef2d::readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset ) { sal_Int32 nRow; sal_uInt16 nCol; @@ -134,7 +134,7 @@ void BinSingleRef2d::readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffs // ---------------------------------------------------------------------------- -void BinComplexRef2d::readBiff12Data( RecordInputStream& rStrm, bool bRelativeAsOffset ) +void BinComplexRef2d::readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset ) { sal_Int32 nRow1, nRow2; sal_uInt16 nCol1, nCol2; diff --git a/oox/source/xls/formulaparser.cxx b/oox/source/xls/formulaparser.cxx index 7ab32981a6ba..8b1f1b809d88 100644 --- a/oox/source/xls/formulaparser.cxx +++ b/oox/source/xls/formulaparser.cxx @@ -34,7 +34,6 @@ #include #include #include "oox/core/filterbase.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/defnamesbuffer.hxx" @@ -419,7 +418,7 @@ public: /** Imports and converts a BIFF12 token array from the passed stream. */ virtual void importBiff12Formula( FormulaContext& rContext, - RecordInputStream& rStrm ); + SequenceInputStream& rStrm ); /** Imports and converts a BIFF2-BIFF8 token array from the passed stream. */ virtual void importBiffFormula( @@ -583,7 +582,7 @@ void FormulaParserImpl::importOoxFormula( FormulaContext&, const OUString& ) OSL_ENSURE( false, "FormulaParserImpl::importOoxFormula - not implemented" ); } -void FormulaParserImpl::importBiff12Formula( FormulaContext&, RecordInputStream& ) +void FormulaParserImpl::importBiff12Formula( FormulaContext&, SequenceInputStream& ) { OSL_ENSURE( false, "FormulaParserImpl::importBiff12Formula - not implemented" ); } @@ -1241,31 +1240,31 @@ public: virtual void importBiff12Formula( FormulaContext& rContext, - RecordInputStream& rStrm ); + SequenceInputStream& rStrm ); private: // import token contents and create API formula token --------------------- - bool importAttrToken( RecordInputStream& rStrm ); - bool importSpaceToken( RecordInputStream& rStrm ); - bool importTableToken( RecordInputStream& rStrm ); - bool importArrayToken( RecordInputStream& rStrm ); - bool importRefToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); - bool importAreaToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); - bool importRef3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); - bool importArea3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); - bool importMemAreaToken( RecordInputStream& rStrm, bool bAddData ); - bool importMemFuncToken( RecordInputStream& rStrm ); - bool importNameToken( RecordInputStream& rStrm ); - bool importNameXToken( RecordInputStream& rStrm ); - bool importFuncToken( RecordInputStream& rStrm ); - bool importFuncVarToken( RecordInputStream& rStrm ); - bool importExpToken( RecordInputStream& rStrm ); - - LinkSheetRange readSheetRange( RecordInputStream& rStrm ); - - void swapStreamPosition( RecordInputStream& rStrm ); - void skipMemAreaAddData( RecordInputStream& rStrm ); + bool importAttrToken( SequenceInputStream& rStrm ); + bool importSpaceToken( SequenceInputStream& rStrm ); + bool importTableToken( SequenceInputStream& rStrm ); + bool importArrayToken( SequenceInputStream& rStrm ); + bool importRefToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); + bool importAreaToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); + bool importRef3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); + bool importArea3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); + bool importMemAreaToken( SequenceInputStream& rStrm, bool bAddData ); + bool importMemFuncToken( SequenceInputStream& rStrm ); + bool importNameToken( SequenceInputStream& rStrm ); + bool importNameXToken( SequenceInputStream& rStrm ); + bool importFuncToken( SequenceInputStream& rStrm ); + bool importFuncVarToken( SequenceInputStream& rStrm ); + bool importExpToken( SequenceInputStream& rStrm ); + + LinkSheetRange readSheetRange( SequenceInputStream& rStrm ); + + void swapStreamPosition( SequenceInputStream& rStrm ); + void skipMemAreaAddData( SequenceInputStream& rStrm ); // convert BIN token and push API operand or operator --------------------- @@ -1301,7 +1300,7 @@ void OoxFormulaParserImpl::importOoxFormula( FormulaContext& rContext, const OUS finalizeImport( maApiParser.parseFormula( rFormulaString, rContext.getBaseAddress() ) ); } -void OoxFormulaParserImpl::importBiff12Formula( FormulaContext& rContext, RecordInputStream& rStrm ) +void OoxFormulaParserImpl::importBiff12Formula( FormulaContext& rContext, SequenceInputStream& rStrm ) { initializeImport( rContext ); @@ -1330,34 +1329,34 @@ void OoxFormulaParserImpl::importBiff12Formula( FormulaContext& rContext, Record // base tokens switch( nBaseId ) { - case BIFF_TOKID_EXP: bOk = importExpToken( rStrm ); break; - case BIFF_TOKID_ADD: bOk = pushBinaryOperator( OPCODE_ADD ); break; - case BIFF_TOKID_SUB: bOk = pushBinaryOperator( OPCODE_SUB ); break; - case BIFF_TOKID_MUL: bOk = pushBinaryOperator( OPCODE_MULT ); break; - case BIFF_TOKID_DIV: bOk = pushBinaryOperator( OPCODE_DIV ); break; - case BIFF_TOKID_POWER: bOk = pushBinaryOperator( OPCODE_POWER ); break; - case BIFF_TOKID_CONCAT: bOk = pushBinaryOperator( OPCODE_CONCAT ); break; - case BIFF_TOKID_LT: bOk = pushBinaryOperator( OPCODE_LESS ); break; - case BIFF_TOKID_LE: bOk = pushBinaryOperator( OPCODE_LESS_EQUAL ); break; - case BIFF_TOKID_EQ: bOk = pushBinaryOperator( OPCODE_EQUAL ); break; - case BIFF_TOKID_GE: bOk = pushBinaryOperator( OPCODE_GREATER_EQUAL ); break; - case BIFF_TOKID_GT: bOk = pushBinaryOperator( OPCODE_GREATER ); break; - case BIFF_TOKID_NE: bOk = pushBinaryOperator( OPCODE_NOT_EQUAL ); break; - case BIFF_TOKID_ISECT: bOk = pushBinaryOperator( OPCODE_INTERSECT ); break; - case BIFF_TOKID_LIST: bOk = pushBinaryOperator( OPCODE_LIST ); break; - case BIFF_TOKID_RANGE: bOk = pushBinaryOperator( OPCODE_RANGE ); break; - case BIFF_TOKID_UPLUS: bOk = pushUnaryPreOperator( OPCODE_PLUS_SIGN ); break; - case BIFF_TOKID_UMINUS: bOk = pushUnaryPreOperator( OPCODE_MINUS_SIGN ); break; - case BIFF_TOKID_PERCENT: bOk = pushUnaryPostOperator( OPCODE_PERCENT ); break; - case BIFF_TOKID_PAREN: bOk = pushParenthesesOperator(); break; - case BIFF_TOKID_MISSARG: bOk = pushOperand( OPCODE_MISSING ); break; - case BIFF_TOKID_STR: bOk = pushValueOperand( rStrm.readString( false ) ); break; - case BIFF_TOKID_NLR: bOk = importTableToken( rStrm ); break; - case BIFF_TOKID_ATTR: bOk = importAttrToken( rStrm ); break; - case BIFF_TOKID_ERR: bOk = pushBiffErrorOperand( rStrm.readuInt8() ); break; - case BIFF_TOKID_BOOL: bOk = pushBiffBoolOperand( rStrm.readuInt8() ); break; - case BIFF_TOKID_INT: bOk = pushValueOperand< double >( rStrm.readuInt16() ); break; - case BIFF_TOKID_NUM: bOk = pushValueOperand( rStrm.readDouble() ); break; + case BIFF_TOKID_EXP: bOk = importExpToken( rStrm ); break; + case BIFF_TOKID_ADD: bOk = pushBinaryOperator( OPCODE_ADD ); break; + case BIFF_TOKID_SUB: bOk = pushBinaryOperator( OPCODE_SUB ); break; + case BIFF_TOKID_MUL: bOk = pushBinaryOperator( OPCODE_MULT ); break; + case BIFF_TOKID_DIV: bOk = pushBinaryOperator( OPCODE_DIV ); break; + case BIFF_TOKID_POWER: bOk = pushBinaryOperator( OPCODE_POWER ); break; + case BIFF_TOKID_CONCAT: bOk = pushBinaryOperator( OPCODE_CONCAT ); break; + case BIFF_TOKID_LT: bOk = pushBinaryOperator( OPCODE_LESS ); break; + case BIFF_TOKID_LE: bOk = pushBinaryOperator( OPCODE_LESS_EQUAL ); break; + case BIFF_TOKID_EQ: bOk = pushBinaryOperator( OPCODE_EQUAL ); break; + case BIFF_TOKID_GE: bOk = pushBinaryOperator( OPCODE_GREATER_EQUAL ); break; + case BIFF_TOKID_GT: bOk = pushBinaryOperator( OPCODE_GREATER ); break; + case BIFF_TOKID_NE: bOk = pushBinaryOperator( OPCODE_NOT_EQUAL ); break; + case BIFF_TOKID_ISECT: bOk = pushBinaryOperator( OPCODE_INTERSECT ); break; + case BIFF_TOKID_LIST: bOk = pushBinaryOperator( OPCODE_LIST ); break; + case BIFF_TOKID_RANGE: bOk = pushBinaryOperator( OPCODE_RANGE ); break; + case BIFF_TOKID_UPLUS: bOk = pushUnaryPreOperator( OPCODE_PLUS_SIGN ); break; + case BIFF_TOKID_UMINUS: bOk = pushUnaryPreOperator( OPCODE_MINUS_SIGN ); break; + case BIFF_TOKID_PERCENT: bOk = pushUnaryPostOperator( OPCODE_PERCENT ); break; + case BIFF_TOKID_PAREN: bOk = pushParenthesesOperator(); break; + case BIFF_TOKID_MISSARG: bOk = pushOperand( OPCODE_MISSING ); break; + case BIFF_TOKID_STR: bOk = pushValueOperand( BiffHelper::readString( rStrm, false ) ); break; + case BIFF_TOKID_NLR: bOk = importTableToken( rStrm ); break; + case BIFF_TOKID_ATTR: bOk = importAttrToken( rStrm ); break; + case BIFF_TOKID_ERR: bOk = pushBiffErrorOperand( rStrm.readuInt8() ); break; + case BIFF_TOKID_BOOL: bOk = pushBiffBoolOperand( rStrm.readuInt8() ); break; + case BIFF_TOKID_INT: bOk = pushValueOperand< double >( rStrm.readuInt16() ); break; + case BIFF_TOKID_NUM: bOk = pushValueOperand( rStrm.readDouble() ); break; default: bOk = false; } } @@ -1403,7 +1402,7 @@ void OoxFormulaParserImpl::importBiff12Formula( FormulaContext& rContext, Record // import token contents and create API formula token ------------------------- -bool OoxFormulaParserImpl::importAttrToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importAttrToken( SequenceInputStream& rStrm ) { bool bOk = true; sal_uInt8 nType; @@ -1436,7 +1435,7 @@ bool OoxFormulaParserImpl::importAttrToken( RecordInputStream& rStrm ) return bOk; } -bool OoxFormulaParserImpl::importSpaceToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importSpaceToken( SequenceInputStream& rStrm ) { // equal constants in BIFF and OOX sal_uInt8 nType, nCount; @@ -1465,7 +1464,7 @@ bool OoxFormulaParserImpl::importSpaceToken( RecordInputStream& rStrm ) return true; } -bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importTableToken( SequenceInputStream& rStrm ) { sal_uInt16 nFlags, nTableId, nCol1, nCol2; rStrm.skip( 3 ); @@ -1590,7 +1589,7 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm ) return pushBiffErrorOperand( BIFF_ERR_REF ); } -bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importArrayToken( SequenceInputStream& rStrm ) { rStrm.skip( 14 ); @@ -1620,7 +1619,7 @@ bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm ) appendRawToken( OPCODE_PUSH ) <<= rStrm.readDouble(); break; case BIFF_TOK_ARRAY_STRING: - appendRawToken( OPCODE_PUSH ) <<= rStrm.readString( false ); + appendRawToken( OPCODE_PUSH ) <<= BiffHelper::readString( rStrm, false ); break; case BIFF_TOK_ARRAY_BOOL: appendRawToken( OPCODE_PUSH ) <<= static_cast< double >( (rStrm.readuInt8() == BIFF_TOK_BOOL_FALSE) ? 0.0 : 1.0 ); @@ -1643,21 +1642,21 @@ bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm ) return true; } -bool OoxFormulaParserImpl::importRefToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) +bool OoxFormulaParserImpl::importRefToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) { BinSingleRef2d aRef; aRef.readBiff12Data( rStrm, bRelativeAsOffset ); return pushReferenceOperand( aRef, bDeleted, bRelativeAsOffset ); } -bool OoxFormulaParserImpl::importAreaToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) +bool OoxFormulaParserImpl::importAreaToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) { BinComplexRef2d aRef; aRef.readBiff12Data( rStrm, bRelativeAsOffset ); return pushReferenceOperand( aRef, bDeleted, bRelativeAsOffset ); } -bool OoxFormulaParserImpl::importRef3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) +bool OoxFormulaParserImpl::importRef3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) { LinkSheetRange aSheetRange = readSheetRange( rStrm ); BinSingleRef2d aRef; @@ -1665,7 +1664,7 @@ bool OoxFormulaParserImpl::importRef3dToken( RecordInputStream& rStrm, bool bDel return pushReferenceOperand( aSheetRange, aRef, bDeleted, bRelativeAsOffset ); } -bool OoxFormulaParserImpl::importArea3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) +bool OoxFormulaParserImpl::importArea3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) { LinkSheetRange aSheetRange = readSheetRange( rStrm ); BinComplexRef2d aRef; @@ -1673,7 +1672,7 @@ bool OoxFormulaParserImpl::importArea3dToken( RecordInputStream& rStrm, bool bDe return pushReferenceOperand( aSheetRange, aRef, bDeleted, bRelativeAsOffset ); } -bool OoxFormulaParserImpl::importMemAreaToken( RecordInputStream& rStrm, bool bAddData ) +bool OoxFormulaParserImpl::importMemAreaToken( SequenceInputStream& rStrm, bool bAddData ) { rStrm.skip( 6 ); if( bAddData ) @@ -1681,32 +1680,32 @@ bool OoxFormulaParserImpl::importMemAreaToken( RecordInputStream& rStrm, bool bA return true; } -bool OoxFormulaParserImpl::importMemFuncToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importMemFuncToken( SequenceInputStream& rStrm ) { rStrm.skip( 2 ); return true; } -bool OoxFormulaParserImpl::importNameToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importNameToken( SequenceInputStream& rStrm ) { return pushBiff12Name( rStrm.readInt32() ); } -bool OoxFormulaParserImpl::importNameXToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importNameXToken( SequenceInputStream& rStrm ) { sal_Int32 nRefId = rStrm.readInt16(); sal_Int32 nNameId = rStrm.readInt32(); return pushBiff12ExtName( nRefId, nNameId ); } -bool OoxFormulaParserImpl::importFuncToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importFuncToken( SequenceInputStream& rStrm ) { sal_uInt16 nFuncId; rStrm >> nFuncId; return pushBiff12Function( nFuncId ); } -bool OoxFormulaParserImpl::importFuncVarToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importFuncVarToken( SequenceInputStream& rStrm ) { sal_uInt8 nParamCount; sal_uInt16 nFuncId; @@ -1714,7 +1713,7 @@ bool OoxFormulaParserImpl::importFuncVarToken( RecordInputStream& rStrm ) return pushBiff12Function( nFuncId, nParamCount ); } -bool OoxFormulaParserImpl::importExpToken( RecordInputStream& rStrm ) +bool OoxFormulaParserImpl::importExpToken( SequenceInputStream& rStrm ) { BinAddress aBaseAddr; rStrm >> aBaseAddr.mnRow; @@ -1726,19 +1725,19 @@ bool OoxFormulaParserImpl::importExpToken( RecordInputStream& rStrm ) return false; } -LinkSheetRange OoxFormulaParserImpl::readSheetRange( RecordInputStream& rStrm ) +LinkSheetRange OoxFormulaParserImpl::readSheetRange( SequenceInputStream& rStrm ) { return getExternalLinks().getSheetRange( rStrm.readInt16() ); } -void OoxFormulaParserImpl::swapStreamPosition( RecordInputStream& rStrm ) +void OoxFormulaParserImpl::swapStreamPosition( SequenceInputStream& rStrm ) { sal_Int64 nRecPos = rStrm.tell(); rStrm.seek( mnAddDataPos ); mnAddDataPos = nRecPos; } -void OoxFormulaParserImpl::skipMemAreaAddData( RecordInputStream& rStrm ) +void OoxFormulaParserImpl::skipMemAreaAddData( SequenceInputStream& rStrm ) { swapStreamPosition( rStrm ); rStrm.skip( 16 * rStrm.readInt32() ); @@ -2771,7 +2770,7 @@ void FormulaParser::importFormula( FormulaContext& rContext, const OUString& rFo mxImpl->importOoxFormula( rContext, rFormulaString ); } -void FormulaParser::importFormula( FormulaContext& rContext, RecordInputStream& rStrm ) const +void FormulaParser::importFormula( FormulaContext& rContext, SequenceInputStream& rStrm ) const { mxImpl->importBiff12Formula( rContext, rStrm ); } @@ -2833,7 +2832,7 @@ OUString FormulaParser::importOleTargetLink( const OUString& rFormulaString ) return OUString(); } -OUString FormulaParser::importOleTargetLink( RecordInputStream& rStrm ) +OUString FormulaParser::importOleTargetLink( SequenceInputStream& rStrm ) { OUString aTargetLink; sal_Int32 nFmlaSize = rStrm.readInt32(); diff --git a/oox/source/xls/numberformatsbuffer.cxx b/oox/source/xls/numberformatsbuffer.cxx index f610167e5edd..c77381b2a1c8 100644 --- a/oox/source/xls/numberformatsbuffer.cxx +++ b/oox/source/xls/numberformatsbuffer.cxx @@ -40,7 +40,6 @@ #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/propertymap.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" namespace oox { @@ -1998,10 +1997,10 @@ NumberFormatRef NumberFormatsBuffer::importNumFmt( const AttributeList& rAttribs return createNumFmt( nNumFmtId, aFmtCode ); } -void NumberFormatsBuffer::importNumFmt( RecordInputStream& rStrm ) +void NumberFormatsBuffer::importNumFmt( SequenceInputStream& rStrm ) { sal_Int32 nNumFmtId = rStrm.readuInt16(); - OUString aFmtCode = rStrm.readString(); + OUString aFmtCode = BiffHelper::readString( rStrm ); createNumFmt( nNumFmtId, aFmtCode ); } diff --git a/oox/source/xls/pagesettings.cxx b/oox/source/xls/pagesettings.cxx index b50a23989356..188bf78544ec 100644 --- a/oox/source/xls/pagesettings.cxx +++ b/oox/source/xls/pagesettings.cxx @@ -44,7 +44,6 @@ #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/excelhandlers.hxx" #include "oox/xls/stylesbuffer.hxx" @@ -242,14 +241,14 @@ void PageSettings::importPicture( const Relations& rRelations, const AttributeLi importPictureData( rRelations, rAttribs.getString( R_TOKEN( id ), OUString() ) ); } -void PageSettings::importPageMargins( RecordInputStream& rStrm ) +void PageSettings::importPageMargins( SequenceInputStream& rStrm ) { rStrm >> maModel.mfLeftMargin >> maModel.mfRightMargin >> maModel.mfTopMargin >> maModel.mfBottomMargin >> maModel.mfHeaderMargin >> maModel.mfFooterMargin; } -void PageSettings::importPrintOptions( RecordInputStream& rStrm ) +void PageSettings::importPrintOptions( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; rStrm >> nFlags; @@ -259,7 +258,7 @@ void PageSettings::importPrintOptions( RecordInputStream& rStrm ) maModel.mbPrintHeadings = getFlag( nFlags, BIFF12_PRINTOPT_PRINTHEADING ); } -void PageSettings::importPageSetup( const Relations& rRelations, RecordInputStream& rStrm ) +void PageSettings::importPageSetup( const Relations& rRelations, SequenceInputStream& rStrm ) { OUString aRelId; sal_uInt16 nFlags; @@ -279,7 +278,7 @@ void PageSettings::importPageSetup( const Relations& rRelations, RecordInputStre maModel.mbDraftQuality = getFlag( nFlags, BIFF12_PAGESETUP_DRAFTQUALITY ); } -void PageSettings::importChartPageSetup( const Relations& rRelations, RecordInputStream& rStrm ) +void PageSettings::importChartPageSetup( const Relations& rRelations, SequenceInputStream& rStrm ) { OUString aRelId; sal_uInt16 nFirstPage, nFlags; @@ -294,7 +293,7 @@ void PageSettings::importChartPageSetup( const Relations& rRelations, RecordInpu maModel.mbDraftQuality = getFlag( nFlags, BIFF12_CHARTPAGESETUP_DRAFTQUALITY ); } -void PageSettings::importHeaderFooter( RecordInputStream& rStrm ) +void PageSettings::importHeaderFooter( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; rStrm >> nFlags @@ -305,9 +304,9 @@ void PageSettings::importHeaderFooter( RecordInputStream& rStrm ) maModel.mbUseFirstHF = getFlag( nFlags, BIFF12_HEADERFOOTER_DIFFFIRST ); } -void PageSettings::importPicture( const Relations& rRelations, RecordInputStream& rStrm ) +void PageSettings::importPicture( const Relations& rRelations, SequenceInputStream& rStrm ) { - importPictureData( rRelations, rStrm.readString() ); + importPictureData( rRelations, BiffHelper::readString( rStrm ) ); } void PageSettings::importLeftMargin( BiffInputStream& rStrm ) diff --git a/oox/source/xls/pivotcachebuffer.cxx b/oox/source/xls/pivotcachebuffer.cxx index 76fd48dc3ab1..e8ca3539e167 100644 --- a/oox/source/xls/pivotcachebuffer.cxx +++ b/oox/source/xls/pivotcachebuffer.cxx @@ -38,8 +38,8 @@ #include #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/defnamesbuffer.hxx" #include "oox/xls/excelhandlers.hxx" @@ -212,19 +212,19 @@ void PivotCacheItem::readIndex( const AttributeList& rAttribs ) mnType = XML_x; } -void PivotCacheItem::readString( RecordInputStream& rStrm ) +void PivotCacheItem::readString( SequenceInputStream& rStrm ) { - maValue <<= rStrm.readString(); + maValue <<= BiffHelper::readString( rStrm ); mnType = XML_s; } -void PivotCacheItem::readDouble( RecordInputStream& rStrm ) +void PivotCacheItem::readDouble( SequenceInputStream& rStrm ) { maValue <<= rStrm.readDouble(); mnType = XML_n; } -void PivotCacheItem::readDate( RecordInputStream& rStrm ) +void PivotCacheItem::readDate( SequenceInputStream& rStrm ) { DateTime aDateTime; aDateTime.Year = rStrm.readuInt16(); @@ -238,19 +238,19 @@ void PivotCacheItem::readDate( RecordInputStream& rStrm ) mnType = XML_d; } -void PivotCacheItem::readBool( RecordInputStream& rStrm ) +void PivotCacheItem::readBool( SequenceInputStream& rStrm ) { maValue <<= (rStrm.readuInt8() != 0); mnType = XML_b; } -void PivotCacheItem::readError( RecordInputStream& rStrm ) +void PivotCacheItem::readError( SequenceInputStream& rStrm ) { maValue <<= static_cast< sal_Int32 >( rStrm.readuInt8() ); mnType = XML_e; } -void PivotCacheItem::readIndex( RecordInputStream& rStrm ) +void PivotCacheItem::readIndex( SequenceInputStream& rStrm ) { maValue <<= rStrm.readInt32(); mnType = XML_x; @@ -338,7 +338,7 @@ void PivotCacheItemList::importItem( sal_Int32 nElement, const AttributeList& rA } } -void PivotCacheItemList::importItem( sal_Int32 nRecId, RecordInputStream& rStrm ) +void PivotCacheItemList::importItem( sal_Int32 nRecId, SequenceInputStream& rStrm ) { if( nRecId == BIFF12_ID_PCITEM_ARRAY ) { @@ -407,7 +407,7 @@ PivotCacheItem& PivotCacheItemList::createItem() return maItems.back(); } -void PivotCacheItemList::importArray( RecordInputStream& rStrm ) +void PivotCacheItemList::importArray( SequenceInputStream& rStrm ) { sal_uInt16 nType = rStrm.readuInt16(); sal_Int32 nCount = rStrm.readInt32(); @@ -558,7 +558,7 @@ void PivotCacheField::importGroupItem( sal_Int32 nElement, const AttributeList& maGroupItems.importItem( nElement, rAttribs ); } -void PivotCacheField::importPCDField( RecordInputStream& rStrm ) +void PivotCacheField::importPCDField( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; rStrm >> nFlags >> maFieldModel.mnNumFmtId; @@ -579,7 +579,7 @@ void PivotCacheField::importPCDField( RecordInputStream& rStrm ) maFieldModel.mbMemberPropField = getFlag( nFlags, BIFF12_PCDFIELD_MEMBERPROPFIELD ); } -void PivotCacheField::importPCDFSharedItems( RecordInputStream& rStrm ) +void PivotCacheField::importPCDFSharedItems( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; rStrm >> nFlags; @@ -594,17 +594,17 @@ void PivotCacheField::importPCDFSharedItems( RecordInputStream& rStrm ) maSharedItemsModel.mbHasLongText = getFlag( nFlags, BIFF12_PCDFSITEMS_HASLONGTEXT ); } -void PivotCacheField::importPCDFSharedItem( sal_Int32 nRecId, RecordInputStream& rStrm ) +void PivotCacheField::importPCDFSharedItem( sal_Int32 nRecId, SequenceInputStream& rStrm ) { maSharedItems.importItem( nRecId, rStrm ); } -void PivotCacheField::importPCDFieldGroup( RecordInputStream& rStrm ) +void PivotCacheField::importPCDFieldGroup( SequenceInputStream& rStrm ) { rStrm >> maFieldGroupModel.mnParentField >> maFieldGroupModel.mnBaseField; } -void PivotCacheField::importPCDFRangePr( RecordInputStream& rStrm ) +void PivotCacheField::importPCDFRangePr( SequenceInputStream& rStrm ) { sal_uInt8 nGroupBy, nFlags; rStrm >> nGroupBy >> nFlags >> maFieldGroupModel.mfStartValue >> maFieldGroupModel.mfEndValue >> maFieldGroupModel.mfInterval; @@ -623,14 +623,14 @@ void PivotCacheField::importPCDFRangePr( RecordInputStream& rStrm ) } } -void PivotCacheField::importPCDFDiscretePrItem( sal_Int32 nRecId, RecordInputStream& rStrm ) +void PivotCacheField::importPCDFDiscretePrItem( sal_Int32 nRecId, SequenceInputStream& rStrm ) { OSL_ENSURE( nRecId == BIFF12_ID_PCITEM_INDEX, "PivotCacheField::importPCDFDiscretePrItem - unexpected record" ); if( nRecId == BIFF12_ID_PCITEM_INDEX ) maDiscreteItems.push_back( rStrm.readInt32() ); } -void PivotCacheField::importPCDFGroupItem( sal_Int32 nRecId, RecordInputStream& rStrm ) +void PivotCacheField::importPCDFGroupItem( sal_Int32 nRecId, SequenceInputStream& rStrm ) { maGroupItems.importItem( nRecId, rStrm ); } @@ -833,7 +833,7 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie typedef ::std::vector< GroupItemList > GroupItemMap; GroupItemMap aItemMap( maGroupItems.size() ); for( IndexVector::const_iterator aBeg = maDiscreteItems.begin(), aIt = aBeg, aEnd = maDiscreteItems.end(); aIt != aEnd; ++aIt ) - if( GroupItemList* pItems = ContainerHelper::getVectorElement( aItemMap, *aIt ) ) + if( GroupItemList* pItems = ContainerHelper::getVectorElementAccess( aItemMap, *aIt ) ) pItems->push_back( static_cast< sal_Int32 >( aIt - aBeg ) ); // process all groups @@ -920,7 +920,7 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie } // replace original item names in passed vector with group name for( GroupItemList::iterator aIt2 = aIt->begin(), aEnd2 = aIt->end(); aIt2 != aEnd2; ++aIt2 ) - if( PivotCacheGroupItem* pName = ContainerHelper::getVectorElement( orItemNames, *aIt2 ) ) + if( PivotCacheGroupItem* pName = ContainerHelper::getVectorElementAccess( orItemNames, *aIt2 ) ) pName->maGroupName = aGroupName; } } @@ -949,7 +949,7 @@ void PivotCacheField::writeSourceDataCell( WorksheetHelper& rSheetHelper, sal_In writeItemToSourceDataCell( rSheetHelper, nCol, nRow, rItem ); } -void PivotCacheField::importPCRecordItem( RecordInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow ) const +void PivotCacheField::importPCRecordItem( SequenceInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow ) const { if( hasSharedItems() ) { @@ -1084,7 +1084,7 @@ void PivotCache::importWorksheetSource( const AttributeList& rAttribs, const Rel getAddressConverter().convertToCellRangeUnchecked( maSheetSrcModel.maRange, rAttribs.getString( XML_ref, OUString() ), 0 ); } -void PivotCache::importPCDefinition( RecordInputStream& rStrm ) +void PivotCache::importPCDefinition( SequenceInputStream& rStrm ) { sal_uInt8 nFlags1, nFlags2; rStrm.skip( 3 ); // create/refresh version id's @@ -1106,7 +1106,7 @@ void PivotCache::importPCDefinition( RecordInputStream& rStrm ) maDefModel.mbSupportDrill = getFlag( nFlags2, BIFF12_PCDEFINITION_SUPPORTDRILL ); } -void PivotCache::importPCDSource( RecordInputStream& rStrm ) +void PivotCache::importPCDSource( SequenceInputStream& rStrm ) { sal_Int32 nSourceType; rStrm >> nSourceType >> maSourceModel.mnConnectionId; @@ -1114,7 +1114,7 @@ void PivotCache::importPCDSource( RecordInputStream& rStrm ) maSourceModel.mnSourceType = STATIC_ARRAY_SELECT( spnSourceTypes, nSourceType, XML_TOKEN_INVALID ); } -void PivotCache::importPCDSheetSource( RecordInputStream& rStrm, const Relations& rRelations ) +void PivotCache::importPCDSheetSource( SequenceInputStream& rStrm, const Relations& rRelations ) { sal_uInt8 nIsDefName, nIsBuiltinName, nFlags; rStrm >> nIsDefName >> nIsBuiltinName >> nFlags; @@ -1264,7 +1264,7 @@ const PivotCacheField* PivotCache::getCacheField( sal_Int32 nFieldIdx ) const sal_Int32 PivotCache::getCacheDatabaseIndex( sal_Int32 nFieldIdx ) const { - return ContainerHelper::getVectorElement< sal_Int32 >( maDatabaseIndexes, nFieldIdx, -1 ); + return ContainerHelper::getVectorElement( maDatabaseIndexes, nFieldIdx, -1 ); } void PivotCache::writeSourceHeaderCells( WorksheetHelper& rSheetHelper ) const @@ -1286,7 +1286,7 @@ void PivotCache::writeSourceDataCell( WorksheetHelper& rSheetHelper, sal_Int32 n pCacheField->writeSourceDataCell( rSheetHelper, maSheetSrcModel.maRange.StartColumn + nCol, maSheetSrcModel.maRange.StartRow + nRow, rItem ); } -void PivotCache::importPCRecord( RecordInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const +void PivotCache::importPCRecord( SequenceInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const { OSL_ENSURE( (0 < nRow) && (nRow <= maSheetSrcModel.maRange.EndRow - maSheetSrcModel.maRange.StartRow), "PivotCache::importPCRecord - invalid row index" ); sal_Int32 nCol = maSheetSrcModel.maRange.StartColumn; @@ -1504,7 +1504,7 @@ PivotCache* PivotCacheBuffer::importPivotCacheFragment( sal_Int32 nCacheId ) { /* Resolve cache index to cache identifier and try to find pivot cache. Cache must exist already for a valid cache index. */ - nCacheId = ContainerHelper::getVectorElement< sal_Int32 >( maCacheIds, nCacheId, -1 ); + nCacheId = ContainerHelper::getVectorElement( maCacheIds, nCacheId, -1 ); PivotCache* pCache = maCaches.get( nCacheId ).get(); if( !pCache ) return 0; diff --git a/oox/source/xls/pivotcachefragment.cxx b/oox/source/xls/pivotcachefragment.cxx index 68e24c03c3d7..d49077af4f91 100644 --- a/oox/source/xls/pivotcachefragment.cxx +++ b/oox/source/xls/pivotcachefragment.cxx @@ -28,7 +28,6 @@ #include "oox/xls/pivotcachefragment.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/pivotcachebuffer.hxx" @@ -82,7 +81,7 @@ void PivotCacheFieldContext::onStartElement( const AttributeList& rAttribs ) mrCacheField.importCacheField( rAttribs ); } -ContextHandlerRef PivotCacheFieldContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef PivotCacheFieldContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -110,7 +109,7 @@ ContextHandlerRef PivotCacheFieldContext::onCreateRecordContext( sal_Int32 nRecI return 0; } -void PivotCacheFieldContext::onStartRecord( RecordInputStream& rStrm ) +void PivotCacheFieldContext::onStartRecord( SequenceInputStream& rStrm ) { if( isRootElement() ) mrCacheField.importPCDField( rStrm ); @@ -152,7 +151,7 @@ ContextHandlerRef PivotCacheDefinitionFragment::onCreateContext( sal_Int32 nElem return 0; } -ContextHandlerRef PivotCacheDefinitionFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef PivotCacheDefinitionFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -261,7 +260,7 @@ ContextHandlerRef PivotCacheRecordsFragment::onCreateContext( sal_Int32 nElement return 0; } -ContextHandlerRef PivotCacheRecordsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef PivotCacheRecordsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -300,14 +299,14 @@ void PivotCacheRecordsFragment::startCacheRecord() mbInRecord = true; } -void PivotCacheRecordsFragment::importPCRecord( RecordInputStream& rStrm ) +void PivotCacheRecordsFragment::importPCRecord( SequenceInputStream& rStrm ) { startCacheRecord(); mrPivotCache.importPCRecord( rStrm, *this, mnRow ); mbInRecord = false; } -void PivotCacheRecordsFragment::importPCRecordItem( sal_Int32 nRecId, RecordInputStream& rStrm ) +void PivotCacheRecordsFragment::importPCRecordItem( sal_Int32 nRecId, SequenceInputStream& rStrm ) { if( mbInRecord ) { diff --git a/oox/source/xls/pivottablebuffer.cxx b/oox/source/xls/pivottablebuffer.cxx index be48e63f001f..7cdeddaa879b 100644 --- a/oox/source/xls/pivottablebuffer.cxx +++ b/oox/source/xls/pivottablebuffer.cxx @@ -47,8 +47,8 @@ #include #include #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" @@ -383,7 +383,7 @@ void PivotTableField::importReferenceItem( const AttributeList& rAttribs ) maModel.mnSortRefItem = rAttribs.getInteger( XML_v, -1 ); } -void PivotTableField::importPTField( RecordInputStream& rStrm ) +void PivotTableField::importPTField( SequenceInputStream& rStrm ) { sal_uInt32 nFlags1, nFlags2; rStrm >> nFlags1 >> maModel.mnNumFmtId >> nFlags2 >> maModel.mnAutoShowItems >> maModel.mnAutoShowRankBy; @@ -417,7 +417,7 @@ void PivotTableField::importPTField( RecordInputStream& rStrm ) maModel.mnSortType = bAutoSort ? (bAscending ? XML_ascending : XML_descending) : XML_manual; } -void PivotTableField::importPTFItem( RecordInputStream& rStrm ) +void PivotTableField::importPTFItem( SequenceInputStream& rStrm ) { PTFieldItemModel aModel; sal_uInt8 nType; @@ -431,12 +431,12 @@ void PivotTableField::importPTFItem( RecordInputStream& rStrm ) maItems.push_back( aModel ); } -void PivotTableField::importPTReference( RecordInputStream& rStrm ) +void PivotTableField::importPTReference( SequenceInputStream& rStrm ) { rStrm >> maModel.mnSortRefField; } -void PivotTableField::importPTReferenceItem( RecordInputStream& rStrm ) +void PivotTableField::importPTReferenceItem( SequenceInputStream& rStrm ) { rStrm >> maModel.mnSortRefItem; } @@ -906,7 +906,7 @@ void PivotTableFilter::importTop10( const AttributeList& rAttribs ) maModel.mbTopFilter = rAttribs.getBool( XML_top, true ); } -void PivotTableFilter::importPTFilter( RecordInputStream& rStrm ) +void PivotTableFilter::importPTFilter( SequenceInputStream& rStrm ) { sal_Int32 nType; sal_uInt16 nFlags; @@ -946,7 +946,7 @@ void PivotTableFilter::importPTFilter( RecordInputStream& rStrm ) maModel.mnType = STATIC_ARRAY_SELECT( spnTypes, nType, XML_TOKEN_INVALID ); } -void PivotTableFilter::importTop10Filter( RecordInputStream& rStrm ) +void PivotTableFilter::importTop10Filter( SequenceInputStream& rStrm ) { sal_uInt8 nFlags; rStrm >> nFlags >> maModel.mfValue; @@ -1128,7 +1128,7 @@ void PivotTable::importDataField( const AttributeList& rAttribs ) maDataFields.push_back( aModel ); } -void PivotTable::importPTDefinition( RecordInputStream& rStrm ) +void PivotTable::importPTDefinition( SequenceInputStream& rStrm ) { sal_uInt32 nFlags1, nFlags2, nFlags3; sal_uInt8 nDataAxis; @@ -1196,7 +1196,7 @@ void PivotTable::importPTDefinition( RecordInputStream& rStrm ) maDefModel.mbCustomListSort = !getFlag( nFlags3, BIFF12_PTDEF_NOCUSTOMLISTSORT ); } -void PivotTable::importPTLocation( RecordInputStream& rStrm, sal_Int16 nSheet ) +void PivotTable::importPTLocation( SequenceInputStream& rStrm, sal_Int16 nSheet ) { BinRange aBinRange; rStrm >> aBinRange >> maLocationModel.mnFirstHeaderRow @@ -1205,17 +1205,17 @@ void PivotTable::importPTLocation( RecordInputStream& rStrm, sal_Int16 nSheet ) getAddressConverter().convertToCellRangeUnchecked( maLocationModel.maRange, aBinRange, nSheet ); } -void PivotTable::importPTRowFields( RecordInputStream& rStrm ) +void PivotTable::importPTRowFields( SequenceInputStream& rStrm ) { importFields( maRowFields, rStrm ); } -void PivotTable::importPTColFields( RecordInputStream& rStrm ) +void PivotTable::importPTColFields( SequenceInputStream& rStrm ) { importFields( maColFields, rStrm ); } -void PivotTable::importPTPageField( RecordInputStream& rStrm ) +void PivotTable::importPTPageField( SequenceInputStream& rStrm ) { PTPageFieldModel aModel; sal_uInt8 nFlags; @@ -1227,7 +1227,7 @@ void PivotTable::importPTPageField( RecordInputStream& rStrm ) maPageFields.push_back( aModel ); } -void PivotTable::importPTDataField( RecordInputStream& rStrm ) +void PivotTable::importPTDataField( SequenceInputStream& rStrm ) { PTDataFieldModel aModel; sal_Int32 nSubtotal, nShowDataAs; @@ -1521,7 +1521,7 @@ void PivotTable::importField( IndexVector& orFields, const AttributeList& rAttri orFields.push_back( rAttribs.getInteger( XML_x, -1 ) ); } -void PivotTable::importFields( IndexVector& orFields, RecordInputStream& rStrm ) +void PivotTable::importFields( IndexVector& orFields, SequenceInputStream& rStrm ) { OSL_ENSURE( orFields.empty(), "PivotTable::importFields - multiple record instances" ); orFields.clear(); diff --git a/oox/source/xls/pivottablefragment.cxx b/oox/source/xls/pivottablefragment.cxx index 7c16eb7c5b51..6e28118711c9 100644 --- a/oox/source/xls/pivottablefragment.cxx +++ b/oox/source/xls/pivottablefragment.cxx @@ -83,7 +83,7 @@ void PivotTableFieldContext::onStartElement( const AttributeList& rAttribs ) mrTableField.importPivotField( rAttribs ); } -ContextHandlerRef PivotTableFieldContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef PivotTableFieldContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -113,7 +113,7 @@ ContextHandlerRef PivotTableFieldContext::onCreateRecordContext( sal_Int32 nRecI return 0; } -void PivotTableFieldContext::onStartRecord( RecordInputStream& rStrm ) +void PivotTableFieldContext::onStartRecord( SequenceInputStream& rStrm ) { if( isRootElement() ) mrTableField.importPTField( rStrm ); @@ -150,7 +150,7 @@ void PivotTableFilterContext::onStartElement( const AttributeList& rAttribs ) mrTableFilter.importFilter( rAttribs ); } -ContextHandlerRef PivotTableFilterContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef PivotTableFilterContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -167,7 +167,7 @@ ContextHandlerRef PivotTableFilterContext::onCreateRecordContext( sal_Int32 nRec return 0; } -void PivotTableFilterContext::onStartRecord( RecordInputStream& rStrm ) +void PivotTableFilterContext::onStartRecord( SequenceInputStream& rStrm ) { if( isRootElement() ) mrTableFilter.importPTFilter( rStrm ); @@ -224,7 +224,7 @@ ContextHandlerRef PivotTableFragment::onCreateContext( sal_Int32 nElement, const return 0; } -ContextHandlerRef PivotTableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef PivotTableFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/querytablebuffer.cxx b/oox/source/xls/querytablebuffer.cxx index 26f677f1bbc3..28ace4de52d8 100644 --- a/oox/source/xls/querytablebuffer.cxx +++ b/oox/source/xls/querytablebuffer.cxx @@ -32,7 +32,6 @@ #include #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/connectionsbuffer.hxx" @@ -219,7 +218,7 @@ void QueryTable::importQueryTable( const AttributeList& rAttribs ) maModel.mbApplyProtection = rAttribs.getBool( XML_applyWidthHeightFormats, false ); } -void QueryTable::importQueryTable( RecordInputStream& rStrm ) +void QueryTable::importQueryTable( SequenceInputStream& rStrm ) { sal_uInt32 nFlags; rStrm >> nFlags; diff --git a/oox/source/xls/querytablefragment.cxx b/oox/source/xls/querytablefragment.cxx index a6ed80af2194..c74aa53a581e 100644 --- a/oox/source/xls/querytablefragment.cxx +++ b/oox/source/xls/querytablefragment.cxx @@ -59,7 +59,7 @@ ContextHandlerRef QueryTableFragment::onCreateContext( sal_Int32 nElement, const return 0; } -ContextHandlerRef QueryTableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef QueryTableFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/richstring.cxx b/oox/source/xls/richstring.cxx index 2fc659f83536..5c79373b09b2 100644 --- a/oox/source/xls/richstring.cxx +++ b/oox/source/xls/richstring.cxx @@ -31,7 +31,6 @@ #include #include "oox/helper/attributelist.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" namespace oox { @@ -108,7 +107,7 @@ void RichStringPortion::convert( const Reference< XText >& rxText, sal_Int32 nXf // ---------------------------------------------------------------------------- -void FontPortionModel::read( RecordInputStream& rStrm ) +void FontPortionModel::read( SequenceInputStream& rStrm ) { mnPos = rStrm.readuInt16(); mnFontId = rStrm.readuInt16(); @@ -146,7 +145,7 @@ void FontPortionModelList::appendPortion( const FontPortionModel& rPortion ) back().mnFontId = rPortion.mnFontId; } -void FontPortionModelList::importPortions( RecordInputStream& rStrm ) +void FontPortionModelList::importPortions( SequenceInputStream& rStrm ) { sal_Int32 nCount = rStrm.readInt32(); clear(); @@ -216,7 +215,7 @@ void PhoneticSettings::importPhoneticPr( const AttributeList& rAttribs ) maModel.mnAlignment = rAttribs.getToken( XML_alignment, XML_left ); } -void PhoneticSettings::importPhoneticPr( RecordInputStream& rStrm ) +void PhoneticSettings::importPhoneticPr( SequenceInputStream& rStrm ) { sal_uInt16 nFontId; sal_Int32 nType, nAlignment; @@ -234,7 +233,7 @@ void PhoneticSettings::importPhoneticPr( BiffInputStream& rStrm ) // following: range list with cells showing phonetic text } -void PhoneticSettings::importStringData( RecordInputStream& rStrm ) +void PhoneticSettings::importStringData( SequenceInputStream& rStrm ) { sal_uInt16 nFontId, nFlags; rStrm >> nFontId >> nFlags; @@ -278,7 +277,7 @@ void RichStringPhonetic::setBaseRange( sal_Int32 nBasePos, sal_Int32 nBaseEnd ) // ---------------------------------------------------------------------------- -void PhoneticPortionModel::read( RecordInputStream& rStrm ) +void PhoneticPortionModel::read( SequenceInputStream& rStrm ) { mnPos = rStrm.readuInt16(); mnBasePos = rStrm.readuInt16(); @@ -311,7 +310,7 @@ void PhoneticPortionModelList::appendPortion( const PhoneticPortionModel& rPorti } } -void PhoneticPortionModelList::importPortions( RecordInputStream& rStrm ) +void PhoneticPortionModelList::importPortions( SequenceInputStream& rStrm ) { sal_Int32 nCount = rStrm.readInt32(); clear(); @@ -383,10 +382,10 @@ void RichString::importPhoneticPr( const AttributeList& rAttribs ) maPhonSettings.importPhoneticPr( rAttribs ); } -void RichString::importString( RecordInputStream& rStrm, bool bRich ) +void RichString::importString( SequenceInputStream& rStrm, bool bRich ) { sal_uInt8 nFlags = bRich ? rStrm.readuInt8() : 0; - OUString aBaseText = rStrm.readString(); + OUString aBaseText = BiffHelper::readString( rStrm ); if( !rStrm.isEof() && getFlag( nFlags, BIFF12_STRINGFLAG_FONTS ) ) { @@ -401,7 +400,7 @@ void RichString::importString( RecordInputStream& rStrm, bool bRich ) if( !rStrm.isEof() && getFlag( nFlags, BIFF12_STRINGFLAG_PHONETICS ) ) { - OUString aPhoneticText = rStrm.readString(); + OUString aPhoneticText = BiffHelper::readString( rStrm ); PhoneticPortionModelList aPortions; aPortions.importPortions( rStrm ); maPhonSettings.importStringData( rStrm ); diff --git a/oox/source/xls/scenariobuffer.cxx b/oox/source/xls/scenariobuffer.cxx index 697b74889dad..8915f1ae0c7b 100644 --- a/oox/source/xls/scenariobuffer.cxx +++ b/oox/source/xls/scenariobuffer.cxx @@ -34,8 +34,8 @@ #include #include #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" @@ -102,7 +102,7 @@ void Scenario::importInputCells( const AttributeList& rAttribs ) maCells.push_back( aModel ); } -void Scenario::importScenario( RecordInputStream& rStrm ) +void Scenario::importScenario( SequenceInputStream& rStrm ) { rStrm.skip( 2 ); // cell count // two longs instead of flag field @@ -111,7 +111,7 @@ void Scenario::importScenario( RecordInputStream& rStrm ) rStrm >> maModel.maName >> maModel.maComment >> maModel.maUser; } -void Scenario::importInputCells( RecordInputStream& rStrm ) +void Scenario::importInputCells( SequenceInputStream& rStrm ) { // TODO: where is the deleted flag? ScenarioCellModel aModel; @@ -232,7 +232,7 @@ void SheetScenarios::importScenarios( const AttributeList& rAttribs ) maModel.mnShown = rAttribs.getInteger( XML_show, 0 ); } -void SheetScenarios::importScenarios( RecordInputStream& rStrm ) +void SheetScenarios::importScenarios( SequenceInputStream& rStrm ) { maModel.mnCurrent = rStrm.readuInt16(); maModel.mnShown = rStrm.readuInt16(); diff --git a/oox/source/xls/scenariocontext.cxx b/oox/source/xls/scenariocontext.cxx index 1ecb8ce1fe59..be44bc8545f2 100644 --- a/oox/source/xls/scenariocontext.cxx +++ b/oox/source/xls/scenariocontext.cxx @@ -61,7 +61,7 @@ void ScenarioContext::onStartElement( const AttributeList& rAttribs ) mrScenario.importScenario( rAttribs ); } -ContextHandlerRef ScenarioContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef ScenarioContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -72,7 +72,7 @@ ContextHandlerRef ScenarioContext::onCreateRecordContext( sal_Int32 nRecId, Reco return 0; } -void ScenarioContext::onStartRecord( RecordInputStream& rStrm ) +void ScenarioContext::onStartRecord( SequenceInputStream& rStrm ) { if( isRootElement() ) mrScenario.importScenario( rStrm ); @@ -103,7 +103,7 @@ void ScenariosContext::onStartElement( const AttributeList& rAttribs ) mrSheetScenarios.importScenarios( rAttribs ); } -ContextHandlerRef ScenariosContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& ) +ContextHandlerRef ScenariosContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& ) { switch( getCurrentElement() ) { @@ -114,7 +114,7 @@ ContextHandlerRef ScenariosContext::onCreateRecordContext( sal_Int32 nRecId, Rec return 0; } -void ScenariosContext::onStartRecord( RecordInputStream& rStrm ) +void ScenariosContext::onStartRecord( SequenceInputStream& rStrm ) { if( isRootElement() ) mrSheetScenarios.importScenarios( rStrm ); diff --git a/oox/source/xls/sharedformulabuffer.cxx b/oox/source/xls/sharedformulabuffer.cxx index 0cf616646722..efdfe801f784 100644 --- a/oox/source/xls/sharedformulabuffer.cxx +++ b/oox/source/xls/sharedformulabuffer.cxx @@ -30,7 +30,6 @@ #include #include #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/formulaparser.hxx" @@ -112,7 +111,7 @@ void SharedFormulaBuffer::importSharedFmla( const OUString& rFormula, const OUSt } } -void SharedFormulaBuffer::importSharedFmla( RecordInputStream& rStrm, const CellAddress& rBaseAddr ) +void SharedFormulaBuffer::importSharedFmla( SequenceInputStream& rStrm, const CellAddress& rBaseAddr ) { BinRange aRange; rStrm >> aRange; diff --git a/oox/source/xls/sharedstringsfragment.cxx b/oox/source/xls/sharedstringsfragment.cxx index a356e9b29d7e..bdb60f6962b8 100644 --- a/oox/source/xls/sharedstringsfragment.cxx +++ b/oox/source/xls/sharedstringsfragment.cxx @@ -64,7 +64,7 @@ ContextHandlerRef SharedStringsFragment::onCreateContext( sal_Int32 nElement, co return 0; } -ContextHandlerRef SharedStringsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef SharedStringsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/sheetdatacontext.cxx b/oox/source/xls/sheetdatacontext.cxx index 258ec995e9e0..c515ec02bfbe 100644 --- a/oox/source/xls/sheetdatacontext.cxx +++ b/oox/source/xls/sheetdatacontext.cxx @@ -35,7 +35,6 @@ #include #include "oox/helper/attributelist.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/formulaparser.hxx" @@ -285,7 +284,7 @@ void SheetDataContext::onEndElement() } } -ContextHandlerRef SheetDataContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef SheetDataContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -375,7 +374,7 @@ void SheetDataContext::importFormula( const AttributeList& rAttribs ) maTableData.mbRef2Deleted = rAttribs.getBool( XML_del2, false ); } -void SheetDataContext::importCellHeader( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellHeader( SequenceInputStream& rStrm, CellType eCellType ) { maCurrCell.reset(); @@ -398,7 +397,7 @@ void SheetDataContext::importCellHeader( RecordInputStream& rStrm, CellType eCel extendUsedArea( maCurrCell.maAddress ); } -void SheetDataContext::importCellBool( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellBool( SequenceInputStream& rStrm, CellType eCellType ) { importCellHeader( rStrm, eCellType ); maCurrCell.mnCellType = XML_b; @@ -419,14 +418,14 @@ void SheetDataContext::importCellBool( RecordInputStream& rStrm, CellType eCellT setCellFormat( maCurrCell ); } -void SheetDataContext::importCellBlank( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellBlank( SequenceInputStream& rStrm, CellType eCellType ) { OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellBlank - no formula cells supported" ); importCellHeader( rStrm, eCellType ); setCellFormat( maCurrCell ); } -void SheetDataContext::importCellDouble( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellDouble( SequenceInputStream& rStrm, CellType eCellType ) { importCellHeader( rStrm, eCellType ); maCurrCell.mnCellType = XML_n; @@ -441,7 +440,7 @@ void SheetDataContext::importCellDouble( RecordInputStream& rStrm, CellType eCel setCellFormat( maCurrCell ); } -void SheetDataContext::importCellError( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellError( SequenceInputStream& rStrm, CellType eCellType ) { importCellHeader( rStrm, eCellType ); maCurrCell.mnCellType = XML_e; @@ -456,7 +455,7 @@ void SheetDataContext::importCellError( RecordInputStream& rStrm, CellType eCell setCellFormat( maCurrCell ); } -void SheetDataContext::importCellRk( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellRk( SequenceInputStream& rStrm, CellType eCellType ) { OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellRk - no formula cells supported" ); importCellHeader( rStrm, eCellType ); @@ -466,7 +465,7 @@ void SheetDataContext::importCellRk( RecordInputStream& rStrm, CellType eCellTyp setCellFormat( maCurrCell ); } -void SheetDataContext::importCellRString( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellRString( SequenceInputStream& rStrm, CellType eCellType ) { OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellRString - no formula cells supported" ); importCellHeader( rStrm, eCellType ); @@ -482,7 +481,7 @@ void SheetDataContext::importCellRString( RecordInputStream& rStrm, CellType eCe setCellFormat( maCurrCell ); } -void SheetDataContext::importCellSi( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellSi( SequenceInputStream& rStrm, CellType eCellType ) { OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellSi - no formula cells supported" ); importCellHeader( rStrm, eCellType ); @@ -492,7 +491,7 @@ void SheetDataContext::importCellSi( RecordInputStream& rStrm, CellType eCellTyp setCellFormat( maCurrCell ); } -void SheetDataContext::importCellString( RecordInputStream& rStrm, CellType eCellType ) +void SheetDataContext::importCellString( SequenceInputStream& rStrm, CellType eCellType ) { importCellHeader( rStrm, eCellType ); maCurrCell.mnCellType = XML_inlineStr; @@ -510,7 +509,7 @@ void SheetDataContext::importCellString( RecordInputStream& rStrm, CellType eCel setCellFormat( maCurrCell ); } -void SheetDataContext::importCellFormula( RecordInputStream& rStrm ) +void SheetDataContext::importCellFormula( SequenceInputStream& rStrm ) { rStrm.skip( 2 ); Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, UNO_QUERY ); @@ -521,7 +520,7 @@ void SheetDataContext::importCellFormula( RecordInputStream& rStrm ) } } -void SheetDataContext::importRow( RecordInputStream& rStrm ) +void SheetDataContext::importRow( SequenceInputStream& rStrm ) { RowModel aModel; @@ -545,7 +544,7 @@ void SheetDataContext::importRow( RecordInputStream& rStrm ) setRowModel( aModel ); } -void SheetDataContext::importArray( RecordInputStream& rStrm ) +void SheetDataContext::importArray( SequenceInputStream& rStrm ) { BinRange aRange; rStrm >> aRange; @@ -560,12 +559,12 @@ void SheetDataContext::importArray( RecordInputStream& rStrm ) } } -void SheetDataContext::importSharedFmla( RecordInputStream& rStrm ) +void SheetDataContext::importSharedFmla( SequenceInputStream& rStrm ) { getSharedFormulas().importSharedFmla( rStrm, maCurrCell.maAddress ); } -void SheetDataContext::importDataTable( RecordInputStream& rStrm ) +void SheetDataContext::importDataTable( SequenceInputStream& rStrm ) { BinRange aRange; rStrm >> aRange; diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx index 13c4bb6612a6..56c26d8b9f67 100644 --- a/oox/source/xls/stylesbuffer.cxx +++ b/oox/source/xls/stylesbuffer.cxx @@ -46,9 +46,9 @@ #include #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/condformatbuffer.hxx" #include "oox/xls/excelhandlers.hxx" @@ -366,7 +366,7 @@ void Color::importColor( const AttributeList& rAttribs ) } } -void Color::importColor( RecordInputStream& rStrm ) +void Color::importColor( SequenceInputStream& rStrm ) { sal_uInt8 nFlags, nIndex; sal_Int16 nTint; @@ -403,12 +403,12 @@ void Color::importColor( RecordInputStream& rStrm ) } } -void Color::importColorId( RecordInputStream& rStrm ) +void Color::importColorId( SequenceInputStream& rStrm ) { setIndexed( rStrm.readInt32() ); } -void Color::importColorRgb( RecordInputStream& rStrm ) +void Color::importColorRgb( SequenceInputStream& rStrm ) { setRgb( lclReadRgbColor( rStrm ) ); } @@ -423,7 +423,7 @@ void Color::importColorRgb( BiffInputStream& rStrm ) setRgb( lclReadRgbColor( rStrm ) ); } -RecordInputStream& operator>>( RecordInputStream& rStrm, Color& orColor ) +SequenceInputStream& operator>>( SequenceInputStream& rStrm, Color& orColor ) { orColor.importColor( rStrm ); return rStrm; @@ -518,7 +518,7 @@ void ColorPalette::importPaletteColor( const AttributeList& rAttribs ) appendColor( rAttribs.getIntegerHex( XML_rgb, API_RGB_WHITE ) ); } -void ColorPalette::importPaletteColor( RecordInputStream& rStrm ) +void ColorPalette::importPaletteColor( SequenceInputStream& rStrm ) { sal_Int32 nRgb = lclReadRgbColor( rStrm ); appendColor( nRgb & 0xFFFFFF ); @@ -791,7 +791,7 @@ void Font::importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ) } } -void Font::importFont( RecordInputStream& rStrm ) +void Font::importFont( SequenceInputStream& rStrm ) { OSL_ENSURE( !mbDxf, "Font::importFont - unexpected conditional formatting flag" ); @@ -816,56 +816,56 @@ void Font::importFont( RecordInputStream& rStrm ) maModel.mbShadow = getFlag( nFlags, BIFF_FONTFLAG_SHADOW ); } -void Font::importDxfName( RecordInputStream& rStrm ) +void Font::importDxfName( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfName - missing conditional formatting flag" ); - maModel.maName = rStrm.readString( false ); + maModel.maName = BiffHelper::readString( rStrm, false ); maUsedFlags.mbColorUsed = true; } -void Font::importDxfColor( RecordInputStream& rStrm ) +void Font::importDxfColor( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfColor - missing conditional formatting flag" ); rStrm >> maModel.maColor; maUsedFlags.mbColorUsed = true; } -void Font::importDxfScheme( RecordInputStream& rStrm ) +void Font::importDxfScheme( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfScheme - missing conditional formatting flag" ); maModel.setBiff12Scheme( rStrm.readuInt8() ); maUsedFlags.mbSchemeUsed = true; } -void Font::importDxfHeight( RecordInputStream& rStrm ) +void Font::importDxfHeight( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfHeight - missing conditional formatting flag" ); maModel.setBiffHeight( rStrm.readuInt16() ); maUsedFlags.mbHeightUsed = true; } -void Font::importDxfWeight( RecordInputStream& rStrm ) +void Font::importDxfWeight( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfWeight - missing conditional formatting flag" ); maModel.setBiffWeight( rStrm.readuInt16() ); maUsedFlags.mbWeightUsed = true; } -void Font::importDxfUnderline( RecordInputStream& rStrm ) +void Font::importDxfUnderline( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfUnderline - missing conditional formatting flag" ); maModel.setBiffUnderline( rStrm.readuInt16() ); maUsedFlags.mbUnderlineUsed = true; } -void Font::importDxfEscapement( RecordInputStream& rStrm ) +void Font::importDxfEscapement( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfEscapement - missing conditional formatting flag" ); maModel.setBiffEscapement( rStrm.readuInt16() ); maUsedFlags.mbEscapementUsed = true; } -void Font::importDxfFlag( sal_Int32 nElement, RecordInputStream& rStrm ) +void Font::importDxfFlag( sal_Int32 nElement, SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Font::importDxfFlag - missing conditional formatting flag" ); bool bFlag = rStrm.readuInt8() != 0; @@ -1652,7 +1652,7 @@ void Border::importColor( sal_Int32 nElement, const AttributeList& rAttribs ) pBorderLine->maColor.importColor( rAttribs ); } -void Border::importBorder( RecordInputStream& rStrm ) +void Border::importBorder( SequenceInputStream& rStrm ) { sal_uInt8 nFlags = rStrm.readuInt8(); maModel.mbDiagTLtoBR = getFlag( nFlags, BIFF12_BORDER_DIAG_TLBR ); @@ -1669,7 +1669,7 @@ void Border::importBorder( RecordInputStream& rStrm ) rStrm >> maModel.maDiagonal.maColor; } -void Border::importDxfBorder( sal_Int32 nElement, RecordInputStream& rStrm ) +void Border::importDxfBorder( sal_Int32 nElement, SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Border::importDxfBorder - missing conditional formatting flag" ); if( BorderLineModel* pBorderLine = getBorderLine( nElement ) ) @@ -1861,7 +1861,7 @@ GradientFillModel::GradientFillModel() : { } -void GradientFillModel::readGradient( RecordInputStream& rStrm ) +void GradientFillModel::readGradient( SequenceInputStream& rStrm ) { sal_Int32 nType; rStrm >> nType >> mfAngle >> mfLeft >> mfRight >> mfTop >> mfBottom; @@ -1869,7 +1869,7 @@ void GradientFillModel::readGradient( RecordInputStream& rStrm ) mnType = STATIC_ARRAY_SELECT( spnTypes, nType, XML_TOKEN_INVALID ); } -void GradientFillModel::readGradientStop( RecordInputStream& rStrm, bool bDxf ) +void GradientFillModel::readGradientStop( SequenceInputStream& rStrm, bool bDxf ) { Color aColor; double fPosition; @@ -1976,7 +1976,7 @@ void Fill::importColor( const AttributeList& rAttribs, double fPosition ) mxGradientModel->maColors[ fPosition ].importColor( rAttribs ); } -void Fill::importFill( RecordInputStream& rStrm ) +void Fill::importFill( SequenceInputStream& rStrm ) { OSL_ENSURE( !mbDxf, "Fill::importFill - unexpected conditional formatting flag" ); sal_Int32 nPattern = rStrm.readInt32(); @@ -1998,7 +1998,7 @@ void Fill::importFill( RecordInputStream& rStrm ) } } -void Fill::importDxfPattern( RecordInputStream& rStrm ) +void Fill::importDxfPattern( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Fill::importDxfPattern - missing conditional formatting flag" ); if( !mxPatternModel ) @@ -2007,7 +2007,7 @@ void Fill::importDxfPattern( RecordInputStream& rStrm ) mxPatternModel->mbPatternUsed = true; } -void Fill::importDxfFgColor( RecordInputStream& rStrm ) +void Fill::importDxfFgColor( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Fill::importDxfFgColor - missing conditional formatting flag" ); if( !mxPatternModel ) @@ -2016,7 +2016,7 @@ void Fill::importDxfFgColor( RecordInputStream& rStrm ) mxPatternModel->mbPattColorUsed = true; } -void Fill::importDxfBgColor( RecordInputStream& rStrm ) +void Fill::importDxfBgColor( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Fill::importDxfBgColor - missing conditional formatting flag" ); if( !mxPatternModel ) @@ -2025,7 +2025,7 @@ void Fill::importDxfBgColor( RecordInputStream& rStrm ) mxPatternModel->mbFillColorUsed = true; } -void Fill::importDxfGradient( RecordInputStream& rStrm ) +void Fill::importDxfGradient( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Fill::importDxfGradient - missing conditional formatting flag" ); if( !mxGradientModel ) @@ -2033,7 +2033,7 @@ void Fill::importDxfGradient( RecordInputStream& rStrm ) mxGradientModel->readGradient( rStrm ); } -void Fill::importDxfStop( RecordInputStream& rStrm ) +void Fill::importDxfStop( SequenceInputStream& rStrm ) { OSL_ENSURE( mbDxf, "Fill::importDxfStop - missing conditional formatting flag" ); if( !mxGradientModel ) @@ -2255,7 +2255,7 @@ void Xf::importProtection( const AttributeList& rAttribs ) maProtection.importProtection( rAttribs ); } -void Xf::importXf( RecordInputStream& rStrm, bool bCellXf ) +void Xf::importXf( SequenceInputStream& rStrm, bool bCellXf ) { maModel.mbCellXf = bCellXf; maModel.mnStyleXfId = rStrm.readuInt16(); @@ -2546,7 +2546,7 @@ void Dxf::importProtection( const AttributeList& rAttribs ) mxProtection->importProtection( rAttribs ); } -void Dxf::importDxf( RecordInputStream& rStrm ) +void Dxf::importDxf( SequenceInputStream& rStrm ) { sal_Int32 nNumFmtId = -1; OUString aFmtCode; @@ -2581,7 +2581,7 @@ void Dxf::importDxf( RecordInputStream& rStrm ) case BIFF12_DXF_FONT_SHADOW: createFont( false )->importDxfFlag( XML_shadow, rStrm ); break; case BIFF12_DXF_FONT_HEIGHT: createFont( false )->importDxfHeight( rStrm ); break; case BIFF12_DXF_FONT_SCHEME: createFont( false )->importDxfScheme( rStrm ); break; - case BIFF12_DXF_NUMFMT_CODE: aFmtCode = rStrm.readString( false ); break; + case BIFF12_DXF_NUMFMT_CODE: aFmtCode = BiffHelper::readString( rStrm, false ); break; case BIFF12_DXF_NUMFMT_ID: nNumFmtId = rStrm.readuInt16(); break; } rStrm.seek( nRecEnd ); @@ -2851,7 +2851,7 @@ void CellStyle::importCellStyle( const AttributeList& rAttribs ) maModel.mbHidden = rAttribs.getBool( XML_hidden, false ); } -void CellStyle::importCellStyle( RecordInputStream& rStrm ) +void CellStyle::importCellStyle( SequenceInputStream& rStrm ) { sal_uInt16 nFlags; rStrm >> maModel.mnXfId >> nFlags; @@ -2952,7 +2952,7 @@ CellStyleRef CellStyleBuffer::importCellStyle( const AttributeList& rAttribs ) return xCellStyle; } -CellStyleRef CellStyleBuffer::importCellStyle( RecordInputStream& rStrm ) +CellStyleRef CellStyleBuffer::importCellStyle( SequenceInputStream& rStrm ) { CellStyleRef xCellStyle( new CellStyle( *this ) ); xCellStyle->importCellStyle( rStrm ); @@ -3189,17 +3189,17 @@ CellStyleRef StylesBuffer::importCellStyle( const AttributeList& rAttribs ) return maCellStyles.importCellStyle( rAttribs ); } -void StylesBuffer::importPaletteColor( RecordInputStream& rStrm ) +void StylesBuffer::importPaletteColor( SequenceInputStream& rStrm ) { maPalette.importPaletteColor( rStrm ); } -void StylesBuffer::importNumFmt( RecordInputStream& rStrm ) +void StylesBuffer::importNumFmt( SequenceInputStream& rStrm ) { maNumFmts.importNumFmt( rStrm ); } -void StylesBuffer::importCellStyle( RecordInputStream& rStrm ) +void StylesBuffer::importCellStyle( SequenceInputStream& rStrm ) { maCellStyles.importCellStyle( rStrm ); } diff --git a/oox/source/xls/stylesfragment.cxx b/oox/source/xls/stylesfragment.cxx index 2ea01a8a84e2..c890196dc518 100644 --- a/oox/source/xls/stylesfragment.cxx +++ b/oox/source/xls/stylesfragment.cxx @@ -56,7 +56,7 @@ ContextHandlerRef IndexedColorsContext::onCreateContext( sal_Int32 nElement, con return 0; } -ContextHandlerRef IndexedColorsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef IndexedColorsContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -242,7 +242,7 @@ ContextHandlerRef StylesFragment::onCreateContext( sal_Int32 nElement, const Att return 0; } -ContextHandlerRef StylesFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef StylesFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/tablebuffer.cxx b/oox/source/xls/tablebuffer.cxx index b3dac5e85eed..91fad31e6ee4 100644 --- a/oox/source/xls/tablebuffer.cxx +++ b/oox/source/xls/tablebuffer.cxx @@ -29,8 +29,8 @@ #include #include "oox/helper/attributelist.hxx" +#include "oox/helper/binaryinputstream.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" namespace oox { @@ -74,7 +74,7 @@ void Table::importTable( const AttributeList& rAttribs, sal_Int16 nSheet ) maModel.mnTotalsRows = rAttribs.getInteger( XML_totalsRowCount, 0 ); } -void Table::importTable( RecordInputStream& rStrm, sal_Int16 nSheet ) +void Table::importTable( SequenceInputStream& rStrm, sal_Int16 nSheet ) { BinRange aBinRange; sal_Int32 nType; diff --git a/oox/source/xls/tablefragment.cxx b/oox/source/xls/tablefragment.cxx index 027a37eb4dcc..37503f8577fb 100644 --- a/oox/source/xls/tablefragment.cxx +++ b/oox/source/xls/tablefragment.cxx @@ -67,7 +67,7 @@ ContextHandlerRef TableFragment::onCreateContext( sal_Int32 nElement, const Attr return 0; } -ContextHandlerRef TableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef TableFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { diff --git a/oox/source/xls/viewsettings.cxx b/oox/source/xls/viewsettings.cxx index b86ec1fe7612..c9658dd41cf9 100644 --- a/oox/source/xls/viewsettings.cxx +++ b/oox/source/xls/viewsettings.cxx @@ -39,7 +39,6 @@ #include "oox/helper/containerhelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/unitconverter.hxx" @@ -289,7 +288,7 @@ void SheetViewSettings::importChartSheetView( const AttributeList& rAttribs ) rModel.mbZoomToFit = rAttribs.getBool( XML_zoomToFit, false ); } -void SheetViewSettings::importSheetView( RecordInputStream& rStrm ) +void SheetViewSettings::importSheetView( SequenceInputStream& rStrm ) { SheetViewModel& rModel = *createSheetView(); sal_uInt16 nFlags; @@ -316,7 +315,7 @@ void SheetViewSettings::importSheetView( RecordInputStream& rStrm ) rModel.mbShowOutline = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWOUTLINE ); } -void SheetViewSettings::importPane( RecordInputStream& rStrm ) +void SheetViewSettings::importPane( SequenceInputStream& rStrm ) { OSL_ENSURE( !maSheetViews.empty(), "SheetViewSettings::importPane - missing sheet view model" ); if( !maSheetViews.empty() ) @@ -334,7 +333,7 @@ void SheetViewSettings::importPane( RecordInputStream& rStrm ) } } -void SheetViewSettings::importSelection( RecordInputStream& rStrm ) +void SheetViewSettings::importSelection( SequenceInputStream& rStrm ) { OSL_ENSURE( !maSheetViews.empty(), "SheetViewSettings::importSelection - missing sheet view model" ); if( !maSheetViews.empty() ) @@ -354,7 +353,7 @@ void SheetViewSettings::importSelection( RecordInputStream& rStrm ) } } -void SheetViewSettings::importChartSheetView( RecordInputStream& rStrm ) +void SheetViewSettings::importChartSheetView( SequenceInputStream& rStrm ) { SheetViewModel& rModel = *createSheetView(); sal_uInt16 nFlags; @@ -649,7 +648,7 @@ void ViewSettings::importOleSize( const AttributeList& rAttribs ) mbValidOleSize = getAddressConverter().convertToCellRange( maOleSize, aRange, 0, true, false ); } -void ViewSettings::importWorkbookView( RecordInputStream& rStrm ) +void ViewSettings::importWorkbookView( SequenceInputStream& rStrm ) { WorkbookViewModel& rModel = createWorkbookView(); sal_uInt8 nFlags; @@ -661,7 +660,7 @@ void ViewSettings::importWorkbookView( RecordInputStream& rStrm ) rModel.mbMinimized = getFlag( nFlags, BIFF12_WBVIEW_MINIMIZED ); } -void ViewSettings::importOleSize( RecordInputStream& rStrm ) +void ViewSettings::importOleSize( SequenceInputStream& rStrm ) { BinRange aBinRange; rStrm >> aBinRange; diff --git a/oox/source/xls/workbookfragment.cxx b/oox/source/xls/workbookfragment.cxx index 042acc50dcbb..dce3c8eb461e 100644 --- a/oox/source/xls/workbookfragment.cxx +++ b/oox/source/xls/workbookfragment.cxx @@ -33,7 +33,6 @@ #include "oox/helper/attributelist.hxx" #include "oox/helper/progressbar.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/ole/olestorage.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/chartsheetfragment.hxx" @@ -128,7 +127,7 @@ void WorkbookFragment::onCharacters( const OUString& rChars ) mxCurrName->setFormula( rChars ); } -ContextHandlerRef WorkbookFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef WorkbookFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -317,16 +316,16 @@ void WorkbookFragment::importPivotCache( const AttributeList& rAttribs ) importPivotCacheDefFragment( aRelId, nCacheId ); } -void WorkbookFragment::importExternalRef( RecordInputStream& rStrm ) +void WorkbookFragment::importExternalRef( SequenceInputStream& rStrm ) { if( ExternalLink* pExtLink = getExternalLinks().importExternalRef( rStrm ).get() ) importExternalLinkFragment( *pExtLink ); } -void WorkbookFragment::importPivotCache( RecordInputStream& rStrm ) +void WorkbookFragment::importPivotCache( SequenceInputStream& rStrm ) { sal_Int32 nCacheId = rStrm.readInt32(); - OUString aRelId = rStrm.readString(); + OUString aRelId = BiffHelper::readString( rStrm ); importPivotCacheDefFragment( aRelId, nCacheId ); } diff --git a/oox/source/xls/workbooksettings.cxx b/oox/source/xls/workbooksettings.cxx index e54628a6143f..6889d42ed2f6 100644 --- a/oox/source/xls/workbooksettings.cxx +++ b/oox/source/xls/workbooksettings.cxx @@ -34,7 +34,6 @@ #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/unitconverter.hxx" @@ -156,13 +155,13 @@ void WorkbookSettings::importCalcPr( const AttributeList& rAttribs ) maCalcSettings.mbConcurrent = rAttribs.getBool( XML_concurrentCalc, true ); } -void WorkbookSettings::importFileSharing( RecordInputStream& rStrm ) +void WorkbookSettings::importFileSharing( SequenceInputStream& rStrm ) { maFileSharing.mbRecommendReadOnly = rStrm.readuInt16() != 0; rStrm >> maFileSharing.mnPasswordHash >> maFileSharing.maUserName; } -void WorkbookSettings::importWorkbookPr( RecordInputStream& rStrm ) +void WorkbookSettings::importWorkbookPr( SequenceInputStream& rStrm ) { sal_uInt32 nFlags; rStrm >> nFlags >> maBookSettings.mnDefaultThemeVer >> maBookSettings.maCodeName; @@ -172,7 +171,7 @@ void WorkbookSettings::importWorkbookPr( RecordInputStream& rStrm ) setDateMode( getFlag( nFlags, BIFF12_WORKBOOKPR_DATE1904 ) ); } -void WorkbookSettings::importCalcPr( RecordInputStream& rStrm ) +void WorkbookSettings::importCalcPr( SequenceInputStream& rStrm ) { sal_Int32 nCalcMode, nProcCount; sal_uInt16 nFlags; diff --git a/oox/source/xls/worksheetbuffer.cxx b/oox/source/xls/worksheetbuffer.cxx index 12903a4b3c27..6144c35d6a55 100644 --- a/oox/source/xls/worksheetbuffer.cxx +++ b/oox/source/xls/worksheetbuffer.cxx @@ -36,8 +36,8 @@ #include #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" +#include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/excelhandlers.hxx" @@ -95,7 +95,7 @@ void WorksheetBuffer::importSheet( const AttributeList& rAttribs ) insertSheet( aModel ); } -void WorksheetBuffer::importSheet( RecordInputStream& rStrm ) +void WorksheetBuffer::importSheet( SequenceInputStream& rStrm ) { sal_Int32 nState; SheetInfoModel aModel; diff --git a/oox/source/xls/worksheetfragment.cxx b/oox/source/xls/worksheetfragment.cxx index 1008a67af9b5..4867c7c350c1 100644 --- a/oox/source/xls/worksheetfragment.cxx +++ b/oox/source/xls/worksheetfragment.cxx @@ -30,7 +30,6 @@ #include "oox/core/filterbase.hxx" #include "oox/core/relations.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/autofilterbuffer.hxx" #include "oox/xls/autofiltercontext.hxx" @@ -164,7 +163,7 @@ void DataValidationsContext::onEndElement() } -ContextHandlerRef DataValidationsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef DataValidationsContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { if( nRecId == BIFF12_ID_DATAVALIDATION ) importDataValidation( rStrm ); @@ -191,7 +190,7 @@ void DataValidationsContext::importDataValidation( const AttributeList& rAttribs mxValModel->mbAllowBlank = rAttribs.getBool( XML_allowBlank, false ); } -void DataValidationsContext::importDataValidation( RecordInputStream& rStrm ) +void DataValidationsContext::importDataValidation( SequenceInputStream& rStrm ) { ValidationModel aModel; @@ -370,7 +369,7 @@ void WorksheetFragment::onCharacters( const OUString& rChars ) } } -ContextHandlerRef WorksheetFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) +ContextHandlerRef WorksheetFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) { switch( getCurrentElement() ) { @@ -621,7 +620,7 @@ void WorksheetFragment::importControl( const AttributeList& rAttribs ) getVmlDrawing().registerControl( aInfo ); } -void WorksheetFragment::importDimension( RecordInputStream& rStrm ) +void WorksheetFragment::importDimension( SequenceInputStream& rStrm ) { BinRange aBinRange; aBinRange.read( rStrm ); @@ -635,7 +634,7 @@ void WorksheetFragment::importDimension( RecordInputStream& rStrm ) extendUsedArea( aRange ); } -void WorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm ) +void WorksheetFragment::importSheetFormatPr( SequenceInputStream& rStrm ) { sal_Int32 nDefaultWidth; sal_uInt16 nBaseWidth, nDefaultHeight, nFlags; @@ -654,7 +653,7 @@ void WorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm ) getFlag( nFlags, BIFF_DEFROW_THICKBOTTOM ) ); } -void WorksheetFragment::importCol( RecordInputStream& rStrm ) +void WorksheetFragment::importCol( SequenceInputStream& rStrm ) { ColumnModel aModel; @@ -676,7 +675,7 @@ void WorksheetFragment::importCol( RecordInputStream& rStrm ) setColumnModel( aModel ); } -void WorksheetFragment::importMergeCell( RecordInputStream& rStrm ) +void WorksheetFragment::importMergeCell( SequenceInputStream& rStrm ) { BinRange aBinRange; rStrm >> aBinRange; @@ -685,20 +684,20 @@ void WorksheetFragment::importMergeCell( RecordInputStream& rStrm ) setMergedRange( aRange ); } -void WorksheetFragment::importHyperlink( RecordInputStream& rStrm ) +void WorksheetFragment::importHyperlink( SequenceInputStream& rStrm ) { BinRange aBinRange; rStrm >> aBinRange; HyperlinkModel aModel; if( getAddressConverter().convertToCellRange( aModel.maRange, aBinRange, getSheetIndex(), true, true ) ) { - aModel.maTarget = getRelations().getExternalTargetFromRelId( rStrm.readString() ); + aModel.maTarget = getRelations().getExternalTargetFromRelId( BiffHelper::readString( rStrm ) ); rStrm >> aModel.maLocation >> aModel.maTooltip >> aModel.maDisplay; setHyperlink( aModel ); } } -void WorksheetFragment::importBrk( RecordInputStream& rStrm, bool bRowBreak ) +void WorksheetFragment::importBrk( SequenceInputStream& rStrm, bool bRowBreak ) { PageBreakModel aModel; sal_Int32 nManual; @@ -707,17 +706,17 @@ void WorksheetFragment::importBrk( RecordInputStream& rStrm, bool bRowBreak ) setPageBreak( aModel, bRowBreak ); } -void WorksheetFragment::importDrawing( RecordInputStream& rStrm ) +void WorksheetFragment::importDrawing( SequenceInputStream& rStrm ) { - setDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) ); + setDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) ); } -void WorksheetFragment::importLegacyDrawing( RecordInputStream& rStrm ) +void WorksheetFragment::importLegacyDrawing( SequenceInputStream& rStrm ) { - setVmlDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) ); + setVmlDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) ); } -void WorksheetFragment::importOleObject( RecordInputStream& rStrm ) +void WorksheetFragment::importOleObject( SequenceInputStream& rStrm ) { ::oox::vml::OleObjectInfo aInfo; sal_Int32 nAspect, nUpdateMode, nShapeId; @@ -727,7 +726,7 @@ void WorksheetFragment::importOleObject( RecordInputStream& rStrm ) if( aInfo.mbLinked ) aInfo.maTargetLink = getFormulaParser().importOleTargetLink( rStrm ); else - importEmbeddedOleData( aInfo.maEmbeddedData, rStrm.readString() ); + importEmbeddedOleData( aInfo.maEmbeddedData, BiffHelper::readString( rStrm ) ); aInfo.setShapeId( nShapeId ); aInfo.mbShowAsIcon = nAspect == BIFF12_OLEOBJECT_ICON; aInfo.mbAutoUpdate = nUpdateMode == BIFF12_OLEOBJECT_ALWAYS; @@ -735,11 +734,11 @@ void WorksheetFragment::importOleObject( RecordInputStream& rStrm ) getVmlDrawing().registerOleObject( aInfo ); } -void WorksheetFragment::importControl( RecordInputStream& rStrm ) +void WorksheetFragment::importControl( SequenceInputStream& rStrm ) { ::oox::vml::ControlInfo aInfo; aInfo.setShapeId( rStrm.readInt32() ); - aInfo.maFragmentPath = getFragmentPathFromRelId( rStrm.readString() ); + aInfo.maFragmentPath = getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ); rStrm >> aInfo.maName; getVmlDrawing().registerControl( aInfo ); } diff --git a/oox/source/xls/worksheetsettings.cxx b/oox/source/xls/worksheetsettings.cxx index b81f7fb6b841..cc1aa45f2012 100644 --- a/oox/source/xls/worksheetsettings.cxx +++ b/oox/source/xls/worksheetsettings.cxx @@ -30,7 +30,6 @@ #include #include "oox/core/filterbase.hxx" #include "oox/helper/attributelist.hxx" -#include "oox/helper/recordinputstream.hxx" #include "oox/xls/biffinputstream.hxx" #include "oox/xls/pagesettings.hxx" #include "oox/xls/workbooksettings.hxx" @@ -178,7 +177,7 @@ void WorksheetSettings::importPhoneticPr( const AttributeList& rAttribs ) maPhoneticSett.importPhoneticPr( rAttribs ); } -void WorksheetSettings::importSheetPr( RecordInputStream& rStrm ) +void WorksheetSettings::importSheetPr( SequenceInputStream& rStrm ) { sal_uInt16 nFlags1; sal_uInt8 nFlags2; @@ -196,13 +195,13 @@ void WorksheetSettings::importSheetPr( RecordInputStream& rStrm ) getPageSettings().setFitToPagesMode( getFlag( nFlags1, BIFF_SHEETPR_FITTOPAGES ) ); } -void WorksheetSettings::importChartSheetPr( RecordInputStream& rStrm ) +void WorksheetSettings::importChartSheetPr( SequenceInputStream& rStrm ) { rStrm.skip( 2 ); // flags, contains only the 'published' flag rStrm >> maSheetSettings.maTabColor >> maSheetSettings.maCodeName; } -void WorksheetSettings::importSheetProtection( RecordInputStream& rStrm ) +void WorksheetSettings::importSheetProtection( SequenceInputStream& rStrm ) { rStrm >> maSheetProt.mnPasswordHash; // no flags field for all these boolean flags?!? @@ -224,7 +223,7 @@ void WorksheetSettings::importSheetProtection( RecordInputStream& rStrm ) maSheetProt.mbSelectUnlocked = rStrm.readInt32() != 0; } -void WorksheetSettings::importChartProtection( RecordInputStream& rStrm ) +void WorksheetSettings::importChartProtection( SequenceInputStream& rStrm ) { rStrm >> maSheetProt.mnPasswordHash; // no flags field for all these boolean flags?!? @@ -232,7 +231,7 @@ void WorksheetSettings::importChartProtection( RecordInputStream& rStrm ) maSheetProt.mbObjects = rStrm.readInt32() != 0; } -void WorksheetSettings::importPhoneticPr( RecordInputStream& rStrm ) +void WorksheetSettings::importPhoneticPr( SequenceInputStream& rStrm ) { maPhoneticSett.importPhoneticPr( rStrm ); } -- cgit From 0c446846b7e52a992ec154ca49952b6fb61fb8af Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 9 Nov 2010 11:16:07 +0100 Subject: dr77: unx compiler warning --- sc/source/core/data/makefile.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/sc/source/core/data/makefile.mk b/sc/source/core/data/makefile.mk index 95ce6bcec179..51c01febcd36 100644 --- a/sc/source/core/data/makefile.mk +++ b/sc/source/core/data/makefile.mk @@ -140,6 +140,7 @@ EXCEPTIONSFILES= \ $(SLO)$/documen3.obj \ $(SLO)$/documen5.obj \ $(SLO)$/documen6.obj \ + $(SLO)$/documen8.obj \ $(SLO)$/documen9.obj \ $(SLO)$/dpcachetable.obj \ $(SLO)$/dptablecache.obj \ -- cgit From 9b68fad68642fefd23fec6608ac05d9a44f1fe69 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 9 Nov 2010 11:32:14 +0100 Subject: dr77: remove deleted file from makefile --- oox/source/helper/makefile.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/oox/source/helper/makefile.mk b/oox/source/helper/makefile.mk index 3518db0c6d7c..f31736faac8d 100644 --- a/oox/source/helper/makefile.mk +++ b/oox/source/helper/makefile.mk @@ -51,7 +51,6 @@ SLOFILES = \ $(SLO)$/progressbar.obj \ $(SLO)$/propertymap.obj \ $(SLO)$/propertyset.obj \ - $(SLO)$/recordinputstream.obj \ $(SLO)$/storagebase.obj \ $(SLO)$/textinputstream.obj \ $(SLO)$/zipstorage.obj -- cgit From 65dcdf44cec6dfdad0b90250c579a66968417677 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Tue, 9 Nov 2010 11:55:19 +0100 Subject: minor cleanup in outfont.hxx: prefer fwd-decls and explicit conversions --- vcl/inc/vcl/outfont.hxx | 16 ++++++++-------- vcl/source/gdi/outdev3.cxx | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/vcl/inc/vcl/outfont.hxx b/vcl/inc/vcl/outfont.hxx index 4bbf7176ddb2..7ad233449d93 100644 --- a/vcl/inc/vcl/outfont.hxx +++ b/vcl/inc/vcl/outfont.hxx @@ -39,8 +39,6 @@ #include -#include - class ImplDevFontListData; class ImplGetDevFontList; class ImplGetDevSizeList; @@ -54,6 +52,8 @@ class ConvertChar; struct FontMatchStatus; class OutputDevice; +namespace com { namespace sun { namespace star { namespace lang { struct Locale; }}}} + // ---------------------- // - ImplFontAttributes - // ---------------------- @@ -140,7 +140,7 @@ public: virtual ImplFontData* Clone() const = 0; protected: - ImplFontData( const ImplDevFontAttributes&, int nMagic ); + explicit ImplFontData( const ImplDevFontAttributes&, int nMagic ); void SetBitmapSize( int nW, int nH ) { mnWidth=nW; mnHeight=nH; } long mnWidth; // Width (in pixels) @@ -199,8 +199,8 @@ private: ImplGlyphFallbackFontSubstitution* mpFallbackHook; // device specific glyh fallback substitution public: - ImplDevFontList(); - ~ImplDevFontList(); + explicit ImplDevFontList(); + virtual ~ImplDevFontList(); // fill the list with device fonts void Add( ImplFontData* ); @@ -226,7 +226,7 @@ public: ImplGetDevSizeList* GetDevSizeList( const String& rFontName ) const; //used by 2-level font fallback - ImplDevFontListData* ImplFindByLocale(com::sun::star::lang::Locale lc) const; + ImplDevFontListData* ImplFindByLocale( com::sun::star::lang::Locale& ) const; protected: void InitMatchData() const; @@ -267,7 +267,7 @@ struct ImplKernPairData class ImplFontMetricData : public ImplFontAttributes { public: - ImplFontMetricData( const ImplFontSelectData& ); + explicit ImplFontMetricData( const ImplFontSelectData& ); void ImplInitTextLineSize( const OutputDevice* pDev ); void ImplInitAboveTextLineSize(); @@ -327,7 +327,7 @@ public: // TODO: hide members behind accessor methods class VCL_DLLPUBLIC ImplFontEntry { public: - ImplFontEntry( const ImplFontSelectData& ); + explicit ImplFontEntry( const ImplFontSelectData& ); virtual ~ImplFontEntry(); public: // TODO: make data members private diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index f4ea98484c33..ca50e4bf6c82 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -1686,15 +1686,15 @@ void ImplDevFontList::InitMatchData() const } //---------------------------------------------------------------------------- -ImplDevFontListData* ImplDevFontList::ImplFindByLocale(com::sun::star::lang::Locale lc) const +ImplDevFontListData* ImplDevFontList::ImplFindByLocale( com::sun::star::lang::Locale& rLocale ) const { // get the default font for a specified locale const DefaultFontConfiguration& rDefaults = *DefaultFontConfiguration::get(); - String aDefault = rDefaults.getUserInterfaceFont( lc ); + const String aDefault = rDefaults.getUserInterfaceFont( rLocale ); ImplDevFontListData* pFontData = ImplFindByTokenNames( aDefault ); if( pFontData ) return pFontData; - return 0; + return NULL; } // ----------------------------------------------------------------------- -- cgit From 8044a782c864a5572d236a01e8ac35b1f275b1dd Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 9 Nov 2010 13:08:07 +0100 Subject: dr77: deliver new headers --- oox/prj/d.lst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oox/prj/d.lst b/oox/prj/d.lst index 41cadacbecd5..360acef09111 100644 --- a/oox/prj/d.lst +++ b/oox/prj/d.lst @@ -25,7 +25,8 @@ mkdir: %_DEST%\inc%_EXT%\oox\xls ..\inc\oox\dllapi.h %_DEST%\inc%_EXT%\oox\dllapi.h ..\inc\oox\helper\binarystreambase.hxx %_DEST%\inc%_EXT%\oox\helper\binarystreambase.hxx ..\inc\oox\helper\helper.hxx %_DEST%\inc%_EXT%\oox\helper\helper.hxx -..\inc\oox\helper\containerhelper.hxx %_DEST%\inc%_EXT%\oox\helper\containerhelper.hxx +..\inc\oox\helper\refmap.hxx %_DEST%\inc%_EXT%\oox\helper\refmap.hxx +..\inc\oox\helper\refvector.hxx %_DEST%\inc%_EXT%\oox\helper\refvector.hxx ..\inc\oox\helper\storagebase.hxx %_DEST%\inc%_EXT%\oox\helper\storagebase.hxx ..\inc\oox\helper\zipstorage.hxx %_DEST%\inc%_EXT%\oox\helper\zipstorage.hxx ..\inc\oox\core\filterbase.hxx %_DEST%\inc%_EXT%\oox\core\filterbase.hxx -- cgit From 1cf8cca7c83869e34123a985d1847f01fa53101f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 9 Nov 2010 14:47:50 +0100 Subject: vcl117: #i115456# fix a sal_uInt32 vs long issue --- .../source/processor2d/vclhelperbitmaprender.cxx | 39 ++++++++++------------ 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx index 80e34ba27701..752bf6d13849 100644 --- a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx +++ b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx @@ -84,19 +84,18 @@ namespace drawinglayer aOutlineRange.transform(aSimpleObjectMatrix); } - // prepare dest coor - const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX())); - const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY())); - const Rectangle aDestRectPixel( - basegfx::fround(aOutlineRange.getMinX()), - basegfx::fround(aOutlineRange.getMinY()), - nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0, - nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0); + // prepare dest coordinates + const Point aPoint( + basegfx::fround(aOutlineRange.getMinX()), + basegfx::fround(aOutlineRange.getMinY())); + const Size aSize( + basegfx::fround(aOutlineRange.getWidth()), + basegfx::fround(aOutlineRange.getHeight())); // paint it using GraphicManager Graphic aGraphic(rBitmapEx); GraphicObject aGraphicObject(aGraphic); - aGraphicObject.Draw(&rOutDev, aDestRectPixel.TopLeft(), aDestRectPixel.GetSize(), &aAttributes); + aGraphicObject.Draw(&rOutDev, aPoint, aSize, &aAttributes); } void RenderBitmapPrimitive2D_BitmapEx( @@ -110,13 +109,13 @@ namespace drawinglayer // prepare dest coor. Necessary to expand since vcl's DrawBitmapEx draws one pix less basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0); aOutlineRange.transform(rTransform); - const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX())); - const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY())); - const Rectangle aDestRectPixel( - basegfx::fround(aOutlineRange.getMinX()), - basegfx::fround(aOutlineRange.getMinY()), - nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0, - nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0); + // prepare dest coordinates + const Point aPoint( + basegfx::fround(aOutlineRange.getMinX()), + basegfx::fround(aOutlineRange.getMinY())); + const Size aSize( + basegfx::fround(aOutlineRange.getWidth()), + basegfx::fround(aOutlineRange.getHeight())); // decompose matrix to check for shear, rotate and mirroring basegfx::B2DVector aScale, aTranslate; @@ -142,7 +141,7 @@ namespace drawinglayer } // draw bitmap - rOutDev.DrawBitmapEx(aDestRectPixel.TopLeft(), aDestRectPixel.GetSize(), aContent); + rOutDev.DrawBitmapEx(aPoint, aSize, aContent); } void RenderBitmapPrimitive2D_self( @@ -153,13 +152,11 @@ namespace drawinglayer // process self with free transformation (containing shear and rotate). Get dest rect in pixels. basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0); aOutlineRange.transform(rTransform); - const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX())); - const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY())); const Rectangle aDestRectLogic( basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()), - nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0, - nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0); + basegfx::fround(aOutlineRange.getMaxX()), + basegfx::fround(aOutlineRange.getMaxY())); const Rectangle aDestRectPixel(rOutDev.LogicToPixel(aDestRectLogic)); // #i96708# check if Metafile is recorded -- cgit From 0d3513ca6431804576aef6e294aed3baa305774f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 9 Nov 2010 15:20:35 +0100 Subject: vcl117: #i115477# clean up unused methods --- sc/source/ui/docshell/docsh4.cxx | 198 --------------------------------------- sc/source/ui/inc/docsh.hxx | 4 - sc/source/ui/inc/prevwsh.hxx | 3 - sc/source/ui/inc/tabvwsh.hxx | 4 - sc/source/ui/view/prevwsh.cxx | 59 ------------ sc/source/ui/view/tabvwsh4.cxx | 70 -------------- 6 files changed, 338 deletions(-) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index d6386d040d0c..4b7f79ddfc51 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1943,60 +1943,6 @@ bool ScDocShell::CheckPrint( ScMarkData* pMarkData, bool bForceSelected, bool bI return true; } -void ScDocShell::PreparePrint( ScMarkData* pMarkData ) -{ - SfxPrinter* pPrinter = GetPrinter(); - if ( !pPrinter ) - { - return; - } - - delete pOldJobSetup; // gesetzt nur bei Fehler in StartJob() - pOldJobSetup = new ScJobSetup( pPrinter ); // Einstellungen merken - - // Einstellungen fuer die erste gedruckte Seite muessen hier (vor StartJob) gesetzt werden - //! Selection etc. mit Print() zusammenfassen !!! - //! Seiten nur einmal zaehlen - - bool bHasOptions = false; - ScPrintOptions aOptions; - bool bAllTabs = true; - long nTotalPages = 0; - long aPageArr[MAXTABCOUNT]; // pages per sheet - MultiSelection aPageRanges; // pages to print - ScRange* pMarkedRange = NULL; - - lcl_GetPrintData( this, &aDocument, pPrinter, false, - pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages, - aPageArr, aPageRanges, &pMarkedRange ); - - BOOL bFound = FALSE; // erste Seite gefunden - long nTabStart = 0; - SCTAB nTabCount = aDocument.GetTableCount(); - for ( SCTAB nTab=0; nTabGetTableSelect( nTab ) ) - { - long nNext = nTabStart + aPageArr[nTab]; - BOOL bSelected = FALSE; - for (long nP=nTabStart+1; nP<=nNext; nP++) // 1-basiert - if (aPageRanges.IsSelected( nP )) // eine Seite von dieser Tabelle selektiert? - bSelected = TRUE; - - if (bSelected) - { - ScPrintFunc aPrintFunc( this, pPrinter, nTab ); - - aPrintFunc.ApplyPrintSettings(); // dann Settings fuer diese Tabelle - bFound = TRUE; - } - nTabStart = nNext; - } - } - - delete pMarkedRange; -} - BOOL lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange ) { BOOL bFound = FALSE; @@ -2036,150 +1982,6 @@ BOOL lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange ) return bFound; } -void ScDocShell::Print( SfxProgress& rProgress, - ScMarkData* pMarkData, Window* pDialogParent, BOOL bForceSelected, BOOL bIsAPI ) -{ - SfxPrinter* pPrinter = GetPrinter(); - if ( !pPrinter ) - { - return; - } - - bool bHasOptions = false; - ScPrintOptions aOptions; - bool bAllTabs = true; - long nTotalPages = 0; - long aPageArr[MAXTABCOUNT]; // pages per sheet - MultiSelection aPageRanges; // pages to print - ScRange* pMarkedRange = NULL; - - lcl_GetPrintData( this, &aDocument, pPrinter, bForceSelected, - pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages, - aPageArr, aPageRanges, &pMarkedRange ); - - USHORT nCollateCopies = 1; - // test if printed range contains transparent objects - - BOOL bHasTransp = FALSE; - BOOL bAnyPrintRanges = aDocument.HasPrintRange(); - ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool(); - SCTAB nTabCount = aDocument.GetTableCount(); - for ( SCTAB nTab=0; nTabGetTableSelect( nTab ) ) - { - SfxStyleSheetBase* pStyleSheet = pStylePool->Find( - aDocument.GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE ); - if ( pStyleSheet ) - { - const SfxItemSet& rSet = pStyleSheet->GetItemSet(); - if ( ((const ScViewObjectModeItem&)rSet.Get(ATTR_PAGE_CHARTS)).GetValue() == VOBJ_MODE_SHOW || - ((const ScViewObjectModeItem&)rSet.Get(ATTR_PAGE_OBJECTS)).GetValue() == VOBJ_MODE_SHOW || - ((const ScViewObjectModeItem&)rSet.Get(ATTR_PAGE_DRAWINGS)).GetValue() == VOBJ_MODE_SHOW ) - { - if ( pMarkedRange ) - bHasTransp = bHasTransp || lcl_HasTransparent( &aDocument, nTab, pMarkedRange ); - else if ( aDocument.GetPrintRangeCount(nTab) ) - { - USHORT nRangeCount = aDocument.GetPrintRangeCount(nTab); - for (USHORT i=0; iGetTableSelect( nTab ) ) - { - FmFormView* pDrawView = NULL; - Rectangle aFull( 0, 0, LONG_MAX, LONG_MAX ); - - // #114135# - ScDrawLayer* pModel = aDocument.GetDrawLayer(); // ist nicht NULL - - if(pModel) - { - pDrawView = new FmFormView( pModel, pPrinter ); - pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab)); - pDrawView->SetPrintPreview( TRUE ); - } - - ScPrintFunc aPrintFunc( this, pPrinter, nTab, nAttrPage, nTotalPages, pMarkedRange, &aOptions ); - aPrintFunc.SetDrawView( pDrawView ); - nPrinted += aPrintFunc.DoPrint( aPageRanges, nTabStart, nDisplayStart, TRUE, &rProgress, NULL ); - - nTabStart += aPageArr[nTab]; - if ( aDocument.NeedPageResetAfterTab(nTab) ) - nDisplayStart = 0; - else - nDisplayStart += aPageArr[nTab]; - nAttrPage = aPrintFunc.GetFirstPageNo(); // behalten oder aus Vorlage - - delete pDrawView; - } - } - - if ( n+1 < nCollateCopies && - (pPrinter->GetDuplexMode() == DUPLEX_SHORTEDGE || pPrinter->GetDuplexMode() == DUPLEX_LONGEDGE) && - ( nPrinted % 2 ) == 1 ) - { - // #105584# when several collated copies are printed in duplex mode, and there is - // an odd number of pages, print an empty page between copies, so the first page of - // the second copy isn't printed on the back of the last page of the first copy. - // (same as in Writer ViewShell::Prt) - - // FIXME: needs to be adapted to XRenderable interface - #if 0 - pPrinter->StartPage(); - pPrinter->EndPage(); - #endif - } - } - - delete pMarkedRange; - - if (pOldJobSetup) - { - pPrinter->SetOrientation( pOldJobSetup->eOrientation ); - pPrinter->SetPaperBin ( pOldJobSetup->nPaperBin ); - pPrinter->SetPaper ( pOldJobSetup->ePaper ); - - if ( PAPER_USER == pOldJobSetup->ePaper ) - { - pPrinter->SetMapMode( pOldJobSetup->aUserMapMode ); - pPrinter->SetPaperSizeUser( pOldJobSetup->aUserSize ); - } - - delete pOldJobSetup; - pOldJobSetup = NULL; - } - - if ( bHasOptions ) - { - // remove PrintOptions from printer ItemSet, - // so next time the options from the configuration are used - - SfxItemSet aSet( pPrinter->GetOptions() ); - aSet.ClearItem( SID_SCPRINTOPTIONS ); - pPrinter->SetOptions( aSet ); - } - - PostPaintGridAll(); //! nur wenn geaendert -} - void ScDocShell::GetState( SfxItemSet &rSet ) { SfxWhichIter aIter(rSet); diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index 624aa5181da7..e13bee9d8adc 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -303,10 +303,6 @@ public: void DoHardRecalc( BOOL bApi ); bool CheckPrint( ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI ); - void PreparePrint( ScMarkData* pMarkData ); - void Print( SfxProgress& rProgress, - ScMarkData* pMarkData, Window* pDialogParent, - BOOL bForceSelected, BOOL bIsAPI ); void UpdateOle( const ScViewData* pViewData, BOOL bSnapSize = FALSE ); BOOL IsOle(); diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx index d9f19d48c0c0..79f4d799223a 100644 --- a/sc/source/ui/inc/prevwsh.hxx +++ b/sc/source/ui/inc/prevwsh.hxx @@ -117,9 +117,6 @@ public: virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE ); virtual USHORT SetPrinter( SfxPrinter* pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); - virtual void PreparePrint(); - virtual ErrCode DoPrint( SfxPrinter *pPrinter, BOOL bSilent, BOOL bIsAPI ); - virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI ); void AddAccessibilityObject( SfxListener& rObject ); void RemoveAccessibilityObject( SfxListener& rObject ); diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 27baaa6d9c56..c3316092d044 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -370,10 +370,6 @@ public: USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); - virtual void PreparePrint(); - virtual ErrCode DoPrint( SfxPrinter *pPrinter, - BOOL bSilent, BOOL bIsAPI ); - virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI ); void ConnectObject( SdrOle2Obj* pObj ); BOOL ActivateObject( SdrOle2Obj* pObj, long nVerb ); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 59e3977e9f89..12d153dab1e4 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -495,65 +495,6 @@ SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt return 0; } -void __EXPORT ScPreviewShell::PreparePrint() -{ - SfxViewShell::PreparePrint(); - - ScMarkData aMarkData; - aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE ); - pDocShell->PreparePrint(&aMarkData ); -} - -ErrCode ScPreviewShell::DoPrint( SfxPrinter *pPrinter, BOOL bSilent, BOOL bIsAPI ) -{ - ErrCode nRet = ERRCODE_IO_ABORT; - - ScMarkData aMarkData; - aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE ); - - if ( pDocShell->CheckPrint( &aMarkData, false, bIsAPI ) ) - { - // SfxViewShell::DoPrint calls Print (after StartJob etc.) - nRet = SfxViewShell::DoPrint( pPrinter, bSilent, bIsAPI ); - } - - return nRet; -} - -USHORT __EXPORT ScPreviewShell::Print( SfxProgress& rProgress, BOOL bIsAPI ) -{ - pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen - - // get the list of affected sheets before SfxViewShell::Print - bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); - - ScMarkData aMarkData; - aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE ); - - uno::Sequence< sal_Int32 > aSheets; - SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount(); - sal_Int32 nPrinted = 0; - for ( SCTAB nTab = 0; nTab < nTabCount; ++nTab ) - { - if ( bAllTabs || aMarkData.GetTableSelect( nTab ) ) - { - aSheets.realloc( nPrinted + 1 ); - aSheets[nPrinted] = nTab; - ++nPrinted; - } - } - - uno::Sequence < beans::PropertyValue > aProps(1); - aProps[0].Name = ::rtl::OUString::createFromAscii( "PrintSheets" ); - aProps[0].Value <<= aSheets; - SetAdditionalPrintOptions( aProps ); - - SfxViewShell::Print( rProgress, bIsAPI ); - pDocShell->Print( rProgress, &aMarkData, pPreview, FALSE, bIsAPI ); - - return 0; -} - //------------------------------------------------------------------------ void __EXPORT ScPreviewShell::Activate(BOOL bMDI) diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 77fbe6bf5ada..4596880b7fb6 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1169,76 +1169,6 @@ SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt return 0; } -void __EXPORT ScTabViewShell::PreparePrint() -{ - ScDocShell* pDocShell = GetViewData()->GetDocShell(); - - SfxViewShell::PreparePrint(); - pDocShell->PreparePrint( &GetViewData()->GetMarkData() ); -} - -ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter, BOOL bSilent, BOOL bIsAPI ) -{ - // #72527# if SID_PRINTDOCDIRECT is executed and there's a selection, - // ask if only the selection should be printed - - const ScMarkData& rMarkData = GetViewData()->GetMarkData(); - if ( !bSilent && !bIsAPI && ( rMarkData.IsMarked() || rMarkData.IsMultiMarked() ) ) - { - SvxPrtQryBox aQuery( GetDialogParent() ); - short nBtn = aQuery.Execute(); - - if ( nBtn == RET_CANCEL ) - return ERRCODE_IO_ABORT; - - if ( nBtn == RET_OK ) - bPrintSelected = TRUE; - } - - ErrCode nRet = ERRCODE_IO_ABORT; - - ScDocShell* pDocShell = GetViewData()->GetDocShell(); - if ( pDocShell->CheckPrint( &GetViewData()->GetMarkData(), bPrintSelected, bIsAPI ) ) - { - // get the list of affected sheets before SfxViewShell::Print - bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); - - uno::Sequence aSheets; - SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount(); - USHORT nPrinted = 0; - for ( SCTAB nTab=0; nTab aProps(1); - aProps[0].Name=::rtl::OUString::createFromAscii("PrintSheets"); - aProps[0].Value <<= aSheets; - SetAdditionalPrintOptions( aProps ); - - // SfxViewShell::DoPrint calls Print (after StartJob etc.) - nRet = SfxViewShell::DoPrint( pPrinter, bSilent, bIsAPI ); - } - - bPrintSelected = FALSE; - - return nRet; -} - -USHORT __EXPORT ScTabViewShell::Print( SfxProgress& rProgress, BOOL bIsAPI ) -{ - ScDocShell* pDocShell = GetViewData()->GetDocShell(); - pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen - - SfxViewShell::Print( rProgress, bIsAPI ); - pDocShell->Print( rProgress, &GetViewData()->GetMarkData(), - GetDialogParent(), bPrintSelected, bIsAPI ); - return 0; -} - void ScTabViewShell::StopEditShell() { if ( pEditShell != NULL && !bDontSwitch ) -- cgit From d24982322055f8fcf427ed197cfe5f5ead5f251d Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 9 Nov 2010 15:20:35 +0100 Subject: vcl117: #i115477# clean up unused methods --- sw/source/filter/ascii/parasc.cxx | 20 ++++--------- sw/source/ui/app/docshini.cxx | 41 +++++++++----------------- sw/source/ui/config/optpage.cxx | 62 +++++++++++++++++---------------------- sw/source/ui/dialog/ascfldlg.cxx | 20 ++++++++++--- 4 files changed, 63 insertions(+), 80 deletions(-) diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index 282551474e36..64a261fc8ba0 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -54,6 +54,8 @@ #include // ...Percent() #include +#include "vcl/metric.hxx" + #define ASC_BUFFLEN 4096 class SwASCIIParser @@ -129,24 +131,14 @@ SwASCIIParser::SwASCIIParser(SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn, } if( rOpt.GetFontName().Len() ) { - bool bDelete = false; - const SfxFont* pFnt = 0; + Font aTextFont( rOpt.GetFontName(), Size( 0, 10 ) ); if( pDoc->getPrinter( false ) ) - pFnt = pDoc->getPrinter( false )->GetFontByName( rOpt.GetFontName() ); - - if( !pFnt ) - { - pFnt = new SfxFont( FAMILY_DONTKNOW, rOpt.GetFontName() ); - bDelete = true; - } - SvxFontItem aFont( pFnt->GetFamily(), pFnt->GetName(), - aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), RES_CHRATR_FONT ); + aTextFont = pDoc->getPrinter( false )->GetFontMetric( aTextFont ); + SvxFontItem aFont( aTextFont.GetFamily(), aTextFont.GetName(), + aEmptyStr, aTextFont.GetPitch(), aTextFont.GetCharSet(), RES_CHRATR_FONT ); pItemSet->Put( aFont ); pItemSet->Put( aFont, RES_CHRATR_CJK_FONT ); pItemSet->Put( aFont, RES_CHRATR_CTL_FONT ); - - if( bDelete ) - delete (SfxFont*)pFnt; } } diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index c201109ca1cb..cd6ca0c1a961 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -210,21 +210,15 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) if(!pStdFont->IsFontDefault(nFontId)) { sEntry = pStdFont->GetFontFor(nFontId); - sal_Bool bDelete = sal_False; - const SfxFont* pFnt = pPrt ? pPrt->GetFontByName(sEntry): 0; - if(!pFnt) - { - pFnt = new SfxFont( FAMILY_DONTKNOW, sEntry, PITCH_DONTKNOW, - ::gsl_getSystemTextEncoding() ); - bDelete = sal_True; - } - pFontItem = new SvxFontItem(pFnt->GetFamily(), pFnt->GetName(), - aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), nFontWhich); - if(bDelete) + + Font aFont( sEntry, Size( 0, 10 ) ); + if( pPrt ) { - delete (SfxFont*) pFnt; - bDelete = sal_False; + aFont = pPrt->GetFontMetric( aFont ); } + + pFontItem = new SvxFontItem(aFont.GetFamily(), aFont.GetName(), + aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich); } else { @@ -303,25 +297,18 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) if(!pStdFont->IsFontDefault(aFontIdPoolId[nIdx])) { sEntry = pStdFont->GetFontFor(aFontIdPoolId[nIdx]); - sal_Bool bDelete = sal_False; - const SfxFont* pFnt = pPrt ? pPrt->GetFontByName(sEntry): 0; - if(!pFnt) - { - pFnt = new SfxFont( FAMILY_DONTKNOW, sEntry, PITCH_DONTKNOW, - ::gsl_getSystemTextEncoding() ); - bDelete = sal_True; - } + + Font aFont( sEntry, Size( 0, 10 ) ); + if( pPrt ) + aFont = pPrt->GetFontMetric( aFont ); + pColl = pDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]); if( !bHTMLTemplSet || SFX_ITEM_SET != pColl->GetAttrSet().GetItemState( nFontWhich, sal_False ) ) { - pColl->SetFmtAttr(SvxFontItem(pFnt->GetFamily(), pFnt->GetName(), - aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), nFontWhich)); - } - if(bDelete) - { - delete (SfxFont*) pFnt; + pColl->SetFmtAttr(SvxFontItem(aFont.GetFamily(), aFont.GetName(), + aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich)); } } sal_Int32 nFontHeight = pStdFont->GetFontHeight( static_cast< sal_Int8 >(aFontIdPoolId[nIdx]), 0, eLanguage ); diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 81448870d925..3cd923f7613c 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -721,20 +721,12 @@ void lcl_SetColl(SwWrtShell* pWrtShell, USHORT nType, SfxPrinter* pPrt, const String& rStyle, USHORT nFontWhich) { - BOOL bDelete = FALSE; - const SfxFont* pFnt = pPrt ? pPrt->GetFontByName(rStyle): 0; - if(!pFnt) - { - pFnt = new SfxFont(FAMILY_DONTKNOW, rStyle); - bDelete = TRUE; - } + Font aFont( rStyle, Size( 0, 10 ) ); + if( pPrt ) + aFont = pPrt->GetFontMetric( aFont ); SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(nType); - pColl->SetFmtAttr(SvxFontItem(pFnt->GetFamily(), pFnt->GetName(), - aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), nFontWhich)); - if(bDelete) - { - delete (SfxFont*) pFnt; - } + pColl->SetFmtAttr(SvxFontItem(aFont.GetFamily(), aFont.GetName(), + aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich)); } /*-- 11.10.2005 15:47:52--------------------------------------------------- @@ -817,22 +809,13 @@ BOOL SwStdFontTabPage::FillItemSet( SfxItemSet& ) FONT_GROUP_CJK == nFontGroup ? RES_CHRATR_CJK_FONTSIZE : RES_CHRATR_CTL_FONTSIZE); if(sStandard != sShellStd) { - BOOL bDelete = FALSE; - const SfxFont* pFnt = pPrinter ? pPrinter->GetFontByName(sStandard): 0; - if(!pFnt) - { - pFnt = new SfxFont(FAMILY_DONTKNOW, sStandard); - bDelete = TRUE; - } - pWrtShell->SetDefault(SvxFontItem(pFnt->GetFamily(), pFnt->GetName(), - aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), nFontWhich)); + Font aFont( sStandard, Size( 0, 10 ) ); + if( pPrinter ) + aFont = pPrinter->GetFontMetric( aFont ); + pWrtShell->SetDefault(SvxFontItem(aFont.GetFamily(), aFont.GetName(), + aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich)); SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_STANDARD); pColl->ResetFmtAttr(nFontWhich); - if(bDelete) - { - delete (SfxFont*) pFnt; - bDelete = FALSE; - } // lcl_SetColl(pWrtShell, RES_POOLCOLL_STANDARD, pPrinter, sStandard); bMod = TRUE; } @@ -938,15 +921,24 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet) // #i94536# prevent duplication of font entries when 'reset' button is pressed if( !aStandardBox.GetEntryCount() ) { - const USHORT nCount = pPrt->GetFontCount(); - for (USHORT i = 0; i < nCount; ++i) + // get the set of disctinct available family names + std::set< String > aFontNames; + int nFontNames = pPrt->GetDevFontCount(); + for( int i = 0; i < nFontNames; i++ ) + { + FontInfo aInf( pPrt->GetDevFont( i ) ); + aFontNames.insert( aInf.GetName() ); + } + + // insert to listboxes + for( std::set< String >::const_iterator it = aFontNames.begin(); + it != aFontNames.end(); ++it ) { - const String &rString = pPrt->GetFont(i)->GetName(); - aStandardBox.InsertEntry( rString ); - aTitleBox .InsertEntry( rString ); - aListBox .InsertEntry( rString ); - aLabelBox .InsertEntry( rString ); - aIdxBox .InsertEntry( rString ); + aStandardBox.InsertEntry( *it ); + aTitleBox .InsertEntry( *it ); + aListBox .InsertEntry( *it ); + aLabelBox .InsertEntry( *it ); + aIdxBox .InsertEntry( *it ); } } if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_STDFONTS, FALSE, &pItem)) diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx index 355e68bd5c58..4cab48e79d8a 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -58,6 +58,8 @@ #include #endif +#include "vcl/metric.hxx" + using namespace ::com::sun::star; @@ -180,11 +182,21 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh, bDelPrinter = TRUE; } - const USHORT nCount = pPrt->GetFontCount(); - for (USHORT i = 0; i < nCount; ++i) + + // get the set of disctinct available family names + std::set< String > aFontNames; + int nFontNames = pPrt->GetDevFontCount(); + for( int i = 0; i < nFontNames; i++ ) + { + FontInfo aInf( pPrt->GetDevFont( i ) ); + aFontNames.insert( aInf.GetName() ); + } + + // insert to listbox + for( std::set< String >::const_iterator it = aFontNames.begin(); + it != aFontNames.end(); ++it ) { - const String &rStr = pPrt->GetFont(i)->GetName(); - aFontLB.InsertEntry( rStr ); + aFontLB.InsertEntry( *it ); } if( !aOpt.GetFontName().Len() ) -- cgit From d6c96ba8a0fd7ef324cd40fb2525ef15bfb23bdf Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 9 Nov 2010 15:20:35 +0100 Subject: vcl117: #i115477# clean up unused methods --- sfx2/inc/sfx2/printer.hxx | 54 ----------- sfx2/inc/sfx2/viewsh.hxx | 3 - sfx2/source/view/printer.cxx | 221 +------------------------------------------ sfx2/source/view/viewprn.cxx | 23 ----- 4 files changed, 1 insertion(+), 300 deletions(-) diff --git a/sfx2/inc/sfx2/printer.hxx b/sfx2/inc/sfx2/printer.hxx index 7aa79a8a2c30..11f07ea9e7db 100644 --- a/sfx2/inc/sfx2/printer.hxx +++ b/sfx2/inc/sfx2/printer.hxx @@ -34,60 +34,11 @@ #include #endif -class SfxFont; class SfxTabPage; class SfxItemSet; struct SfxPrinter_Impl; -#define SFX_RANGE_NOTSET ((USHORT)0xFFFF) - -// class SfxFontSizeInfo ------------------------------------------------- - -class SfxFontSizeInfo -{ -private: - static USHORT pStaticSizes[]; - Size* pSizes; - USHORT nSizes; - BOOL bScalable; - -public: - SfxFontSizeInfo( const SfxFont& rFont, const OutputDevice& rDevice ); - ~SfxFontSizeInfo(); - - BOOL HasSize(const Size &rSize) const; - BOOL IsScalable() const { return bScalable; } - - USHORT SizeCount() const { return nSizes; } - const Size& GetSize( USHORT nNo ) const - { return pSizes[nNo]; } -}; - -// class SfxFont --------------------------------------------------------- - -class SFX2_DLLPUBLIC SfxFont -{ -private: - String aName; - FontFamily eFamily; - FontPitch ePitch; - CharSet eCharSet; - - SfxFont& operator=(const SfxFont& rFont); // not implemented - -public: - SfxFont( const FontFamily eFam, - const String& aName, - const FontPitch eFontPitch = PITCH_DONTKNOW, - const CharSet eFontCharSet = RTL_TEXTENCODING_DONTKNOW ); - // ZugriffsMethoden: - inline const String& GetName() const { return aName; } - inline FontFamily GetFamily() const { return eFamily; } - inline FontPitch GetPitch() const { return ePitch; } - inline CharSet GetCharSet() const { return eCharSet; } -}; - // class SfxPrinter ------------------------------------------------------ class SFX2_DLLPUBLIC SfxPrinter : public Printer @@ -127,11 +78,6 @@ public: BOOL IsKnown() const { return bKnown; } BOOL IsOriginal() const { return bKnown; } - - using OutputDevice::GetFont; - USHORT GetFontCount(); - const SfxFont* GetFont( USHORT nNo ) const; - const SfxFont* GetFontByName( const String &rFontName ); }; #endif diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index f147c9419ec1..788467edd4bb 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -237,9 +237,6 @@ public: void AdjustVisArea(const Rectangle& rRect); // Printing Interface - virtual void PreparePrint(); - virtual ErrCode DoPrint( SfxPrinter *pPrinter, BOOL bSilent, BOOL bIsAPI ); - virtual USHORT Print( SfxProgress &rProgress, BOOL bIsAPI ); virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE ); virtual USHORT SetPrinter( SfxPrinter *pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=FALSE ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index 243e3c508966..e446b24a1d7a 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -46,54 +46,23 @@ #include "sfxresid.hxx" #include "view.hrc" -#ifdef MSC -// der ist buggy -#define NEW_OBJECTS(Class, nCount) ((Class*) new char[ sizeof(Class) * (nCount) ]) -#else -#define NEW_OBJECTS(Class, nCount) (new Class[nCount]) -#endif - - -USHORT SfxFontSizeInfo::pStaticSizes[] = -{ - 60, - 80, - 100, - 120, - 140, - 180, - 240, - 360, - 480, - 600, - 720 -}; - -//-------------------------------------------------------------------- - -SV_DECL_PTRARR_DEL(SfxFontArr_Impl,SfxFont*,10,5) - // struct SfxPrinter_Impl ------------------------------------------------ struct SfxPrinter_Impl { - SfxFontArr_Impl* mpFonts; BOOL mbAll; BOOL mbSelection; BOOL mbFromTo; BOOL mbRange; SfxPrinter_Impl() : - mpFonts ( NULL ), mbAll ( TRUE ), mbSelection ( TRUE ), mbFromTo ( TRUE ), mbRange ( TRUE ) {} - ~SfxPrinter_Impl() { delete mpFonts; } + ~SfxPrinter_Impl() {} }; -#define FONTS() pImpl->mpFonts - struct SfxPrintOptDlg_Impl { sal_Bool mbHelpDisabled; @@ -102,98 +71,6 @@ struct SfxPrintOptDlg_Impl mbHelpDisabled ( sal_False ) {} }; -//-------------------------------------------------------------------- - -SfxFontSizeInfo::SfxFontSizeInfo( const SfxFont &rFont, - const OutputDevice &rDevice ) : - - pSizes(0), - nSizes(0), - bScalable(TRUE) - -{ - if ( 0 == rDevice.GetDevFontCount() ) - bScalable = FALSE; - else - { - OutputDevice &rDev = (OutputDevice&) rDevice; - Font aFont(rFont.GetName(), Size(0,12)); - aFont.SetFamily(rFont.GetFamily()); - aFont.SetPitch(rFont.GetPitch()); - aFont.SetCharSet(rFont.GetCharSet()); - - // verfuegbare Groessen in die Liste eintragen, Groesse in 10tel Punkt - int nSizeCount = rDev.GetDevFontSizeCount(aFont); - pSizes = NEW_OBJECTS(Size, nSizeCount); - const MapMode aOldMapMode = rDev.GetMapMode(); - MapMode aMap(aOldMapMode); - aMap.SetMapUnit(MAP_POINT); - const Fraction aTen(1, 10); - aMap.SetScaleX(aTen); - aMap.SetScaleY(aTen); - rDev.SetMapMode(aMap); - - // Es gibt Fonts mit Bitmaps und skalierbaren Groessen - // In diesem Fall wird der Fonts als skalierbar behandelt. - BOOL bFoundScalable = FALSE; - for ( int i = 0; i < nSizeCount; ++i ) - { - const Size aSize( rDev.GetDevFontSize(aFont, i) ); - if ( aSize.Height() != 0 ) - pSizes[nSizes++] = aSize; - else - bFoundScalable |= TRUE; - } - if( !bFoundScalable ) - bScalable = FALSE; - else - { - // statische Font-Sizes verwenden - delete [] pSizes; - nSizes = 0; - } - rDev.SetMapMode(aOldMapMode); - } - - if ( 0 == nSizes ) - { - nSizes = sizeof(pStaticSizes) / sizeof(USHORT); - pSizes = NEW_OBJECTS(Size, nSizes); - for ( USHORT nPos = 0; nPos GetName() == rName ) - return pFont; - } - return NULL; -} - -//-------------------------------------------------------------------- - -void SfxPrinter::UpdateFonts_Impl() -{ - VirtualDevice *pVirDev = 0; - const OutputDevice *pOut = this; - - // falls kein Drucker gefunden werden konnte, ein - // temp. Device erzeugen fuer das Erfragen der Fonts - if( !IsValid() ) - pOut = pVirDev = new VirtualDevice; - - int nCount = pOut->GetDevFontCount(); - FONTS() = new SfxFontArr_Impl((BYTE)nCount); - - std::vector< Font > aNonRegularFonts; - for(int i = 0;i < nCount;++i) - { - Font aFont(pOut->GetDevFont(i)); - if ( (aFont.GetItalic() != ITALIC_NONE) || - (aFont.GetWeight() != WEIGHT_MEDIUM) ) - { - // First: Don't add non-regular fonts. The font name is not unique so we have - // to filter the device font list. - aNonRegularFonts.push_back( aFont ); - } - else if ( FONTS()->Count() == 0 || - (*FONTS())[FONTS()->Count()-1]->GetName() != aFont.GetName() ) - { - DBG_ASSERT(0 == SfxFindFont_Impl(*FONTS(), aFont.GetName()), "Doppelte Fonts vom SV-Device!"); - SfxFont* pTmp = new SfxFont( aFont.GetFamily(), aFont.GetName(), - aFont.GetPitch(), aFont.GetCharSet() ); - FONTS()->C40_INSERT(SfxFont, pTmp, FONTS()->Count()); - } - } - delete pVirDev; - - // Try to add all non-regular fonts. It could be that there was no regular font - // with the same name added. - std::vector< Font >::const_iterator pIter; - for ( pIter = aNonRegularFonts.begin(); pIter != aNonRegularFonts.end(); pIter++ ) - { - if ( SfxFindFont_Impl( *FONTS(), pIter->GetName() ) == 0 ) - { - SfxFont* pTmp = new SfxFont( pIter->GetFamily(), pIter->GetName(), - pIter->GetPitch(), pIter->GetCharSet() ); - FONTS()->C40_INSERT( SfxFont, pTmp, FONTS()->Count() ); - } - } -} - -//-------------------------------------------------------------------- - -USHORT SfxPrinter::GetFontCount() -{ - if ( !FONTS() ) - UpdateFonts_Impl(); - return FONTS()->Count(); -} - -//-------------------------------------------------------------------- - -const SfxFont* SfxPrinter::GetFont( USHORT nNo ) const -{ - DBG_ASSERT( FONTS(), "bitte erst GetFontCount() abfragen!" ); - return (*FONTS())[ nNo ]; -} - -//-------------------------------------------------------------------- - -const SfxFont* SfxPrinter::GetFontByName( const String &rFontName ) -{ - if ( !FONTS() ) - UpdateFonts_Impl(); - return SfxFindFont_Impl(*FONTS(), rFontName); -} - -//-------------------------------------------------------------------- - SfxPrintOptionsDialog::SfxPrintOptionsDialog( Window *pParent, SfxViewShell *pViewShell, const SfxItemSet *pSet ) : diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 6f39487b406e..7e71821ac75b 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -855,22 +855,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) //-------------------------------------------------------------------- -void SfxViewShell::PreparePrint() -{ -} - -//-------------------------------------------------------------------- - - -ErrCode SfxViewShell::DoPrint( SfxPrinter* /*pPrinter*/, - BOOL /*bSilent*/, BOOL /*bIsAPI*/ ) -{ - DBG_ERROR( "DoPrint called, dead code !" ); - return ERRCODE_IO_NOTSUPPORTED; -} - -//-------------------------------------------------------------------- - BOOL SfxViewShell::IsPrinterLocked() const { return pImp->m_nPrinterLocks > 0; @@ -900,13 +884,6 @@ void SfxViewShell::LockPrinter( BOOL bLock) //-------------------------------------------------------------------- -USHORT SfxViewShell::Print( SfxProgress& /*rProgress*/, BOOL /*bIsAPI*/ ) -{ - return 0; -} - -//-------------------------------------------------------------------- - SfxPrinter* SfxViewShell::GetPrinter( BOOL /*bCreate*/ ) { return 0; -- cgit From ef82e70080adef60010429f7cacd5ae82be47f54 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 9 Nov 2010 15:20:35 +0100 Subject: vcl117: #i115477# clean up unused methods --- sd/source/ui/inc/ViewShellBase.hxx | 10 ---------- sd/source/ui/view/ViewShellBase.cxx | 33 --------------------------------- 2 files changed, 43 deletions(-) diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx index 463b32ac2fb6..2d1ae6404108 100755 --- a/sd/source/ui/inc/ViewShellBase.hxx +++ b/sd/source/ui/inc/ViewShellBase.hxx @@ -148,16 +148,6 @@ public: ::Window *pParent, const SfxItemSet &rOptions); - /// Forwarded to the print manager. - virtual USHORT Print (SfxProgress& rProgress, BOOL bIsAPI); - - /// Forwarded to the print manager. - virtual ErrCode DoPrint ( - SfxPrinter *pPrinter, - BOOL bSilent, BOOL bIsAPI ); - - virtual void PreparePrint (); - /// Forward methods to main sub shell. virtual void WriteUserDataSequence ( ::com::sun::star::uno::Sequence < diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 244bcc3b4da7..7f6d3be02167 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -667,39 +667,6 @@ SfxTabPage* ViewShellBase::CreatePrintOptionsPage( -USHORT ViewShellBase::Print(SfxProgress&, BOOL bIsAPI) -{ - (void)bIsAPI; - return 0; - // return mpImpl->mpPrintManager->Print (rProgress, bIsAPI, pDlg); -} - - - - -ErrCode ViewShellBase::DoPrint ( - SfxPrinter* pPrinter, - BOOL bSilent, BOOL bIsAPI ) -{ - (void)pPrinter; - (void)bSilent; - (void)bIsAPI; - return 0; - //return mpImpl->mpPrintManager->DoPrint (pPrinter, pPrintDialog, bSilent, bIsAPI ); -} - - - - -void ViewShellBase::PreparePrint () -{ - SfxViewShell::PreparePrint (); - //mpImpl->mpPrintManager->PreparePrint (pPrintDialog); -} - - - - void ViewShellBase::UIActivating( SfxInPlaceClient* pClient ) { mpImpl->ShowViewTabBar(false); -- cgit From b5864fbb817ceb405eb7da4f34d73d7cae69226e Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 9 Nov 2010 15:33:37 +0100 Subject: vcl117: #i115477# clean up dead code --- sc/inc/sc.hrc | 1 - sc/source/ui/docshell/docsh4.cxx | 155 --------------------------------------- sc/source/ui/inc/docsh.hxx | 2 - sc/source/ui/src/scstring.src | 5 -- 4 files changed, 163 deletions(-) diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 159da72a34d2..b38bec784b54 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -928,7 +928,6 @@ #define STR_REPLCELLSWARN (STR_START + 91) #define SCSTR_DPFUNCLISTBOX (STR_START + 92) -#define STR_PRINT_NOTHING (STR_START + 93) #define SCSTR_ALLFILTER (STR_START + 94) #define SCSTR_MOREBTN_MOREOPTIONS (STR_START + 95) #define SCSTR_MOREBTN_FEWEROPTIONS (STR_START + 96) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 4b7f79ddfc51..78287257c080 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1827,161 +1827,6 @@ void ScDocShell::GetStatePageStyle( SfxViewShell& /* rCaller */, } } -void lcl_GetPrintData( ScDocShell* pDocShell /*in*/, - ScDocument* pDocument /*in*/, SfxPrinter* pPrinter /*in*/, - bool bForceSelected /*in*/, - ScMarkData* pMarkData /*inout*/, bool& rbHasOptions /*out*/, - ScPrintOptions& rOptions /*out*/, bool& rbAllTabs /*out*/, - long& rnTotalPages /*out*/, long aPageArr[] /*out*/, - MultiSelection& rPageRanges /*out*/, ScRange** ppMarkedRange /*out*/ ) -{ - // get settings from print options sub-dialog - const SfxItemSet& rOptionSet = pPrinter->GetOptions(); - const SfxPoolItem* pItem; - rbHasOptions = ( rOptionSet.GetItemState( SID_SCPRINTOPTIONS, FALSE, &pItem ) == SFX_ITEM_SET ); - if ( rbHasOptions ) - { - rOptions = ((const ScTpPrintItem*)pItem)->GetPrintOptions(); - } - else - { - // use configuration - rOptions = SC_MOD()->GetPrintOptions(); - } - - // update all pending row heights with a single progress bar, - // instead of a separate progress for each sheet from ScPrintFunc - pDocShell->UpdatePendingRowHeights( MAXTAB, true ); - - // get number of total pages - rnTotalPages = 0; - SCTAB nTabCount = pDocument->GetTableCount(); - for ( SCTAB nTab = 0; nTab < nTabCount; ++nTab ) - { - ScPrintFunc aPrintFunc( pDocShell, pPrinter, nTab, 0, 0, NULL, &rOptions ); - long nThisTab = aPrintFunc.GetTotalPages(); - aPageArr[nTab] = nThisTab; - rnTotalPages += nThisTab; - } - - rPageRanges.SetTotalRange( Range( 0, RANGE_MAX ) ); - rPageRanges.Select( Range( 1, rnTotalPages ) ); - - rbAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); - if ( bForceSelected ) - { - rbAllTabs = false; - } - - if ( bForceSelected ) - { - if ( pMarkData && ( pMarkData->IsMarked() || pMarkData->IsMultiMarked() ) ) - { - pMarkData->MarkToMulti(); - *ppMarkedRange = new ScRange; - pMarkData->GetMultiMarkArea( **ppMarkedRange ); - pMarkData->MarkToSimple(); - } - } - - // get number of total pages if selection - if ( !rbAllTabs ) - { - rnTotalPages = 0; - for ( SCTAB nTab = 0; nTab < nTabCount; ++nTab ) - { - if ( *ppMarkedRange ) // selected range is used instead of print ranges -> page count is different - { - ScPrintFunc aPrintFunc( pDocShell, pPrinter, nTab, 0, 0, *ppMarkedRange, &rOptions ); - aPageArr[nTab] = aPrintFunc.GetTotalPages(); - } - if ( !pMarkData || pMarkData->GetTableSelect( nTab ) ) - { - rnTotalPages += aPageArr[nTab]; - } - } - if ( bForceSelected ) - { - rPageRanges.Select( Range( 1, rnTotalPages ) ); - } - } -} - -bool ScDocShell::CheckPrint( ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI ) -{ - SfxPrinter* pPrinter = GetPrinter(); - if ( !pPrinter ) - { - return false; - } - - bool bHasOptions = false; - ScPrintOptions aOptions; - bool bAllTabs = true; - long nTotalPages = 0; - long aPageArr[MAXTABCOUNT]; // pages per sheet - MultiSelection aPageRanges; // pages to print - ScRange* pMarkedRange = NULL; - - lcl_GetPrintData( this, &aDocument, pPrinter, bForceSelected, - pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages, - aPageArr, aPageRanges, &pMarkedRange ); - - delete pMarkedRange; - - if ( nTotalPages == 0 ) - { - if ( !bIsAPI ) - { - WarningBox aWarningBox( GetActiveDialogParent(), WinBits( WB_OK ), - String( ScResId( STR_PRINT_NOTHING ) ) ); - aWarningBox.Execute(); - } - return false; - } - - return true; -} - -BOOL lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange ) -{ - BOOL bFound = FALSE; - ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); - if (pDrawLayer) - { - SdrPage* pPage = pDrawLayer->GetPage(static_cast(nTab)); - DBG_ASSERT(pPage,"Page ?"); - if (pPage) - { - Rectangle aMMRect; - if ( pRange ) - aMMRect = pDoc->GetMMRect( pRange->aStart.Col(), pRange->aStart.Row(), - pRange->aEnd.Col(), pRange->aEnd.Row(), nTab ); - - SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); - SdrObject* pObject = aIter.Next(); - while (pObject && !bFound) - { - if (pObject->IsTransparent()) - { - if ( pRange ) - { - Rectangle aObjRect = pObject->GetLogicRect(); - if ( aObjRect.IsOver( aMMRect ) ) - bFound = TRUE; - } - else - bFound = TRUE; - } - - pObject = aIter.Next(); - } - } - } - - return bFound; -} - void ScDocShell::GetState( SfxItemSet &rSet ) { SfxWhichIter aIter(rSet); diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index e13bee9d8adc..fe94db107be0 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -302,8 +302,6 @@ public: void DoRecalc( BOOL bApi ); void DoHardRecalc( BOOL bApi ); - bool CheckPrint( ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI ); - void UpdateOle( const ScViewData* pViewData, BOOL bSnapSize = FALSE ); BOOL IsOle(); diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src index d13f3a807ff0..17b7b99b2e04 100644 --- a/sc/source/ui/src/scstring.src +++ b/sc/source/ui/src/scstring.src @@ -553,11 +553,6 @@ String STR_REPLCELLSWARN Text [ en-US ] = "You are pasting data into cells that already contain data.\nDo you really want to overwrite the existing data?"; }; -String STR_PRINT_NOTHING -{ - Text [ en-US ] = "There is nothing to print. The selected print range or sheet is empty."; -}; - String SCSTR_ALLFILTER { Text [ en-US ] = "All"; -- cgit From 2d2592be455526fd7bfa9611eb166f37193fd4d3 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Tue, 9 Nov 2010 15:42:55 +0100 Subject: enable optimized drawing for NSWindows --- vcl/aqua/source/window/salframeview.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm index 240a915e4e12..bc87ea444710 100755 --- a/vcl/aqua/source/window/salframeview.mm +++ b/vcl/aqua/source/window/salframeview.mm @@ -154,7 +154,9 @@ static AquaSalFrame* getMouseContainerFrame() NSRect aRect = { { pFrame->maGeometry.nX, pFrame->maGeometry.nY }, { pFrame->maGeometry.nWidth, pFrame->maGeometry.nHeight } }; pFrame->VCLToCocoa( aRect ); - return [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ]; + NSWindow* pNSWindow = [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ]; + [pNSWindow useOptimizedDrawing: YES]; // OSX recommendation when there are no overlapping subviews within the receiver + return pNSWindow; } -(AquaSalFrame*)getSalFrame -- cgit From 2c3ee5c72d40f9415b52cb0851dd328c254124f6 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 9 Nov 2010 16:43:41 +0100 Subject: vcl117: #i115493# check index for validity --- cui/source/options/optcolor.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index ff10e2744533..bcc4dbf54dcb 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -945,12 +945,14 @@ ColorConfigWindow_Impl::ColorConfigWindow_Impl(Window* pParent, const ResId& rRe aColorBoxes[0]->SetHelpId( aColorLBHids[0] ); + OSL_ENSURE( nCount < sal_Int32(sizeof(aColorLBHids)/sizeof(aColorLBHids[0])), "too few helpIDs for color listboxes" ); for( sal_Int32 i = 1; i < nCount; i++ ) { if(aColorBoxes[i]) { aColorBoxes[i]->CopyEntries( *aColorBoxes[0] ); - aColorBoxes[i]->SetHelpId( aColorLBHids[i] ); + if( i < sal_Int32(sizeof(aColorLBHids)/sizeof(aColorLBHids[0])) ) + aColorBoxes[i]->SetHelpId( aColorLBHids[i] ); } } } -- cgit From 8180400d2cb052932476af3000da55f972b8a84c Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 9 Nov 2010 16:56:47 +0100 Subject: dr77: missing properties --- oox/source/token/properties.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index 4a4f4c0e0e88..7d41b89bfa68 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -394,6 +394,8 @@ ShowPositiveError ShowZeroValues ShrinkToFit Size +Size100thMM +SizePixel SkipDuplicates SortInfo Sound -- cgit From 2311a11aa89539a976a6cbde78bfcff39ee61110 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 9 Nov 2010 19:13:30 +0100 Subject: dr77: missing include --- oox/source/helper/graphichelper.cxx | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 oox/source/helper/graphichelper.cxx diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx old mode 100644 new mode 100755 index 50aeac9c884a..2e5a612699e2 --- a/oox/source/helper/graphichelper.cxx +++ b/oox/source/helper/graphichelper.cxx @@ -38,6 +38,7 @@ #include #include #include "oox/helper/containerhelper.hxx" +#include "oox/helper/propertyset.hxx" #include "oox/token/tokens.hxx" namespace oox { -- cgit From f073a29432ce929aa7bb7028c4ce6219f728e00b Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 10 Nov 2010 10:49:59 +0100 Subject: vcl117: add exceptions to ascfldlg.cxx --- sw/source/ui/dialog/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/ui/dialog/makefile.mk b/sw/source/ui/dialog/makefile.mk index 758ea00fcb10..5d4685ffb9b5 100644 --- a/sw/source/ui/dialog/makefile.mk +++ b/sw/source/ui/dialog/makefile.mk @@ -50,12 +50,12 @@ SRC1FILES = \ wordcountdialog.src EXCEPTIONSFILES = \ + $(SLO)$/ascfldlg.obj \ $(SLO)$/SwSpellDialogChildWindow.obj SLOFILES = \ $(SLO)$/abstract.obj \ $(SLO)$/addrdlg.obj \ - $(SLO)$/ascfldlg.obj \ $(SLO)$/docstdlg.obj \ $(SLO)$/macassgn.obj \ $(SLO)$/SwSpellDialogChildWindow.obj \ -- cgit From 73fa55760d61974485de859782e9821f9a445eb5 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 10 Nov 2010 11:25:27 +0100 Subject: vcl117: add exceptions to optpage.cxx --- sw/source/ui/config/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/ui/config/makefile.mk b/sw/source/ui/config/makefile.mk index 4b8ed01ca90e..af5f8a5bc1c0 100644 --- a/sw/source/ui/config/makefile.mk +++ b/sw/source/ui/config/makefile.mk @@ -51,6 +51,7 @@ SRC1FILES = \ EXCEPTIONSFILES = \ $(SLO)$/mailconfigpage.obj \ $(SLO)$/optcomp.obj \ + $(SLO)$/optpage.obj \ $(SLO)$/optload.obj SLOFILES = \ @@ -61,7 +62,6 @@ SLOFILES = \ $(SLO)$/dbconfig.obj \ $(SLO)$/fontcfg.obj \ $(SLO)$/modcfg.obj \ - $(SLO)$/optpage.obj \ $(SLO)$/prtopt.obj \ $(SLO)$/uinums.obj \ $(SLO)$/usrpref.obj \ -- cgit From 9838822e5885585806a1da77c52755c17ab5a0ff Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Wed, 10 Nov 2010 16:07:20 +0100 Subject: dr77: adaptions to new component registration --- oox/source/core/services.cxx | 5 ---- oox/source/docprop/ooxmldocpropimport.cxx | 2 +- oox/source/xls/ooxformulaparser.cxx | 2 +- oox/util/oox.component | 41 +++++++++++++++++++------------ 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx index 29b31e4672ab..f05524f4d046 100644 --- a/oox/source/core/services.cxx +++ b/oox/source/core/services.cxx @@ -94,9 +94,4 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices ); } -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey ) -{ - return ::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, spServices ); -} - // ============================================================================ diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx index 26e26daad3ad..7f3a08859302 100644 --- a/oox/source/docprop/ooxmldocpropimport.cxx +++ b/oox/source/docprop/ooxmldocpropimport.cxx @@ -57,7 +57,7 @@ using ::rtl::OUString; OUString SAL_CALL DocumentPropertiesImport_getImplementationName() { - return CREATE_OUSTRING( "com.sun.star.comp.oox.docprop.DocumentPropertiesImport" ); + return CREATE_OUSTRING( "com.sun.star.comp.oox.docprop.DocumentPropertiesImporter" ); } Sequence< OUString > SAL_CALL DocumentPropertiesImport_getSupportedServiceNames() diff --git a/oox/source/xls/ooxformulaparser.cxx b/oox/source/xls/ooxformulaparser.cxx index e88218957f7e..efa69abcb750 100644 --- a/oox/source/xls/ooxformulaparser.cxx +++ b/oox/source/xls/ooxformulaparser.cxx @@ -140,7 +140,7 @@ Sequence< OUString > OOXMLFormulaParser_getSupportedServiceNames() OUString OOXMLFormulaParser_getImplementationName() { - return CREATE_OUSTRING( "com.sun.star.comp.oox.OOXMLFormulaParser" ); + return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.FormulaParser" ); } Reference< XInterface > SAL_CALL OOXMLFormulaParser_createInstance( const Reference< XComponentContext >& ) throw( Exception ) diff --git a/oox/util/oox.component b/oox/util/oox.component index 686ee6f1728e..f6519d5a8664 100644 --- a/oox/util/oox.component +++ b/oox/util/oox.component @@ -28,31 +28,40 @@ - - + + - + - - + + - - + + - - + + + - + + + + - - + + + - - + + + - - + + + + + -- cgit From f82c3a7d237a86d4835c3c22e680e3993f1faa18 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 15 Nov 2010 13:05:11 +0100 Subject: vcl117: #i113061# more clarity (thanks cmc!) --- svx/source/gallery2/gallery1.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 419e160e6765..683e993cb3f0 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -626,7 +626,7 @@ BOOL Gallery::CreateTheme( const String& rThemeName, UINT32 nNumFrom ) if( !HasTheme( rThemeName ) && ( GetUserURL().GetProtocol() != INET_PROT_NOT_VALID ) ) { - nLastFileNumber=nNumFrom > nLastFileNumber ? nNumFrom : ++nLastFileNumber; + nLastFileNumber = nNumFrom > nLastFileNumber ? nNumFrom : nLastFileNumber + 1; GalleryThemeEntry* pNewEntry = new GalleryThemeEntry( GetUserURL(), rThemeName, nLastFileNumber, FALSE, FALSE, TRUE, 0, FALSE ); -- cgit From da55906d78a8dc986e25cb13186cb810f021de1a Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 15 Nov 2010 14:08:49 +0100 Subject: vcl117: #i97832# remove unused code (thanks cmc!) --- sfx2/source/appl/appmain.cxx | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx index cf097b900b52..6987d9feabfc 100644 --- a/sfx2/source/appl/appmain.cxx +++ b/sfx2/source/appl/appmain.cxx @@ -116,21 +116,6 @@ void SfxApplication::Init */ { -#ifdef DDE_AVAILABLE -#ifndef DBG_UTIL - InitializeDde(); -#else - if( !InitializeDde() ) - { - ByteString aStr( "Kein DDE-Service moeglich. Fehler: " ); - if( GetDdeService() ) - aStr += GetDdeService()->GetError(); - else - aStr += '?'; - DBG_ASSERT( sal_False, aStr.GetBuffer() ) - } -#endif -#endif } //-------------------------------------------------------------------- -- cgit From 9015fa6906c13e8c2e36ed29f1ce5c222612b6e4 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 15 Nov 2010 16:04:30 +0100 Subject: #i112446# win-port baseline nowdays assumes SalShlData::mbWNT==true --- vcl/win/inc/saldata.hxx | 1 - vcl/win/source/app/saldata.cxx | 37 ++----- vcl/win/source/app/salinst.cxx | 48 +-------- vcl/win/source/gdi/salgdi3.cxx | 208 ++++--------------------------------- vcl/win/source/gdi/winlayout.cxx | 90 +++++----------- vcl/win/source/window/salframe.cxx | 129 ++--------------------- vcl/win/source/window/salobj.cxx | 12 +-- 7 files changed, 63 insertions(+), 462 deletions(-) diff --git a/vcl/win/inc/saldata.hxx b/vcl/win/inc/saldata.hxx index ec67272ed07f..a960d117eed0 100644 --- a/vcl/win/inc/saldata.hxx +++ b/vcl/win/inc/saldata.hxx @@ -154,7 +154,6 @@ struct SalShlData UINT mnWheelScrollChars; // WheelScrollChars UINT mnWheelMsgId; // Wheel-Message-Id fuer W95 WORD mnVersion; // System-Version (311 == 3.11) - WIN_BOOL mbWNT; // kein W16/W95/W98 sondern ein NT WIN_BOOL mbW40; // Is System-Version >= 4.0 WIN_BOOL mbWXP; // Windows XP WIN_BOOL mbWPrinter; // true: use unicode printer functions diff --git a/vcl/win/source/app/saldata.cxx b/vcl/win/source/app/saldata.cxx index bb8a198a96e6..5f94029ad817 100644 --- a/vcl/win/source/app/saldata.cxx +++ b/vcl/win/source/app/saldata.cxx @@ -119,42 +119,28 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 ) LONG ImplSetWindowLong( HWND hWnd, int nIndex, DWORD dwNewLong ) { - if ( aSalShlData.mbWNT ) - return SetWindowLongW( hWnd, nIndex, dwNewLong ); - else - return SetWindowLongA( hWnd, nIndex, dwNewLong ); + return SetWindowLongW( hWnd, nIndex, dwNewLong ); } // ----------------------------------------------------------------------- LONG ImplGetWindowLong( HWND hWnd, int nIndex ) { - if ( aSalShlData.mbWNT ) - return GetWindowLongW( hWnd, nIndex ); - else - return GetWindowLongA( hWnd, nIndex ); + return GetWindowLongW( hWnd, nIndex ); } // ----------------------------------------------------------------------- WIN_BOOL ImplPostMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam ) { - if ( aSalShlData.mbWNT ) - return PostMessageW( hWnd, nMsg, wParam, lParam ); - else - return PostMessageA( hWnd, nMsg, wParam, lParam ); + return PostMessageW( hWnd, nMsg, wParam, lParam ); } // ----------------------------------------------------------------------- WIN_BOOL ImplSendMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam ) { - WIN_BOOL bRet; - if ( aSalShlData.mbWNT ) - bRet = SendMessageW( hWnd, nMsg, wParam, lParam ); - else - bRet = SendMessageA( hWnd, nMsg, wParam, lParam ); - + WIN_BOOL bRet = SendMessageW( hWnd, nMsg, wParam, lParam ); return bRet; } @@ -162,29 +148,20 @@ WIN_BOOL ImplSendMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam ) WIN_BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax ) { - if ( aSalShlData.mbWNT ) - return GetMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax ); - else - return GetMessageA( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax ); + return GetMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax ); } // ----------------------------------------------------------------------- WIN_BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg ) { - if ( aSalShlData.mbWNT ) - return PeekMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg ); - else - return PeekMessageA( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg ); + return PeekMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg ); } // ----------------------------------------------------------------------- LONG ImplDispatchMessage( CONST MSG *lpMsg ) { - if ( aSalShlData.mbWNT ) - return DispatchMessageW( lpMsg ); - else - return DispatchMessageA( lpMsg ); + return DispatchMessageW( lpMsg ); } diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx index 419723ee6442..d05f64d147ed 100644 --- a/vcl/win/source/app/salinst.cxx +++ b/vcl/win/source/app/salinst.cxx @@ -503,7 +503,6 @@ SalInstance* CreateSalInstance() SalData* pSalData = GetSalData(); // determine the windows version - aSalShlData.mbWNT = 0; aSalShlData.mbWXP = 0; aSalShlData.mbWPrinter = 0; WORD nVer = (WORD)GetVersion(); @@ -516,7 +515,6 @@ SalInstance* CreateSalInstance() { if ( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) { - aSalShlData.mbWNT = 1; // Windows XP ? if ( aSalShlData.maVersionInfo.dwMajorVersion > 5 || ( aSalShlData.maVersionInfo.dwMajorVersion == 5 && aSalShlData.maVersionInfo.dwMinorVersion >= 1 ) ) @@ -531,8 +529,6 @@ SalInstance* CreateSalInstance() // register frame class if ( !pSalData->mhPrevInst ) { - if ( aSalShlData.mbWNT ) - { WNDCLASSEXW aWndClassEx; aWndClassEx.cbSize = sizeof( aWndClassEx ); aWndClassEx.style = CS_OWNDC; @@ -568,53 +564,11 @@ SalInstance* CreateSalInstance() aWndClassEx.lpszClassName = SAL_COM_CLASSNAMEW; if ( !RegisterClassExW( &aWndClassEx ) ) return NULL; - } - else - { - WNDCLASSEXA aWndClassEx; - aWndClassEx.cbSize = sizeof( aWndClassEx ); - aWndClassEx.style = CS_OWNDC; - aWndClassEx.lpfnWndProc = SalFrameWndProcA; - aWndClassEx.cbClsExtra = 0; - aWndClassEx.cbWndExtra = SAL_FRAME_WNDEXTRA; - aWndClassEx.hInstance = pSalData->mhInst; - aWndClassEx.hCursor = 0; - aWndClassEx.hbrBackground = 0; - aWndClassEx.lpszMenuName = 0; - aWndClassEx.lpszClassName = SAL_FRAME_CLASSNAMEA; - ImplLoadSalIcon( SAL_RESID_ICON_DEFAULT, aWndClassEx.hIcon, aWndClassEx.hIconSm ); - if ( !RegisterClassExA( &aWndClassEx ) ) - return NULL; - - aWndClassEx.hIcon = 0; - aWndClassEx.hIconSm = 0; - aWndClassEx.style |= CS_SAVEBITS; - aWndClassEx.lpszClassName = SAL_SUBFRAME_CLASSNAMEA; - if ( !RegisterClassExA( &aWndClassEx ) ) - return NULL; - - aWndClassEx.style = 0; - aWndClassEx.lpfnWndProc = SalComWndProcA; - aWndClassEx.cbWndExtra = 0; - aWndClassEx.lpszClassName = SAL_COM_CLASSNAMEA; - if ( !RegisterClassExA( &aWndClassEx ) ) - return NULL; - } } - HWND hComWnd; - if ( aSalShlData.mbWNT ) - { - hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW, + HWND hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW, L"", WS_POPUP, 0, 0, 0, 0, 0, 0, pSalData->mhInst, NULL ); - } - else - { - hComWnd = CreateWindowExA( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEA, - "", WS_POPUP, 0, 0, 0, 0, 0, 0, - pSalData->mhInst, NULL ); - } if ( !hComWnd ) return NULL; diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index c8e0210196e6..29e4bd786735 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -1366,10 +1366,6 @@ int CALLBACK SalEnumQueryFontProcExA( const ENUMLOGFONTEXA*, bool ImplIsFontAvailable( HDC hDC, const UniString& rName ) { - bool bAvailable = false; - - if ( aSalShlData.mbWNT ) - { // Test, if Font available LOGFONTW aLogFont; memset( &aLogFont, 0, sizeof( aLogFont ) ); @@ -1381,27 +1377,9 @@ bool ImplIsFontAvailable( HDC hDC, const UniString& rName ) memcpy( aLogFont.lfFaceName, rName.GetBuffer(), nNameLen*sizeof( wchar_t ) ); aLogFont.lfFaceName[nNameLen] = 0; - EnumFontFamiliesExW( hDC, &aLogFont, (FONTENUMPROCW)SalEnumQueryFontProcExW, - (LPARAM)(void*)&bAvailable, 0 ); - } - else - { - ByteString aTemp = ImplSalGetWinAnsiString( rName ); - - // Test, if Font available - LOGFONTA aLogFont; - memset( &aLogFont, 0, sizeof( aLogFont ) ); - aLogFont.lfCharSet = DEFAULT_CHARSET; - - UINT nNameLen = aTemp.Len(); - if ( nNameLen > sizeof( aLogFont.lfFaceName )-1 ) - nNameLen = sizeof( aLogFont.lfFaceName )-1; - memcpy( aLogFont.lfFaceName, aTemp.GetBuffer(), nNameLen ); - aLogFont.lfFaceName[nNameLen] = 0; - - EnumFontFamiliesExA( hDC, &aLogFont, (FONTENUMPROCA)SalEnumQueryFontProcExA, + bool bAvailable = false; + EnumFontFamiliesExW( hDC, &aLogFont, (FONTENUMPROCW)SalEnumQueryFontProcExW, (LPARAM)(void*)&bAvailable, 0 ); - } return bAvailable; } @@ -1564,7 +1542,7 @@ HFONT WinSalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFont // only required for virtual devices, see below for details hdcScreen = GetDC(0); - if( aSalShlData.mbWNT ) + if( true/*aSalShlData.mbWNT*/ ) { LOGFONTW aLogFont; ImplGetLogFontFromFontSelect( mhDC, i_pFont, aLogFont, true ); @@ -1624,63 +1602,6 @@ HFONT WinSalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFont hNewFont = hNewFont2; } } - else - { - if( !mpLogFont ) - // mpLogFont is needed for getting the kerning pairs - // TODO: get them from somewhere else - mpLogFont = new LOGFONTA; - LOGFONTA& aLogFont = *mpLogFont; - ImplGetLogFontFromFontSelect( mhDC, i_pFont, aLogFont, true ); - - // on the display we prefer Courier New when Courier is a - // bitmap only font and we need to stretch or rotate it - if( mbScreen - && (i_pFont->mnWidth != 0 - || i_pFont->mnOrientation != 0 - || i_pFont->mpFontData == NULL - || (i_pFont->mpFontData->GetHeight() != i_pFont->mnHeight)) - && !bImplSalCourierScalable - && bImplSalCourierNew - && (stricmp( aLogFont.lfFaceName, "Courier" ) == 0) ) - strncpy( aLogFont.lfFaceName, "Courier New", 11 ); - - // limit font requests to MAXFONTHEIGHT to work around driver problems - // TODO: share MAXFONTHEIGHT font instance - if( -aLogFont.lfHeight <= MAXFONTHEIGHT ) - o_rFontScale = 1.0; - else - { - o_rFontScale = -aLogFont.lfHeight / (float)MAXFONTHEIGHT; - aLogFont.lfHeight = -MAXFONTHEIGHT; - aLogFont.lfWidth = static_cast( aLogFont.lfWidth / o_rFontScale ); - } - - hNewFont = ::CreateFontIndirectA( &aLogFont ); - if( hdcScreen ) - { - // select font into screen hdc first to get an antialiased font - // see knowledge base article 305290: - // "PRB: Fonts Not Drawn Antialiased on Device Context for DirectDraw Surface" - ::SelectFont( hdcScreen, ::SelectFont( hdcScreen , hNewFont ) ); - } - o_rOldFont = ::SelectFont( mhDC, hNewFont ); - - TEXTMETRICA aTextMetricA; - // when the font doesn't work try a replacement - if ( !::GetTextMetricsA( mhDC, &aTextMetricA ) ) - { - // the selected font doesn't work => try a replacement - // TODO: use its font fallback instead - LOGFONTA aTempLogFont = aLogFont; - strncpy( aTempLogFont.lfFaceName, "Courier New", 11 ); - aTempLogFont.lfPitchAndFamily = FIXED_PITCH; - HFONT hNewFont2 = CreateFontIndirectA( &aTempLogFont ); - ::SelectFont( mhDC, hNewFont2 ); - ::DeleteFont( hNewFont ); - hNewFont = hNewFont2; - } - } if( hdcScreen ) ::ReleaseDC( NULL, hdcScreen ); @@ -1767,18 +1688,9 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe // temporarily change the HDC to the font in the fallback level HFONT hOldFont = SelectFont( mhDC, mhFonts[nFallbackLevel] ); - if ( aSalShlData.mbWNT ) - { wchar_t aFaceName[LF_FACESIZE+60]; if( ::GetTextFaceW( mhDC, sizeof(aFaceName)/sizeof(wchar_t), aFaceName ) ) pMetric->maName = reinterpret_cast(aFaceName); - } - else - { - char aFaceName[LF_FACESIZE+60]; - if( ::GetTextFaceA( mhDC, sizeof(aFaceName), aFaceName ) ) - pMetric->maName = ImplSalGetUniString( aFaceName ); - } // get the font metric TEXTMETRICA aWinMetric; @@ -1842,11 +1754,6 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe pMetric->mnAscent += nHalfTmpExtLeading; pMetric->mnDescent += nOtherHalfTmpExtLeading; - - // #109280# HACK korean only: increase descent for wavelines and impr - if( !aSalShlData.mbWNT ) - if( mpWinFontData[nFallbackLevel]->SupportsKorean() ) - pMetric->mnDescent += pMetric->mnExtLeading; } pMetric->mnMinKashida = GetMinKashidaWidth(); @@ -2000,8 +1907,6 @@ ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ) } mnFontKernPairCount = 0; - if ( aSalShlData.mbWNT ) - { KERNINGPAIR* pPairs = NULL; int nCount = ::GetKerningPairsW( mhDC, 0, NULL ); if( nCount ) @@ -2019,27 +1924,6 @@ ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ) #endif // GCP_KERN_HACK } } - else - { - if ( !mnFontCharSetCount ) - ImplGetAllFontCharSets( this ); - - if ( mnFontCharSetCount <= 1 ) - ImplAddKerningPairs( this ); - else - { - // Query All Kerning Pairs from all possible CharSets - for ( BYTE i = 0; i < mnFontCharSetCount; i++ ) - { - mpLogFont->lfCharSet = mpFontCharSets[i]; - HFONT hNewFont = CreateFontIndirectA( mpLogFont ); - HFONT hOldFont = SelectFont( mhDC, hNewFont ); - ImplAddKerningPairs( this ); - SelectFont( mhDC, hOldFont ); - DeleteFont( hNewFont ); - } - } - } mbFontKernInit = FALSE; @@ -2270,19 +2154,7 @@ void ImplReleaseTempFonts( SalData& rSalData ) } else { - if( aSalShlData.mbWNT ) - ::RemoveFontResourceW( reinterpret_cast(p->maFontFilePath.getStr()) ); - else - { - // poor man's string conversion because converter is gone - int nLen = p->maFontFilePath.getLength(); - char* pNameA = new char[ nLen + 1 ]; - for( int i = 0; i < nLen; ++i ) - pNameA[i] = (char)(p->maFontFilePath.getStr())[i]; - pNameA[ nLen ] = 0; - ::RemoveFontResourceA( pNameA ); - delete[] pNameA; - } + ::RemoveFontResourceW( reinterpret_cast(p->maFontFilePath.getStr()) ); } rSalData.mpTempFontItem = p->mpNextItem; @@ -2424,14 +2296,6 @@ bool WinSalGraphics::AddTempDevFont( ImplDevFontList* pFontList, return false; UINT nPreferedCharSet = DEFAULT_CHARSET; - if ( !aSalShlData.mbWNT ) - { - // for W98 guess charset preference from active codepage - CHARSETINFO aCharSetInfo; - DWORD nCP = GetACP(); - if ( TranslateCharsetInfo( (DWORD*)nCP, &aCharSetInfo, TCI_SRCCODEPAGE ) ) - nPreferedCharSet = aCharSetInfo.ciCharset; - } // create matching FontData struct aDFA.mbSymbolFlag = false; // TODO: how to know it without accessing the font? @@ -2536,24 +2400,12 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList ) if ( TranslateCharsetInfo( (DWORD*)nCP, &aCharSetInfo, TCI_SRCCODEPAGE ) ) aInfo.mnPreferedCharSet = aCharSetInfo.ciCharset; - if ( aSalShlData.mbWNT ) - { - LOGFONTW aLogFont; - memset( &aLogFont, 0, sizeof( aLogFont ) ); - aLogFont.lfCharSet = DEFAULT_CHARSET; - aInfo.mpLogFontW = &aLogFont; - EnumFontFamiliesExW( mhDC, &aLogFont, + LOGFONTW aLogFont; + memset( &aLogFont, 0, sizeof( aLogFont ) ); + aLogFont.lfCharSet = DEFAULT_CHARSET; + aInfo.mpLogFontW = &aLogFont; + EnumFontFamiliesExW( mhDC, &aLogFont, (FONTENUMPROCW)SalEnumFontsProcExW, (LPARAM)(void*)&aInfo, 0 ); - } - else - { - LOGFONTA aLogFont; - memset( &aLogFont, 0, sizeof( aLogFont ) ); - aLogFont.lfCharSet = DEFAULT_CHARSET; - aInfo.mpLogFontA = &aLogFont; - EnumFontFamiliesExA( mhDC, &aLogFont, - (FONTENUMPROCA)SalEnumFontsProcExA, (LPARAM)(void*)&aInfo, 0 ); - } // Feststellen, was es fuer Courier-Schriften auf dem Bildschirm gibt, // um in SetFont() evt. Courier auf Courier New zu mappen @@ -2592,12 +2444,7 @@ BOOL WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect ) GLYPHMETRICS aGM; aGM.gmptGlyphOrigin.x = aGM.gmptGlyphOrigin.y = 0; aGM.gmBlackBoxX = aGM.gmBlackBoxY = 0; - DWORD nSize = GDI_ERROR; - if ( aSalShlData.mbWNT ) - nSize = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat ); - else if( (nGGOFlags & GGO_GLYPH_INDEX) || (nIndex <= 255) ) - nSize = ::GetGlyphOutlineA( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat ); - + DWORD nSize = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat ); if( nSize == GDI_ERROR ) return false; @@ -2617,7 +2464,6 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex, { rB2DPolyPoly.clear(); - BOOL bRet = FALSE; HDC hDC = mhDC; // use unity matrix @@ -2631,29 +2477,20 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex, nIndex &= GF_IDXMASK; GLYPHMETRICS aGlyphMetrics; - DWORD nSize1 = GDI_ERROR; - if ( aSalShlData.mbWNT ) - nSize1 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat ); - else if( (nGGOFlags & GGO_GLYPH_INDEX) || (nIndex <= 255) ) - nSize1 = ::GetGlyphOutlineA( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat ); - + const DWORD nSize1 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat ); if( !nSize1 ) // blank glyphs are ok - bRet = TRUE; - else if( nSize1 != GDI_ERROR ) - { - BYTE* pData = new BYTE[ nSize1 ]; - DWORD nSize2; - if ( aSalShlData.mbWNT ) - nSize2 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, - &aGlyphMetrics, nSize1, pData, &aMat ); - else - nSize2 = ::GetGlyphOutlineA( hDC, nIndex, nGGOFlags, - &aGlyphMetrics, nSize1, pData, &aMat ); + return TRUE; + else if( nSize1 == GDI_ERROR ) + return FALSE; - if( nSize1 == nSize2 ) - { - bRet = TRUE; + BYTE* pData = new BYTE[ nSize1 ]; + const DWORD nSize2 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, + &aGlyphMetrics, nSize1, pData, &aMat ); + if( nSize1 != nSize2 ) + return FALSE; + + // TODO: avoid tools polygon by creating B2DPolygon directly int nPtSize = 512; Point* pPoints = new Point[ nPtSize ]; BYTE* pFlags = new BYTE[ nPtSize ]; @@ -2791,7 +2628,6 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex, delete[] pPoints; delete[] pFlags; - } delete[] pData; } @@ -2803,7 +2639,7 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex, rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(fFactor, fFactor)); } - return bRet; + return TRUE; } // ----------------------------------------------------------------------- diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index 82fa9bb4b5e1..6a4bbe885bd3 100644 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -244,24 +244,11 @@ HFONT WinLayout::DisableFontScaling() const if( mfFontScale == 1.0 ) return 0; - HFONT hHugeFont = 0; - if( aSalShlData.mbWNT ) - { - LOGFONTW aLogFont; - ::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont); - aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight); - aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth); - hHugeFont = ::CreateFontIndirectW( &aLogFont); - } - else - { - LOGFONTA aLogFont; - ::GetObjectA( mhFont, sizeof(LOGFONTA), &aLogFont); - aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight); - aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth); - hHugeFont = ::CreateFontIndirectA( &aLogFont); - } - + LOGFONTW aLogFont; + ::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont); + aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight); + aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth); + HFONT hHugeFont = ::CreateFontIndirectW( &aLogFont); if( !hHugeFont ) return 0; @@ -671,57 +658,30 @@ void SimpleWinLayout::DrawText( SalGraphics& rGraphics ) const Point aPos = GetDrawPosition( Point( mnBaseAdv, 0 ) ); - // #108267#, limit the number of glyphs to avoid paint errors - UINT limitedGlyphCount = Min( 8192, mnGlyphCount ); - if( mnDrawOptions || aSalShlData.mbWNT ) - { - // #108267#, break up into glyph portions of a limited size required by Win32 API - const unsigned int maxGlyphCount = 8192; - UINT numGlyphPortions = mnGlyphCount / maxGlyphCount; - UINT remainingGlyphs = mnGlyphCount % maxGlyphCount; + // #108267#, break up into glyph portions of a limited size required by Win32 API + const unsigned int maxGlyphCount = 8192; + UINT numGlyphPortions = mnGlyphCount / maxGlyphCount; + UINT remainingGlyphs = mnGlyphCount % maxGlyphCount; - if( numGlyphPortions ) - { - // #108267#,#109387# break up string into smaller chunks - // the output positions will be updated by windows (SetTextAlign) - unsigned int i,n; - POINT oldPos; - UINT oldTa = ::GetTextAlign( aHDC ); - ::SetTextAlign( aHDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP ); - ::MoveToEx( aHDC, aPos.X(), aPos.Y(), &oldPos ); - for( i=n=0; nmhInst, (void*)pFrame ); - } if ( !hWnd ) { delete pFrame; @@ -617,21 +606,10 @@ HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild ) nExSysStyle = 0; } - HWND hWnd = NULL; - if ( aSalShlData.mbWNT ) - { - LPCWSTR pClassName = SAL_SUBFRAME_CLASSNAMEW; - hWnd = CreateWindowExW( nExSysStyle, pClassName, L"", nSysStyle, - CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, - hWndParent, 0, hInstance, (void*)GetWindowPtr( oldhWnd ) ); - } - else - { - LPCSTR pClassName = SAL_SUBFRAME_CLASSNAMEA; - hWnd = CreateWindowExA( nExSysStyle, pClassName, "", nSysStyle, + LPCWSTR pClassName = SAL_SUBFRAME_CLASSNAMEW; + HWND hWnd = CreateWindowExW( nExSysStyle, pClassName, L"", nSysStyle, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, hWndParent, 0, hInstance, (void*)GetWindowPtr( oldhWnd ) ); - } return hWnd; } @@ -2531,7 +2509,7 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf, int nKeyLen = 0; if ( lParam ) { - if ( aSalShlData.mbWNT ) + if ( true/*aSalShlData.mbWNT*/ ) { nKeyLen = GetKeyNameTextW( lParam, aKeyBuf, nMaxKeyLen ); // #i12401# the current unicows.dll has a bug in CharUpperBuffW, which corrupts the stack @@ -2553,32 +2531,6 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf, } } } - else // !mbWnt - { - sal_Char aAnsiKeyBuf[ nMaxKeyLen ]; - int nAnsiKeyLen = GetKeyNameTextA( lParam, aAnsiKeyBuf, nMaxKeyLen ); - DBG_ASSERT( nAnsiKeyLen <= nMaxKeyLen, "Invalid key name length!" ); - if( nAnsiKeyLen > nMaxKeyLen ) - nAnsiKeyLen = 0; - else if( nAnsiKeyLen > 0 ) - { - // Capitalize just the first letter of key names - // TODO: check MCBS key names - CharLowerBuffA( aAnsiKeyBuf, nAnsiKeyLen ); - - bool bUpper = true; - for( sal_Char *pA=aAnsiKeyBuf, *pE=pA+nAnsiKeyLen; pA < pE; ++pA ) - { - if( bUpper ) - CharUpperBuffA( pA, 1 ); - bUpper = (*pA=='+') || (*pA=='-') || (*pA==' ') || (*pA=='.'); - } - - // Convert to Unicode and copy the data in the Unicode Buffer - nKeyLen = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, - aAnsiKeyBuf, nAnsiKeyLen, aKeyBuf, nMaxKeyLen ); - } - } } if ( (nKeyLen > 0) || pReplace ) @@ -3027,7 +2979,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) Font aAppFont = aStyleSettings.GetAppFont(); Font aIconFont = aStyleSettings.GetIconFont(); HDC hDC = GetDC( 0 ); - if ( aSalShlData.mbWNT ) + if( true/*aSalShlData.mbWNT*/ ) { NONCLIENTMETRICSW aNonClientMetrics; aNonClientMetrics.cbSize = sizeof( aNonClientMetrics ); @@ -3044,23 +2996,6 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) ImplSalUpdateStyleFontW( hDC, aLogFont, aIconFont ); } } - else - { - NONCLIENTMETRICSA aNonClientMetrics; - aNonClientMetrics.cbSize = sizeof( aNonClientMetrics ); - if ( SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, sizeof( aNonClientMetrics ), &aNonClientMetrics, 0 ) ) - { - ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfMenuFont, aMenuFont ); - ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfCaptionFont, aTitleFont ); - ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfSmCaptionFont, aFloatTitleFont ); - ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfStatusFont, aHelpFont ); - ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfMessageFont, aAppFont ); - - LOGFONTA aLogFont; - if ( SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0, &aLogFont, 0 ) ) - ImplSalUpdateStyleFontA( hDC, aLogFont, aIconFont ); - } - } // get screen font resolution to calculate toolbox item size long nDPIY = GetDeviceCaps( hDC, LOGPIXELSY ); @@ -3649,27 +3584,7 @@ static void ImplUpdateInputLang( WinSalFrame* pFrame ) // If we are on Windows NT we use Unicode FrameProcs and so we // get Unicode charcodes directly from Windows // no need to set up a code page - if ( aSalShlData.mbWNT ) - return; - - if ( !nLang ) - { - pFrame->mnInputLang = 0; - pFrame->mnInputCodePage = GetACP(); - } - else if ( bLanguageChange ) - { - sal_Char aBuf[10]; - if ( GetLocaleInfoA( MAKELCID( nLang, SORT_DEFAULT ), LOCALE_IDEFAULTANSICODEPAGE, - aBuf, sizeof(aBuf) ) > 0 ) - { - pFrame->mnInputCodePage = ImplStrToNum( aBuf ); - if ( !pFrame->mnInputCodePage ) - pFrame->mnInputCodePage = GetACP(); - } - else - pFrame->mnInputCodePage = GetACP(); - } + return; } @@ -3679,29 +3594,7 @@ static sal_Unicode ImplGetCharCode( WinSalFrame* pFrame, WPARAM nCharCode ) // If we are on Windows NT we use Unicode FrameProcs and so we // get Unicode charcodes directly from Windows - if ( aSalShlData.mbWNT ) - return (sal_Unicode)nCharCode; - - sal_Char aCharBuf[2]; - int nCharLen; - WCHAR c; - if ( nCharCode > 0xFF ) - { - aCharBuf[0] = (sal_Char)(nCharCode>>8); - aCharBuf[1] = (sal_Char)nCharCode; - nCharLen = 2; - } - else - { - aCharBuf[0] = (sal_Char)nCharCode; - nCharLen = 1; - } - if ( ::MultiByteToWideChar( pFrame->mnInputCodePage, - MB_PRECOMPOSED, - aCharBuf, nCharLen, &c, 1 ) ) - return (sal_Unicode)c; - else - return (sal_Unicode)nCharCode; + return (sal_Unicode)nCharCode; } // ----------------------------------------------------------------------- @@ -4507,16 +4400,8 @@ static void ImplHandleSettingsChangeMsg( HWND hWnd, UINT nMsg, { if ( lParam ) { - if ( aSalShlData.mbWNT ) - { if ( ImplSalWICompareAscii( (const wchar_t*)lParam, "devices" ) == 0 ) nSalEvent = SALEVENT_PRINTERCHANGED; - } - else - { - if ( stricmp( (const char*)lParam, "devices" ) == 0 ) - nSalEvent = SALEVENT_PRINTERCHANGED; - } } } diff --git a/vcl/win/source/window/salobj.cxx b/vcl/win/source/window/salobj.cxx index 2f657968284f..4c38ec49d403 100644 --- a/vcl/win/source/window/salobj.cxx +++ b/vcl/win/source/window/salobj.cxx @@ -493,20 +493,10 @@ SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent ) // Hook installieren, wenn es das erste SalObject ist if ( !pSalData->mpFirstObject ) { - if ( aSalShlData.mbWNT ) - { - pSalData->mhSalObjMsgHook = SetWindowsHookExW( WH_CALLWNDPROC, - SalSysMsgProc, - pSalData->mhInst, - pSalData->mnAppThreadId ); - } - else - { - pSalData->mhSalObjMsgHook = SetWindowsHookExA( WH_CALLWNDPROC, + pSalData->mhSalObjMsgHook = SetWindowsHookExW( WH_CALLWNDPROC, SalSysMsgProc, pSalData->mhInst, pSalData->mnAppThreadId ); - } } if ( !pSalData->mbObjClassInit ) -- cgit From b3a698533c14db14beae871486270b752d21774c Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 15 Nov 2010 16:15:10 +0100 Subject: vcl117: #i115133# catch an XError in gtk_im_context_set_cursor_location --- vcl/unx/gtk/window/gtkframe.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index d04d5c0ce684..9181ee3fd40d 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -3339,7 +3339,9 @@ void GtkSalFrame::IMHandler::updateIMSpotLocation() aArea.y = aPosEvent.mnY; aArea.width = aPosEvent.mnWidth; aArea.height = aPosEvent.mnHeight; + m_pFrame->getDisplay()->GetXLib()->PushXErrorLevel( true ); gtk_im_context_set_cursor_location( m_pIMContext, &aArea ); + m_pFrame->getDisplay()->GetXLib()->PopXErrorLevel(); } void GtkSalFrame::IMHandler::setInputContext( SalInputContext* ) -- cgit From cd17f5da7f69678d3cec9af251dbfc3651b950be Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 16 Nov 2010 17:28:04 +0100 Subject: vcl117: add debug clarity --- vcl/unx/source/app/saldisp.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index 354c4d433d42..063b03de7798 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -2575,6 +2575,7 @@ void SalDisplay::PrintInfo() const fprintf( stderr, "\tProperties \t0x%lX\n", GetProperties() ); if( eWindowManager_ != otherwm ) fprintf( stderr, "\tWindowmanager \t%d\n", eWindowManager_ ); + fprintf( stderr, "\tWMName \t%s\n", rtl::OUStringToOString( getWMAdaptor()->getWindowManagerName(), osl_getThreadTextEncoding() ).getStr() ); } fprintf( stderr, "Screen\n" ); fprintf( stderr, "\tResolution/Size \t%ld*%ld %ld*%ld %.1lf\"\n", -- cgit From 269f91cd65551454c94d71bfd6f688c949c22a66 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Tue, 16 Nov 2010 17:31:59 +0100 Subject: #i110171# RIP XLFD --- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 7 +- vcl/unx/inc/saldisp.hxx | 18 - vcl/unx/inc/salgdi.h | 9 +- vcl/unx/inc/xfont.hxx | 162 ----- vcl/unx/source/app/saldisp.cxx | 4 - vcl/unx/source/gdi/makefile.mk | 5 - vcl/unx/source/gdi/salgdi.cxx | 10 +- vcl/unx/source/gdi/salgdi3.cxx | 561 +---------------- vcl/unx/source/gdi/xfont.cxx | 780 ----------------------- vcl/unx/source/gdi/xlfd_attr.cxx | 686 -------------------- vcl/unx/source/gdi/xlfd_attr.hxx | 228 ------- vcl/unx/source/gdi/xlfd_extd.cxx | 1001 ------------------------------ vcl/unx/source/gdi/xlfd_extd.hxx | 272 -------- vcl/unx/source/gdi/xlfd_smpl.cxx | 268 -------- vcl/unx/source/gdi/xlfd_smpl.hxx | 92 --- 15 files changed, 11 insertions(+), 4092 deletions(-) delete mode 100644 vcl/unx/inc/xfont.hxx delete mode 100644 vcl/unx/source/gdi/xfont.cxx delete mode 100644 vcl/unx/source/gdi/xlfd_attr.cxx delete mode 100644 vcl/unx/source/gdi/xlfd_attr.hxx delete mode 100644 vcl/unx/source/gdi/xlfd_extd.cxx delete mode 100644 vcl/unx/source/gdi/xlfd_extd.hxx delete mode 100644 vcl/unx/source/gdi/xlfd_smpl.cxx delete mode 100644 vcl/unx/source/gdi/xlfd_smpl.hxx diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 318f593ac6a3..ff615f5ede74 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -737,7 +737,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, { BOOL returnVal = FALSE; // get a GC with current clipping region set - SelectFont(); + GetFontGC(); // theme changed ? @@ -3687,7 +3687,8 @@ GdkPixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect ) BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect ) { // The GC can't be null, otherwise we'd have no clip region - if( SelectFont() == NULL ) + GC aFontGC = GetFontGC(); + if( aFontGC == NULL ) { std::fprintf(stderr, "salnativewidgets.cxx: no valid GC\n" ); return( FALSE ); @@ -3702,7 +3703,7 @@ BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRe gdk_screen_get_number( gdk_drawable_get_screen( GDK_DRAWABLE(pPixmap) ) ), gdk_drawable_get_depth( GDK_DRAWABLE(pPixmap) ), GetDrawable(), m_nScreen, GetVisual().GetDepth(), - SelectFont(), + aFontGC, 0, 0, dstRect.GetWidth(), dstRect.GetHeight(), dstRect.Left(), dstRect.Top() ); return( TRUE ); diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx index 99c9bea699d6..89efad3cde4d 100644 --- a/vcl/unx/inc/saldisp.hxx +++ b/vcl/unx/inc/saldisp.hxx @@ -269,15 +269,10 @@ public: class SalI18N_InputMethod; class SalI18N_KeyboardExtension; -class XlfdStorage; -class ExtendedFontStruct; -class ExtendedXlfd; class AttributeProvider; class SalUnicodeConverter; class SalConverterCache; -DECLARE_LIST( SalFontCache, ExtendedFontStruct* ) - extern "C" { struct SnDisplay; struct SnLauncheeContext; @@ -349,8 +344,6 @@ protected: SalI18N_KeyboardExtension *mpKbdExtension; AttributeProvider *mpFactory; - XlfdStorage *mpFontList; - const ExtendedXlfd *mpFallbackFactory; Display *pDisp_; // X Display int m_nDefaultScreen; // XDefaultScreen @@ -374,8 +367,6 @@ protected: XLIB_Cursor aPointerCache_[POINTER_COUNT]; SalFrame* m_pCapture; - mutable SalFontCache* m_pFontCache; - // Keyboard BOOL bNumLockFromXS_; // Num Lock handled by X Server int nNumLockIndex_; // modifier index in modmap @@ -397,7 +388,6 @@ protected: mutable XLIB_Time m_nLastUserEventTime; // mutable because changed on first access - void DestroyFontCache(); virtual long Dispatch( XEvent *pEvent ) = 0; void InitXinerama(); void InitRandR( XLIB_Window aRoot ) const; @@ -434,14 +424,6 @@ public: void PrintEvent( const ByteString &rComment, XEvent *pEvent ) const; - XlfdStorage* GetXlfdList() const; - ExtendedFontStruct* - GetFont( const ExtendedXlfd *pFont, - const Size& rPixelSize, sal_Bool bVertical ) const; - const ExtendedXlfd* - GetFallbackFactory() - { return mpFallbackFactory; } - void Beep() const; void ModifierMapping(); diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index b5fdce50eee9..6a77d4bacf96 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -38,8 +38,9 @@ class SalFontCacheItem; #include "vcl/salgtype.hxx" #include "tools/fract.hxx" #include "vcl/dllapi.h" +#include +#include #include -#include "xfont.hxx" // -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= struct ImplFontMetricData; @@ -100,7 +101,6 @@ protected: Pixel nPenPixel_; GC pFontGC_; // Font attributes - ExtendedFontStructRef mXFont[ MAX_FALLBACK ]; ServerFont* mpServerFont[ MAX_FALLBACK ]; SalColor nTextColor_; @@ -185,7 +185,7 @@ protected: const SalBitmap &rTransparentBitmap, SalColor nTransparentColor ); - GC SelectFont(); + GC GetFontGC(); bool setFont( const ImplFontSelectData* pEntry, int nFallbackLevel ); void drawMaskedBitmap( const SalTwoRect* pPosAry, @@ -193,9 +193,6 @@ protected: const SalBitmap& rTransparentBitmap ); protected: - void DrawStringUCS2MB( ExtendedFontStruct& rFont, const Point&, - const sal_Unicode* pStr, int nLength ); - void DrawPrinterString( const SalLayout& ); void DrawServerFontString( const ServerFontLayout& ); diff --git a/vcl/unx/inc/xfont.hxx b/vcl/unx/inc/xfont.hxx deleted file mode 100644 index 4041ed7ce67d..000000000000 --- a/vcl/unx/inc/xfont.hxx +++ /dev/null @@ -1,162 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef EXTENDED_FONTSTRUCT_HXX -#define EXTENDED_FONTSTRUCT_HXX - -#ifndef _XLIB_H_ -#include -#include -#include -#endif -#include -#include -#include -#include - -typedef unsigned short sal_MultiByte; - -class ImplFontMetricData; -class ExtendedXlfd; - -struct VerticalTextItem -{ - BOOL mbFixed; - XFontStruct* mpXFontStruct; - const sal_Unicode* mpString; - int mnLength; - int mnTransX; - int mnTransY; - int mnFixedAdvance; - int* mpAdvanceAry; - - VerticalTextItem( XFontStruct* pXFontStruct, - const sal_Unicode* pString, - int nLength, - int nTransX, - int nTransY, - int nFixedAdvance ) - : mbFixed( TRUE ), - mpXFontStruct( pXFontStruct ), - mpString( pString ), - mnLength( nLength ), - mnTransX( nTransX ), - mnTransY( nTransY ), - mnFixedAdvance( nFixedAdvance ) - {} - - VerticalTextItem( XFontStruct* pXFontStruct, - const sal_Unicode* pString, - int nLength, - int nTransX, - int nTransY, - int* pAdvanceAry ) - : mbFixed( FALSE ), - mpXFontStruct( pXFontStruct ), - mpString( pString ), - mnLength( nLength ), - mnTransX( nTransX ), - mnTransY( nTransY ), - mpAdvanceAry( pAdvanceAry ) - {} - - ~VerticalTextItem() - { - if (!mbFixed) - { - delete( mpAdvanceAry ); - } - } -}; - -class ExtendedFontStruct : public SvRefBase -{ - private: - Display* mpDisplay; - Size maPixelSize; - float mfXScale; - float mfYScale; - sal_Size mnDefaultWidth; - sal_Bool mbVertical; - rtl_TextEncoding mnCachedEncoding; - rtl_TextEncoding mnAsciiEncoding; - - ExtendedXlfd* mpXlfd; - XFontStruct** mpXFontStruct; - - // unicode range cache - mutable sal_uInt32* mpRangeCodes; - mutable int mnRangeCount; - - int LoadEncoding( rtl_TextEncoding nEncoding ); - FontPitch GetSpacing( rtl_TextEncoding nEncoding ); - bool GetFontBoundingBox( XCharStruct *pCharStruct, - int *pAscent, int *pDescent ) ; - - sal_Size GetDefaultWidth(); - sal_Size GetCharWidth8( sal_Unicode nFrom, sal_Unicode nTo, - sal_Int32 *pWidthArray, - rtl_TextEncoding nEncoding ); - sal_Size GetCharWidthUTF16( sal_Unicode nFrom, sal_Unicode nTo, - sal_Int32 *pWidthArray ); - sal_Size GetCharWidth16( sal_Unicode nFrom, sal_Unicode nTo, - sal_Int32 *pWidthArray, ExtendedFontStruct *pFallback ); - public: - ExtendedFontStruct( Display* pDisplay, - const Size& rPixelSize, sal_Bool bVertical, - ExtendedXlfd* pXlfd ); - ~ExtendedFontStruct(); - bool Match( const ExtendedXlfd *pXlfd, - const Size& rPixelSize, sal_Bool bVertical ) const; - XFontStruct* GetFontStruct( rtl_TextEncoding nEncoding ); - XFontStruct* GetFontStruct( sal_Unicode nChar, - rtl_TextEncoding *pEncoding ); - bool ToImplFontMetricData( ImplFontMetricData *pMetric ); - rtl_TextEncoding GetAsciiEncoding( int *pAsciiRange = NULL ) const; - sal_Size GetCharWidth( sal_Unicode, - sal_Int32* pPhysWidth, sal_Int32* pLogWidth ); - int GetFontCodeRanges( sal_uInt32* pCodePairs ) const; - bool HasUnicodeChar( sal_Unicode ) const; -}; - -// Declaration and Implementation for ExtendedFontStructRef: Add RefCounting -// to ExtendedFontStruct (it's not possible to separate decl and impl into -// a separate source file: all ref member functions are inline -SV_DECL_IMPL_REF( ExtendedFontStruct ); - -class X11FontLayout : public GenericSalLayout -{ -public: - X11FontLayout( ExtendedFontStruct& ); - virtual bool LayoutText( ImplLayoutArgs& ); - virtual void AdjustLayout( ImplLayoutArgs& ); - virtual void DrawText( SalGraphics& ) const; - -private: - ExtendedFontStruct& mrFont; -}; - -#endif /* EXTENDED_FONTSTRUCT_HXX */ diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index 063b03de7798..cd3d7ea06fde 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -508,7 +508,6 @@ BOOL SalDisplay::BestVisual( Display *pDisplay, SalDisplay::SalDisplay( Display *display ) : mpInputMethod( NULL ), - mpFallbackFactory ( NULL ), pDisp_( display ), m_pWMAdaptor( NULL ), m_pDtIntegrator( NULL ), @@ -557,7 +556,6 @@ void SalDisplay::doDestruct() m_pDtIntegrator = NULL; X11SalBitmap::ImplDestroyCache(); X11SalGraphics::releaseGlyphPeer(); - DestroyFontCache(); if( IsDisplay() ) { @@ -814,8 +812,6 @@ void SalDisplay::Init() eWindowManager_ = otherwm; nProperties_ = PROPERTY_DEFAULT; hEventGuard_ = NULL; - m_pFontCache = NULL; - mpFontList = (XlfdStorage*)NULL; mpFactory = (AttributeProvider*)NULL; m_pCapture = NULL; m_bXinerama = false; diff --git a/vcl/unx/source/gdi/makefile.mk b/vcl/unx/source/gdi/makefile.mk index 536aadcac015..7e889266a831 100644 --- a/vcl/unx/source/gdi/makefile.mk +++ b/vcl/unx/source/gdi/makefile.mk @@ -53,17 +53,12 @@ SLOFILES= \ $(SLO)$/salvd.obj \ $(SLO)$/dtint.obj \ $(SLO)$/salcvt.obj \ - $(SLO)$/xfont.obj \ - $(SLO)$/xlfd_attr.obj \ - $(SLO)$/xlfd_extd.obj \ - $(SLO)$/xlfd_smpl.obj \ $(SLO)$/salgdi3.obj \ $(SLO)$/gcach_xpeer.obj \ $(SLO)$/xrender_peer.obj \ $(SLO)$/pspgraphics.obj EXCEPTIONSFILES=\ - $(SLO)$/xlfd_extd.obj \ $(SLO)$/salgdi.obj \ $(SLO)$/salbmp.obj \ $(SLO)$/salgdi3.obj \ diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 9215f2e25b16..b2e40310a03e 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -111,12 +111,8 @@ X11SalGraphics::X11SalGraphics() nPenPixel_ = 0; nPenColor_ = MAKE_SALCOLOR( 0x00, 0x00, 0x00 ); // Black - pFontGC_ = NULL; for( int i = 0; i < MAX_FALLBACK; ++i ) - { - mXFont[i] = NULL; mpServerFont[i] = NULL; - } nTextPixel_ = 0; nTextColor_ = MAKE_SALCOLOR( 0x00, 0x00, 0x00 ); // Black @@ -144,7 +140,6 @@ X11SalGraphics::X11SalGraphics() bPrinter_ = FALSE; bVirDev_ = FALSE; bPenGC_ = FALSE; - bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; @@ -174,7 +169,6 @@ void X11SalGraphics::freeResources() if( hBrush_ ) XFreePixmap( pDisplay, hBrush_ ), hBrush_ = None; if( pPenGC_ ) XFreeGC( pDisplay, pPenGC_ ), pPenGC_ = None; - if( pFontGC_ ) XFreeGC( pDisplay, pFontGC_ ), pFontGC_ = None; if( pBrushGC_ ) XFreeGC( pDisplay, pBrushGC_ ), pBrushGC_ = None; if( pMonoGC_ ) XFreeGC( pDisplay, pMonoGC_ ), pMonoGC_ = None; if( pCopyGC_ ) XFreeGC( pDisplay, pCopyGC_ ), pCopyGC_ = None; @@ -189,7 +183,7 @@ void X11SalGraphics::freeResources() if( m_aRenderPicture ) XRenderPeer::GetInstance().FreePicture( m_aRenderPicture ), m_aRenderPicture = 0; - bPenGC_ = bFontGC_ = bBrushGC_ = bMonoGC_ = bCopyGC_ = bInvertGC_ = bInvert50GC_ = bStippleGC_ = bTrackingGC_ = false; + bPenGC_ = bBrushGC_ = bMonoGC_ = bCopyGC_ = bInvertGC_ = bInvert50GC_ = bStippleGC_ = bTrackingGC_ = false; } void X11SalGraphics::SetDrawable( Drawable aDrawable, int nScreen ) @@ -582,7 +576,6 @@ void X11SalGraphics::ResetClipRegion() if( pClipRegion_ ) { bPenGC_ = FALSE; - bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; @@ -632,7 +625,6 @@ bool X11SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) void X11SalGraphics::EndSetClipRegion() { bPenGC_ = FALSE; - bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 62e575ebc5ef..360c7e95d8f9 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -46,11 +46,7 @@ #include "salgdi.h" #include "pspgraphics.h" #include "salvd.h" -#include "xfont.hxx" #include -#include "xlfd_attr.hxx" -#include "xlfd_smpl.hxx" -#include "xlfd_extd.hxx" #include "salcvt.hxx" #include "vcl/printergfx.hxx" @@ -112,391 +108,6 @@ struct _XRegion }; using namespace rtl; -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -// ---------------------------------------------------------------------------- -// -// manage X11 fonts and self rastered fonts -// -// ---------------------------------------------------------------------------- - -#ifndef _USE_PRINT_EXTENSION_ - -class FontLookup -{ - public: - - struct hash; - struct equal; - typedef ::std::hash_set< FontLookup, - FontLookup::hash, - FontLookup::equal > fl_hashset; - - private: - - rtl::OString maName; - FontWeight mnWeight; - FontItalic mnItalic; - sal_Bool mbDisplay; - - public: - - FontLookup ( ::std::list< psp::fontID >::iterator& it, - const psp::PrintFontManager& rMgr ); - FontLookup (const Xlfd& rFont); - FontLookup (const FontLookup &rRef) : - maName (rRef.maName), - mnWeight (rRef.mnWeight), - mnItalic (rRef.mnItalic), - mbDisplay(rRef.mbDisplay) - {} - ~FontLookup () - {} - - static void BuildSet (fl_hashset& rSet); - static bool InSet (const fl_hashset& rSet, const Xlfd& rXfld); - bool InSet (const fl_hashset& rSet) const; - - bool operator== (const FontLookup &rRef) const - { - return (abs(mnWeight - rRef.mnWeight) < 2) - && (mnItalic == rRef.mnItalic) - && (maName == rRef.maName) - && (mbDisplay== rRef.mbDisplay); - } - FontLookup& operator= (const FontLookup &rRef) - { - mnWeight = rRef.mnWeight; - mnItalic = rRef.mnItalic; - maName = rRef.maName; - mbDisplay= rRef.mbDisplay; - - return *this; - } - size_t Hash() const - { - return maName.hashCode (); - } - - struct equal - { - bool operator()(const FontLookup &r1, const FontLookup &r2) const - { - return r1 == r2; - } - }; - struct hash - { - size_t operator()(const FontLookup &rArg) const - { - return rArg.Hash(); - } - }; -}; - -FontLookup::FontLookup ( ::std::list< psp::fontID >::iterator& it, - const psp::PrintFontManager& rMgr ) -{ - psp::FastPrintFontInfo aInfo; - if (rMgr.getFontFastInfo (*it, aInfo)) - { - mnItalic = PspGraphics::ToFontItalic (aInfo.m_eItalic); - mnWeight = PspGraphics::ToFontWeight (aInfo.m_eWeight); - mbDisplay= aInfo.m_eType == psp::fonttype::Builtin - || aInfo.m_eType == psp::fonttype::Unknown ? False : True; - maName = rtl::OUStringToOString - ( aInfo.m_aFamilyName, - RTL_TEXTENCODING_ISO_8859_1).toAsciiLowerCase(); - - sal_Int32 n_length = maName.getLength(); - const sal_Char* p_from = maName.getStr(); - sal_Char* p_to = (sal_Char*)alloca (n_length + 1); - - sal_Int32 i, j; - for (i = 0, j = 0; i < n_length; i++) - { - if ( p_from[i] != ' ' ) - p_to[j++] = p_from[i]; - } - maName = rtl::OString (p_to, j); - if (mnItalic == ITALIC_OBLIQUE) - mnItalic = ITALIC_NORMAL; - } - else - { - mnItalic = ITALIC_DONTKNOW; - mnWeight = WEIGHT_DONTKNOW; - mbDisplay= False; - } -} - -FontLookup::FontLookup (const Xlfd& rFont) -{ - AttributeProvider* pFactory = rFont.mpFactory; - Attribute* pAttr; - - pAttr = pFactory->RetrieveSlant (rFont.mnSlant); - mnItalic = (FontItalic)pAttr->GetValue(); - pAttr = pFactory->RetrieveWeight (rFont.mnWeight); - mnWeight = (FontWeight)pAttr->GetValue(); - pAttr = pFactory->RetrieveFamily (rFont.mnFamily); - maName = pAttr->GetKey(); - - if (mnItalic == ITALIC_OBLIQUE) - mnItalic = ITALIC_NORMAL; - - mbDisplay = True; -} - -void -FontLookup::BuildSet (FontLookup::fl_hashset &rSet) -{ - ::std::list< psp::fontID > aIdList; - - psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); - rMgr.getFontList( aIdList, NULL, false ); - - ::std::list< psp::fontID >::iterator it; - for (it = aIdList.begin(); it != aIdList.end(); ++it) - { - FontLookup aItem (it, rMgr); - rSet.insert (aItem); - } -} - -bool -FontLookup::InSet (const FontLookup::fl_hashset& rSet) const -{ - fl_hashset::const_iterator it = rSet.find(*this); - return it == rSet.end() ? false : true; -} - -bool -FontLookup::InSet (const FontLookup::fl_hashset& rSet, const Xlfd& rXlfd) -{ - FontLookup aNeedle (rXlfd); - return aNeedle.InSet (rSet); -} - -#endif - -// ---------------------------------------------------------------------------- -// -// SalDisplay -// -// ---------------------------------------------------------------------------- - -XlfdStorage* -SalDisplay::GetXlfdList() const -{ - if ( mpFontList != NULL ) - { - return mpFontList; - } - else - { - const_cast(this)->mpFactory = new AttributeProvider; - const_cast(this)->mpFontList = new XlfdStorage; - const_cast(this)->mpFallbackFactory = new VirtualXlfd; - - int i, nFontCount; - const int nMaxCount = 64 * 1024 - 1; - Display *pDisplay = GetDisplay(); - char **ppFontList = XListFonts(pDisplay, "-*", nMaxCount, &nFontCount); - - // - // create a list of simple Xlfd font information - // - - Xlfd *pXlfdList = (Xlfd*)malloc( nFontCount * sizeof(Xlfd) ); - int nXlfdCount = 0; - - for ( i = 0; i < nFontCount; i++ ) - { - if ( pXlfdList[ nXlfdCount ].FromString(ppFontList[i], mpFactory) ) - ++nXlfdCount; - } - - XFreeFontNames( ppFontList ); - - mpFactory->AddClassification(); - // add some pretty print description - mpFactory->AddAnnotation(); - // misc feature checking - mpFactory->TagFeature(); - - // sort according to font style - qsort( pXlfdList, nXlfdCount, sizeof(Xlfd), XlfdCompare ); - -#ifndef _USE_PRINT_EXTENSION_ - // create a list of fonts already managed by the fontmanager - FontLookup::fl_hashset aSet; - FontLookup::BuildSet (aSet); -#endif - - // - // create a font list with merged encoding information - // - - BitmapXlfdStorage aBitmapList; - ScalableXlfd *pScalableFont = NULL; - - int nFrom = 0; - for ( i = 0; i < nXlfdCount; i++ ) - { - // exclude openlook glyph and cursor - Attribute *pAttr = mpFactory->RetrieveFamily(pXlfdList[i].mnFamily); - if ( pAttr->HasFeature( XLFD_FEATURE_OL_GLYPH - | XLFD_FEATURE_OL_CURSOR) ) - continue; - // exclude fonts with unknown encoding - if ( pXlfdList[i].GetEncoding() == RTL_TEXTENCODING_DONTKNOW ) - continue; - // exclude "interface system" and "interface user" - if (pAttr->HasFeature( XLFD_FEATURE_APPLICATION_FONT ) ) - continue; - // exclude fonts already managed by fontmanager, anyway keep - // gui fonts: they are candidates for GetInterfaceFont () - if (pXlfdList[i].Fonttype() == eTypeScalable) - ((VirtualXlfd*)mpFallbackFactory)->FilterInterfaceFont (pXlfdList + i); -#ifndef _USE_PRINT_EXTENSION_ - if (FontLookup::InSet (aSet, pXlfdList[i])) - continue; -#endif - Bool bSameOutline = pXlfdList[i].SameFontoutline(pXlfdList + nFrom); - XlfdFonttype eType = pXlfdList[i].Fonttype(); - - // flush the old merged font list if the name doesn't match any more - if ( !bSameOutline ) - { - mpFontList->Add( pScalableFont ); - mpFontList->Add( &aBitmapList ); - pScalableFont = NULL; - aBitmapList.Reset(); - } - - // merge the font or generate a new one - switch( eType ) - { - case eTypeScalable: - if ( pScalableFont == NULL ) - pScalableFont = new ScalableXlfd; - pScalableFont->AddEncoding(pXlfdList + i); - break; - - case eTypeBitmap: - aBitmapList.AddBitmapFont( pXlfdList + i ); - break; - - case eTypeScalableBitmap: - // ignore scaled X11 bitmap fonts because they look too ugly - default: - break; - } - - nFrom = i; - } - - // flush the merged list into the global list - mpFontList->Add( pScalableFont ); - mpFontList->Add( &aBitmapList ); - if (mpFallbackFactory->NumEncodings() > 0) - mpFontList->Add( mpFallbackFactory ); - // cleanup the list of simple font information - if ( pXlfdList != NULL ) - free( pXlfdList ); - - return mpFontList; - } -} - -// --------------------------------------------------------------------------- - -ExtendedFontStruct* -SalDisplay::GetFont( const ExtendedXlfd *pRequestedFont, - const Size& rPixelSize, sal_Bool bVertical ) const -{ - // TODO: either get rid of X11 fonts or get rid of the non-hashmapped cache - if( !m_pFontCache ) - { - m_pFontCache = new SalFontCache( 64, 64, 16 ); // ??? - } - else - { - ExtendedFontStruct *pItem; - for ( pItem = m_pFontCache->First(); - pItem != NULL; - pItem = m_pFontCache->Next() ) - { - if ( pItem->Match(pRequestedFont, rPixelSize, bVertical) ) - { - if( m_pFontCache->GetCurPos() ) - { - m_pFontCache->Remove( pItem ); - m_pFontCache->Insert( pItem, 0UL ); - } - return pItem; - } - } - } - - // before we expand the cache, we look for very old and unused items - if( m_pFontCache->Count() >= 64 ) - { - ExtendedFontStruct *pItem; - for ( pItem = m_pFontCache->Last(); - pItem != NULL; - pItem = m_pFontCache->Prev() ) - { - if( 1 == pItem->GetRefCount() ) - { - m_pFontCache->Remove( pItem ); - pItem->ReleaseRef(); - if( m_pFontCache->Count() < 64 ) - break; - } - } - } - - ExtendedFontStruct *pItem = new ExtendedFontStruct( GetDisplay(), - rPixelSize, bVertical, - const_cast(pRequestedFont) ); - m_pFontCache->Insert( pItem, 0UL ); - pItem->AddRef(); - - return pItem; -} - -// --------------------------------------------------------------------------- - -void -SalDisplay::DestroyFontCache() -{ - if( m_pFontCache ) - { - ExtendedFontStruct *pItem = m_pFontCache->First(); - while( pItem ) - { - delete pItem; - pItem = m_pFontCache->Next(); - } - delete m_pFontCache; - } - if( mpFontList ) - { - mpFontList->Dispose(); - delete mpFontList; - } - if ( mpFactory ) - { - delete mpFactory; - } - - m_pFontCache = (SalFontCache*)NULL; - mpFontList = (XlfdStorage*)NULL; - mpFactory = (AttributeProvider*)NULL; -} - // =========================================================================== // PspKernInfo allows on-demand-querying of psprint provided kerning info (#i29881#) @@ -538,7 +149,7 @@ void PspKernInfo::Initialize() const // ---------------------------------------------------------------------------- GC -X11SalGraphics::SelectFont() +X11SalGraphics::GetFontGC() { Display *pDisplay = GetXDisplay(); @@ -594,8 +205,6 @@ bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLev // release all no longer needed font resources for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i ) { - mXFont[i] = NULL; // ->ReleaseRef() - if( mpServerFont[i] != NULL ) { // old server side font is no longer referenced @@ -614,18 +223,6 @@ bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLev if( !pEntry->mpFontData ) return false; - // handle the request for a native X11-font - if( ImplX11FontData::CheckFontData( *pEntry->mpFontData ) ) - { - const ImplX11FontData* pRequestedFont = static_cast( pEntry->mpFontData ); - const ExtendedXlfd& rX11Font = pRequestedFont->GetExtendedXlfd(); - - Size aReqSize( pEntry->mnWidth, pEntry->mnHeight ); - mXFont[ nFallbackLevel ] = GetDisplay()->GetFont( &rX11Font, aReqSize, bFontVertical_ ); - bFontGC_ = FALSE; - return true; - } - // handle the request for a non-native X11-font => use the GlyphCache ServerFont* pServerFont = GlyphCache::GetInstance().CacheFont( *pEntry ); if( pServerFont != NULL ) @@ -674,83 +271,6 @@ void ImplServerFontEntry::HandleFontOptions( void ) //-------------------------------------------------------------------------- -inline sal_Unicode SwapBytes( const sal_Unicode nIn ) -{ - return ((nIn >> 8) & 0x00ff) | ((nIn & 0x00ff) << 8); -} - -// draw string in a specific multibyte encoding -static void -ConvertTextItem16( XTextItem16* pTextItem, rtl_TextEncoding nEncoding ) -{ - if ( (pTextItem == NULL) || (pTextItem->nchars <= 0) ) - return; - - SalConverterCache* pCvt = SalConverterCache::GetInstance(); - // convert the string into the font encoding - sal_Size nSize; - sal_Size nBufferSize = pTextItem->nchars * 2; - sal_Char *pBuffer = (sal_Char*)alloca( nBufferSize ); - - nSize = pCvt->ConvertStringUTF16( (sal_Unicode*)pTextItem->chars, pTextItem->nchars, - pBuffer, nBufferSize, nEncoding); - - sal_Char *pTextChars = (sal_Char*)pTextItem->chars; - unsigned int n = 0, m = 0; - - if ( nEncoding == RTL_TEXTENCODING_GB_2312 - || nEncoding == RTL_TEXTENCODING_GBT_12345 - || nEncoding == RTL_TEXTENCODING_GBK - || nEncoding == RTL_TEXTENCODING_BIG5 ) - { - // GB and Big5 needs special treatment since chars can be single or - // double byte: encoding is - // [ 0x00 - 0x7f ] | [ 0x81 - 0xfe ] [ 0x40 - 0x7e 0x80 - 0xfe ] - while ( n < nSize ) - { - if ( (unsigned char)pBuffer[ n ] < 0x80 ) - { - pTextChars[ m++ ] = 0x0; - pTextChars[ m++ ] = pBuffer[ n++ ]; - } - else - { - pTextChars[ m++ ] = pBuffer[ n++ ]; - pTextChars[ m++ ] = pBuffer[ n++ ]; - } - } - pTextItem->nchars = m / 2; - } - else - if ( pCvt->IsSingleByteEncoding(nEncoding) ) - { - // Single Byte encoding has to be padded - while ( n < nSize ) - { - pTextChars[ m++ ] = 0x0; - pTextChars[ m++ ] = pBuffer[ n++ ]; - } - pTextItem->nchars = nSize; - } - else - { - while ( n < nSize ) - { - pTextChars[ m++ ] = pBuffer[ n++ ]; - } - pTextItem->nchars = nSize / 2; - } - - // XXX FIXME - if ( (nEncoding == RTL_TEXTENCODING_GB_2312) - || (nEncoding == RTL_TEXTENCODING_EUC_KR) ) - { - for (unsigned int n_char = 0; n_char < m; n_char++ ) - pTextChars[ n_char ] &= 0x7F; - } -} - -//-------------------------------------------------------------------------- namespace { class CairoWrapper @@ -1289,7 +809,7 @@ bool X11SalGraphics::DrawServerAAForcedString( const ServerFontLayout& rLayout ) } // prepare context - GC nGC = SelectFont(); + GC nGC = GetFontGC(); XGCValues aGCVal; XGetGCValues( pDisplay, nGC, GCForeground, &aGCVal ); @@ -1376,7 +896,7 @@ void X11SalGraphics::DrawServerSimpleFontString( const ServerFontLayout& rSalLay X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer(); Display* pDisplay = GetXDisplay(); - GC nGC = SelectFont(); + GC nGC = GetFontGC(); XGCValues aGCVal; aGCVal.fill_style = FillStippled; @@ -1439,61 +959,6 @@ void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) //-------------------------------------------------------------------------- -void X11SalGraphics::DrawStringUCS2MB( ExtendedFontStruct& rFont, - const Point& rPoint, const sal_Unicode* pStr, int nLength ) -{ - Display* pDisplay = GetXDisplay(); - GC nGC = SelectFont(); - - if( rFont.GetAsciiEncoding() == RTL_TEXTENCODING_UNICODE ) - { - // plain Unicode, can handle all chars and can be handled straight forward - XFontStruct* pFontStruct = rFont.GetFontStruct( RTL_TEXTENCODING_UNICODE ); - if( !pFontStruct ) - return; - - XSetFont( pDisplay, nGC, pFontStruct->fid ); - - #ifdef OSL_LITENDIAN - sal_Unicode *pBuffer = (sal_Unicode*)alloca( nLength * sizeof(sal_Unicode) ); - for ( int i = 0; i < nLength; i++ ) - pBuffer[ i ] = SwapBytes(pStr[ i ]) ; - #else - sal_Unicode *pBuffer = const_cast(pStr); - #endif - - XDrawString16( pDisplay, hDrawable_, nGC, rPoint.X(), rPoint.Y(), (XChar2b*)pBuffer, nLength ); - } - else - { - XTextItem16 *pTextItem = (XTextItem16*)alloca( nLength * sizeof(XTextItem16) ); - XChar2b *pMBChar = (XChar2b*)pStr; - int nItem = 0; - - DBG_ASSERT( nLength<=1, "#i49902# DrawStringUCS2MB with nLength>1 => problems with XOrg6.8.[0123]"); - - for( int nChar = 0; nChar < nLength; ++nChar ) - { - rtl_TextEncoding nEnc; - XFontStruct* pFontStruct = rFont.GetFontStruct( pStr[nChar], &nEnc ); - if( !pFontStruct ) - continue; - - pTextItem[ nItem ].chars = pMBChar + nChar; - pTextItem[ nItem ].delta = 0; - pTextItem[ nItem ].font = pFontStruct->fid; - pTextItem[ nItem ].nchars = 1; - - ConvertTextItem16( &pTextItem[ nItem ], nEnc ); - ++nItem; - } - - XDrawText16( pDisplay, hDrawable_, nGC, rPoint.X(), rPoint.Y(), pTextItem, nItem ); - } -} - -//-------------------------------------------------------------------------- - const ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const { if( !mpServerFont[0] ) @@ -1528,7 +993,6 @@ X11SalGraphics::SetTextColor( SalColor nSalColor ) { nTextColor_ = nSalColor; nTextPixel_ = GetPixel( nSalColor ); - bFontGC_ = FALSE; } } @@ -1575,15 +1039,6 @@ void RegisterFontSubstitutors( ImplDevFontList* ); void X11SalGraphics::GetDevFontList( ImplDevFontList *pList ) { - // allow disabling of native X11 fonts - static const char* pEnableX11FontStr = getenv( "SAL_ENABLE_NATIVE_XFONTS" ); - if( pEnableX11FontStr && (pEnableX11FontStr[0] != '0') ) - { - // announce X11 fonts - XlfdStorage* pX11FontList = GetDisplay()->GetXlfdList(); - pX11FontList->AnnounceFonts( pList ); - } - // prepare the GlyphCache using psprint's font infos X11GlyphCache& rGC = X11GlyphCache::GetInstance(); @@ -1766,12 +1221,6 @@ X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel ) long rDummyFactor; mpServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor ); } - else if( mXFont[nFallbackLevel] != NULL ) - { - mXFont[nFallbackLevel]->ToImplFontMetricData( pMetric ); - if ( bFontVertical_ ) - pMetric->mnOrientation = 0; - } } // --------------------------------------------------------------------------- @@ -1859,10 +1308,6 @@ SalLayout* X11SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe #endif pLayout = new ServerFontLayout( *mpServerFont[ nFallbackLevel ] ); } - else if( mXFont[ nFallbackLevel ] ) - pLayout = new X11FontLayout( *mXFont[ nFallbackLevel ] ); - else - pLayout = NULL; return pLayout; } diff --git a/vcl/unx/source/gdi/xfont.cxx b/vcl/unx/source/gdi/xfont.cxx deleted file mode 100644 index f6d19909cd4a..000000000000 --- a/vcl/unx/source/gdi/xfont.cxx +++ /dev/null @@ -1,780 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" - -#include -#include "xfont.hxx" -#include "xlfd_extd.hxx" -#include "salcvt.hxx" -#include -#include -#include -#include - -// for GetMirroredChar -#include - -#if OSL_DEBUG_LEVEL > 1 -#include -#endif - -#include - -#define VCLASS_ROTATE 0 -#define VCLASS_ROTATE_REVERSE 1 -#define VCLASS_TRANSFORM1 2 -#define VCLASS_TRANSFORM2 3 -#define VCLASS_CJK 4 -#define VCLASS_DONTKNOW 5 -#define VCLASS_FONT_NUM 2 // Other than rotate and rotate_reverse, - // don't have spacial font - -// Select the max size of a font, which is token for real -// This routine is (and should be) called only once, the result should be -// stored in some static variable - -static int GetMaxFontHeight() -{ - static int nMaxFontHeight = 0; - if( nMaxFontHeight <= 0 ) - { - const char *pFontHeight = getenv ("SAL_MAXFONTHEIGHT"); - if( pFontHeight ) - nMaxFontHeight = atoi( pFontHeight ); - static const int DEFAULT_MAXFONTHEIGHT = 250; - if (nMaxFontHeight <= 20) - nMaxFontHeight = DEFAULT_MAXFONTHEIGHT; - } - - return nMaxFontHeight; -} - - -ExtendedFontStruct::ExtendedFontStruct( Display* pDisplay, const Size& rPixelSize, - sal_Bool bVertical, ExtendedXlfd* pXlfd ) : - mpDisplay( pDisplay ), - maPixelSize( rPixelSize ), - mfXScale(1.0), mfYScale(1.0), - mbVertical( bVertical ), - mnCachedEncoding( RTL_TEXTENCODING_DONTKNOW ), - mpXlfd( pXlfd ), - mpRangeCodes(NULL), - mnRangeCount(-1) -{ - if( !maPixelSize.Width() ) - maPixelSize.Width() = maPixelSize.Height(); - mnAsciiEncoding = GetAsciiEncoding (NULL); - mnDefaultWidth = GetDefaultWidth(); - - mpXFontStruct = (XFontStruct**)calloc( mpXlfd->NumEncodings(), - sizeof(XFontStruct*) ); -} - -ExtendedFontStruct::~ExtendedFontStruct() -{ - delete[] mpRangeCodes; - - for ( int nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ ) - if ( mpXFontStruct[nIdx] != NULL ) - XFreeFont( mpDisplay, mpXFontStruct[nIdx] ); - - free(mpXFontStruct); -} - -rtl_TextEncoding -ExtendedFontStruct::GetAsciiEncoding( int *pAsciiRange ) const -{ - return mpXlfd->GetAsciiEncoding( pAsciiRange ); -} - -FontPitch -ExtendedFontStruct::GetSpacing( rtl_TextEncoding nEncoding ) -{ - return mpXlfd->GetPitch( nEncoding ); -} - -static XFontStruct* -LoadXFont (Display* pDisplay, const char* pFontName) -{ - XFontStruct* pFont = XLoadQueryFont (pDisplay, pFontName); - if ((pFont != NULL) && (pFont->fid == 0)) - pFont->fid = XLoadFont(pDisplay, pFontName); - -#ifdef HDU_DEBUG - fprintf( stderr, "XLoadFont \"%s\" => %d\n", pFontName, (pFont!= NULL) ); -#endif - return pFont; -} - -int -ExtendedFontStruct::LoadEncoding( rtl_TextEncoding nEncoding ) -{ - int nIdx = mpXlfd->GetEncodingIdx( nEncoding ); - if ( (nIdx < 0) || (mpXFontStruct[ nIdx ] != NULL) ) - return nIdx; - - // limit font height that gets requested from the XServer - // see BugId #44528# FontWork (-> #45038#) and as well Bug #47127# - int nReqPixelHeight = maPixelSize.Height(); - if( nReqPixelHeight > GetMaxFontHeight() ) - nReqPixelHeight = GetMaxFontHeight(); - else if( nReqPixelHeight < 2 ) - nReqPixelHeight = 2; - - // get the X11 font from a matching XLFD - ByteString aFontName; - mpXlfd->ToString( aFontName, nReqPixelHeight, nEncoding ); - mpXFontStruct[ nIdx ] = LoadXFont( mpDisplay, aFontName.GetBuffer() ); - if (mpXFontStruct[nIdx] == NULL) - mpXFontStruct[nIdx] = LoadXFont( mpDisplay, "fixed" ); - - // calculate correction factors to improve matching - // the selected font size to the used bitmap font - int nRealPixelSize = mpXlfd->GetPixelSize(); - if( !nRealPixelSize ) // check for scalable mpXlfd - nRealPixelSize = nReqPixelHeight; - if( nRealPixelSize && (nRealPixelSize != maPixelSize.Width()) ) - mfXScale = (float)maPixelSize.Width() / nRealPixelSize; - if( nRealPixelSize && (nRealPixelSize != maPixelSize.Height()) ) - mfYScale = (float)maPixelSize.Height() / nRealPixelSize; - - return nIdx; -} - -XFontStruct* -ExtendedFontStruct::GetFontStruct( rtl_TextEncoding nEncoding ) -{ - int nIdx = LoadEncoding( nEncoding ); - return nIdx < 0 ? NULL : mpXFontStruct[nIdx] ; -} - -bool -ExtendedFontStruct::GetFontBoundingBox( XCharStruct *pCharStruct, - int *pAscent, int *pDescent ) -{ - pCharStruct->lbearing = 0; - pCharStruct->rbearing = 0; - pCharStruct->width = 0; - pCharStruct->ascent = 0; - pCharStruct->descent = 0; - - *pAscent = 0; - *pDescent = 0; - - int nIdx; - - // check if there is at least one encoding already loaded - bool bEmpty = true; - for ( nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ ) - bEmpty &= (mpXFontStruct[nIdx] == NULL); - if ( bEmpty ) - LoadEncoding( mpXlfd->GetAsciiEncoding() ); - - // get the max bounding box from all font structs - for ( nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ ) - if ( mpXFontStruct[ nIdx ] != NULL ) - { - *pAscent = std::max( mpXFontStruct[nIdx]->ascent, *pAscent ); - *pDescent = std::max( mpXFontStruct[nIdx]->descent, *pDescent ); - - XCharStruct* pMaxBounds = &(mpXFontStruct[nIdx]->max_bounds); - - pCharStruct->lbearing = std::max( pMaxBounds->lbearing, - pCharStruct->lbearing ); - pCharStruct->rbearing = std::max( pMaxBounds->rbearing, - pCharStruct->rbearing ); - pCharStruct->width = std::max( pMaxBounds->width, - pCharStruct->width ); - pCharStruct->ascent = std::max( pMaxBounds->ascent, - pCharStruct->ascent ); - pCharStruct->descent = std::max( pMaxBounds->descent, - pCharStruct->descent ); - } - - // apply correction factors to better match selected size to available size - if( mfYScale != 1.0 ) - { - *pAscent = int(*pAscent * mfYScale); - *pDescent = int(*pDescent * mfYScale); - pCharStruct->ascent = (short int)(pCharStruct->ascent * mfYScale); - pCharStruct->descent = (short int)(pCharStruct->descent * mfYScale); - } - if( mfXScale != 1.0 ) - { - pCharStruct->lbearing = (short int)(pCharStruct->lbearing * mfXScale); - pCharStruct->rbearing = (short int)(pCharStruct->rbearing * mfXScale); - pCharStruct->width = (short int)(pCharStruct->width * mfXScale); - } - - return (pCharStruct->width > 0); -} - -bool -ExtendedFontStruct::ToImplFontMetricData(ImplFontMetricData *pFontMetric) -{ - pFontMetric->mnOrientation = 0; - pFontMetric->mnSlant = 0; - pFontMetric->mbDevice = true; - pFontMetric->mbScalableFont = mpXlfd->IsScalable(); - pFontMetric->mbKernableFont = false; - pFontMetric->mbSymbolFlag= mpXlfd->IsSymbolFont(); - pFontMetric->meFamily = mpXlfd->GetFamilyType(); - pFontMetric->meWeight = mpXlfd->GetWeight(); - pFontMetric->mePitch = mpXlfd->GetPitch(); - pFontMetric->meItalic = mpXlfd->GetSlant(); - - int nAscent, nDescent; - XCharStruct aBoundingBox; - if ( GetFontBoundingBox(&aBoundingBox, &nAscent, &nDescent) ) - { - pFontMetric->mnWidth = aBoundingBox.width; - pFontMetric->mnAscent = aBoundingBox.ascent; - pFontMetric->mnDescent = aBoundingBox.descent; - pFontMetric->mnIntLeading = std::max(0, aBoundingBox.ascent - nAscent - + aBoundingBox.descent - nDescent ); - pFontMetric->mnExtLeading = 0; // TODO!!! - return true; - } - else - { - return false; - } -} - -bool -ExtendedFontStruct::Match( const ExtendedXlfd *pXlfd, - const Size& rPixelSize, sal_Bool bVertical ) const -{ - if( mpXlfd != pXlfd ) - return false; - - if( bVertical != mbVertical ) - return FALSE; - - if( rPixelSize.Height() != maPixelSize.Height() ) - return FALSE; - - long nReqWidth = rPixelSize.Width(); - if( !nReqWidth ) - nReqWidth = rPixelSize.Height(); - if( nReqWidth != maPixelSize.Width() ) - return FALSE; - - return true; -} - -// Get an appropriate x-font that contains a glyph for the given unicode -// code point. -// This routine is designed to be called for each character in a text. -// It first checks the given encoding to optimize for the fact that two -// adjacent characters in a text most probably have the same encoding -// In the first call initialize pEncodingInOut to dontknow, this causes -// EncodingHasChar() to fail and thus bootstraps the encoding, otherwise -// make sure that the initial value of pFontInOut matches the encoding and -// that the encoding is valid for the font. -XFontStruct* -ExtendedFontStruct::GetFontStruct( sal_Unicode nChar, rtl_TextEncoding *pEncoding ) -{ - SalConverterCache *pCvt = SalConverterCache::GetInstance(); - - if ( pCvt->EncodingHasChar(mnAsciiEncoding, nChar) ) - { - *pEncoding = mnAsciiEncoding; - return GetFontStruct (mnAsciiEncoding); - } - else - if ( pCvt->EncodingHasChar(mnCachedEncoding, nChar) ) - { - *pEncoding = mnCachedEncoding; - return GetFontStruct (mnCachedEncoding); - } - else - { - for ( int nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ ) - { - rtl_TextEncoding nEnc = mpXlfd->GetEncoding(nIdx); - if ( (nEnc != mnCachedEncoding) && (nEnc != mnAsciiEncoding) - && pCvt->EncodingHasChar(nEnc, nChar)) - { - mnCachedEncoding = nEnc; - *pEncoding = mnCachedEncoding; - return GetFontStruct (mnCachedEncoding); - } - } - } - - *pEncoding = RTL_TEXTENCODING_DONTKNOW; - return NULL; -} - -// --------------------------------------------------------------------------- -// utility functions to handle xfontstruct information, this is all to -// calculate charwidth information -// --------------------------------------------------------------------------- - -static bool -CharExists( const XCharStruct* pChar ) -{ - if ( pChar == NULL ) - return false; - - return pChar->width - || pChar->ascent || pChar->descent - || pChar->lbearing || pChar->rbearing; -} - -// this relies on non-null per_char information in the fontstruct -static XCharStruct* -GetCharinfo( const XFontStruct *pXFontStruct, sal_MultiByte nChar ) -{ - unsigned int nRow = nChar >> 8; - unsigned int nCol = nChar & 0xFF; - - unsigned int nMinRow = pXFontStruct->min_byte1; - unsigned int nMaxRow = pXFontStruct->max_byte1; - unsigned int nMinCol = pXFontStruct->min_char_or_byte2; - unsigned int nMaxCol = pXFontStruct->max_char_or_byte2; - - if ( nRow >= nMinRow && nRow <= nMaxRow - && nCol >= nMinCol && nCol <= nMaxCol ) - { - return &pXFontStruct->per_char[ - (nRow-nMinRow) * (nMaxCol-nMinCol+1) + (nCol-nMinCol) ]; - } - - return NULL; -} - -static sal_Size -QueryCharWidth16( Display* pDisplay, XLIB_Font nFontID, sal_MultiByte nChar, - sal_Size nDefaultWidth ) -{ - int nDirection, nFontAscent, nFontDescent; - XCharStruct aBoundingBox; - - XQueryTextExtents16( pDisplay, nFontID, (XChar2b*)&nChar, 1, - &nDirection, &nFontAscent, &nFontDescent, &aBoundingBox ); - - return CharExists( &aBoundingBox ) ? aBoundingBox.width : nDefaultWidth; -} - -#if 0 -// currently not used -static sal_Size -QueryCharWidth8( XFontStruct* pXFontStruct, sal_Char nChar, - sal_Size nDefaultWidth ) -{ - int nDirection, nFontAscent, nFontDescent; - XCharStruct aBoundingBox; - - XTextExtents( pXFontStruct, &nChar, 1, - &nDirection, &nFontAscent, &nFontDescent, &aBoundingBox ); - - return CharExists( &aBoundingBox ) ? aBoundingBox.width : nDefaultWidth; -} -#endif - -sal_Size -ExtendedFontStruct::GetDefaultWidth() -{ - return (maPixelSize.Width() + 1) / 2; -} - -// Handle single byte fonts which do not require conversion, this exploits -// the fact that unicode equals latin1 or ansi1252 in the range [0..0xff] and -// is compatible with iso8859-X at least in the range to 0x7f -sal_Size -ExtendedFontStruct::GetCharWidth8( sal_Unicode nFrom, sal_Unicode nTo, - sal_Int32* pWidthArray, rtl_TextEncoding nEncoding ) -{ - if ( !(nFrom <= nTo) ) - return 0; - - XFontStruct* pXFontStruct = GetFontStruct( nEncoding ); - if ( pXFontStruct == NULL ) - return 0; - - // query the font metrics - if ( (pXFontStruct->max_bounds.width == pXFontStruct->min_bounds.width) - || (pXFontStruct->per_char == NULL) ) - { - // fixed width font - for ( int nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ ) - *pWidthArray = pXFontStruct->max_bounds.width; - } - else - { - // variable width font - int nMinChar = pXFontStruct->min_char_or_byte2; - int nMaxChar = pXFontStruct->max_char_or_byte2; - - int nIdx = nFrom; - - for ( ; nIdx < std::min((int)nTo, nMinChar); nIdx++, pWidthArray++ ) - *pWidthArray = mnDefaultWidth; - for ( ; nIdx <= std::min((int)nTo, nMaxChar); nIdx++, pWidthArray++ ) - { - XCharStruct* pChar = &(pXFontStruct->per_char[nIdx - nMinChar]); - *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth; - } - for ( ; nIdx <= nTo; nIdx++, pWidthArray++ ) - *pWidthArray = mnDefaultWidth; - } - - // return amount of handled chars - return nTo - nFrom + 1; -} - -// Handle utf16 encoded fonts, which do not require conversion -sal_Size -ExtendedFontStruct::GetCharWidthUTF16( sal_Unicode nFrom, sal_Unicode nTo, - sal_Int32* pWidthArray ) -{ - if ( !(nFrom <= nTo) ) - return 0; - - XFontStruct* pXFontStruct = GetFontStruct( RTL_TEXTENCODING_UNICODE ); - FontPitch nSpacing = mpXlfd->GetPitch( RTL_TEXTENCODING_UNICODE ); - - if ( pXFontStruct == NULL ) - return 0; - - // query the font metrics - if ( nSpacing == PITCH_VARIABLE - && pXFontStruct->per_char == NULL) - { - // get per_char information from the server - for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ ) - *pWidthArray = QueryCharWidth16( mpDisplay, pXFontStruct->fid, - nIdx, mnDefaultWidth ); - } - else - if ( (pXFontStruct->max_bounds.width == pXFontStruct->min_bounds.width) - || (pXFontStruct->per_char == NULL) ) - { - // really a fixed width font - for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ ) - *pWidthArray = pXFontStruct->max_bounds.width; - } - else - { - // get per_char information from the xfontstruct - for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ ) - { - XCharStruct* pChar = GetCharinfo( pXFontStruct, nIdx ); - *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth; - } - } - - // return amount of handled chars - return nTo - nFrom + 1; -} - -// handle non unicode fonts that are converted into encoding matching the -// font in fontstruct, 8 and 16 bit fonts are handled the same way -sal_Size -ExtendedFontStruct::GetCharWidth16( sal_Unicode nFrom, sal_Unicode nTo, - sal_Int32* pWidthArray, ExtendedFontStruct *pFallback ) -{ - if ( nFrom > nTo ) - return 0; - - sal_Char pBuffer[64]; - - SalConverterCache *pCvt = SalConverterCache::GetInstance(); - for ( sal_Int32 nIdx = nFrom ; nIdx <= nTo ; nIdx++, pWidthArray++ ) - { - FontPitch nSpacing; - sal_Size nSize; - sal_Unicode nUniIdx = (sal_Unicode)nIdx; - - // get a matching fontstruct - rtl_TextEncoding nEnc; - XFontStruct *pFont; - - if ( (pFont = GetFontStruct(nUniIdx, &nEnc)) != NULL ) - { - nSpacing = GetSpacing( nEnc ); - } - else - if ( (pFallback != NULL) - && ((pFont = pFallback->GetFontStruct(nUniIdx, &nEnc)) != NULL) ) - { - nSpacing = pFallback->GetSpacing( nEnc ); - } - else - if ( (pFallback != NULL) - && ((pFont = pFallback->GetFontStruct(nUniIdx = '?', &nEnc)) != NULL) ) - { - nSpacing = pFallback->GetSpacing( nEnc ); - } - else - { - // TODO What should the default value be? - nSpacing = PITCH_FIXED; - } - - if ( pFont ) - { - nSize = pCvt->ConvertStringUTF16(&nUniIdx, 1, pBuffer, sizeof(pBuffer), nEnc); - // XXX FIXME - if ((nEnc == RTL_TEXTENCODING_GB_2312) || (nEnc == RTL_TEXTENCODING_EUC_KR)) - { - for (unsigned int n_char = 0; n_char < nSize; n_char++ ) - pBuffer[ n_char ] &= 0x7F; - } - } - - // query font metrics - if ( pFont && (nSize == 1 || nSize == 2) ) - { - sal_MultiByte nChar = (nSize == 1) ? (unsigned char)pBuffer[0] : - ((sal_MultiByte)pBuffer[0] << 8) + (sal_MultiByte)pBuffer[1]; - - if ( nSpacing == PITCH_VARIABLE - && pFont->per_char == NULL) - { - // get per_char information from the x-server - *pWidthArray = QueryCharWidth16( mpDisplay, pFont->fid, - nChar, mnDefaultWidth ); - } - else - if ( (pFont->max_bounds.width == pFont->min_bounds.width) - || (pFont->per_char == NULL) ) - { - // fixed width font - *pWidthArray = pFont->max_bounds.width; - } - else - { - // get per_char information from the xfontstruct - XCharStruct* pChar = GetCharinfo( pFont, nChar ); - *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth; - } - } - else - { - // conversion error - *pWidthArray = mnDefaultWidth; - } - } - - // return amount of handled chars - return nTo - nFrom + 1; -} - -sal_Size -ExtendedFontStruct::GetCharWidth( sal_Unicode cChar, sal_Int32 *pPhysicalWidth, - sal_Int32 *pLogicalWidth ) -{ - sal_Size nConverted = 0; - - // dispatch querying of metrics to most promising encoding candidate - int nAsciiRange; - rtl_TextEncoding nEncoding = mpXlfd->GetAsciiEncoding(&nAsciiRange); - if ( nEncoding == RTL_TEXTENCODING_UNICODE ) - { - // if we have a unicode encoded system font than we get the charwidth - // straight forward - nConverted = GetCharWidthUTF16( cChar, cChar, pPhysicalWidth ); - } - else - { - if ( cChar < nAsciiRange ) - { - // optimize the most frequent case, requesting only the latin1 - // chars which are mappable to a single encoding - nConverted = GetCharWidth8( cChar, cChar, pPhysicalWidth, nEncoding ); - } - - // if further requests are pending, then the according unicode - // codepoint has to be dispatched to one of the system fonts and - // converted to this fonts encoding - nConverted += GetCharWidth16( cChar + nConverted, cChar, - pPhysicalWidth + nConverted, NULL ); - } - - // convert physical width to logical width, apply correction factor if needed - *pLogicalWidth = *pPhysicalWidth; - if( mfXScale != 1.0 ) - *pLogicalWidth = sal_Int32(*pLogicalWidth * mfXScale); - - return nConverted; -} - -bool ExtendedFontStruct::HasUnicodeChar( sal_Unicode cChar ) const -{ - // #i18818# return false if there are no known encodings - if( !mnRangeCount ) - return false; - - // init unicode range cache if needed - if( mnRangeCount < 0 ) - { - mnRangeCount = mpXlfd->GetFontCodeRanges( NULL ); - if( !mnRangeCount ) - return false; - mpRangeCodes = new sal_uInt32[ 2*mnRangeCount ]; - mpXlfd->GetFontCodeRanges( mpRangeCodes ); - // TODO: make sure everything is sorted - } - - // binary search in unicode ranges - int nLower = 0; - int nMid = mnRangeCount; - int nUpper = 2 * mnRangeCount - 1; - while( nLower < nUpper ) - { - if( cChar >= mpRangeCodes[ nMid ] ) - nLower = nMid; - else - nUpper = nMid - 1; - nMid = (nLower + nUpper + 1) / 2; - } - if( (nMid == 0) && (cChar < mpRangeCodes[0]) ) - return false; - return (nMid & 1) ? false: true; -} - -int ExtendedFontStruct::GetFontCodeRanges( sal_uInt32* pCodePairs ) const -{ - // make sure unicode range cache is initialized - HasUnicodeChar(0); - - // transfer range pairs if requested - if( pCodePairs ) - { - for( int i = 0; i < 2*mnRangeCount; ++i ) - pCodePairs[i] = mpRangeCodes[i]; - } - - return mnRangeCount; -} - -// ======================================================================= - -X11FontLayout::X11FontLayout( ExtendedFontStruct& rFont ) -: mrFont( rFont ) -{} - -// ----------------------------------------------------------------------- - -bool X11FontLayout::LayoutText( ImplLayoutArgs& rArgs ) -{ - Point aNewPos( 0, 0 ); - bool bRightToLeft; - int nCharPos; - - for( nCharPos = -1; rArgs.GetNextPos( &nCharPos, &bRightToLeft ); ) - { - sal_UCS4 cChar = rArgs.mpStr[ nCharPos ]; - if( bRightToLeft ) - cChar = GetMirroredChar( cChar ); - int nGlyphIndex = cChar | GF_ISCHAR; - - // check if the font supports the char - if( !mrFont.HasUnicodeChar( cChar ) ) - { - // try to replace the failing char using the same font - const char* pApproxUTF8 = GetAutofallback( cChar ); - cChar = 0; - if( pApproxUTF8 ) - { - String aApproxStr( pApproxUTF8, RTL_TEXTENCODING_UTF8 ); - if( aApproxStr.Len() == 1 ) - { - // TODO: support Autofallback for len>1 - sal_Unicode cApprox = aApproxStr.GetChar( 0 ); - if( mrFont.HasUnicodeChar( cApprox ) ) - nGlyphIndex = (cChar = cApprox) | GF_ISCHAR; - } - } - // request fallback glyph if necessary - if( !cChar ) - { - rArgs.NeedFallback( nCharPos, bRightToLeft ); - if( rArgs.mnFlags & SAL_LAYOUT_FOR_FALLBACK ) - nGlyphIndex = 0; // drop NotDef fallback glyphs - } - } - - sal_Int32 nPhysGlyphWidth, nLogGlyphWidth; - mrFont.GetCharWidth( cChar, &nPhysGlyphWidth, &nLogGlyphWidth ); - int nGlyphFlags = (nPhysGlyphWidth > 0) ? 0 : GlyphItem::IS_IN_CLUSTER; - if( bRightToLeft ) - nGlyphFlags |= GlyphItem::IS_RTL_GLYPH; - GlyphItem aGI( nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nPhysGlyphWidth ); - aGI.mnNewWidth = nLogGlyphWidth; - AppendGlyph( aGI ); - - aNewPos.X() += nLogGlyphWidth; - } - - return (nCharPos >= 0); -} - -// ----------------------------------------------------------------------- - -void X11FontLayout::AdjustLayout( ImplLayoutArgs& rArgs ) -{ - GenericSalLayout::AdjustLayout( rArgs ); - SetOrientation( 0 ); // X11 fonts are to be rotated in upper layers -} - -// ----------------------------------------------------------------------- - -void X11FontLayout::DrawText( SalGraphics& rSalGraphics ) const -{ - static const int MAXGLYPHS = 160; - int nMaxGlyphs = GetOrientation() ? 1 : MAXGLYPHS; - - // workaround for #i49902# similar to #b6228733 with XDrawText items - // => output each item separately for non-unicode font encodings! - // this is done here instead of in DrawStringUCS2MB() because - // it needs the item positions and they are easily available here - if( mrFont.GetAsciiEncoding() != RTL_TEXTENCODING_UNICODE ) - nMaxGlyphs = 1; - - Point aPos; - sal_GlyphId aGlyphAry[ MAXGLYPHS ]; - sal_Unicode pStr[ MAXGLYPHS ]; - for( int nStart=0;;) - { - int nGlyphCount = GetNextGlyphs( nMaxGlyphs, aGlyphAry, aPos, nStart ); - if( !nGlyphCount ) - break; - - for( int i = 0; i < nGlyphCount; ++i ) - pStr[ i ] = aGlyphAry[ i ] & GF_IDXMASK; - - static_cast(rSalGraphics).DrawStringUCS2MB( mrFont, aPos, pStr, nGlyphCount ); - } -} - -// ======================================================================= diff --git a/vcl/unx/source/gdi/xlfd_attr.cxx b/vcl/unx/source/gdi/xlfd_attr.cxx deleted file mode 100644 index ca49a8548afb..000000000000 --- a/vcl/unx/source/gdi/xlfd_attr.cxx +++ /dev/null @@ -1,686 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" -#include -#include -#include -#include -#include "xlfd_attr.hxx" -#include -#include - -// --------------------------------------------------------------------------- -// -// -// Attribute is a container for simple name value pairs -// eg. ( "times", FAMILY_ROMAN ) or ( "demi bold", WEIGHT_SEMIBOLD ) -// enriched with an annotation which is a pretty-printed version of the -// string, i.e. "itc avant garde" would get an annotation of "Itc Avant Garde" -// -// -// --------------------------------------------------------------------------- - -// release the stored string -void -Attribute::Release() -{ - if ( mpAnnotation != NULL ) - delete mpAnnotation; - if ( mpKeyName != NULL ) - delete mpKeyName; - if ( mpName != NULL ) - free( (void*)mpName ); -} - -// get a private copy of the given argument -void -Attribute::SetName( const char *p, int nLen ) -{ - mpName = (char*)malloc( nLen + 1 ); - mnLength = nLen; - memcpy( (void*)mpName, p, mnLength ); - ((char*)mpName)[ mnLength ] = '\0'; -} - -// Compare whether two strings a equal for the first nLen bytes -// i.e. arial == arialnarrow -int -Attribute::Compare( const char *p, int nLen ) -{ - return strncmp( mpName, p, nLen ); -} - -// Get a all lowercase name with all blanks removed -const rtl::OString& -Attribute::GetKey () -{ - static rtl::OString aEmptyStr; - - if (mpKeyName != NULL) - return *mpKeyName; - if (mnLength == 0) - return aEmptyStr; - - sal_Char* pBuffer = (sal_Char*)alloca (mnLength); - - sal_Int32 i, j; - for (i = 0, j = 0; i < mnLength; i++) - { - if ( mpName[i] != ' ' ) - pBuffer[j++] = mpName[i]; - } - mpKeyName = new rtl::OString(pBuffer, j); - - return *mpKeyName; -} - -void -Attribute::InitKey () -{ - mpKeyName = NULL; -} - -// Compare two strings, they have to be equal for nLen bytes, after nLen -// bytes both strings have to be terminated either by '\0' or by '-' -// this is for comparing a string being a substring in a Xlfd with a -// zeroterminated string -Bool -Attribute::ExactMatch( const char *p, int nLen ) -{ - Bool bMatch; - if ( nLen > 0 ) - bMatch = Compare( p, nLen ) == 0; - else - bMatch = True; - if ( bMatch ) - { - char c1 = p[ nLen ]; - char c2 = mpName[ nLen ]; - bMatch = (c1 == '-' || c1 == '\0') && (c2 == '-' || c2 == '\0'); - } - - return bMatch; -} - -void -Attribute::TagFeature( unsigned short nFeature ) -{ - if ( (nFeature & XLFD_FEATURE_NARROW) - && (strstr(mpName, "narrow") != NULL) ) - { - mnFeature |= XLFD_FEATURE_NARROW; - } - - if ( (nFeature & XLFD_FEATURE_OL_CURSOR) - && (strcmp(mpName, "open look cursor") == 0) ) - { - mnFeature |= XLFD_FEATURE_OL_CURSOR; - } - - if ( (nFeature & XLFD_FEATURE_OL_GLYPH) - && (strcmp(mpName, "open look glyph") == 0) ) - { - mnFeature |= XLFD_FEATURE_OL_GLYPH; - } - - if ( (nFeature & XLFD_FEATURE_APPLICATION_FONT) - && ( (strcmp(mpName, "interface user") == 0) - || (strcmp(mpName, "interface system") == 0))) - { - mnFeature |= XLFD_FEATURE_APPLICATION_FONT; - } - - if (nFeature & XLFD_FEATURE_INTERFACE_FONT) - { - // european - if (strcmp(mpName, "arial") == 0) - mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_HQ | XLFD_FEATURE_MQ); - else - if (strcmp(mpName, "helvetica") == 0) - mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_HQ); - else - if ( (strcmp(mpName, "lucidux sans") == 0) - || (strcmp(mpName, "luxi sans") == 0)) - mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_MQ | XLFD_FEATURE_LQ); - else - if (strcmp(mpName, "charter") == 0) - mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_MQ); - else - // japanese - if ( (strcmp(mpName, "hg mincho l") == 0) /* Solaris: jisx0208 jisx0201 */ - || (strcmp(mpName, "heiseimin") == 0) /* Solaris: jisx0212 */ - || (strcmp(mpName, "minchol") == 0) /* TurboLinux */ - || (strcmp(mpName, "mincho") == 0)) /* Redhat 6.2 JP */ - { - mnFeature |= XLFD_FEATURE_INTERFACE_FONT; - } - else - // chinese - if ( (strcmp(mpName, "kai") == 0) /* Solaris */ - || (strcmp(mpName, "ar pl mingti2l big5") == 0)) /* TurboLinux */ - { - mnFeature |= XLFD_FEATURE_INTERFACE_FONT; - } - else - // korean - if ( (strcmp(mpName, "myeongjo") == 0)) /* Solaris */ - { - mnFeature |= XLFD_FEATURE_INTERFACE_FONT; - } - } - - if ( nFeature & XLFD_FEATURE_REDUNDANTSTYLE ) - { - switch ( mpName[0] ) - { - case '\0': - mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE; - break; - - case 'b': - if ( (strcmp(mpName, "bold") == 0) - || (strcmp(mpName, "bold italic") == 0) - || (strcmp(mpName, "bold sans") == 0) ) - mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE; - break; - - case 'd': - if ( (strcmp(mpName, "demi") == 0) - || (strcmp(mpName, "demi italic") == 0) ) - mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE; - break; - - case 'i': - if ( strcmp(mpName, "italic") == 0 ) - mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE; - break; - - case 's': - if ( (strcmp(mpName, "sans") == 0) - || (strcmp(mpName, "serif") == 0) ) - mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE; - break; - } - } -} - -// given Attribute classifications, strings have to be in alphabetical -// order, since they are treated by binary search algorithm - -#define InitializeAttributeWith( p, a ) p, sizeof(p) - 1, a, 0, NULL, NULL -#define MembersOf( p ) (sizeof(p) / sizeof(p[0]) ) - -const Attribute pFamilyAttribute[] = { - { InitializeAttributeWith( "arial", FAMILY_SWISS ) }, - { InitializeAttributeWith( "arioso", FAMILY_SCRIPT ) }, - { InitializeAttributeWith( "avant garde", FAMILY_SWISS ) }, - { InitializeAttributeWith( "avantgarde", FAMILY_SWISS ) }, - { InitializeAttributeWith( "bembo", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "bookman", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "conga", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "courier", FAMILY_MODERN ) }, - { InitializeAttributeWith( "curl", FAMILY_SCRIPT ) }, - { InitializeAttributeWith( "fixed", FAMILY_MODERN ) }, - { InitializeAttributeWith( "gill", FAMILY_SWISS ) }, - { InitializeAttributeWith( "helmet", FAMILY_MODERN ) }, - { InitializeAttributeWith( "helvetica", FAMILY_SWISS ) }, - { InitializeAttributeWith( "international", FAMILY_MODERN ) }, - { InitializeAttributeWith( "lucida", FAMILY_SWISS ) }, - { InitializeAttributeWith( "new century schoolbook", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "palatino", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "roman", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "sans serif", FAMILY_SWISS ) }, - { InitializeAttributeWith( "sansserif", FAMILY_SWISS ) }, - { InitializeAttributeWith( "serf", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "serif", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "times", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "utopia", FAMILY_ROMAN ) }, - { InitializeAttributeWith( "zapf chancery", FAMILY_SCRIPT ) }, - { InitializeAttributeWith( "zapfchancery", FAMILY_SCRIPT ) } -}; - -const Attribute pWeightAttribute[] = { - { InitializeAttributeWith( "black", WEIGHT_BLACK ) }, - { InitializeAttributeWith( "bold", WEIGHT_BOLD ) }, - { InitializeAttributeWith( "book", WEIGHT_LIGHT ) }, - { InitializeAttributeWith( "demi", WEIGHT_SEMIBOLD ) }, - { InitializeAttributeWith( "demi bold", WEIGHT_SEMIBOLD ) }, - { InitializeAttributeWith( "demibold", WEIGHT_SEMIBOLD ) }, - { InitializeAttributeWith( "light", WEIGHT_LIGHT ) }, - { InitializeAttributeWith( "medium", WEIGHT_MEDIUM ) }, - { InitializeAttributeWith( "normal", WEIGHT_NORMAL ) }, - { InitializeAttributeWith( "regular", WEIGHT_NORMAL ) }, - { InitializeAttributeWith( "roman", WEIGHT_NORMAL ) }, - { InitializeAttributeWith( "semicondensed", WEIGHT_LIGHT ) }, - { InitializeAttributeWith( "ultrabold", WEIGHT_ULTRABOLD ) } -}; - -const Attribute pSlantAttribute[] = { - { InitializeAttributeWith( "i", ITALIC_NORMAL ) }, - { InitializeAttributeWith( "o", ITALIC_OBLIQUE ) }, - { InitializeAttributeWith( "r", ITALIC_NONE ) } -}; - -const Attribute pSetwidthAttribute[] = { - { InitializeAttributeWith( "bold", WIDTH_SEMI_EXPANDED ) }, - { InitializeAttributeWith( "condensed", WIDTH_CONDENSED ) }, - { InitializeAttributeWith( "double wide", WIDTH_ULTRA_EXPANDED ) }, - { InitializeAttributeWith( "expanded", WIDTH_EXPANDED ) }, - { InitializeAttributeWith( "extracondensed", WIDTH_EXTRA_CONDENSED ) }, - { InitializeAttributeWith( "extraexpanded", WIDTH_EXTRA_EXPANDED ) }, - { InitializeAttributeWith( "medium", WIDTH_NORMAL ) }, - { InitializeAttributeWith( "narrow", WIDTH_CONDENSED ) }, - { InitializeAttributeWith( "normal", WIDTH_NORMAL ) }, - { InitializeAttributeWith( "semicondensed", WIDTH_SEMI_CONDENSED ) }, - { InitializeAttributeWith( "semiexpanded", WIDTH_SEMI_EXPANDED ) }, - { InitializeAttributeWith( "ultracondensed", WIDTH_ULTRA_CONDENSED ) }, - { InitializeAttributeWith( "ultraexpanded", WIDTH_ULTRA_EXPANDED ) }, - { InitializeAttributeWith( "wide", WIDTH_EXPANDED ) } -}; - -const Attribute pEnhancedCharsetAttribute[] = { - { InitializeAttributeWith( "iso8859-1", RTL_TEXTENCODING_MS_1252 ) }, - { InitializeAttributeWith( "iso8859_1", RTL_TEXTENCODING_MS_1252 ) } -}; - -// ------------------------------------------------------------------------- -// -// String handling utility functions -// -// ------------------------------------------------------------------------- - - -void -AppendAttribute( Attribute *pAttribute, ByteString &rString ) -{ - if ( pAttribute == NULL ) - return ; - - int nLength = pAttribute->GetLength(); - char *pBuffer = (char*)alloca( nLength + 1); - - pBuffer[ 0 ] = '-'; - memcpy( pBuffer + 1, pAttribute->GetName(), nLength ); - rString.Append( pBuffer, nLength + 1); -} - -// -// Prettify the font name: make each leading character of a fontname -// uppercase. For example -// times new roman -> Times New Roman -// - -static void -ToUpper( char *pCharacter ) -{ - // replace [a,z] with [A,Z] - if ( (*pCharacter >= 97) && (*pCharacter <= 122) ) - *pCharacter -= 32; -} - -static String* -Capitalize( const char *pStr, int nLength ) -{ - char *pCopy = (char*)alloca( nLength + 1 ); - char *pPtr = pCopy; - memcpy( pPtr, pStr, nLength + 1 ); - - // loop over string data and uppercase first char and all chars - // following a space (other white space would be unexpected here) - char nPreviousChar = ' '; - while ( *pPtr ) - { - if ( nPreviousChar == ' ' ) - ToUpper( pPtr ); - nPreviousChar = *pPtr++; - } - - return new String( pCopy, RTL_TEXTENCODING_ISO_8859_1 ); -} - -String* -AnnotateString( const Attribute& rAttribute ) -{ - return Capitalize(rAttribute.GetName(), rAttribute.GetLength()); -} - -String* -AnnotateSlant( const Attribute& rAttribute ) -{ - const char* pStr = rAttribute.GetName(); - int nLen = rAttribute.GetLength(); - - static const struct { - const char *pFrom; const char *pTo; - } pTranslation[] = { - { "r", "Roman" }, - { "o", "Oblique" }, - { "i", "Italic" }, - { "ri", "Reverse Italic" }, - { "ro", "Reverse Oblique" }, - { "ot", "Other" } - }; - - for ( unsigned int i = 0; i < MembersOf(pTranslation); i++ ) - if ( strcmp(pStr, pTranslation[i].pFrom) == 0 ) - { - return new String( pTranslation[i].pTo, - RTL_TEXTENCODING_ISO_8859_1 ); - } - - return Capitalize(pStr, nLen); -} - -String* -AnnotateNone( const Attribute& ) -{ - return new String(); -} - -// --------------------------------------------------------------------------- -// -// -// manage global lists of Attributes -// since XListFonts does never list more than 64K fonts this storage does -// handle array size and indices with unsigned short values for low -// memory consumption -// -// -// --------------------------------------------------------------------------- - -AttributeStorage::AttributeStorage( unsigned short nDefaultValue ) : - mpList( NULL ), - mnSize( 0 ), - mnCount( 0 ), - mnLastmatch( 0 ), - mnDefaultValue( nDefaultValue ) -{ -} - -AttributeStorage::~AttributeStorage() -{ - if ( mpList != NULL ) - { - for ( int i = 0; i < mnCount; i++ ) - mpList[i].Release(); - free( mpList ); - } -} - -#if OSL_DEBUG_LEVEL > 1 -void -AttributeStorage::Dump() -{ - fprintf(stderr, "AttributeStorage: size=%i, used=%i\n", mnSize, mnCount); - for ( int i = 0; i < mnCount; i++ ) - { - ByteString aAnnotation = ByteString( - mpList[i].GetAnnotation(), - RTL_TEXTENCODING_ISO_8859_1 ); - fprintf(stderr, "\t%4i: <%s><%s>\n", i, mpList[i].GetName(), - mpList[i].GetLength(), mpList[i].GetValue(), - aAnnotation.GetBuffer() ); - } - fprintf(stderr, "\n"); -} -#endif - -Attribute* -AttributeStorage::Retrieve( unsigned short nIndex ) const -{ - return nIndex < mnCount ? &mpList[ nIndex ] : (Attribute*)NULL ; -} - -// pClassification contains a list of name-value pairs. If names in -// the AttributeStorage match those in the pClassification then -// the according value is copied. Matching means match for the length -// of the string in pClassification (i.e. arial matches arialnarrow) -// the strings in pClassification must be in alphabetical order, all -// strings Lowercase -void -AttributeStorage::AddClassification( Attribute *pClassification, - unsigned short nNum ) -{ - for ( int i = 0; i < mnCount; i++ ) - { - unsigned int nLower = 0; - unsigned int nUpper = nNum; - unsigned int nCurrent; - int nComparison = 1; - Attribute *pHaystack = 0, *pNeedle; - - pNeedle = &mpList[ i ]; - - // binary search - while ( nLower < nUpper ) - { - nCurrent = (nLower + nUpper) / 2; - pHaystack = &pClassification[ nCurrent ]; - nComparison = pNeedle->Compare( pHaystack->GetName(), - pHaystack->GetLength() ); - if (nComparison < 0) - nUpper = nCurrent; - else - if (nComparison > 0) - nLower = nCurrent + 1; - else - break; - } - - // if there's a match store the according classification in the - // Attribute storage, otherwise do nothing since defaults are - // already provided in AttributeStorage::Insert() - if ( nComparison == 0 ) - pNeedle->SetValue( pHaystack->GetValue() ); - } -} - -void -AttributeStorage::AddClassification( AttributeClassifierT Classify ) -{ - for ( int i = 0; i < mnCount; i++ ) - { - Attribute& rCurrent = mpList[i] ; - int nValue = Classify( rCurrent.GetName() ); - rCurrent.SetValue( nValue ); - } -} - -void -AttributeStorage::AddAnnotation( AttributeAnnotatorT Annotate ) -{ - for ( int i = 0; i < mnCount; i++ ) - { - String* pAnnotation = Annotate( mpList[i] ); - mpList[i].SetAnnotation( pAnnotation ); - } -} - -void -AttributeStorage::TagFeature( unsigned short nFeature ) -{ - for ( int i = 0; i < mnCount; i++ ) - mpList[i].TagFeature( nFeature ); -} - -// Enlarge the list of Attributes -void -AttributeStorage::Enlarge() -{ - if ( mnSize == 0 ) - { - mnSize = 8; - mpList = (Attribute*) malloc( mnSize * sizeof(Attribute) ); - } - else - { - mnSize = mnSize < 32768 ? (mnSize * 2) : 65535; - mpList = (Attribute*) realloc( mpList, mnSize * sizeof(Attribute) ); - } -} - -// nLength is the length as it would be reported by strlen(3) -// for an null-terminated string. if a string is part of a Xlfd -// the field separator '-' is taken as '\0' -// the AttributeStorage itself is NOT sorted to make sure that the -// leased keys are still valid -unsigned short -AttributeStorage::Insert( const char *pString, int nLength ) -{ - // check whether the last match is still equal to the current - // string since XListFonts lists fonts in sets of similar fontnames - if ( mnLastmatch < mnCount ) - { - if ( mpList[mnLastmatch].ExactMatch(pString, nLength) ) - return mnLastmatch; - } - - // otherwise search in list - for ( int i = 0; i < mnCount; i++ ) - { - if ( mpList[i].ExactMatch(pString, nLength) ) - return mnLastmatch = i; - } - - // if still not found we have to Insert the new string - if ( mnSize == mnCount ) - Enlarge(); - mpList[mnCount].SetName( pString, nLength ); - mpList[mnCount].SetValue( mnDefaultValue ); - mpList[mnCount].SetAnnotation( NULL ); - mpList[mnCount].SetFeature( XLFD_FEATURE_NONE ); - mpList[mnCount].InitKey( ); - mnLastmatch = mnCount; - mnCount = mnCount < 65535 ? mnCount + 1 : mnCount; - - return mnLastmatch; -} - - -// --------------------------------------------------------------------------- -// -// -// Attribute provider is a frame for a set of AttributeStorages. -// -// -// --------------------------------------------------------------------------- - -AttributeProvider::AttributeProvider () -{ - mpField[eXLFDFoundry ] = new AttributeStorage(0); - mpField[eXLFDFamilyName ] = new AttributeStorage(FAMILY_DONTKNOW); - mpField[eXLFDWeightName ] = new AttributeStorage(WEIGHT_NORMAL); - mpField[eXLFDSlant ] = new AttributeStorage(ITALIC_NONE); - mpField[eXLFDSetwidthName] = new AttributeStorage(WIDTH_NORMAL); - mpField[eXLFDAddstyleName] = new AttributeStorage(RTL_TEXTENCODING_DONTKNOW); - mpField[eXLFDCharset ] = new AttributeStorage(RTL_TEXTENCODING_DONTKNOW); -} - -AttributeProvider::~AttributeProvider() -{ - for ( int i = 0; i < eXLFDMaxEntry; i++ ) - delete mpField[ i ]; -} - -#if OSL_DEBUG_LEVEL > 1 -void -AttributeProvider::Dump() -{ - for ( int i = 0; i < eXLFDMaxEntry; i++ ) - mpField[ i ]->Dump(); -} -#endif - -extern "C" rtl_TextEncoding -GetTextEncodingFromAddStylename( const sal_Char *pAddStylename ) -{ - int nBufferLength = strlen( pAddStylename ) + 1; - sal_Char *pBuffer = (sal_Char*)alloca( nBufferLength ); - for ( int i = 0; i < nBufferLength; i++ ) - pBuffer[i] = pAddStylename[i] == '_' ? '-' : pAddStylename[i] ; - - return rtl_getTextEncodingFromUnixCharset( pBuffer ); -} - - -// classification information is needed before sorting because of course the -// classification is the sort criteria -void -AttributeProvider::AddClassification() -{ - /* mpField[ eXLFDFoundry ] doesn't need classification */ - mpField[ eXLFDFamilyName ]->AddClassification( - (Attribute*)pFamilyAttribute, - MembersOf(pFamilyAttribute) ); - mpField[ eXLFDWeightName ]->AddClassification( - (Attribute*)pWeightAttribute, - MembersOf(pWeightAttribute) ); - mpField[ eXLFDSlant ]->AddClassification( - (Attribute*)pSlantAttribute, - MembersOf(pSlantAttribute) ); - mpField[ eXLFDSetwidthName ]->AddClassification( - (Attribute*)pSetwidthAttribute, - MembersOf(pSetwidthAttribute) ); - mpField[ eXLFDAddstyleName ]->AddClassification( - GetTextEncodingFromAddStylename ); - mpField[ eXLFDCharset ]->AddClassification( - rtl_getTextEncodingFromUnixCharset ); -} - -// add some pretty print description -void -AttributeProvider::AddAnnotation() -{ - mpField[ eXLFDFoundry ]->AddAnnotation( AnnotateNone ); - mpField[ eXLFDFamilyName ]->AddAnnotation( AnnotateString ); - mpField[ eXLFDWeightName ]->AddAnnotation( AnnotateString ); - mpField[ eXLFDSlant ]->AddAnnotation( AnnotateSlant ); - mpField[ eXLFDSetwidthName ]->AddAnnotation( AnnotateString ); - mpField[ eXLFDAddstyleName ]->AddAnnotation( AnnotateNone ); - mpField[ eXLFDCharset ]->AddAnnotation( AnnotateNone ); -} - -// this is the misc or any section: dirty hacks for dirty xlfd usage -void -AttributeProvider::TagFeature() -{ - mpField[ eXLFDFamilyName ]->TagFeature( - XLFD_FEATURE_OL_GLYPH - | XLFD_FEATURE_OL_CURSOR - | XLFD_FEATURE_NARROW - | XLFD_FEATURE_INTERFACE_FONT - | XLFD_FEATURE_APPLICATION_FONT); - - mpField[ eXLFDSetwidthName ]->TagFeature( - XLFD_FEATURE_NARROW ); - - mpField[ eXLFDAddstyleName ]->TagFeature( - XLFD_FEATURE_REDUNDANTSTYLE ); -} - diff --git a/vcl/unx/source/gdi/xlfd_attr.hxx b/vcl/unx/source/gdi/xlfd_attr.hxx deleted file mode 100644 index b721310da506..000000000000 --- a/vcl/unx/source/gdi/xlfd_attr.hxx +++ /dev/null @@ -1,228 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef XLFD_ATTRIBUTE_HXX -#define XLFD_ATTRIBUTE_HXX - -#include -#include - - -struct Attribute { - - const char* mpName; - unsigned short mnLength; - unsigned short mnValue; - unsigned short mnFeature; - String* mpAnnotation; - rtl::OString* mpKeyName; - - const char* GetName() const - { return mpName; } - unsigned short GetValue() const - { return mnValue; } - unsigned short GetLength() const - { return mnLength; } - Bool HasFeature( unsigned short nFeature ) const - { return ((mnFeature & nFeature) != 0); } - const String &GetAnnotation() const - { return *mpAnnotation; } - const rtl::OString& - GetKey(); - void InitKey(); - - void SetName( const char *p, int nLen ); - void SetValue( unsigned short nIn ) - { mnValue = nIn; } - void SetAnnotation( String *pString ) - { mpAnnotation = pString; } - void SetFeature( unsigned short nFeature ) - { mnFeature = nFeature; } - void TagFeature( unsigned short nFeature ); - - int Compare( const char *p, int nLen ); - Bool ExactMatch( const char *p, int nLen ); - void Release(); -}; - - -void -AppendAttribute( Attribute *pAttribute, ByteString &rString ); - - -typedef String*(*AttributeAnnotatorT)(const Attribute &rAttribute); -extern "C" { -typedef rtl_TextEncoding(*AttributeClassifierT)(const char* pStr); -} - -#define XLFD_FEATURE_NONE 0x0000 -#define XLFD_FEATURE_NARROW 0x0001 -#define XLFD_FEATURE_OL_GLYPH 0x0002 -#define XLFD_FEATURE_OL_CURSOR 0x0004 -#define XLFD_FEATURE_REDUNDANTSTYLE 0x0008 -#define XLFD_FEATURE_APPLICATION_FONT 0x0010 - -#define XLFD_FEATURE_INTERFACE_FONT 0x0020 -#define XLFD_FEATURE_LQ 0x0040 -#define XLFD_FEATURE_MQ 0x0080 -#define XLFD_FEATURE_HQ 0x0100 - -// --------------------------------------------------------------------------- -// -// -// manage global lists of Attributes -// since XListFonts does never list more than 64K fonts this storage does -// handle array size and indices with unsigned short values for low -// memory consumption -// -// -// --------------------------------------------------------------------------- - -class AttributeStorage { - - private: - - Attribute* mpList; - unsigned short mnSize; - unsigned short mnCount; - unsigned short mnLastmatch; - unsigned short mnDefaultValue; - - void Enlarge(); - AttributeStorage(); - - public: - - AttributeStorage( unsigned short nDefaultValue ); - ~AttributeStorage(); - unsigned short Insert( const char *pString, int nLength ); - Attribute* Retrieve( unsigned short nIndex ) const ; - void AddClassification( Attribute *pClassification, - unsigned short nNum ); - void AddClassification( AttributeClassifierT Classify ); - void TagFeature( unsigned short nFeature ); - void AddAnnotation( AttributeAnnotatorT Annotate ); - #if OSL_DEBUG_LEVEL > 1 - void Dump(); - #endif -}; - - -// --------------------------------------------------------------------------- -// -// -// Attribute provider is a frame for a set of AttributeStorages. For XLFD -// interpretation and efficient storage, AttributeStorages for foundry, -// family_name, weight_name, slant, setwidth_name, add_style_name and combined -// charset_registry and charset_encoding are used. pixel_size, point_size, -// resolution_x and resolution_y are stored as numbers. please note that this -// does not allow storage of matrix-enhanced fonts. spacing is stored as -// a char, since only the 'm', 'c' and 'p' types are defined. -// -// -// --------------------------------------------------------------------------- - -enum eXLFDAttributeT { - eXLFDFoundry = 0, - eXLFDFamilyName, - eXLFDWeightName, - eXLFDSlant, - eXLFDSetwidthName, - eXLFDAddstyleName, - eXLFDCharset, - eXLFDMaxEntry -}; - -class AttributeProvider { - - private: - - AttributeStorage* mpField[ eXLFDMaxEntry ]; - - AttributeStorage* GetField( eXLFDAttributeT eXLFDField ) - { return mpField[ eXLFDField]; } - public: - - AttributeProvider (); - ~AttributeProvider (); - - void AddClassification(); - void AddAnnotation(); - void TagFeature(); - #if OSL_DEBUG_LEVEL > 1 - void Dump(); - #endif - - // these are just shortcuts or proxies for the most common used - // AttributeStorage functionality - AttributeStorage* GetFoundry() - { return GetField(eXLFDFoundry); } - AttributeStorage* GetFamily() - { return GetField(eXLFDFamilyName); } - AttributeStorage* GetWeight() - { return GetField(eXLFDWeightName); } - AttributeStorage* GetSlant() - { return GetField(eXLFDSlant); } - AttributeStorage* GetSetwidth() - { return GetField(eXLFDSetwidthName); } - AttributeStorage* GetAddstyle() - { return GetField(eXLFDAddstyleName); } - AttributeStorage* GetCharset() - { return GetField(eXLFDCharset); } - - Attribute* RetrieveFoundry( unsigned short nIndex ) - { return GetFoundry()->Retrieve(nIndex); } - Attribute* RetrieveFamily( unsigned short nIndex ) - { return GetFamily()->Retrieve(nIndex); } - Attribute* RetrieveWeight( unsigned short nIndex ) - { return GetWeight()->Retrieve(nIndex); } - Attribute* RetrieveSlant( unsigned short nIndex ) - { return GetSlant()->Retrieve(nIndex); } - Attribute* RetrieveSetwidth( unsigned short nIndex ) - { return GetSetwidth()->Retrieve(nIndex); } - Attribute* RetrieveAddstyle( unsigned short nIndex ) - { return GetAddstyle()->Retrieve(nIndex); } - Attribute* RetrieveCharset( unsigned short nIndex ) - { return GetCharset()->Retrieve(nIndex); } - - unsigned short InsertFoundry( const char *pString, int nLength ) - { return GetFoundry()->Insert(pString, nLength); } - unsigned short InsertFamily( const char *pString, int nLength ) - { return GetFamily()->Insert(pString, nLength); } - unsigned short InsertWeight( const char *pString, int nLength ) - { return GetWeight()->Insert(pString, nLength); } - unsigned short InsertSlant( const char *pString, int nLength ) - { return GetSlant()->Insert(pString, nLength); } - unsigned short InsertSetwidth( const char *pString, int nLength ) - { return GetSetwidth()->Insert(pString, nLength);} - unsigned short InsertAddstyle( const char *pString, int nLength ) - { return GetAddstyle()->Insert(pString, nLength);} - unsigned short InsertCharset( const char *pString, int nLength ) - { return GetCharset()->Insert(pString, nLength); } -}; - -#endif /* XLFD_ATTRIBUTE_HXX */ - diff --git a/vcl/unx/source/gdi/xlfd_extd.cxx b/vcl/unx/source/gdi/xlfd_extd.cxx deleted file mode 100644 index 73731eddf115..000000000000 --- a/vcl/unx/source/gdi/xlfd_extd.cxx +++ /dev/null @@ -1,1001 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" -#include -#include -#include -#include "xlfd_attr.hxx" -#include "xlfd_smpl.hxx" -#include "xlfd_extd.hxx" -#include -#include - -#ifndef _RTL_TENCINFO_H_ -#include -#endif - -#include - -// -------------------------------------------------------------------------- - -ImplX11FontData::ImplX11FontData( const ExtendedXlfd& rXlfd, int nHeight ) -: ImplFontData( rXlfd, X11IFD_MAGIC ), - mrXlfd( rXlfd ) -{ - mnHeight = nHeight; - mnWidth = 0; -} - -ImplFontEntry* ImplX11FontData::CreateFontInstance( ImplFontSelectData& rFSD ) const -{ - ImplFontEntry* pEntry = new ImplFontEntry( rFSD ); - return pEntry; -} - -sal_IntPtr ImplX11FontData::GetFontId() const -{ - return reinterpret_cast(&mrXlfd); -} - -// -------------------------------------------------------------------------- -// -// classes for Xlfd handling that contain more than a single encoding. -// Members that may vary through different encodings are stored in -// a mpEncodingInfo member. There are three different classes: -// true scalable fonts (truetype and type1) scalable bitmap fonts -// (the ugly ones) and bitmap fonts. The ExtendedXlfd stores all the members -// that are specific to a font outline -// ( e.g. adobe-times-roman-medium-r-normal- X -p- X ) -// and specifies the interface. -// -// -------------------------------------------------------------------------- - -ExtendedXlfd::EncodingInfo& -ExtendedXlfd::EncodingInfo::operator= ( const Xlfd *pXlfd ) -{ - mcSpacing = pXlfd->mcSpacing; - mnResolutionX = pXlfd->mnResolutionX; - mnResolutionY = pXlfd->mnResolutionY; - mnAddstyle = pXlfd->mnAddstyle; - mnCharset = pXlfd->mnCharset; - mnEncoding = pXlfd->GetEncoding(); - - return *this; -} - -// ------ base class -------------------------------------------------------- - -ExtendedXlfd::ExtendedXlfd( bool bScalable ) -: mbScalable( bScalable ), - mnEncodings( 0 ), - mnEncCapacity( 0 ), - mpEncodingInfo( NULL ) -{ - mbOrientation = false; - mbDevice = false; - mbSubsettable = false; - mbEmbeddable = false; - - mnQuality = -1; -} - -ExtendedXlfd::~ExtendedXlfd() -{ - if ( mnEncodings != 0 ) - rtl_freeMemory( mpEncodingInfo ); -} - -inline void* -Realloc( void *pPtr, sal_Size nSize ) -{ - return rtl_reallocateMemory( pPtr, nSize ); -} - -int -ExtendedXlfd::GetEncodingIdx( rtl_TextEncoding nEncoding ) const -{ - for ( int i = 0; i < mnEncodings; i++ ) - if ( nEncoding == mpEncodingInfo[i].mnEncoding ) - return i; - return -1; -} - -bool -ExtendedXlfd::HasEncoding( rtl_TextEncoding nEncoding ) const -{ - return !(GetEncodingIdx( nEncoding ) < 0) ; -} - -rtl_TextEncoding -ExtendedXlfd::GetEncoding( int i ) const -{ - if ( i < mnEncodings && i >= 0 ) - return mpEncodingInfo[i].mnEncoding; - - return RTL_TEXTENCODING_DONTKNOW; -} - -rtl_TextEncoding -ExtendedXlfd::GetEncoding() const -{ - return mnEncodings == 1 ? mpEncodingInfo[0].mnEncoding : RTL_TEXTENCODING_DONTKNOW; -} - -// query the most unicode / Ascii compatible font: either one of the fonts -// is utf16 encoded or there's a single byte font which is unicode -// compatible for the first 256 chars (latin1) or for at least 128 -// chars (most latin-X encodings, cyrillic encodings) -rtl_TextEncoding -ExtendedXlfd::GetAsciiEncoding( int *pAsciiRange ) const -{ - rtl_TextEncoding nBestEncoding = RTL_TEXTENCODING_DONTKNOW; - int nLargestRange = 0x0000; - - for ( int i = 0; i < mnEncodings && nLargestRange < 0xffff; i++ ) - { - rtl_TextEncoding nCurEncoding = mpEncodingInfo[i].mnEncoding; - switch ( nCurEncoding ) - { - case RTL_TEXTENCODING_UNICODE: - nLargestRange = 0xffff; - nBestEncoding = nCurEncoding; - break; - - case RTL_TEXTENCODING_ISO_8859_1: - case RTL_TEXTENCODING_MS_1252: - nLargestRange = 0x00ff; - nBestEncoding = nCurEncoding; - break; - - case RTL_TEXTENCODING_ISO_8859_2: - case RTL_TEXTENCODING_ISO_8859_4: - case RTL_TEXTENCODING_ISO_8859_5: - case RTL_TEXTENCODING_ISO_8859_6: - case RTL_TEXTENCODING_ISO_8859_7: - case RTL_TEXTENCODING_ISO_8859_8: - case RTL_TEXTENCODING_ISO_8859_9: - case RTL_TEXTENCODING_ISO_8859_13: - case RTL_TEXTENCODING_ISO_8859_15: - case RTL_TEXTENCODING_MS_1251: - case RTL_TEXTENCODING_KOI8_R: - case RTL_TEXTENCODING_JIS_X_0201: - if ( nLargestRange < 0x0080 ) - { - nLargestRange = 0x0080; - nBestEncoding = nCurEncoding; - } - break; - - default: - if ( nLargestRange == 0x0000 ) - { - nBestEncoding = nCurEncoding; - } - break; - } - } - - if ( pAsciiRange != NULL ) - *pAsciiRange = nLargestRange; - - return nBestEncoding; -} - -bool -ExtendedXlfd::AddEncoding( const Xlfd *pXlfd ) -{ - rtl_TextEncoding nEncoding = pXlfd->GetEncoding(); - if ( HasEncoding(nEncoding) ) - return false; - - if ( mnEncodings == 0 ) - { - // bootstrap - mnFoundry = pXlfd->mnFoundry; - mnFamily = pXlfd->mnFamily; - mnWeight = pXlfd->mnWeight; - mnSlant = pXlfd->mnSlant; - mnSetwidth = pXlfd->mnSetwidth; - mpFactory = pXlfd->mpFactory; - - Attribute *pFamilyAttr = mpFactory->RetrieveFamily( mnFamily ); - Attribute *pWeightAttr = mpFactory->RetrieveWeight( mnWeight ); - Attribute *pWidthAttr = mpFactory->RetrieveSetwidth( mnSetwidth ); - Attribute *pSlantAttr = mpFactory->RetrieveSlant( mnSlant ); - - meFamily = GetFamilyType(); - meWeight = GetWeight(); - meItalic = GetSlant(); - meWidthType = GetWidthType(); - mbSymbolFlag= (GetEncoding() == RTL_TEXTENCODING_SYMBOL); - mePitch = GetPitch(); - - maName = pFamilyAttr->GetAnnotation(); - - // the helvetica narrow hack - if ( ! pFamilyAttr->HasFeature(XLFD_FEATURE_NARROW) - && pWidthAttr->HasFeature(XLFD_FEATURE_NARROW) ) - { - static const String aNarrow( RTL_CONSTASCII_USTRINGPARAM(" Narrow") ); - maName += aNarrow; - } - - // stylename = weight + slant + width - // XXX Fix me: there may be a space missing between them - if ( meWeight != WEIGHT_NORMAL ) - maStyleName += pWeightAttr->GetAnnotation(); - if ( meItalic != ITALIC_NONE ) - maStyleName += pSlantAttr->GetAnnotation(); - if ( (meWidthType != WIDTH_NORMAL) - && (! pWidthAttr->HasFeature(XLFD_FEATURE_NARROW)) ) - maStyleName += pWidthAttr->GetAnnotation(); - } - - if( mnEncodings <= mnEncCapacity ) - { - mnEncCapacity += mnEncodings + 4; - mpEncodingInfo = (EncodingInfo*)Realloc( mpEncodingInfo, mnEncCapacity * sizeof(EncodingInfo) ); - } - - mpEncodingInfo[ mnEncodings ] = pXlfd; - mnEncodings += 1; - return true; -} - -void -ExtendedXlfd::ToString( ByteString &rString, - unsigned short /*nPixelSize*/, rtl_TextEncoding /*nEncoding*/ ) const -{ - AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString ); - AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString ); - AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString ); - AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString ); - AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString ); -} - -void -ExtendedXlfd::ToString( ByteString &rString, - unsigned short /*nPixelSize*/, char* /*pMatricsString*/, rtl_TextEncoding /*nEncoding*/ ) const -{ - AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString ); - AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString ); - AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString ); - AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString ); - AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString ); -} - -static FontPitch GetPitchFromX11Pitch( const char cSpacing ) -{ - switch ( cSpacing ) - { - case 'c': // fall through - case 'm': return PITCH_FIXED; - case 'p': return PITCH_VARIABLE; - default: return PITCH_DONTKNOW; - } -} - -// you must not call any of the ExtendedXlfd::GetXXX() functions if the -// ExtendedXlfd is really empty (i.e. mnEncodings is zero) - -FontPitch ExtendedXlfd::GetPitch() const -{ - if( mnEncodings > 1 ) - return PITCH_VARIABLE; - if( mnEncodings == 1 ) - return GetPitchFromX11Pitch( mpEncodingInfo[0].mcSpacing ); - return PITCH_DONTKNOW; -} - -FontPitch ExtendedXlfd::GetPitch( rtl_TextEncoding nEncoding ) const -{ - for ( int nIdx = 0; nIdx < mnEncodings; nIdx++ ) - if ( mpEncodingInfo[nIdx].mnEncoding == nEncoding ) - return GetPitchFromX11Pitch( mpEncodingInfo[nIdx].mcSpacing ); - return PITCH_DONTKNOW; -} - -FontFamily ExtendedXlfd::GetFamilyType() const -{ - Attribute *pFamilyAttr= mpFactory->RetrieveFamily(mnFamily); - return (FontFamily)pFamilyAttr->GetValue(); -} - -FontWeight ExtendedXlfd::GetWeight() const -{ - Attribute *pWeightAttr = mpFactory->RetrieveWeight(mnWeight); - return (FontWeight)pWeightAttr->GetValue(); -} - -FontItalic ExtendedXlfd::GetSlant() const -{ - Attribute *pSlantAttr = mpFactory->RetrieveSlant(mnSlant); - return (FontItalic)pSlantAttr->GetValue(); -} - -FontWidth ExtendedXlfd::GetWidthType() const -{ - Attribute *pWidthAttr = mpFactory->RetrieveSetwidth(mnSetwidth); - return (FontWidth)pWidthAttr->GetValue(); -} - -class CodeRange -{ -public: - CodeRange( int nMin, int nEnd ) : mnMin( nMin ), mnEnd( nEnd ) {} - - sal_uInt32 GetMin() const { return mnMin; } - sal_uInt32 GetEnd() const { return mnEnd; } - - bool operator<( const CodeRange& r ) const - { return (mnMin RangeSet; - RangeSet aRangeSet; - - for( unsigned short i = 0; i < mnEncodings; ++i ) - { - // TODO: move encoding -> unicode range mapping to RTL - // NOTE: for now only some are VERY roughly approximated - const rtl_TextEncoding eEncoding = mpEncodingInfo[i].mnEncoding; - switch( mpEncodingInfo[i].mnEncoding ) - { - case RTL_TEXTENCODING_SYMBOL: // postscript symbol encoding - aRangeSet.insert( CodeRange( 0x0020, 0x0100 ) ); // symbol aliasing - aRangeSet.insert( CodeRange( 0xF020, 0xF100 ) ); - break; - - case RTL_TEXTENCODING_ISO_8859_15: - aRangeSet.insert( CodeRange( 0x20AC, 0x20AD ) ); // Euro currency symbol - // fall through - case RTL_TEXTENCODING_APPLE_ROMAN: - case RTL_TEXTENCODING_ISO_8859_1: - case RTL_TEXTENCODING_MS_1252: - case RTL_TEXTENCODING_IBM_437: - case RTL_TEXTENCODING_IBM_852: - aRangeSet.insert( CodeRange( 0x0020, 0x0080 ) ); - aRangeSet.insert( CodeRange( 0x00A0, 0x0100 ) ); - break; - - // Traditional, Simplified, Japanese - case RTL_TEXTENCODING_APPLE_CHINSIMP: - case RTL_TEXTENCODING_APPLE_CHINTRAD: - case RTL_TEXTENCODING_APPLE_JAPANESE: - case RTL_TEXTENCODING_SHIFT_JIS: - case RTL_TEXTENCODING_GB_2312: - case RTL_TEXTENCODING_GBT_12345: - case RTL_TEXTENCODING_GBK: - case RTL_TEXTENCODING_BIG5: - case RTL_TEXTENCODING_EUC_JP: - case RTL_TEXTENCODING_EUC_CN: - case RTL_TEXTENCODING_EUC_TW: - case RTL_TEXTENCODING_ISO_2022_JP: - case RTL_TEXTENCODING_ISO_2022_CN: - case RTL_TEXTENCODING_GB_18030: - case RTL_TEXTENCODING_BIG5_HKSCS: - case RTL_TEXTENCODING_JIS_X_0201: - case RTL_TEXTENCODING_JIS_X_0208: - case RTL_TEXTENCODING_JIS_X_0212: - case RTL_TEXTENCODING_MS_932: - case RTL_TEXTENCODING_MS_936: - case RTL_TEXTENCODING_MS_950: - aRangeSet.insert( CodeRange( 0x3000, 0xA000 ) ); - aRangeSet.insert( CodeRange( 0xF900, 0xFB00 ) ); - break; - - // Korean - case RTL_TEXTENCODING_APPLE_KOREAN: - case RTL_TEXTENCODING_MS_949: - case RTL_TEXTENCODING_MS_1361: - case RTL_TEXTENCODING_EUC_KR: - case RTL_TEXTENCODING_ISO_2022_KR: - aRangeSet.insert( CodeRange( 0x1100, 0x1200 ) ); - aRangeSet.insert( CodeRange( 0x3130, 0x3190 ) ); - aRangeSet.insert( CodeRange( 0xAC00, 0xD7A4 ) ); - break; - - // unknown encoding - case RTL_TEXTENCODING_DONTKNOW: - bHasUnknownEncoding = true; - break; - - // Unicode - case RTL_TEXTENCODING_UNICODE: - case RTL_TEXTENCODING_UTF7: - case RTL_TEXTENCODING_UTF8: - bHasUnicode = true; - break; - - // misc 8bit encodings - default: - if( !rtl_isOctetTextEncoding( eEncoding ) ) - bHasUnknownEncoding = true; - else - { - // use the unicode converter to get the coverage of an 8bit encoding - rtl_TextToUnicodeConverter aConverter = rtl_createTextToUnicodeConverter( eEncoding ); - rtl_UnicodeToTextContext aCvtContext = rtl_createTextToUnicodeContext( aConverter ); - if( !aConverter || !aCvtContext ) - bHasUnknownEncoding = true; - else - { - sal_Char cCharsInp[ 0x100 ]; - for( int j = 0x20; j < 0x080; ++j ) - cCharsInp[ j-0x20 ] = j; - for( int j = 0xA0; j < 0x100; ++j ) - cCharsInp[ j-0x40 ] = j; - - sal_Unicode cCharsOut[ 0x100 ]; - sal_uInt32 nCvtInfo; - sal_Size nSrcCvtBytes; - int nOutLen = rtl_convertTextToUnicode( - aConverter, aCvtContext, - cCharsInp, 0xC0, - cCharsOut, sizeof(cCharsOut)/sizeof(*cCharsOut), - RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE - | RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE, - &nCvtInfo, &nSrcCvtBytes ); - - for( int j = 0; j < nOutLen; ++j ) - aRangeSet.insert( CodeRange( cCharsOut[j], cCharsOut[j]+1 ) ); - - rtl_destroyTextToUnicodeConverter( aCvtContext ); - rtl_destroyTextToUnicodeConverter( aConverter ); - } - } - break; - } - } - - // unicode encoded fonts usually do not cover the entire unicode range - // => only use them to determine coverage when no other encodings are available - if( aRangeSet.empty() && (bHasUnicode || bHasUnknownEncoding) ) - { - if( pCodePairs ) - { - pCodePairs[0] = 0x0020; - pCodePairs[1] = 0xD800; - pCodePairs[2] = 0xE000; - pCodePairs[3] = 0xFFFE; - } - return 2; - } - - if( aRangeSet.empty() ) - return 0; - - // sort and merge the code pairs - sal_uInt32* pDst = pCodePairs; - RangeSet::const_iterator it = aRangeSet.begin(); - for( sal_uInt32 nEnd = 0; it != aRangeSet.end(); ++it ) - { - // check overlap with to previous range - const CodeRange& rSrc = *it; - if( nEnd < rSrc.GetMin() ) - { - nEnd = rSrc.GetEnd(); - if( pCodePairs ) - { - pDst[0] = rSrc.GetMin(); - pDst[1] = rSrc.GetEnd(); - } - pDst += 2; - } - else - { - // merge overlapping ranges - if( nEnd < rSrc.GetEnd() ) - { - nEnd = rSrc.GetEnd(); - if( pCodePairs ) - pDst[-1] = nEnd; - } - } - } - - int nRangeCount = (pDst - pCodePairs) / 2; - return nRangeCount; -} - -// ------ class to handle scalable bitmap fonts ------------------------------ - -ScalableBitmapXlfd::ScalableBitmapXlfd() -: ExtendedXlfd( true ) -{} - -ScalableBitmapXlfd::~ScalableBitmapXlfd() -{} - -void -ScalableBitmapXlfd::ToString( ByteString &rString, - unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtendedXlfd::ToString( rString, nPixelSize, nEncoding ); - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += '-'; - rString += ByteString::CreateFromInt32( nPixelSize ); - rString += "-0-"; - rString += ByteString::CreateFromInt32( rInfo.mnResolutionX ); - rString += '-'; - rString += ByteString::CreateFromInt32( rInfo.mnResolutionY ); - rString += '-'; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-0"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -void -ScalableBitmapXlfd::ToString( ByteString &rString, - unsigned short nPixelSize, char *pMatricsString, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtendedXlfd::ToString( rString, nPixelSize, nEncoding ); - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += "-*-"; - char pTmp[256]; - snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize ); - rString += pTmp; - rString += "-*-*-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-*"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -ImplFontData* ScalableBitmapXlfd::GetImplFontData() const -{ - ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 ); - pFontData->mnQuality= 0; - return pFontData; -} - -// ------ class to handle true bitmap fonts ---------------------------------- - -void -BitmapXlfd::ToString( ByteString &rString, - unsigned short nPixelSize, char *pMatricsString, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtendedXlfd::ToString( rString, nPixelSize, nEncoding ); - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += "-*-"; - char pTmp[256]; - snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize ); - rString += pTmp; - rString += "-*-*-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-*"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -BitmapXlfd::BitmapXlfd( ) -: ExtendedXlfd( false ) -{} - -BitmapXlfd::~BitmapXlfd( ) -{} - -bool -BitmapXlfd::AddEncoding( const Xlfd *pXlfd ) -{ - if ( mnEncodings == 0 ) - { - mnPixelSize = pXlfd->mnPixelSize; - mnPointSize = pXlfd->mnPointSize; - mnAverageWidth = pXlfd->mnAverageWidth; - } - - return ExtendedXlfd::AddEncoding( pXlfd ); -} - -void -BitmapXlfd::ToString( ByteString &rString, - unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtendedXlfd::ToString( rString, nPixelSize, nEncoding ); - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - rString += '-'; - rString += ByteString::CreateFromInt32( mnPixelSize ); - rString += "-*-*-*-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-*"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -ImplFontData* BitmapXlfd::GetImplFontData() const -{ - ImplX11FontData* pFontData = new ImplX11FontData( *this, mnPixelSize ); - pFontData->mnQuality= 100; - return pFontData; -} - -// ------ class to handle true scalable fonts -------------------------------- - -ScalableXlfd::ScalableXlfd() -: ExtendedXlfd( true ) -{} - -ScalableXlfd::~ScalableXlfd() -{} - -void -ScalableXlfd::ToString( ByteString &rString, - unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtendedXlfd::ToString( rString, nPixelSize, nEncoding); - - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += '-'; - rString += ByteString::CreateFromInt32( nPixelSize ); - rString += "-0-0-0-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-0"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -void -ScalableXlfd::ToString( ByteString &rString, - unsigned short nPixelSize, char* pMatricsString, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtendedXlfd::ToString( rString, nPixelSize, nEncoding); - - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += "-*-"; - char pTmp[256]; - snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize ); - rString += pTmp; - rString += "-*-*-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-*"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -ImplFontData* ScalableXlfd::GetImplFontData() const -{ - ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 ); - pFontData->mnQuality= 200; - return pFontData; -} - -/* ------- virtual fonts for user interface ------------------------------- */ - -VirtualXlfd::ExtEncodingInfo& -VirtualXlfd::ExtEncodingInfo::operator= ( const Xlfd *pXlfd ) -{ - mnFoundry = pXlfd->mnFoundry; - mnFamily = pXlfd->mnFamily; - mnWeight = pXlfd->mnWeight; - mnSlant = pXlfd->mnSlant; - mnSetwidth = pXlfd->mnSetwidth; - - return *this; -} - -VirtualXlfd::VirtualXlfd() -: ExtendedXlfd( true ), - mnExtCapacity(0), - mpExtEncodingInfo(NULL) -{ - mnFoundry = 0; - mnFamily = 0; - mnWeight = 0; - mnSlant = 0; - mnSetwidth = 0; -} - -VirtualXlfd::~VirtualXlfd() -{ - if ( mpExtEncodingInfo != NULL ) - rtl_freeMemory( mpExtEncodingInfo ); -} - -int -VirtualXlfd::GetFontQuality (unsigned short nFamily) -{ - Attribute *pFamily = mpFactory->RetrieveFamily(nFamily); - int nQuality = 0; - - if (pFamily->HasFeature(XLFD_FEATURE_HQ)) - nQuality += 16; - if (pFamily->HasFeature(XLFD_FEATURE_MQ)) - nQuality += 8; - if (pFamily->HasFeature(XLFD_FEATURE_LQ)) - nQuality += 4; - return nQuality; -} - -bool -VirtualXlfd::AddEncoding( const Xlfd *pXlfd ) -{ - // add new font - bool bRC = ExtendedXlfd::AddEncoding( pXlfd ); - - int nIdx; - if( bRC ) - { - // new encoding => append the new pXlfd - nIdx = mnEncodings - 1; - if( nIdx >= mnExtCapacity ) - { - mnExtCapacity = mnEncCapacity; - mpExtEncodingInfo = (ExtEncodingInfo*)Realloc( mpExtEncodingInfo, - mnExtCapacity * sizeof(ExtEncodingInfo) ); - } - } - else - { - // existing encoding => check if the new pXlfd is better - rtl_TextEncoding nEncoding = pXlfd->GetEncoding(); - nIdx = GetEncodingIdx( nEncoding ); - - int nOldQuality = GetFontQuality( mpExtEncodingInfo[nIdx].mnFamily ); - int nNewQuality = GetFontQuality( pXlfd->mnFamily ); - if( nOldQuality >= nNewQuality ) - return false; - } - - mpExtEncodingInfo[ nIdx ] = pXlfd; - return true; -} - -void -VirtualXlfd::FilterInterfaceFont (const Xlfd *pXlfd) -{ - Attribute *pAttr; - AttributeProvider *pFactory = pXlfd->mpFactory; - - if (! pXlfd->Fonttype() == TYPE_SCALABLE) - return; - pAttr = pFactory->RetrieveFamily(pXlfd->mnFamily); - if (! pAttr->HasFeature(XLFD_FEATURE_INTERFACE_FONT)) - return; - pAttr = pFactory->RetrieveSlant(pXlfd->mnSlant); - if (! (FontItalic)pAttr->GetValue() == ITALIC_NONE) - return; - pAttr = pFactory->RetrieveSetwidth(pXlfd->mnSetwidth); - if (pAttr->HasFeature(XLFD_FEATURE_NARROW)) - return; - pAttr = pFactory->RetrieveWeight(pXlfd->mnWeight); - FontWeight eWeight = (FontWeight)pAttr->GetValue(); - if ((eWeight != WEIGHT_NORMAL) && (eWeight != WEIGHT_MEDIUM)) - return; - - AddEncoding (pXlfd); -} - -void -VirtualXlfd::ToString( ByteString &rString, unsigned short nPixelSize, - rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtEncodingInfo &rExtInfo = mpExtEncodingInfo[ nIdx ]; - - AppendAttribute( mpFactory->RetrieveFoundry(rExtInfo.mnFoundry), rString ); - AppendAttribute( mpFactory->RetrieveFamily(rExtInfo.mnFamily), rString ); - AppendAttribute( mpFactory->RetrieveWeight(rExtInfo.mnWeight), rString ); - AppendAttribute( mpFactory->RetrieveSlant(rExtInfo.mnSlant), rString ); - AppendAttribute( mpFactory->RetrieveSetwidth(rExtInfo.mnSetwidth), rString ); - - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += '-'; - rString += ByteString::CreateFromInt32( nPixelSize ); - rString += "-0-0-0-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-0"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -void -VirtualXlfd::ToString( ByteString &rString, unsigned short nPixelSize, - char* pMatricsString, rtl_TextEncoding nEncoding ) const -{ - int nIdx = GetEncodingIdx( nEncoding ); - if ( nIdx < 0 ) - return; - - ExtEncodingInfo &rExtInfo = mpExtEncodingInfo[ nIdx ]; - - AppendAttribute( mpFactory->RetrieveFoundry(rExtInfo.mnFoundry), rString ); - AppendAttribute( mpFactory->RetrieveFamily(rExtInfo.mnFamily), rString ); - AppendAttribute( mpFactory->RetrieveWeight(rExtInfo.mnWeight), rString ); - AppendAttribute( mpFactory->RetrieveSlant(rExtInfo.mnSlant), rString ); - AppendAttribute( mpFactory->RetrieveSetwidth(rExtInfo.mnSetwidth), rString ); - - EncodingInfo& rInfo = mpEncodingInfo[ nIdx ]; - AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString ); - - rString += "-*-"; - char pTmp[256]; - snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize ); - rString += pTmp; - rString += "-*-*-"; - rString += static_cast< char >(rInfo.mcSpacing); - rString += "-*"; - - AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString ); -} - -ImplFontData* VirtualXlfd::GetImplFontData() const -{ - ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 ); - - // family name - static const String aFontName( RTL_CONSTASCII_USTRINGPARAM("Interface User") ); - pFontData->maName = aFontName; - // pFontData->maStyleName = aStyleName; - pFontData->meFamily = FAMILY_SWISS; - pFontData->meWeight = WEIGHT_NORMAL; - pFontData->meItalic = ITALIC_NONE; - pFontData->meWidthType = WIDTH_NORMAL; - pFontData->mePitch = PITCH_VARIABLE; - - pFontData->mbSymbolFlag = false; - pFontData->mbOrientation= false; - pFontData->mbDevice = true; - pFontData->mnQuality = 100; - - return pFontData; -} - -// ------ font list ------------------------------------------------------- - -XlfdStorage::XlfdStorage() -{ - maXlfdList.reserve( 256 ); -} - -void -XlfdStorage::Dispose() -{ - XlfdList::const_iterator it = maXlfdList.begin(); - for(; it != maXlfdList.end(); ++it ) - delete *it; - maXlfdList.clear(); -} - -void -XlfdStorage::Reset() -{ - maXlfdList.clear(); -} - -void -XlfdStorage::Add( const ExtendedXlfd* pXlfd ) -{ - if ( pXlfd != NULL ) - maXlfdList.push_back( pXlfd ); -} - -void -XlfdStorage::Add( const XlfdStorage* pXlfd ) -{ - if ( !pXlfd || pXlfd->maXlfdList.empty() ) - return; - - maXlfdList.reserve( maXlfdList.size() + pXlfd->maXlfdList.size() ); - XlfdList::const_iterator it = pXlfd->maXlfdList.begin(); - for(; it != pXlfd->maXlfdList.end(); ++it ) - maXlfdList.push_back( *it ); -} - -void XlfdStorage::AnnounceFonts( ImplDevFontList* pList ) const -{ - XlfdList::const_iterator it = maXlfdList.begin(); - for(; it != maXlfdList.end(); ++it ) - { - const ExtendedXlfd* pXlfd = *it; - ImplFontData* pFontData = pXlfd->GetImplFontData(); - pList->Add( pFontData ); - } -} - -// ------ bitmap font list -------------------------------------------------- - -void -BitmapXlfdStorage::AddBitmapFont( const Xlfd *pXlfd ) -{ - if ( pXlfd == NULL ) - return; - - int nPixelSize = pXlfd->mnPixelSize; - XlfdList::const_iterator it = maXlfdList.begin(); - for(; it != maXlfdList.end(); ++it ) - { - BitmapXlfd* pBitmapXlfd = (BitmapXlfd*)*it; - if( nPixelSize == pBitmapXlfd->GetPixelSize() ) - { - // we need to add an encoding to an existing bitmap font - pBitmapXlfd->AddEncoding( pXlfd ); - return; - } - } - - // we have a new bitmap font - BitmapXlfd* pBitmapXlfd = new BitmapXlfd; - pBitmapXlfd->AddEncoding( pXlfd ); - Add( pBitmapXlfd ); -} diff --git a/vcl/unx/source/gdi/xlfd_extd.hxx b/vcl/unx/source/gdi/xlfd_extd.hxx deleted file mode 100644 index 523f87fac477..000000000000 --- a/vcl/unx/source/gdi/xlfd_extd.hxx +++ /dev/null @@ -1,272 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef XLFD_EXTENDED_HXX -#define XLFD_EXTENDED_HXX - -#include -#ifndef _VCL_VCLENUM_HXX -#include -#endif -#ifndef _VCL_OUTFONT_HXX -#include -#endif - -#include - -class Xlfd; -class AttributeProvider; -class ImplDevFontList; -class ByteString; - -// -------------------------------------------------------------------------- -// -// classes for Xlfd handling that contain more than a single encoding. -// Members that may vary through different encodings are stored in -// a mpEncodingInfo member. There are three different classes: -// true scalable fonts (truetype and type1) scalable bitmap fonts -// (the ugly ones) and bitmap fonts. The ExtendedXlfd stores all the members -// that are specific to a font outline -// ( e.g. adobe-times-roman-medium-r-normal- * -p- * ) -// and specifies the interface. -// -// -------------------------------------------------------------------------- - -// base class - -class ExtendedXlfd : public ImplDevFontAttributes -{ - public: - ExtendedXlfd( bool bScalable ); - virtual ~ExtendedXlfd(); - virtual bool AddEncoding( const Xlfd* ); - bool HasEncoding( rtl_TextEncoding ) const; - int GetEncodingIdx( rtl_TextEncoding nEncoding ) const; - unsigned short NumEncodings() const - { return mnEncodings; } - virtual int GetPixelSize() const - { return 0; } - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - rtl_TextEncoding nEncoding ) const ; - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - char* pMatricsString, - rtl_TextEncoding nEncoding ) const; - - virtual ImplFontData* GetImplFontData() const = 0; - bool IsScalable() const { return mbScalable; } - virtual FontFamily GetFamilyType() const; - virtual FontWeight GetWeight() const; - virtual FontItalic GetSlant() const; - virtual FontWidth GetWidthType() const; - virtual FontPitch GetPitch() const; - virtual FontPitch GetPitch( rtl_TextEncoding ) const; - rtl_TextEncoding GetAsciiEncoding( int *pAsciiRange = NULL ) const; - rtl_TextEncoding GetEncoding() const; - rtl_TextEncoding GetEncoding( int i ) const; - - int GetFontCodeRanges( sal_uInt32* pCodePairs ) const; - - protected: - AttributeProvider* mpFactory; - - public: - unsigned short mnFoundry; - unsigned short mnFamily; - unsigned short mnWeight; - unsigned short mnSlant; - unsigned short mnSetwidth; - bool mbScalable; - - protected: - unsigned short mnEncodings; - unsigned short mnEncCapacity; - struct EncodingInfo { - unsigned char mcSpacing; - unsigned short mnResolutionX; - unsigned short mnResolutionY; - unsigned short mnAddstyle; - unsigned short mnCharset; - rtl_TextEncoding mnEncoding; - - EncodingInfo& operator= ( const Xlfd *pXlfd ); - } *mpEncodingInfo; -}; - -// class to handle scalable bitmap fonts - -class ScalableBitmapXlfd : public ExtendedXlfd { - - public: - ScalableBitmapXlfd(); - virtual ~ScalableBitmapXlfd(); - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - rtl_TextEncoding nEncoding ) const; - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - char* pMatricsString, - rtl_TextEncoding nEncoding ) const; - - virtual ImplFontData* GetImplFontData() const ; -}; - -// class to handle true bitmap fonts - -class ScalableXlfd; - -class BitmapXlfd : public ExtendedXlfd { - - public: - BitmapXlfd(); - ~BitmapXlfd(); - bool AddEncoding( const Xlfd* ); - virtual int GetPixelSize() const - { return mnPixelSize; } - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - rtl_TextEncoding nEncoding ) const; - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - char* pMatricsString, - rtl_TextEncoding nEncoding ) const; - virtual ImplFontData* GetImplFontData() const ; - protected: - - unsigned short mnPixelSize; - unsigned short mnPointSize; - unsigned short mnAverageWidth; -}; - -// class to handle true scalable fonts - -class ScalableXlfd : public ExtendedXlfd { - - friend class BitmapXlfd; - - public: - ScalableXlfd(); - virtual ~ScalableXlfd(); - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - rtl_TextEncoding nEncoding ) const; - - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - char* pMatricsString, - rtl_TextEncoding nEncoding ) const; - virtual ImplFontData* GetImplFontData() const ; -}; - -// class to maintain a list of fonts ( bitmap and scalable ) - -class XlfdStorage { - - public: - XlfdStorage(); - - void Dispose(); - void Reset(); - - void Add( const ExtendedXlfd *pXlfd ); - void Add( const XlfdStorage *pXlfd ); - void AnnounceFonts( ImplDevFontList* ) const; - - protected: - - typedef ::std::vector XlfdList; - XlfdList maXlfdList; -}; - -// list of fonts specific for bitmap fonts - -class BitmapXlfdStorage : public XlfdStorage { - - public: - - void AddBitmapFont( const Xlfd *pXlfd ); -}; - - -/* Virtual font for User Interface */ - -class VirtualXlfd : public ExtendedXlfd -{ - private: - - int GetFontQuality (unsigned short nFamily); - - public: - VirtualXlfd(); - virtual ~VirtualXlfd(); - virtual bool AddEncoding( const Xlfd* ); - void FilterInterfaceFont (const Xlfd *pXlfd); - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - rtl_TextEncoding nEncoding ) const ; - virtual void ToString( ByteString &rString, - unsigned short nPixelSize, - char* pMatricsString, - rtl_TextEncoding nEncoding ) const; - - virtual ImplFontData* GetImplFontData() const ; - protected: - - unsigned short mnExtCapacity; - struct ExtEncodingInfo { - unsigned short mnFoundry; - unsigned short mnFamily; - unsigned short mnWeight; - unsigned short mnSlant; - unsigned short mnSetwidth; - - ExtEncodingInfo& operator= ( const Xlfd *pXlfd ); - } *mpExtEncodingInfo; - - friend class ExtEncodingInfo; -}; - - -// class to describe a X11 physically available font face - -class ImplX11FontData : public ImplFontData -{ -private: - enum { X11IFD_MAGIC = 0x111FDA1C }; - const ExtendedXlfd& mrXlfd; - -public: - ImplX11FontData( const ExtendedXlfd&, int nHeight ); - const ExtendedXlfd& GetExtendedXlfd() const { return mrXlfd; } - virtual ImplFontData* Clone() const { return new ImplX11FontData( *this ); } - virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const; - virtual sal_IntPtr GetFontId() const; - - static bool CheckFontData( const ImplFontData& r ) { return r.CheckMagic( X11IFD_MAGIC ); } -}; - -#endif /* XLFD_EXTENDED_HXX */ diff --git a/vcl/unx/source/gdi/xlfd_smpl.cxx b/vcl/unx/source/gdi/xlfd_smpl.cxx deleted file mode 100644 index 6cf18d98de1e..000000000000 --- a/vcl/unx/source/gdi/xlfd_smpl.cxx +++ /dev/null @@ -1,268 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" -#include -#include -#include -#include "xlfd_attr.hxx" -#include "xlfd_smpl.hxx" - -// -------------------------------------------------------------------------- -// -// -// broken down structure equivalent to a Xlfd string -// -// -// -------------------------------------------------------------------------- - -Xlfd::Xlfd() -{ -} - -// XlfdCompare abi has to be qsort(3) compatible, the sorting result must -// guarantee that fonts with SameFontoutline() are successive -// XlfdCompare relies on vFrom->mpFactory eq vTo->mpFactory. Since comparing -// Xlfd's is done by comparing attributes there is no way around this. -extern "C" int -XlfdCompare( const void *vFrom, const void *vTo ) -{ - const Xlfd *pFrom = (Xlfd*)vFrom; - const Xlfd *pTo = (Xlfd*)vTo; - - // Compare outline description - if ( pFrom->mnFoundry != pTo->mnFoundry ) - return (int)pFrom->mnFoundry - (int)pTo->mnFoundry; - if ( pFrom->mnFamily != pTo->mnFamily ) - return (int)pFrom->mnFamily - (int)pTo->mnFamily; - if ( pFrom->mnWeight != pTo->mnWeight ) - return (int)pFrom->mnWeight - (int)pTo->mnWeight; - if ( pFrom->mnSlant != pTo->mnSlant ) - return (int)pFrom->mnSlant - (int)pTo->mnSlant; - if ( pFrom->mnSetwidth != pTo->mnSetwidth ) - return (int)pFrom->mnSetwidth - (int)pTo->mnSetwidth; - - // Addstyle name is futile tricky. it may contain encoding information - // (like "ansi_1251") which Compares equal, or it may contain style - // information (like "serif") which Compares unequal, anyway if the font - // is "interface user" or "interface system" then compare equal anyway to - // build fontsets as large as possible - if ( pFrom->mnAddstyle == pTo->mnAddstyle ) - return 0; - - AttributeProvider *pFactory = pFrom->mpFactory; - Attribute *pFamily = pFactory->RetrieveFamily( pFrom->mnFamily ); - if ( pFamily->HasFeature(XLFD_FEATURE_APPLICATION_FONT) ) - return 0; - - Attribute *pFromAddStyle = pFactory->RetrieveAddstyle( pFrom->mnAddstyle ); - Attribute *pToAddStyle = pFactory->RetrieveAddstyle( pTo->mnAddstyle ); - - // if both addstyles denote encodings or if one denotes an - // encoding and the other denotes a style which really - // duplicates weight and slant information - - int nFromCompare = (pFromAddStyle->GetValue() != RTL_TEXTENCODING_DONTKNOW) - || (pFromAddStyle->HasFeature(XLFD_FEATURE_REDUNDANTSTYLE)) ? - -1 : pFrom->mnAddstyle; - int nToCompare = (pToAddStyle->GetValue() != RTL_TEXTENCODING_DONTKNOW) - || (pToAddStyle->HasFeature(XLFD_FEATURE_REDUNDANTSTYLE)) ? - -1 : pTo->mnAddstyle; - - return nFromCompare - nToCompare; -} - -// check whether two fonts are identical as appearance is concerned -// this does not Compare the actual scaling of two fonts -Bool -Xlfd::SameFontoutline( const Xlfd* pComparedTo ) const -{ - void* pThis = (void*)this; - return XlfdCompare( (void*)pThis, (void*)pComparedTo ) == 0 ; -} - -unsigned short -Xlfd::GetEncoding() const -{ - Attribute *pAddstyle = mpFactory->RetrieveAddstyle( mnAddstyle ); - if ( pAddstyle->GetValue() != RTL_TEXTENCODING_DONTKNOW ) - return pAddstyle->GetValue(); - - Attribute *pEncoding = mpFactory->RetrieveCharset( mnCharset ); - return pEncoding->GetValue(); -} - -XlfdFonttype -Xlfd::Fonttype() const -{ - if ( (mnAverageWidth == 0) && (mnPixelSize == 0) && (mnPointSize == 0) ) - { - return (mnResolutionX == 0) - && (mnResolutionY == 0) ? eTypeScalable : eTypeScalableBitmap; - } - - return eTypeBitmap; -} - -void -Advance( const char** pFrom, const char** pTo ) -{ - const char *pTmp = *pTo; - - for( ; (*pTmp != '\0') && (*pTmp++ != '-'); ) - {} - *pFrom = *pTo; - *pTo = pTmp; -} - -Bool -Xlfd::IsConformant (const char* pXlfd) const -{ - // X FontNameRegistry prefix "-" - if (*pXlfd++ != '-') - return False; - - // All Xlfd FontName fields are defined - int nNumFields = 1; - while (*pXlfd != '\0') - { - if (*pXlfd++ == '-') - nNumFields++; - } - // enough entries ? - if (nNumFields != 14) - return False; - // and the last one is not empty as well ? - if (*(pXlfd - 1) == '-') - return False; - - return True; -} - -// this is the real workhorse function. Since this is called for every font -// in the fontpath it has to be as fast a possible -Bool -Xlfd::FromString( const char* pXlfdstring, AttributeProvider *pFactory ) -{ - if (!IsConformant(pXlfdstring)) - return False; - - const char* pFrom = pXlfdstring + 1; - const char* pTo = pFrom; - mpFactory = pFactory; - - Advance( &pFrom, &pTo ); //-foundry-* - mnFoundry = mpFactory->InsertFoundry( pFrom, pTo - pFrom - 1 ); - - Advance( &pFrom, &pTo ); // -*-family-* - mnFamily = mpFactory->InsertFamily( pFrom, pTo - pFrom - 1 ); - - Advance( &pFrom, &pTo ); // -*-*-weight-* - mnWeight = mpFactory->InsertWeight( pFrom, pTo - pFrom - 1 ); - - Advance( &pFrom, &pTo ); //-*-*-*-slant-* - mnSlant = mpFactory->InsertSlant( pFrom, pTo - pFrom - 1 ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-setwidth-* - mnSetwidth = mpFactory->InsertSetwidth( pFrom, pTo - pFrom - 1 ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-Addstyle-* - mnAddstyle = mpFactory->InsertAddstyle( pFrom, pTo - pFrom - 1 ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-height-* - mnPixelSize = atoi( pFrom ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-pt height-* - mnPointSize = atoi( pFrom ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-x resolution-* - mnResolutionX = atoi( pFrom ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-y resolution-* - mnResolutionY = atoi( pFrom ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-spacing-* - mcSpacing = pFrom == pTo ? '\0' : *pFrom; - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-*-average-* - mnAverageWidth = atoi( pFrom ); - - Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-*-*-registry-encoding - const char* pTmp = pFrom; - Advance( &pTmp, &pTo ); - mnCharset = mpFactory->InsertCharset( pFrom, pTo - pFrom ); - - // sanity check whether we have really found a valid XLFD, if not - // throw away the whole font, since we have no idea what parts of - // the XLFD contains the error. - if ( !(pTo > pFrom) ) - return False; - - // a non-empty family name is essential, since otherwise the font - // would match the "default font" #52299# - Attribute* pFamily = mpFactory->RetrieveFamily( mnFamily ); - const char* pFamilyName = pFamily->GetName(); - if ( pFamilyName[0] == '\0' ) - return False; - - // well done - return True; -} - -#if OSL_DEBUG_LEVEL > 1 -// pure debug for now: this is only to inspect/pretty print a Xlfd struct -const char* -Xlfd::ToString( ByteString &rString ) const -{ - AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString ); - AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString ); - AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString ); - AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString ); - AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString ); - AppendAttribute( mpFactory->RetrieveAddstyle(mnAddstyle), rString ); - - rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnPixelSize ) ); - rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnPointSize ) ); - rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnResolutionX ) ); - rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnResolutionY ) ); - rString.Append("-"); rString.Append( (char)mcSpacing ); - rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnAverageWidth ) ); - - AppendAttribute( mpFactory->RetrieveCharset(mnCharset), rString ); - - return rString.GetBuffer() ; -} - -void -Xlfd::Dump() const -{ - ByteString aString; - fprintf(stderr, "Xlfd: %s\n", ToString(aString) ); -} -#endif - diff --git a/vcl/unx/source/gdi/xlfd_smpl.hxx b/vcl/unx/source/gdi/xlfd_smpl.hxx deleted file mode 100644 index f62ac381e6b9..000000000000 --- a/vcl/unx/source/gdi/xlfd_smpl.hxx +++ /dev/null @@ -1,92 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef XLFD_SIMPLE_HXX -#define XLFD_SIMPLE_HXX - -#include -#include -#include - -class AttributeProvider; - -// -------------------------------------------------------------------------- -// -// -// broken down structure equivalent to a Xlfd string -// -// -// -------------------------------------------------------------------------- - -enum XlfdFonttype { - eTypeUnknown = TYPE_DONTKNOW, - eTypeBitmap = TYPE_RASTER, - eTypeScalableBitmap = TYPE_VECTOR, - eTypeScalable = TYPE_SCALABLE -}; - -class Xlfd { - - public: - - unsigned short mnFoundry; - unsigned short mnFamily; - unsigned short mnWeight; - unsigned short mnSlant; - unsigned short mnSetwidth; - unsigned short mnAddstyle; - unsigned short mnPixelSize; - unsigned short mnPointSize; - unsigned short mnResolutionX; - unsigned short mnResolutionY; - unsigned char mcSpacing; - unsigned short mnAverageWidth; - unsigned short mnCharset; - - // all foundry, family, weight ... information referres - // to this factory - AttributeProvider *mpFactory; - - Bool IsConformant( const char* pXlfdstring ) const; - - public: - Xlfd(); - Bool FromString( const char* pXlfdstring, - AttributeProvider *pFactory ); - Bool SameFontoutline( const Xlfd *pComparedTo ) const ; - XlfdFonttype Fonttype() const ; - unsigned short GetEncoding() const ; - #if OSL_DEBUG_LEVEL > 1 - const char* ToString( ByteString &rString ) const ; - void Dump() const; - #endif -}; - -extern "C" int -XlfdCompare( const void *vFrom, const void *vTo ); - -#endif /* XLFD_SIMPLE_HXX */ - -- cgit From 098a95148b87e2cae95912459703ac5b2fb9b722 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 17 Nov 2010 11:35:55 +0100 Subject: #i110171# FontGC is still needed for clipping/forcedAA/gtk/kde-plugins --- vcl/unx/source/gdi/salgdi.cxx | 8 +++++++- vcl/unx/source/gdi/salgdi3.cxx | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index b2e40310a03e..10532b811d68 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -111,6 +111,7 @@ X11SalGraphics::X11SalGraphics() nPenPixel_ = 0; nPenColor_ = MAKE_SALCOLOR( 0x00, 0x00, 0x00 ); // Black + pFontGC_ = NULL; for( int i = 0; i < MAX_FALLBACK; ++i ) mpServerFont[i] = NULL; @@ -140,6 +141,7 @@ X11SalGraphics::X11SalGraphics() bPrinter_ = FALSE; bVirDev_ = FALSE; bPenGC_ = FALSE; + bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; @@ -169,6 +171,7 @@ void X11SalGraphics::freeResources() if( hBrush_ ) XFreePixmap( pDisplay, hBrush_ ), hBrush_ = None; if( pPenGC_ ) XFreeGC( pDisplay, pPenGC_ ), pPenGC_ = None; + if( pFontGC_ ) XFreeGC( pDisplay, pFontGC_ ), pFontGC_ = None; if( pBrushGC_ ) XFreeGC( pDisplay, pBrushGC_ ), pBrushGC_ = None; if( pMonoGC_ ) XFreeGC( pDisplay, pMonoGC_ ), pMonoGC_ = None; if( pCopyGC_ ) XFreeGC( pDisplay, pCopyGC_ ), pCopyGC_ = None; @@ -183,7 +186,7 @@ void X11SalGraphics::freeResources() if( m_aRenderPicture ) XRenderPeer::GetInstance().FreePicture( m_aRenderPicture ), m_aRenderPicture = 0; - bPenGC_ = bBrushGC_ = bMonoGC_ = bCopyGC_ = bInvertGC_ = bInvert50GC_ = bStippleGC_ = bTrackingGC_ = false; + bPenGC_ = bFontGC_ = bBrushGC_ = bMonoGC_ = bCopyGC_ = bInvertGC_ = bInvert50GC_ = bStippleGC_ = bTrackingGC_ = false; } void X11SalGraphics::SetDrawable( Drawable aDrawable, int nScreen ) @@ -576,6 +579,7 @@ void X11SalGraphics::ResetClipRegion() if( pClipRegion_ ) { bPenGC_ = FALSE; + bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; @@ -625,6 +629,7 @@ bool X11SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& ) void X11SalGraphics::EndSetClipRegion() { bPenGC_ = FALSE; + bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; @@ -749,6 +754,7 @@ void X11SalGraphics::SetXORMode( bool bSet, bool ) { bXORMode_ = bSet; bPenGC_ = FALSE; + bFontGC_ = FALSE; bBrushGC_ = FALSE; bMonoGC_ = FALSE; bCopyGC_ = FALSE; diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 360c7e95d8f9..0861b778ed57 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -993,6 +993,7 @@ X11SalGraphics::SetTextColor( SalColor nSalColor ) { nTextColor_ = nSalColor; nTextPixel_ = GetPixel( nSalColor ); + bFontGC_ = FALSE; } } -- cgit From 84444c912fd76c38d39c9db7ad94648b49e912ba Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 17 Nov 2010 15:10:23 +0100 Subject: #i110171# remove obsoleted fwd-decls and dbg-utils --- vcl/unx/inc/salgdi.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index 6a77d4bacf96..8af62a5c6607 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -28,10 +28,6 @@ #ifndef _SV_SALGDI_H #define _SV_SALGDI_H - -// -=-= exports -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -class SalFontCacheItem; - // -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #include "salstd.hxx" #include "vcl/salgdi.hxx" @@ -383,19 +379,8 @@ inline Pixel X11SalGraphics::GetPixel( SalColor nSalColor ) const #ifdef DBG_UTIL #define stderr0( s ) fprintf( stderr, s ) -#define stderr1( s, a ) fprintf( stderr, s, a ) -#define stderr2( s, a, b ) fprintf( stderr, s, a, b ) -#define stderr3( s, a, b, c ) fprintf( stderr, s, a, b, c ) -#define stdass0( b ) (void)( !(b) \ - ? fprintf( stderr, "\"%s\" (%s line %d)\n", \ - #b, __FILE__, __LINE__ ) \ - : 0 ) #else #define stderr0( s ) ; -#define stderr1( s, a ) ; -#define stderr2( s, a, b ) ; -#define stderr3( s, a, b, c ) ; -#define stdass0( b ) ; #endif #endif // _SV_SALGDI_H -- cgit From f01fbf1d4f68ddd9dae19de5138e213764be8c1d Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 17 Nov 2010 15:36:53 +0100 Subject: #i115635# finish of remainders of xprint usage --- vcl/unx/inc/i18n_im.hxx | 4 ---- vcl/unx/source/app/saldisp.cxx | 5 ----- vcl/unx/source/gdi/makefile.mk | 5 ----- vcl/unx/source/gdi/salgdi.cxx | 5 ----- vcl/unx/source/gdi/salgdi3.cxx | 18 ------------------ vcl/unx/source/window/salframe.cxx | 2 -- vcl/util/target.pmk | 5 ----- 7 files changed, 44 deletions(-) diff --git a/vcl/unx/inc/i18n_im.hxx b/vcl/unx/inc/i18n_im.hxx index 297bc8edec17..a22a57b976c8 100644 --- a/vcl/unx/inc/i18n_im.hxx +++ b/vcl/unx/inc/i18n_im.hxx @@ -56,10 +56,6 @@ public: Bool FilterEvent( XEvent *pEvent, XLIB_Window window ); Bool AddConnectionWatch (Display *pDisplay, void *pConnectionHandler); - #ifdef _USE_PRINT_EXTENSION_ - void Invalidate() { mbUseable = False; } - #endif - SalI18N_InputMethod(); ~SalI18N_InputMethod(); }; diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index cd3d7ea06fde..92d5f75f7315 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -375,11 +375,6 @@ sal_GetServerVendor( Display *p_display ) { vendor_none, NULL, 0 }, }; -#ifdef _USE_PRINT_EXTENSION_ - if ( ! XSalIsDisplay( p_display ) ) - return vendor_xprinter; -#endif - // handle regular server vendors char *p_name = ServerVendor( p_display ); vendor_t *p_vendor; diff --git a/vcl/unx/source/gdi/makefile.mk b/vcl/unx/source/gdi/makefile.mk index 7e889266a831..123fcbcf9131 100644 --- a/vcl/unx/source/gdi/makefile.mk +++ b/vcl/unx/source/gdi/makefile.mk @@ -64,13 +64,8 @@ EXCEPTIONSFILES=\ $(SLO)$/salgdi3.obj \ $(SLO)$/salcvt.obj -.IF "$(USE_XPRINT)" == "TRUE" -CFLAGS+=-D_USE_PRINT_EXTENSION_=1 -SLOFILES+=$(SLO)$/xprintext.obj -.ELSE SLOFILES+=$(SLO)$/salprnpsp.obj EXCEPTIONSFILES+=$(SLO)$/salprnpsp.obj -.ENDIF .IF "$(OS)"=="SOLARIS" SLOFILES+=$(SLO)$/cdeint.obj diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 10532b811d68..9dfbfff22d03 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -335,13 +335,8 @@ GC X11SalGraphics::SelectBrush() { XSetFillStyle ( pDisplay, pBrushGC_, FillSolid ); XSetForeground( pDisplay, pBrushGC_, nBrushPixel_ ); - #if defined(_USE_PRINT_EXTENSION_) - XSetBackground( pDisplay, pBrushGC_, - WhitePixel(pDisplay, DefaultScreen(pDisplay)) ); - #else if( bPrinter_ ) XSetTile( pDisplay, pBrushGC_, None ); - #endif } else { diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 0861b778ed57..d9f81c0f67d2 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -160,18 +160,10 @@ X11SalGraphics::GetFontGC() values.fill_rule = EvenOddRule; // Pict import/ Gradient values.graphics_exposures = False; values.foreground = nTextPixel_; -#ifdef _USE_PRINT_EXTENSION_ - values.background = xColormap_->GetWhitePixel(); - pFontGC_ = XCreateGC( pDisplay, hDrawable_, - GCSubwindowMode | GCFillRule - | GCGraphicsExposures | GCBackground | GCForeground, - &values ); -#else pFontGC_ = XCreateGC( pDisplay, hDrawable_, GCSubwindowMode | GCFillRule | GCGraphicsExposures | GCForeground, &values ); -#endif } if( !bFontGC_ ) { @@ -1372,7 +1364,6 @@ BOOL X11SalGraphics::CreateFontSubset( const void* X11SalGraphics::GetEmbedFontData( const ImplFontData* pFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen ) { -#ifndef _USE_PRINT_EXTENSION_ // in this context the pFont->GetFontId() is a valid PSP // font since they are the only ones left after the PDF // export has filtered its list of subsettable fonts (for @@ -1380,25 +1371,19 @@ const void* X11SalGraphics::GetEmbedFontData( const ImplFontData* pFont, const s // be to have the GlyphCache search for the ImplFontData pFont psp::fontID aFont = pFont->GetFontId(); return PspGraphics::DoGetEmbedFontData( aFont, pUnicodes, pWidths, rInfo, pDataLen ); -#else - return NULL; -#endif } //-------------------------------------------------------------------------- void X11SalGraphics::FreeEmbedFontData( const void* pData, long nLen ) { -#ifndef _USE_PRINT_EXTENSION_ PspGraphics::DoFreeEmbedFontData( pData, nLen ); -#endif } //-------------------------------------------------------------------------- const Ucs2SIntMap* X11SalGraphics::GetFontEncodingVector( const ImplFontData* pFont, const Ucs2OStrMap** pNonEncoded ) { -#ifndef _USE_PRINT_EXTENSION_ // in this context the pFont->GetFontId() is a valid PSP // font since they are the only ones left after the PDF // export has filtered its list of subsettable fonts (for @@ -1406,9 +1391,6 @@ const Ucs2SIntMap* X11SalGraphics::GetFontEncodingVector( const ImplFontData* pF // be to have the GlyphCache search for the ImplFontData pFont psp::fontID aFont = pFont->GetFontId(); return PspGraphics::DoGetFontEncodingVector( aFont, pNonEncoded ); -#else - return NULL; -#endif } //-------------------------------------------------------------------------- diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index 9934277302e1..11c20aa40f5a 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -3588,9 +3588,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent ) if( FocusIn == pEvent->type ) { -#ifndef _USE_PRINT_EXTENSION_ vcl_sal::PrinterUpdate::update(); -#endif mbInputFocus = True; ImplSVData* pSVData = ImplGetSVData(); diff --git a/vcl/util/target.pmk b/vcl/util/target.pmk index 3144acc4bc05..8ec15475bc90 100644 --- a/vcl/util/target.pmk +++ b/vcl/util/target.pmk @@ -37,8 +37,3 @@ ONLYDLL .SETDIR=$(PRJ)$/util: $(SLOFILES) dmake debug=t prjpch=t linkinc=t compinc=t ..$/$(OUTPATH)$/bin$/sv$(DLLPOSTFIX).dll @echo "READY" -.IF "$(USE_XPRINT)"!="TRUE" -.ELSE -CFLAGS+=-D_USE_PRINT_EXTENSION_=1 -.ENDIF - -- cgit From 5bfa292fa2935335d2bf62a5655099798ed37ae6 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 18 Nov 2010 12:04:52 +0100 Subject: vcl117: solve some compilation issues --- vcl/win/source/gdi/salgdi3.cxx | 276 +++++++++++++++++++-------------------- vcl/win/source/gdi/winlayout.cxx | 3 +- 2 files changed, 139 insertions(+), 140 deletions(-) mode change 100644 => 100755 vcl/win/source/gdi/salgdi3.cxx mode change 100644 => 100755 vcl/win/source/gdi/winlayout.cxx diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx old mode 100644 new mode 100755 index 29e4bd786735..91662fb8aded --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -1907,22 +1907,21 @@ ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ) } mnFontKernPairCount = 0; - KERNINGPAIR* pPairs = NULL; - int nCount = ::GetKerningPairsW( mhDC, 0, NULL ); - if( nCount ) - { -#ifdef GCP_KERN_HACK - pPairs = new KERNINGPAIR[ nCount+1 ]; - mpFontKernPairs = pPairs; - mnFontKernPairCount = nCount; - ::GetKerningPairsW( mhDC, nCount, pPairs ); -#else // GCP_KERN_HACK - pPairs = pKernPairs; - nCount = (nCount < nPairs) : nCount : nPairs; - ::GetKerningPairsW( mhDC, nCount, pPairs ); - return nCount; -#endif // GCP_KERN_HACK - } + KERNINGPAIR* pPairs = NULL; + int nCount = ::GetKerningPairsW( mhDC, 0, NULL ); + if( nCount ) + { + #ifdef GCP_KERN_HACK + pPairs = new KERNINGPAIR[ nCount+1 ]; + mpFontKernPairs = pPairs; + mnFontKernPairCount = nCount; + ::GetKerningPairsW( mhDC, nCount, pPairs ); + #else // GCP_KERN_HACK + pPairs = pKernPairs; + nCount = (nCount < nPairs) : nCount : nPairs; + ::GetKerningPairsW( mhDC, nCount, pPairs ); + return nCount; + #endif // GCP_KERN_HACK } mbFontKernInit = FALSE; @@ -2491,147 +2490,146 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex, return FALSE; // TODO: avoid tools polygon by creating B2DPolygon directly - int nPtSize = 512; - Point* pPoints = new Point[ nPtSize ]; - BYTE* pFlags = new BYTE[ nPtSize ]; + int nPtSize = 512; + Point* pPoints = new Point[ nPtSize ]; + BYTE* pFlags = new BYTE[ nPtSize ]; + + TTPOLYGONHEADER* pHeader = (TTPOLYGONHEADER*)pData; + while( (BYTE*)pHeader < pData+nSize2 ) + { + // only outline data is interesting + if( pHeader->dwType != TT_POLYGON_TYPE ) + break; + + // get start point; next start points are end points + // of previous segment + USHORT nPnt = 0; - TTPOLYGONHEADER* pHeader = (TTPOLYGONHEADER*)pData; - while( (BYTE*)pHeader < pData+nSize2 ) + long nX = IntTimes256FromFixed( pHeader->pfxStart.x ); + long nY = IntTimes256FromFixed( pHeader->pfxStart.y ); + pPoints[ nPnt ] = Point( nX, nY ); + pFlags[ nPnt++ ] = POLY_NORMAL; + + bool bHasOfflinePoints = false; + TTPOLYCURVE* pCurve = (TTPOLYCURVE*)( pHeader + 1 ); + pHeader = (TTPOLYGONHEADER*)( (BYTE*)pHeader + pHeader->cb ); + while( (BYTE*)pCurve < (BYTE*)pHeader ) + { + int nNeededSize = nPnt + 16 + 3 * pCurve->cpfx; + if( nPtSize < nNeededSize ) { - // only outline data is interesting - if( pHeader->dwType != TT_POLYGON_TYPE ) - break; - - // get start point; next start points are end points - // of previous segment - USHORT nPnt = 0; - - long nX = IntTimes256FromFixed( pHeader->pfxStart.x ); - long nY = IntTimes256FromFixed( pHeader->pfxStart.y ); - pPoints[ nPnt ] = Point( nX, nY ); - pFlags[ nPnt++ ] = POLY_NORMAL; - - bool bHasOfflinePoints = false; - TTPOLYCURVE* pCurve = (TTPOLYCURVE*)( pHeader + 1 ); - pHeader = (TTPOLYGONHEADER*)( (BYTE*)pHeader + pHeader->cb ); - while( (BYTE*)pCurve < (BYTE*)pHeader ) + Point* pOldPoints = pPoints; + BYTE* pOldFlags = pFlags; + nPtSize = 2 * nNeededSize; + pPoints = new Point[ nPtSize ]; + pFlags = new BYTE[ nPtSize ]; + for( USHORT i = 0; i < nPnt; ++i ) { - int nNeededSize = nPnt + 16 + 3 * pCurve->cpfx; - if( nPtSize < nNeededSize ) - { - Point* pOldPoints = pPoints; - BYTE* pOldFlags = pFlags; - nPtSize = 2 * nNeededSize; - pPoints = new Point[ nPtSize ]; - pFlags = new BYTE[ nPtSize ]; - for( USHORT i = 0; i < nPnt; ++i ) - { - pPoints[ i ] = pOldPoints[ i ]; - pFlags[ i ] = pOldFlags[ i ]; - } - delete[] pOldPoints; - delete[] pOldFlags; - } + pPoints[ i ] = pOldPoints[ i ]; + pFlags[ i ] = pOldFlags[ i ]; + } + delete[] pOldPoints; + delete[] pOldFlags; + } - int i = 0; - if( TT_PRIM_LINE == pCurve->wType ) + int i = 0; + if( TT_PRIM_LINE == pCurve->wType ) + { + while( i < pCurve->cpfx ) + { + nX = IntTimes256FromFixed( pCurve->apfx[ i ].x ); + nY = IntTimes256FromFixed( pCurve->apfx[ i ].y ); + ++i; + pPoints[ nPnt ] = Point( nX, nY ); + pFlags[ nPnt ] = POLY_NORMAL; + ++nPnt; + } + } + else if( TT_PRIM_QSPLINE == pCurve->wType ) + { + bHasOfflinePoints = true; + while( i < pCurve->cpfx ) + { + // get control point of quadratic bezier spline + nX = IntTimes256FromFixed( pCurve->apfx[ i ].x ); + nY = IntTimes256FromFixed( pCurve->apfx[ i ].y ); + ++i; + Point aControlP( nX, nY ); + + // calculate first cubic control point + // P0 = 1/3 * (PBeg + 2 * PQControl) + nX = pPoints[ nPnt-1 ].X() + 2 * aControlP.X(); + nY = pPoints[ nPnt-1 ].Y() + 2 * aControlP.Y(); + pPoints[ nPnt+0 ] = Point( (2*nX+3)/6, (2*nY+3)/6 ); + pFlags[ nPnt+0 ] = POLY_CONTROL; + + // calculate endpoint of segment + nX = IntTimes256FromFixed( pCurve->apfx[ i ].x ); + nY = IntTimes256FromFixed( pCurve->apfx[ i ].y ); + + if ( i+1 >= pCurve->cpfx ) { - while( i < pCurve->cpfx ) - { - nX = IntTimes256FromFixed( pCurve->apfx[ i ].x ); - nY = IntTimes256FromFixed( pCurve->apfx[ i ].y ); - ++i; - pPoints[ nPnt ] = Point( nX, nY ); - pFlags[ nPnt ] = POLY_NORMAL; - ++nPnt; - } + // endpoint is either last point in segment => advance + ++i; } - else if( TT_PRIM_QSPLINE == pCurve->wType ) + else { - bHasOfflinePoints = true; - while( i < pCurve->cpfx ) - { - // get control point of quadratic bezier spline - nX = IntTimes256FromFixed( pCurve->apfx[ i ].x ); - nY = IntTimes256FromFixed( pCurve->apfx[ i ].y ); - ++i; - Point aControlP( nX, nY ); - - // calculate first cubic control point - // P0 = 1/3 * (PBeg + 2 * PQControl) - nX = pPoints[ nPnt-1 ].X() + 2 * aControlP.X(); - nY = pPoints[ nPnt-1 ].Y() + 2 * aControlP.Y(); - pPoints[ nPnt+0 ] = Point( (2*nX+3)/6, (2*nY+3)/6 ); - pFlags[ nPnt+0 ] = POLY_CONTROL; - - // calculate endpoint of segment - nX = IntTimes256FromFixed( pCurve->apfx[ i ].x ); - nY = IntTimes256FromFixed( pCurve->apfx[ i ].y ); - - if ( i+1 >= pCurve->cpfx ) - { - // endpoint is either last point in segment => advance - ++i; - } - else - { - // or endpoint is the middle of two control points - nX += IntTimes256FromFixed( pCurve->apfx[ i-1 ].x ); - nY += IntTimes256FromFixed( pCurve->apfx[ i-1 ].y ); - nX = (nX + 1) / 2; - nY = (nY + 1) / 2; - // no need to advance, because the current point - // is the control point in next bezier spline - } - - pPoints[ nPnt+2 ] = Point( nX, nY ); - pFlags[ nPnt+2 ] = POLY_NORMAL; - - // calculate second cubic control point - // P1 = 1/3 * (PEnd + 2 * PQControl) - nX = pPoints[ nPnt+2 ].X() + 2 * aControlP.X(); - nY = pPoints[ nPnt+2 ].Y() + 2 * aControlP.Y(); - pPoints[ nPnt+1 ] = Point( (2*nX+3)/6, (2*nY+3)/6 ); - pFlags[ nPnt+1 ] = POLY_CONTROL; - - nPnt += 3; - } + // or endpoint is the middle of two control points + nX += IntTimes256FromFixed( pCurve->apfx[ i-1 ].x ); + nY += IntTimes256FromFixed( pCurve->apfx[ i-1 ].y ); + nX = (nX + 1) / 2; + nY = (nY + 1) / 2; + // no need to advance, because the current point + // is the control point in next bezier spline } - // next curve segment - pCurve = (TTPOLYCURVE*)&pCurve->apfx[ i ]; - } + pPoints[ nPnt+2 ] = Point( nX, nY ); + pFlags[ nPnt+2 ] = POLY_NORMAL; - // end point is start point for closed contour - // disabled, because Polygon class closes the contour itself - // pPoints[nPnt++] = pPoints[0]; - // #i35928# - // Added again, but add only when not yet closed - if(pPoints[nPnt - 1] != pPoints[0]) - { - if( bHasOfflinePoints ) - pFlags[nPnt] = pFlags[0]; + // calculate second cubic control point + // P1 = 1/3 * (PEnd + 2 * PQControl) + nX = pPoints[ nPnt+2 ].X() + 2 * aControlP.X(); + nY = pPoints[ nPnt+2 ].Y() + 2 * aControlP.Y(); + pPoints[ nPnt+1 ] = Point( (2*nX+3)/6, (2*nY+3)/6 ); + pFlags[ nPnt+1 ] = POLY_CONTROL; - pPoints[nPnt++] = pPoints[0]; + nPnt += 3; } + } - // convert y-coordinates W32 -> VCL - for( int i = 0; i < nPnt; ++i ) - pPoints[i].Y() = -pPoints[i].Y(); + // next curve segment + pCurve = (TTPOLYCURVE*)&pCurve->apfx[ i ]; + } - // insert into polypolygon - Polygon aPoly( nPnt, pPoints, (bHasOfflinePoints ? pFlags : NULL) ); - // convert to B2DPolyPolygon - // TODO: get rid of the intermediate PolyPolygon - rB2DPolyPoly.append( aPoly.getB2DPolygon() ); - } + // end point is start point for closed contour + // disabled, because Polygon class closes the contour itself + // pPoints[nPnt++] = pPoints[0]; + // #i35928# + // Added again, but add only when not yet closed + if(pPoints[nPnt - 1] != pPoints[0]) + { + if( bHasOfflinePoints ) + pFlags[nPnt] = pFlags[0]; - delete[] pPoints; - delete[] pFlags; + pPoints[nPnt++] = pPoints[0]; + } - delete[] pData; + // convert y-coordinates W32 -> VCL + for( int i = 0; i < nPnt; ++i ) + pPoints[i].Y() = -pPoints[i].Y(); + + // insert into polypolygon + Polygon aPoly( nPnt, pPoints, (bHasOfflinePoints ? pFlags : NULL) ); + // convert to B2DPolyPolygon + // TODO: get rid of the intermediate PolyPolygon + rB2DPolyPoly.append( aPoly.getB2DPolygon() ); } + delete[] pPoints; + delete[] pFlags; + + delete[] pData; + // rescaling needed for the PolyPolygon conversion if( rB2DPolyPoly.count() ) { diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx old mode 100644 new mode 100755 index 6a4bbe885bd3..a4c588f059d4 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -671,7 +671,8 @@ void SimpleWinLayout::DrawText( SalGraphics& rGraphics ) const UINT oldTa = ::GetTextAlign( aHDC ); ::SetTextAlign( aHDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP ); ::MoveToEx( aHDC, aPos.X(), aPos.Y(), &oldPos ); - for( int i = 0, n = 0; n < numGlyphPortions; ++n, i+=maxGlyphCount ) + unsigned int i = 0; + for( unsigned int n = 0; n < numGlyphPortions; ++n, i+=maxGlyphCount ) ::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL, mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i ); ::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL, -- cgit From 140e83be45834d050d91cd7fad5984f690be09d4 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 18 Nov 2010 15:28:06 +0100 Subject: vcl117: #i114937# give application a hint for cleanup, call DeInitVCL --- vcl/aqua/source/app/vclnsapp.mm | 120 ++++++++++++++++++++++------------------ 1 file changed, 67 insertions(+), 53 deletions(-) diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm index caa506772272..df089fe17cb1 100755 --- a/vcl/aqua/source/app/vclnsapp.mm +++ b/vcl/aqua/source/app/vclnsapp.mm @@ -358,71 +358,85 @@ -(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app { - YIELD_GUARD; - + bool bCallDeInit = false; NSApplicationTerminateReply aReply = NSTerminateNow; - - SalData* pSalData = GetSalData(); - #if 1 // currently do some really bad hack - if( ! pSalData->maFrames.empty() ) { - /* #i92766# something really weird is going on with the retain count of - our windows; sometimes we get a duplicate free before exit on one of our - NSWindows. The reason is unclear; to avoid this currently we retain them once more - - FIXME: this is a really bad hack, relying on the system to catch the leaked - resources. Find out what really goes on here and fix it ! - */ - std::vector< NSWindow* > aHackRetainedWindows; - for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin(); - it != pSalData->maFrames.end(); ++it ) - { - #if OSL_DEBUG_LEVEL > 1 - Window* pWin = (*it)->GetWindow(); - String aTitle = pWin->GetText(); - Window* pClient = pWin->ImplGetClientWindow(); - fprintf( stderr, "retaining %p (old count %d) windowtype=%s clienttyp=%s title=%s\n", - (*it)->mpWindow, [(*it)->mpWindow retainCount], - typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "", - rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr() - ); - #endif - [(*it)->mpWindow retain]; - aHackRetainedWindows.push_back( (*it)->mpWindow ); - } - if( pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ) + YIELD_GUARD; + + SalData* pSalData = GetSalData(); + #if 0 // currently do some really bad hack + if( ! pSalData->maFrames.empty() ) { - for( std::vector< NSWindow* >::iterator it = aHackRetainedWindows.begin(); - it != aHackRetainedWindows.end(); ++it ) + /* #i92766# something really weird is going on with the retain count of + our windows; sometimes we get a duplicate free before exit on one of our + NSWindows. The reason is unclear; to avoid this currently we retain them once more + + FIXME: this is a really bad hack, relying on the system to catch the leaked + resources. Find out what really goes on here and fix it ! + */ + std::vector< NSWindow* > aHackRetainedWindows; + for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin(); + it != pSalData->maFrames.end(); ++it ) { - // clean up the retaing count again from the shutdown workaround #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "releasing %p\n", (*it) ); + Window* pWin = (*it)->GetWindow(); + String aTitle = pWin->GetText(); + Window* pClient = pWin->ImplGetClientWindow(); + fprintf( stderr, "retaining %p (old count %d) windowtype=%s clienttyp=%s title=%s\n", + (*it)->mpWindow, [(*it)->mpWindow retainCount], + typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "", + rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr() + ); #endif - [(*it) release]; + [(*it)->mpWindow retain]; + aHackRetainedWindows.push_back( (*it)->mpWindow ); } - aReply = NSTerminateCancel; + if( pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ) + { + for( std::vector< NSWindow* >::iterator it = aHackRetainedWindows.begin(); + it != aHackRetainedWindows.end(); ++it ) + { + // clean up the retaing count again from the shutdown workaround + #if OSL_DEBUG_LEVEL > 1 + fprintf( stderr, "releasing %p\n", (*it) ); + #endif + [(*it) release]; + } + aReply = NSTerminateCancel; + } + #if OSL_DEBUG_LEVEL > 1 + for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin(); + it != pSalData->maFrames.end(); ++it ) + { + Window* pWin = (*it)->GetWindow(); + String aTitle = pWin->GetText(); + Window* pClient = pWin->ImplGetClientWindow(); + fprintf( stderr, "frame still alive: NSWindow %p windowtype=%s clienttyp=%s title=%s\n", + (*it)->mpWindow, typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "", + rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr() + ); + } + #endif } - #if OSL_DEBUG_LEVEL > 1 - for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin(); - it != pSalData->maFrames.end(); ++it ) + #else // the clean version follows + if( ! pSalData->maFrames.empty() ) + aReply = pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow; + #endif + + if( aReply != NSTerminateNow ) + [NSApp activateIgnoringOtherApps: YES]; + else { - Window* pWin = (*it)->GetWindow(); - String aTitle = pWin->GetText(); - Window* pClient = pWin->ImplGetClientWindow(); - fprintf( stderr, "frame still alive: NSWindow %p windowtype=%s clienttyp=%s title=%s\n", - (*it)->mpWindow, typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "", - rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr() - ); + ApplicationEvent aEv( String(), ApplicationAddress(), ByteString( "PRIVATE:DOSHUTDOWN" ), String() ); + GetpApp()->AppEvent( aEv ); + // call DeInitVCL only after our YIELD_GUARD has expired, + // else its Mutex will be alredy destroyed when it runs out of scope ! + bCallDeInit = true; } - #endif } - #else // the clean version follows - aReply = pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow; - #endif + if( bCallDeInit ) + DeInitVCL(); - if( aReply != NSTerminateNow ) - [NSApp activateIgnoringOtherApps: YES]; return aReply; } -- cgit From 84cbdc6a58981f13c4cae43163d065c7de7eb55c Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 18 Nov 2010 15:28:06 +0100 Subject: vcl117: #i114937# give application a hint for cleanup, call DeInitVCL --- desktop/inc/app.hxx | 2 ++ desktop/source/app/app.cxx | 88 +++++++++++++++++++++++++++++++--------------- 2 files changed, 62 insertions(+), 28 deletions(-) diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index 8eb4dd3cc25b..b64327bd7232 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -65,6 +65,8 @@ class Desktop : public Application { friend class UserInstall; + void doShutdown(); + public: enum BootstrapError { diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index d80aa37fdece..afc957275c35 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1487,8 +1487,26 @@ void Desktop::AppEvent( const ApplicationEvent& rAppEvent ) HandleAppEvent( rAppEvent ); } +struct ExecuteGlobals +{ + Reference < css::document::XEventListener > xGlobalBroadcaster; + sal_Bool bRestartRequested; + sal_Bool bUseSystemFileDialog; + std::auto_ptr pLanguageOptions; + std::auto_ptr pPathOptions; + + ExecuteGlobals() + : bRestartRequested( sal_False ) + , bUseSystemFileDialog( sal_True ) + {} +}; + +static ExecuteGlobals* pExecGlobals = NULL; + void Desktop::Main() { + pExecGlobals = new ExecuteGlobals(); + RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::Main" ); // Remember current context object @@ -1546,14 +1564,8 @@ void Desktop::Main() Reference< XMultiServiceFactory > xSMgr = ::comphelper::getProcessServiceFactory(); - std::auto_ptr pLanguageOptions; - std::auto_ptr pPathOptions; - Reference< ::com::sun::star::task::XRestartManager > xRestartManager; - sal_Bool bRestartRequested( sal_False ); - sal_Bool bUseSystemFileDialog(sal_True); int nAcquireCount( 0 ); - Reference < css::document::XEventListener > xGlobalBroadcaster; try { RegisterServices( xSMgr ); @@ -1659,7 +1671,7 @@ void Desktop::Main() SetDisplayName( aTitle ); // SetSplashScreenProgress(30); RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create SvtPathOptions and SvtLanguageOptions" ); - pPathOptions.reset( new SvtPathOptions); + pExecGlobals->pPathOptions.reset( new SvtPathOptions); // SetSplashScreenProgress(40); // pLanguageOptions = new SvtLanguageOptions(sal_True); // SetSplashScreenProgress(45); @@ -1678,7 +1690,7 @@ void Desktop::Main() } // create service for loadin SFX (still needed in startup) - xGlobalBroadcaster = Reference < css::document::XEventListener > + pExecGlobals->xGlobalBroadcaster = Reference < css::document::XEventListener > ( xSMgr->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.frame.GlobalEventBroadcaster" ) ), UNO_QUERY ); @@ -1734,13 +1746,13 @@ void Desktop::Main() } // keep a language options instance... - pLanguageOptions.reset( new SvtLanguageOptions(sal_True)); + pExecGlobals->pLanguageOptions.reset( new SvtLanguageOptions(sal_True)); - if (xGlobalBroadcaster.is()) + if (pExecGlobals->xGlobalBroadcaster.is()) { css::document::EventObject aEvent; aEvent.EventName = ::rtl::OUString::createFromAscii("OnStartApp"); - xGlobalBroadcaster->notifyEvent(aEvent); + pExecGlobals->xGlobalBroadcaster->notifyEvent(aEvent); } SetSplashScreenProgress(50); @@ -1759,7 +1771,7 @@ void Desktop::Main() } // check whether the shutdown is caused by restart - bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); + pExecGlobals->bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); if ( pCmdLineArgs->IsHeadless() ) { @@ -1767,11 +1779,11 @@ void Desktop::Main() // headless mode relies on Application::EnableHeadlessMode() // which does only work for VCL dialogs!! SvtMiscOptions aMiscOptions; - bUseSystemFileDialog = aMiscOptions.UseSystemFileDialog(); + pExecGlobals->bUseSystemFileDialog = aMiscOptions.UseSystemFileDialog(); aMiscOptions.SetUseSystemFileDialog( sal_False ); } - if ( !bRestartRequested ) + if ( !pExecGlobals->bRestartRequested ) { if ( (pCmdLineArgs->IsEmptyOrAcceptOnly() ) && @@ -1860,7 +1872,7 @@ void Desktop::Main() aOptions.SetVCLSettings(); // SetSplashScreenProgress(60); - if ( !bRestartRequested ) + if ( !pExecGlobals->bRestartRequested ) { Application::SetFilterHdl( LINK( this, Desktop, ImplInitFilterHdl ) ); @@ -1928,9 +1940,9 @@ void Desktop::Main() new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) ); // check whether the shutdown is caused by restart just before entering the Execute - bRestartRequested = bRestartRequested || ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); + pExecGlobals->bRestartRequested = pExecGlobals->bRestartRequested || ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); - if ( !bRestartRequested ) + if ( !pExecGlobals->bRestartRequested ) { // if this run of the office is triggered by restart, some additional actions should be done DoRestartActionsIfNecessary( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoQuickstart() ); @@ -1949,44 +1961,57 @@ void Desktop::Main() FatalError( MakeStartupErrorMessage(exAnyCfg.Message) ); } } + // CAUTION: you do not necessarily get here e.g. on the Mac. + // please put all deinitialization code into doShutdown + doShutdown(); +} + +void Desktop::doShutdown() +{ + if( ! pExecGlobals ) + return; - if ( bRestartRequested ) + if ( pExecGlobals->bRestartRequested ) SetRestartState(); - if (xGlobalBroadcaster.is()) + if (pExecGlobals->xGlobalBroadcaster.is()) { css::document::EventObject aEvent; aEvent.EventName = ::rtl::OUString::createFromAscii("OnCloseApp"); - xGlobalBroadcaster->notifyEvent(aEvent); + pExecGlobals->xGlobalBroadcaster->notifyEvent(aEvent); } - delete pResMgr; + delete pResMgr, pResMgr = NULL; // Restore old value + CommandLineArgs* pCmdLineArgs = GetCommandLineArgs(); if ( pCmdLineArgs->IsHeadless() ) - SvtMiscOptions().SetUseSystemFileDialog( bUseSystemFileDialog ); + SvtMiscOptions().SetUseSystemFileDialog( pExecGlobals->bUseSystemFileDialog ); // remove temp directory RemoveTemporaryDirectory(); FlushConfiguration(); // The acceptors in the AcceptorMap must be released (in DeregisterServices) // with the solar mutex unlocked, to avoid deadlock: - nAcquireCount = Application::ReleaseSolarMutex(); + ULONG nAcquireCount = Application::ReleaseSolarMutex(); DeregisterServices(); Application::AcquireSolarMutex(nAcquireCount); tools::DeInitTestToolLib(); // be sure that path/language options gets destroyed before // UCB is deinitialized RTL_LOGFILE_CONTEXT_TRACE( aLog, "-> dispose path/language options" ); - pLanguageOptions.reset( 0 ); - pPathOptions.reset( 0 ); + pExecGlobals->pLanguageOptions.reset( 0 ); + pExecGlobals->pPathOptions.reset( 0 ); RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- dispose path/language options" ); RTL_LOGFILE_CONTEXT_TRACE( aLog, "-> deinit ucb" ); ::ucbhelper::ContentBroker::deinitialize(); RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- deinit ucb" ); + sal_Bool bRR = pExecGlobals->bRestartRequested; + delete pExecGlobals, pExecGlobals = NULL; + RTL_LOGFILE_CONTEXT_TRACE( aLog, "FINISHED WITH Destop::Main" ); - if ( bRestartRequested ) + if ( bRR ) { restartOnMac(true); // wouldn't the solution be more clean if SalMain returns the exit code to the system? @@ -2101,9 +2126,9 @@ sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r // unfortunately this broke the QUARTZ behavior which is to always run // in quickstart mode since Mac applications do not usually quit // when the last document closes - #ifndef QUARTZ + //#ifndef QUARTZ if ( bQuickstart ) - #endif + //#endif { Reference < XComponent > xQuickstart( rSMgr->createInstanceWithArguments( DEFINE_CONST_UNICODE( "com.sun.star.office.Quickstart" ), aSeq ), @@ -3198,6 +3223,13 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) catch(const css::uno::Exception&) {} } + else if( rAppEvent.GetEvent() == "PRIVATE:DOSHUTDOWN" ) + { + Desktop* pD = dynamic_cast(GetpApp()); + OSL_ENSURE( pD, "no desktop ?!?" ); + if( pD ) + pD->doShutdown(); + } } void Desktop::OpenSplashScreen() -- cgit From 7d914d89219cca3c179951e5c8516726712c9ac5 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 19 Nov 2010 16:24:37 +0100 Subject: vcl117: #i115607# support NWF for menus on Windows --- vcl/inc/vcl/salnativewidgets.hxx | 19 ++++ vcl/source/gdi/outdevnative.cxx | 63 +++--------- vcl/source/window/menu.cxx | 60 ++++++----- vcl/win/inc/saldata.hxx | 7 ++ vcl/win/source/app/salinst.cxx | 3 + vcl/win/source/gdi/salnativewidgets-luna.cxx | 143 +++++++++++++++++++++++++-- vcl/win/source/window/salframe.cxx | 40 ++++++++ 7 files changed, 254 insertions(+), 81 deletions(-) mode change 100644 => 100755 vcl/inc/vcl/salnativewidgets.hxx mode change 100644 => 100755 vcl/source/gdi/outdevnative.cxx mode change 100644 => 100755 vcl/source/window/menu.cxx mode change 100644 => 100755 vcl/win/inc/saldata.hxx mode change 100644 => 100755 vcl/win/source/app/salinst.cxx diff --git a/vcl/inc/vcl/salnativewidgets.hxx b/vcl/inc/vcl/salnativewidgets.hxx old mode 100644 new mode 100755 index 19c34cbc5e34..621cf0e90c5a --- a/vcl/inc/vcl/salnativewidgets.hxx +++ b/vcl/inc/vcl/salnativewidgets.hxx @@ -175,6 +175,7 @@ typedef sal_uInt32 ControlPart; #define PART_MENU_ITEM 250 #define PART_MENU_ITEM_CHECK_MARK 251 #define PART_MENU_ITEM_RADIO_MARK 252 +#define PART_MENU_SEPARATOR 253 /* #i77549# HACK: for scrollbars in case of thumb rect, page up and page down rect we @@ -432,6 +433,24 @@ public: int maTopDockingAreaHeight; }; +/* MenupopupValue: + * + * Value container for menu items; specifies the rectangle for the whole item which + * may be useful when drawing parts with a smaller rectangle. + */ +class MenupopupValue : public ImplControlValue +{ +public: + MenupopupValue() : ImplControlValue( CTRL_MENU_POPUP, BUTTONVALUE_DONTKNOW, 0 ) + {} + MenupopupValue( long i_nGutterWidth, const Rectangle& i_rItemRect ) + : ImplControlValue( CTRL_MENU_POPUP, BUTTONVALUE_DONTKNOW, i_nGutterWidth ) + , maItemRect( i_rItemRect ) + {} + virtual ~MenupopupValue(); + Rectangle maItemRect; +}; + /* PushButtonValue: * * Value container for pushbuttons specifying additional drawing hints diff --git a/vcl/source/gdi/outdevnative.cxx b/vcl/source/gdi/outdevnative.cxx old mode 100644 new mode 100755 index 521f4d7ea62d..b5b745b708fa --- a/vcl/source/gdi/outdevnative.cxx +++ b/vcl/source/gdi/outdevnative.cxx @@ -87,6 +87,10 @@ MenubarValue::~MenubarValue() { } +MenupopupValue::~MenupopupValue() +{ +} + PushButtonValue::~PushButtonValue() { } @@ -200,49 +204,20 @@ static boost::shared_ptr< ImplControlValue > lcl_transformControlValue( const Im case CTRL_GENERIC: aResult.reset( new ImplControlValue( rVal ) ); break; - default: - OSL_ENSURE( 0, "unknown ImplControlValue type !" ); - break; - } - return aResult; -} - -#if 0 -static void lcl_moveControlValue( ControlType nType, const ImplControlValue& aValue, const Point& rDelta ) -{ - switch( aValue.getType() ) - { - case CTRL_SLIDER: - { - SliderValue* pSlVal = static_cast(const_cast(&aValue)); - pSlVal->maThumbRect.Move( rDelta.X(), rDelta.Y() ); - } - break; - case CTRL_SCROLLBAR: - { - ScrollbarValue* pScVal = static_cast(const_cast(&aValue)); - pScVal->maThumbRect.Move( rDelta.X(), rDelta.Y() ); - pScVal->maButton1Rect.Move( rDelta.X(), rDelta.Y() ); - pScVal->maButton2Rect.Move( rDelta.X(), rDelta.Y() ); - } - break; - case CTRL_SPINBOX: - case CTRL_SPINBUTTONS: + case CTRL_MENU_POPUP: { - SpinbuttonValue* pSpVal = static_cast(const_cast(&aValue)); - pSpVal->maUpperRect.Move( rDelta.X(), rDelta.Y() ); - pSpVal->maLowerRect.Move( rDelta.X(), rDelta.Y() ); + const MenupopupValue* pMVal = static_cast(&rVal); + MenupopupValue* pNew = new MenupopupValue( *pMVal ); + pNew->maItemRect = rDev.ImplLogicToDevicePixel( pMVal->maItemRect ); + aResult.reset( pNew ); } break; - case CTRL_TOOLBAR: - { - ToolbarValue* pTVal = static_cast(const_cast(&aValue)); - pTVal->maGripRect.Move( rDelta.X(), rDelta.Y() ); - } + default: + OSL_ENSURE( 0, "unknown ImplControlValue type !" ); break; } + return aResult; } -#endif BOOL OutputDevice::DrawNativeControl( ControlType nType, ControlPart nPart, @@ -254,20 +229,6 @@ BOOL OutputDevice::DrawNativeControl( ControlType nType, if( !lcl_enableNativeWidget( *this ) ) return FALSE; - /* - if( !IsInPaint() && IsPaintTransparent() ) - { - // only required if called directly (ie, we're not in Paint() ): - // force redraw (Paint()) for transparent controls - // to trigger a repaint of the background - Region aClipRgn( GetClipRegion() ); - if( !rControlRegion.IsEmpty() ) - aClipRgn.Intersect( rControlRegion ); - Invalidate( aClipRgn, INVALIDATE_UPDATE ); - return TRUE; - } - */ - // make sure the current clip region is initialized correctly if ( !mpGraphics ) if ( !ImplGetGraphics() ) diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx old mode 100644 new mode 100755 index 52ad54957dd0..5909ab9f8489 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -96,6 +96,7 @@ DBG_NAME( Menu ) #define EXTRASPACEY 2 #define EXTRAITEMHEIGHT 4 +#define GUTTERBORDER 8 // document closer #define IID_DOCUMENTCLOSE 1 @@ -2670,14 +2671,36 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* // Separator if ( !bLayout && !bIsMenuBar && ( pData->eType == MENUITEM_SEPARATOR ) ) { - aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2); - aTmpPos.X() = aPos.X() + 2 + nOuterSpace; - pWin->SetLineColor( rSettings.GetShadowColor() ); - pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) ); - aTmpPos.Y()++; - pWin->SetLineColor( rSettings.GetLightColor() ); - pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) ); - pWin->SetLineColor(); + bool bNativeOk = false; + if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, + PART_MENU_SEPARATOR ) ) + { + ControlState nState = 0; + if ( pData->bEnabled ) + nState |= CTRL_STATE_ENABLED; + if ( bHighlighted ) + nState |= CTRL_STATE_SELECTED; + Size aSz( pData->aSz ); + aSz.Width() = aOutSz.Width() - 2*nOuterSpace; + Rectangle aItemRect( aPos, aSz ); + MenupopupValue aVal( nTextPos-GUTTERBORDER, aItemRect ); + bNativeOk = pWin->DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_SEPARATOR, + aItemRect, + nState, + aVal, + OUString() ); + } + if( ! bNativeOk ) + { + aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2); + aTmpPos.X() = aPos.X() + 2 + nOuterSpace; + pWin->SetLineColor( rSettings.GetShadowColor() ); + pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) ); + aTmpPos.Y()++; + pWin->SetLineColor( rSettings.GetLightColor() ); + pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) ); + pWin->SetLineColor(); + } } Rectangle aOuterCheckRect( Point( aPos.X()+nCheckPos, aPos.Y() ), Size( pData->aSz.Height(), pData->aSz.Height() ) ); @@ -2722,10 +2745,11 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2; Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) ); + MenupopupValue aVal( nTextPos-GUTTERBORDER, Rectangle( aPos, pData->aSz ) ); pWin->DrawNativeControl( CTRL_MENU_POPUP, nPart, aCheckRect, nState, - ImplControlValue(), + aVal, OUString() ); } else if ( pData->bChecked ) // by default do nothing for unchecked items @@ -2845,16 +2869,6 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* aDecoView.DrawSymbol( Rectangle( aTmpPos, Size( nFontHeight/2, nFontHeight/2 ) ), SYMBOL_SPIN_RIGHT, pWin->GetTextColor(), nSymbolStyle ); -// if ( pData->nBits & MIB_POPUPSELECT ) -// { -// aTmpPos.Y() += nFontHeight/2 ; -// pWin->SetLineColor( rSettings.GetShadowColor() ); -// pWin->DrawLine( aTmpPos, Point( aTmpPos.X() + nFontHeight/3, aTmpPos.Y() ) ); -// pWin->SetLineColor( rSettings.GetLightColor() ); -// aTmpPos.Y()++; -// pWin->DrawLine( aTmpPos, Point( aTmpPos.X() + nFontHeight/3, aTmpPos.Y() ) ); -// pWin->SetLineColor(); -// } } if ( pThisItemOnly && bHighlighted ) @@ -4724,10 +4738,11 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) Push( PUSH_CLIPREGION ); IntersectClipRegion( Rectangle( Point( nX, nY ), Size( aSz.Width(), pData->aSz.Height() ) ) ); Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) ); + MenupopupValue aVal( pMenu->nTextPos-GUTTERBORDER, aItemRect ); DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED, - ImplControlValue(), + aVal, OUString() ); if( bHighlight && IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM ) ) @@ -4736,7 +4751,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, aItemRect, CTRL_STATE_SELECTED | ( pData->bEnabled? CTRL_STATE_ENABLED: 0 ), - ImplControlValue(), + aVal, OUString() ) ) { bDrawItemRect = bHighlight; @@ -5071,10 +5086,11 @@ void MenuFloatingWindow::Paint( const Rectangle& ) long nX = pMenu->pLogo ? pMenu->pLogo->aBitmap.GetSizePixel().Width() : 0; Size aPxSize( GetOutputSizePixel() ); aPxSize.Width() -= nX; + ImplControlValue aVal( pMenu->nTextPos-GUTTERBORDER ); DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, Rectangle( Point( nX, 0 ), aPxSize ), CTRL_STATE_ENABLED, - ImplControlValue(), + aVal, OUString() ); ImplInitClipRegion(); } diff --git a/vcl/win/inc/saldata.hxx b/vcl/win/inc/saldata.hxx old mode 100644 new mode 100755 index a960d117eed0..a29010fa6d4b --- a/vcl/win/inc/saldata.hxx +++ b/vcl/win/inc/saldata.hxx @@ -33,6 +33,8 @@ #include #include +#include "osl/module.h" + #include // for hMenu validation #include @@ -46,6 +48,8 @@ class Font; struct HDCCache; struct TempFontItem; +typedef HRESULT (WINAPI *DwmIsCompositionEnabled_ptr)(WIN_BOOL*); + // -------------------- // - Standard-Defines - // -------------------- @@ -131,12 +135,15 @@ public: SalIcon* mpFirstIcon; // icon cache, points to first icon, NULL if none TempFontItem* mpTempFontItem; BOOL mbThemeChanged; // true if visual theme was changed: throw away theme handles + BOOL mbThemeMenuSupport; // for GdiPlus GdiplusStartup/GdiplusShutdown ULONG_PTR gdiplusToken; std::set< HMENU > mhMenuSet; // keeps track of menu handles created by VCL, used by IsKnownMenuHandle() std::map< UINT,USHORT > maVKMap; // map some dynamic VK_* entries + oslModule maDwmLib; + DwmIsCompositionEnabled_ptr mpDwmIsCompositionEnabled; }; inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; } diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx old mode 100644 new mode 100755 index d05f64d147ed..c056bf8281ba --- a/vcl/win/source/app/salinst.cxx +++ b/vcl/win/source/app/salinst.cxx @@ -434,9 +434,12 @@ SalData::SalData() mpFirstIcon = 0; // icon cache, points to first icon, NULL if none mpTempFontItem = 0; mbThemeChanged = FALSE; // true if visual theme was changed: throw away theme handles + mbThemeMenuSupport = FALSE; // init with NULL gdiplusToken = 0; + maDwmLib = 0; + mpDwmIsCompositionEnabled = 0; initKeyCodeMap(); diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx index 8197fb37cd6d..97e3e1b48c79 100755 --- a/vcl/win/source/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx @@ -188,6 +188,8 @@ void SalData::deInitNWF( void ) iter++; } aThemeMap.clear(); + if( maDwmLib ) + osl_unloadModule( maDwmLib ); } static HTHEME getThemeHandle( HWND hWnd, LPCWSTR name ) @@ -286,6 +288,22 @@ BOOL WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP case CTRL_MENUBAR: if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"Rebar"); + else if( GetSalData()->mbThemeMenuSupport ) + { + if( nPart == PART_MENU_ITEM ) + hTheme = getThemeHandle( mhWnd, L"Menu" ); + } + break; + case CTRL_MENU_POPUP: + if( GetSalData()->mbThemeMenuSupport ) + { + if( nPart == PART_ENTIRE_CONTROL || + nPart == PART_MENU_ITEM || + nPart == PART_MENU_ITEM_CHECK_MARK || + nPart == PART_MENU_ITEM_RADIO_MARK || + nPart == PART_MENU_SEPARATOR ) + hTheme = getThemeHandle( mhWnd, L"Menu" ); + } break; case CTRL_PROGRESS: if( nPart == PART_ENTIRE_CONTROL ) @@ -867,15 +885,23 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nType == CTRL_MENUBAR ) { - if( nPart != PART_ENTIRE_CONTROL ) - return FALSE; - - if( aValue.getType() == CTRL_MENUBAR ) + if( nPart == PART_ENTIRE_CONTROL ) { - const MenubarValue *pValue = static_cast(&aValue); - rc.bottom += pValue->maTopDockingAreaHeight; // extend potential gradient to cover docking area as well + if( aValue.getType() == CTRL_MENUBAR ) + { + const MenubarValue *pValue = static_cast(&aValue); + rc.bottom += pValue->maTopDockingAreaHeight; // extend potential gradient to cover docking area as well + } + return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); + } + else if( nPart == PART_MENU_ITEM ) + { + if( (nState & CTRL_STATE_ENABLED) ) + iState = (nState & CTRL_STATE_SELECTED) ? MBI_HOT : MBI_NORMAL; + else + iState = (nState & CTRL_STATE_SELECTED) ? MBI_DISABLEDHOT : MBI_DISABLED; + return ImplDrawTheme( hTheme, hDC, MENU_BARITEM, iState, rc, aCaption ); } - return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); } if( nType == CTRL_PROGRESS ) @@ -954,6 +980,69 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption ); } + if( GetSalData()->mbThemeMenuSupport ) + { + if( nType == CTRL_MENU_POPUP ) + { + if( nPart == PART_ENTIRE_CONTROL ) + { + RECT aGutterRC = rc; + aGutterRC.left += aValue.getNumericVal(); + aGutterRC.right = aGutterRC.left+3; + return + ImplDrawTheme( hTheme, hDC, MENU_POPUPBACKGROUND, 0, rc, aCaption ) && + ImplDrawTheme( hTheme, hDC, MENU_POPUPGUTTER, 0, aGutterRC, aCaption ) + ; + } + else if( nPart == PART_MENU_ITEM ) + { + if( (nState & CTRL_STATE_ENABLED) ) + iState = (nState & CTRL_STATE_SELECTED) ? MPI_HOT : MPI_NORMAL; + else + iState = (nState & CTRL_STATE_SELECTED) ? MPI_DISABLEDHOT : MPI_DISABLED; + return ImplDrawTheme( hTheme, hDC, MENU_POPUPITEM, iState, rc, aCaption ); + } + else if( nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK ) + { + if( (nState & CTRL_STATE_PRESSED) ) + { + RECT aBGRect = rc; + if( aValue.getType() == CTRL_MENU_POPUP ) + { + const MenupopupValue& rMVal( static_cast(aValue) ); + aBGRect.left = rMVal.maItemRect.Left(); + aBGRect.top = rMVal.maItemRect.Top(); + aBGRect.bottom = rMVal.maItemRect.Bottom()+1; // see below in drawNativeControl + aBGRect.right = rMVal.getNumericVal(); + + // FIXME: magic + aBGRect.left += 1; aBGRect.top += 1; aBGRect.bottom +=1; + } + iState = (nState & CTRL_STATE_ENABLED) ? MCB_NORMAL : MCB_DISABLED; + ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECKBACKGROUND, iState, aBGRect, aCaption ); + if( nPart == PART_MENU_ITEM_CHECK_MARK ) + iState = (nState & CTRL_STATE_ENABLED) ? MC_CHECKMARKNORMAL : MC_CHECKMARKDISABLED; + else + iState = (nState & CTRL_STATE_ENABLED) ? MC_BULLETNORMAL : MC_BULLETDISABLED; + return ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECK, iState, rc, aCaption ); + } + else + return true; // unchecked: do nothing + } + else if( nPart == PART_MENU_SEPARATOR ) + { + rc.left += aValue.getNumericVal(); // adjust for gutter position + Rectangle aRect( ImplGetThemeRect( hTheme, hDC, + MENU_POPUPSEPARATOR, 0, Rectangle( rc.left, rc.top, rc.right, rc.bottom ) ) ); + // center the separator inside the passed rectangle + long nDY = ((rc.bottom - rc.top + 1) - aRect.GetHeight()) / 2; + rc.top += nDY; + rc.bottom = rc.top+aRect.GetHeight()-1; + return ImplDrawTheme( hTheme, hDC, MENU_POPUPSEPARATOR, 0, rc, aCaption ); + } + } + } + return false; } @@ -1027,6 +1116,11 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType, case CTRL_MENUBAR: if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"Rebar"); + else if( GetSalData()->mbThemeMenuSupport ) + { + if( nPart == PART_MENU_ITEM ) + hTheme = getThemeHandle( mhWnd, L"Menu" ); + } break; case CTRL_PROGRESS: if( nPart == PART_ENTIRE_CONTROL ) @@ -1040,6 +1134,16 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType, if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA ) hTheme = getThemeHandle( mhWnd, L"Trackbar" ); break; + case CTRL_MENU_POPUP: + if( GetSalData()->mbThemeMenuSupport ) + { + if( nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM || + nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK || + nPart == PART_MENU_SEPARATOR + ) + hTheme = getThemeHandle( mhWnd, L"Menu" ); + } + break; default: hTheme = NULL; break; @@ -1196,7 +1300,7 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType, HTHEME hTheme = getThemeHandle( mhWnd, L"Edit"); if( hTheme ) { - // get borderr size + // get border size Rectangle aBoxRect( rControlRegion ); Rectangle aRect( ImplGetThemeRect( hTheme, hDC, EP_BACKGROUNDWITHBORDER, EBWBS_HOT, aBoxRect ) ); @@ -1225,6 +1329,29 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType, } } + if( GetSalData()->mbThemeMenuSupport ) + { + if( nType == CTRL_MENU_POPUP ) + { + if( nPart == PART_MENU_ITEM_CHECK_MARK || + nPart == PART_MENU_ITEM_RADIO_MARK ) + { + HTHEME hTheme = getThemeHandle( mhWnd, L"Menu"); + Rectangle aBoxRect( rControlRegion ); + Rectangle aRect( ImplGetThemeRect( hTheme, hDC, + MENU_POPUPCHECK, + MC_CHECKMARKNORMAL, + aBoxRect ) ); + if( aBoxRect.GetWidth() && aBoxRect.GetHeight() ) + { + rNativeContentRegion = aRect; + rNativeBoundingRegion = rNativeContentRegion; + bRet = TRUE; + } + } + } + } + if( nType == CTRL_SLIDER && ( (nPart == PART_THUMB_HORZ) || (nPart == PART_THUMB_VERT) ) ) { HTHEME hTheme = getThemeHandle( mhWnd, L"Trackbar"); diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index d6b05c5bb032..df077cc4c4e5 100755 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -2835,6 +2835,29 @@ static long ImplA2I( const BYTE* pStr ) } // ----------------------------------------------------------------------- +static HRESULT WINAPI backwardCompatibleDwmIsCompositionEnabled( WIN_BOOL* pOut ) +{ + *pOut = FALSE; + return S_OK; +} + +static WIN_BOOL ImplDwmIsCompositionEnabled() +{ + SalData* pSalData = GetSalData(); + if( ! pSalData->mpDwmIsCompositionEnabled ) + { + rtl::OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "Dwmapi.dll" ) ); + pSalData->maDwmLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT ); + if( pSalData->maDwmLib ) + pSalData->mpDwmIsCompositionEnabled = (DwmIsCompositionEnabled_ptr)osl_getAsciiFunctionSymbol( pSalData->maDwmLib, "DwmIsCompositionEnabled" ); + if( ! pSalData->mpDwmIsCompositionEnabled ) // something failed + pSalData->mpDwmIsCompositionEnabled = backwardCompatibleDwmIsCompositionEnabled; + } + WIN_BOOL aResult = FALSE; + HRESULT nError = pSalData->mpDwmIsCompositionEnabled( &aResult ); + return nError == S_OK && aResult; +} + void WinSalFrame::UpdateSettings( AllSettings& rSettings ) { @@ -2912,6 +2935,10 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) aStyleSettings.SetHighlightTextColor( ImplWinColorToSal( GetSysColor( COLOR_HIGHLIGHTTEXT ) ) ); aStyleSettings.SetMenuHighlightColor( aStyleSettings.GetHighlightColor() ); aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetHighlightTextColor() ); + ImplSVData* pSVData = ImplGetSVData(); + pSVData->maNWFData.mnMenuFormatExtraBorder = 0; + pSVData->maNWFData.maMenuBarHighlightTextColor = Color( COL_TRANSPARENT ); + GetSalData()->mbThemeMenuSupport = FALSE; if ( bCompBorder ) { aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) ); @@ -2942,6 +2969,19 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) aStyleSettings.SetUseFlatBorders( TRUE ); } } + // check if vista or newer runs + // in Aero theme (and similar ?) the menu text color does not change + // for selected items; also on WinXP and earlier menus are not themed + if( aSalShlData.maVersionInfo.dwMajorVersion >= 6 && + ImplDwmIsCompositionEnabled() + ) + { + // in aero menuitem highlight text is drawn in the same color as normal + aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetMenuTextColor() ); + pSVData->maNWFData.mnMenuFormatExtraBorder = 2; + pSVData->maNWFData.maMenuBarHighlightTextColor = aStyleSettings.GetMenuTextColor(); + GetSalData()->mbThemeMenuSupport = TRUE; + } } // Bei hellgrau geben wir die Farbe vor, damit es besser aussieht if ( aStyleSettings.GetFaceColor() == COL_LIGHTGRAY ) -- cgit From 5946988a4d2b9e43ce9f6980a69085db4d0667ee Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 22 Nov 2010 11:50:12 +0100 Subject: vcl117: fix SLOFILES --- sw/source/ui/dialog/makefile.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/sw/source/ui/dialog/makefile.mk b/sw/source/ui/dialog/makefile.mk index 5d4685ffb9b5..860cfed040e6 100644 --- a/sw/source/ui/dialog/makefile.mk +++ b/sw/source/ui/dialog/makefile.mk @@ -56,6 +56,7 @@ EXCEPTIONSFILES = \ SLOFILES = \ $(SLO)$/abstract.obj \ $(SLO)$/addrdlg.obj \ + $(SLO)$/ascfldlg.obj \ $(SLO)$/docstdlg.obj \ $(SLO)$/macassgn.obj \ $(SLO)$/SwSpellDialogChildWindow.obj \ -- cgit From 21d610c5dc0fcf7adf08d045af1d90eeb5b1b53e Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 22 Nov 2010 15:46:16 +0100 Subject: #i115718# fix IFCM refcounting while subsetting fonts on OSX --- vcl/aqua/source/gdi/salgdi.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index e1daf649f6da..070c0753637d 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -2356,8 +2356,10 @@ void AquaSalGraphics::GetGlyphWidths( const ImplFontData* pFontData, bool bVerti const ImplFontCharMap* pMap = mpMacFontData->GetImplFontCharMap(); DBG_ASSERT( pMap && pMap->GetCharCount(), "no charmap" ); + pMap->AddReference(); // TODO: add and use RAII object instead // get unicode<->glyph encoding + // TODO? avoid sft mapping by using the pMap itself int nCharCount = pMap->GetCharCount(); sal_uInt32 nChar = pMap->GetFirstChar(); for(; --nCharCount >= 0; nChar = pMap->GetNextChar( nChar ) ) -- cgit From 75a3de669fef8dff6cdbe430437f8666ba55029f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 13:57:59 +0100 Subject: vcl117: removed useless header --- vcl/inc/vcl/salatype.hxx | 47 ------------------------------------------ vcl/os2/source/app/salinst.cxx | 2 +- vcl/unx/headless/svpinst.cxx | 2 +- vcl/unx/source/app/salinst.cxx | 2 +- vcl/win/source/app/salinst.cxx | 2 +- 5 files changed, 4 insertions(+), 51 deletions(-) delete mode 100644 vcl/inc/vcl/salatype.hxx diff --git a/vcl/inc/vcl/salatype.hxx b/vcl/inc/vcl/salatype.hxx deleted file mode 100644 index d9e25c0cada9..000000000000 --- a/vcl/inc/vcl/salatype.hxx +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SV_SALATYPE_HXX -#define _SV_SALATYPE_HXX - -#include - -// --------------------- -// - Application-Types - -// --------------------- - -// Derzeit doppelt und in apptypes.hxx auch vorhanden - -#define INPUT_MOUSE 0x0001 -#define INPUT_KEYBOARD 0x0002 -#define INPUT_PAINT 0x0004 -#define INPUT_TIMER 0x0008 -#define INPUT_OTHER 0x0010 -#define INPUT_MOUSEANDKEYBOARD (INPUT_MOUSE | INPUT_KEYBOARD) -#define INPUT_ANY (INPUT_MOUSEANDKEYBOARD | INPUT_PAINT | INPUT_TIMER | INPUT_OTHER) - -#endif // _SV_SALATYPE_HXX diff --git a/vcl/os2/source/app/salinst.cxx b/vcl/os2/source/app/salinst.cxx index df564f36ee0a..9d74f281d680 100644 --- a/vcl/os2/source/app/salinst.cxx +++ b/vcl/os2/source/app/salinst.cxx @@ -43,7 +43,7 @@ #ifndef _SV_SALIDS_HRC #include #endif -#include +#include #include #include #include diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx index fc788b2a0530..09e359ca3f71 100644 --- a/vcl/unx/headless/svpinst.cxx +++ b/vcl/unx/headless/svpinst.cxx @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx index 88af0b70ef7e..f125d5f98fa6 100644 --- a/vcl/unx/source/app/salinst.cxx +++ b/vcl/unx/source/app/salinst.cxx @@ -45,7 +45,7 @@ #include "sm.hxx" #include "vcl/salwtype.hxx" -#include "vcl/salatype.hxx" +#include "vcl/apptypes.hxx" #include "vcl/helper.hxx" #include #include "vos/mutex.hxx" diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx index c056bf8281ba..ef6d82f53d7d 100755 --- a/vcl/win/source/app/salinst.cxx +++ b/vcl/win/source/app/salinst.cxx @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #include -- cgit From c66cef317dc9ef81fa46da221bdd3bccb3ef0953 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 16:05:43 +0100 Subject: vcl117: removed useless header --- vcl/inc/vcl/salctrlhandle.hxx | 48 ------------------------------------------- vcl/inc/vcl/salgdi.hxx | 1 - vcl/inc/vcl/window.h | 1 - vcl/source/app/salvtables.cxx | 4 ---- vcl/source/window/window.cxx | 1 - 5 files changed, 55 deletions(-) delete mode 100644 vcl/inc/vcl/salctrlhandle.hxx diff --git a/vcl/inc/vcl/salctrlhandle.hxx b/vcl/inc/vcl/salctrlhandle.hxx deleted file mode 100644 index 4a0a3a0f5b0a..000000000000 --- a/vcl/inc/vcl/salctrlhandle.hxx +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SV_SALCTRLHANDLE_HXX -#define _SV_SALCTRLHANDLE_HXX - -/* SalControlHandle: - * - * Container for platform-specific handles and data - * about controls. Lives as long as the VCL control - * lives. - */ - -class SalControlHandle -{ - public: - SalControlHandle() {} - virtual ~SalControlHandle(); - - // TODO: derive Sal implementation - //SalControlHandleData maData; -}; - -#endif diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx index d8276406746e..b4769c045708 100644 --- a/vcl/inc/vcl/salgdi.hxx +++ b/vcl/inc/vcl/salgdi.hxx @@ -36,7 +36,6 @@ #include "vos/thread.hxx" #include "vcl/outdev.hxx" #include "vcl/salnativewidgets.hxx" -#include "vcl/salctrlhandle.hxx" #include diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h index ff76874de11a..f4338a895a69 100644 --- a/vcl/inc/vcl/window.h +++ b/vcl/inc/vcl/window.h @@ -56,7 +56,6 @@ class VirtualDevice; class Cursor; class ImplDevFontList; class ImplFontCache; -class SalControlHandle; class VCLXWindow; class SalFrame; class SalObject; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 2a04389d8f44..73eaa8f965d2 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -38,7 +38,6 @@ #include #include #include -#include // this file contains the virtual destructors of the sal interface // compilers ususally put their vtables where the destructor is @@ -161,7 +160,4 @@ Rectangle SalMenu::GetMenuBarButtonRectPixel( USHORT, SalFrame* ) SalMenuItem::~SalMenuItem() { } -SalControlHandle::~SalControlHandle() -{ -} diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 8054afd33080..b432cd0f73f1 100755 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -35,7 +35,6 @@ #include "vcl/salinst.hxx" #include "vcl/salgtype.hxx" #include "vcl/salgdi.hxx" -#include "vcl/salctrlhandle.hxx" #include "vcl/unohelp.hxx" #include "tools/time.hxx" -- cgit From 1002a3c9c689f3738b981ca993b5bc529d781e28 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 16:26:05 +0100 Subject: vcl117: removed useless header --- vcl/inc/vcl/windata.hxx | 49 ------------------------------------------- vcl/inc/vcl/window.h | 11 ++++++++++ vcl/source/app/svapp.cxx | 1 - vcl/source/window/window.cxx | 1 - vcl/source/window/winproc.cxx | 1 - 5 files changed, 11 insertions(+), 52 deletions(-) delete mode 100644 vcl/inc/vcl/windata.hxx diff --git a/vcl/inc/vcl/windata.hxx b/vcl/inc/vcl/windata.hxx deleted file mode 100644 index 9436352e4927..000000000000 --- a/vcl/inc/vcl/windata.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SV_WINDATA_HXX -#define _SV_WINDATA_HXX - -#include - -class SalFrame; -class Window; - -// -------------- -// - Prototypes - -// -------------- - -long ImplWindowFrameProc( Window* pInst, SalFrame* pFrame, USHORT nEvent, const void* pEvent ); - -// ----------- -// - HitTest - -// ----------- - -#define WINDOW_HITTEST_INSIDE ((USHORT)0x0001) -#define WINDOW_HITTEST_TRANSPARENT ((USHORT)0x0002) - -#endif // _SV_WINDATA_HXX diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h index f4338a895a69..c80cb45c2222 100644 --- a/vcl/inc/vcl/window.h +++ b/vcl/inc/vcl/window.h @@ -101,7 +101,18 @@ namespace dnd { namespace vcl { struct ControlLayoutData; } +// -------------- +// - Prototypes - +// -------------- +long ImplWindowFrameProc( Window* pInst, SalFrame* pFrame, USHORT nEvent, const void* pEvent ); + +// ----------- +// - HitTest - +// ----------- + +#define WINDOW_HITTEST_INSIDE ((USHORT)0x0001) +#define WINDOW_HITTEST_TRANSPARENT ((USHORT)0x0002) // --------------- // - ImplWinData - diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index e503172eb2c6..dd1ea7c0469e 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -45,7 +45,6 @@ #include "vcl/event.hxx" #include "vcl/vclevent.hxx" #include "vcl/virdev.hxx" -#include "vcl/windata.hxx" #include "vcl/window.h" #include "vcl/wrkwin.hxx" #include "vcl/idlemgr.hxx" diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index b432cd0f73f1..49851e0cdf4a 100755 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -43,7 +43,6 @@ #include "tools/rc.h" #endif #include "vcl/svdata.hxx" -#include "vcl/windata.hxx" #include "vcl/dbggui.hxx" #include "vcl/outfont.hxx" #include "vcl/outdev.h" diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index c964ad0d739b..2fce7e52f24c 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include -- cgit From 14f48dfabbd5ba686195406c815b55abf1a35bf8 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 16:50:09 +0100 Subject: vcl117: removed useless header --- vcl/inc/vcl/impbmpconv.hxx | 39 --------------------------------------- vcl/inc/vcl/salctype.hxx | 12 ++++++++++++ vcl/source/gdi/bmpconv.cxx | 16 ++++++++-------- vcl/source/window/window.cxx | 1 - 4 files changed, 20 insertions(+), 48 deletions(-) delete mode 100644 vcl/inc/vcl/impbmpconv.hxx diff --git a/vcl/inc/vcl/impbmpconv.hxx b/vcl/inc/vcl/impbmpconv.hxx deleted file mode 100644 index d95da9a4093a..000000000000 --- a/vcl/inc/vcl/impbmpconv.hxx +++ /dev/null @@ -1,39 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _VCL_IMPBMPCONV_HXX_ -#define _VCL_IMPBMPCONV_HXX_ - -#include -#include - -namespace vcl -{ -com::sun::star::uno::Reference< com::sun::star::script::XInvocation > createBmpConverter(); -} - -#endif diff --git a/vcl/inc/vcl/salctype.hxx b/vcl/inc/vcl/salctype.hxx index 1566f02a1299..0cb037ad40e1 100644 --- a/vcl/inc/vcl/salctype.hxx +++ b/vcl/inc/vcl/salctype.hxx @@ -28,6 +28,9 @@ #ifndef _SV_SALCTYPE_HXX #define _SV_SALCTYPE_HXX +#include +#include + #include // ----------- @@ -77,4 +80,13 @@ typedef ULONG (*SALGRFCVTPROC)( void* pInst, ULONG nInFormat, void* pInBuffer, ULONG nInBufSize, ULONG nOutFormat, void** ppOutBuffer ); +// ------------------- +// - BitmapConverter - +// ------------------- + +namespace vcl +{ +com::sun::star::uno::Reference< com::sun::star::script::XInvocation > createBmpConverter(); +} + #endif // _SV_SALCTYPE_HXX diff --git a/vcl/source/gdi/bmpconv.cxx b/vcl/source/gdi/bmpconv.cxx index d949f519d197..188b4e49f0c5 100644 --- a/vcl/source/gdi/bmpconv.cxx +++ b/vcl/source/gdi/bmpconv.cxx @@ -28,14 +28,14 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#include -#include -#include -#include -#include -#include -#include -#include +#include "vcl/bitmap.hxx" +#include "vcl/svapp.hxx" +#include "vcl/salctype.hxx" +#include "vos/mutex.hxx" +#include "tools/stream.hxx" +#include "com/sun/star/script/XInvocation.hpp" +#include "com/sun/star/awt/XBitmap.hpp" +#include "cppuhelper/compbase1.hxx" using namespace com::sun::star::uno; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 49851e0cdf4a..e790b467350d 100755 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -88,7 +88,6 @@ #include "vcl/unowrap.hxx" #include "vcl/dndlcon.hxx" #include "vcl/dndevdis.hxx" -#include "vcl/impbmpconv.hxx" #include "unotools/confignode.hxx" #include "vcl/gdimtf.hxx" -- cgit From eb2b6f72121ded03321d58feb495abd615a8e898 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 18:41:04 +0100 Subject: vcl117: removed obsolete header --- svtools/inc/pch/precompiled_svtools.hxx | 4 +-- svtools/inc/svtools/embedhlp.hxx | 4 +-- svtools/inc/svtools/svmedit.hxx | 2 +- .../filter.vcl/filter/SvFilterOptionsDialog.hxx | 2 +- svtools/source/misc/ehdl.cxx | 2 +- svtools/source/misc/embedtransfer.cxx | 2 +- toolkit/inc/layout/layout.hxx | 4 +-- toolkit/inc/pch/precompiled_toolkit.hxx | 2 +- toolkit/inc/toolkit/awt/vclxtoolkit.hxx | 2 +- toolkit/inc/toolkit/helper/vclunohelper.hxx | 4 +-- toolkit/source/awt/vclxplugin.hxx | 2 +- vcl/inc/vcl/field.hxx | 2 +- vcl/inc/vcl/fldunit.hxx | 33 ---------------------- vcl/inc/vcl/mapmod.hxx | 2 +- vcl/inc/vcl/mapunit.hxx | 33 ---------------------- vcl/inc/vcl/window.h | 2 +- vcl/inc/vcl/window.hxx | 2 +- vcl/inc/vcl/wintypes.hxx | 33 ---------------------- vcl/prj/d.lst | 3 -- vcl/source/window/window.cxx | 1 + vcl/util/makefile.mk | 1 - 21 files changed, 19 insertions(+), 123 deletions(-) delete mode 100644 vcl/inc/vcl/fldunit.hxx delete mode 100644 vcl/inc/vcl/mapunit.hxx delete mode 100644 vcl/inc/vcl/wintypes.hxx diff --git a/svtools/inc/pch/precompiled_svtools.hxx b/svtools/inc/pch/precompiled_svtools.hxx index ddedfc5a0369..ebabe33af690 100644 --- a/svtools/inc/pch/precompiled_svtools.hxx +++ b/svtools/inc/pch/precompiled_svtools.hxx @@ -419,8 +419,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/svtools/inc/svtools/embedhlp.hxx b/svtools/inc/svtools/embedhlp.hxx index 098b565385ec..bc9770c1bcc8 100644 --- a/svtools/inc/svtools/embedhlp.hxx +++ b/svtools/inc/svtools/embedhlp.hxx @@ -34,9 +34,7 @@ #include #include #include -#ifndef _SV_MAPUNIT_HXX -#include -#endif +#include #include #define NS_UNO ::com::sun::star::uno diff --git a/svtools/inc/svtools/svmedit.hxx b/svtools/inc/svtools/svmedit.hxx index 3bdfdc44e8e9..9c8a4a34dbf6 100644 --- a/svtools/inc/svtools/svmedit.hxx +++ b/svtools/inc/svtools/svmedit.hxx @@ -28,7 +28,7 @@ #ifndef _SVEDIT_HXX #define _SVEDIT_HXX -#include +#include #include #include diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx index 16592bac8df7..027fac99c2e8 100644 --- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx +++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx @@ -28,7 +28,7 @@ #ifndef _SV_FILTER_OPTIONS_DIALOG_HXX_ #define _SV_FILTER_OPTIONS_DIALOG_HXX_ -#include +#include #include #include #include diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx index 8834f5497e5a..127a40494e26 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.cxx @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #if defined(OS2) diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx index cbf87f40b7fc..e49cf0ab62cf 100644 --- a/svtools/source/misc/embedtransfer.cxx +++ b/svtools/source/misc/embedtransfer.cxx @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include #include diff --git a/toolkit/inc/layout/layout.hxx b/toolkit/inc/layout/layout.hxx index 5d013e8a74c4..b4b219b850e2 100644 --- a/toolkit/inc/layout/layout.hxx +++ b/toolkit/inc/layout/layout.hxx @@ -38,9 +38,9 @@ #include #include #include -#include +#include #include -#include +#include class Button; class ComboBox; diff --git a/toolkit/inc/pch/precompiled_toolkit.hxx b/toolkit/inc/pch/precompiled_toolkit.hxx index d0baff3b8343..77be02429484 100644 --- a/toolkit/inc/pch/precompiled_toolkit.hxx +++ b/toolkit/inc/pch/precompiled_toolkit.hxx @@ -327,7 +327,7 @@ #include "vcl/gradient.hxx" #include "vcl/image.hxx" #include "vcl/jobset.hxx" -#include "vcl/mapunit.hxx" +#include "tools/mapunit.hxx" #include "vcl/menu.hxx" #include "vcl/metric.hxx" #include "vcl/outdev.hxx" diff --git a/toolkit/inc/toolkit/awt/vclxtoolkit.hxx b/toolkit/inc/toolkit/awt/vclxtoolkit.hxx index 3f37ac58200f..31de39bf1fc3 100644 --- a/toolkit/inc/toolkit/awt/vclxtoolkit.hxx +++ b/toolkit/inc/toolkit/awt/vclxtoolkit.hxx @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include diff --git a/toolkit/inc/toolkit/helper/vclunohelper.hxx b/toolkit/inc/toolkit/helper/vclunohelper.hxx index cc11f3a586bb..fc35c480d854 100644 --- a/toolkit/inc/toolkit/helper/vclunohelper.hxx +++ b/toolkit/inc/toolkit/helper/vclunohelper.hxx @@ -64,8 +64,8 @@ namespace com { namespace sun { namespace star { namespace awt { #include #include #include -#include -#include +#include +#include #include class Window; diff --git a/toolkit/source/awt/vclxplugin.hxx b/toolkit/source/awt/vclxplugin.hxx index 49a2b2950854..2b42eecc5872 100644 --- a/toolkit/source/awt/vclxplugin.hxx +++ b/toolkit/source/awt/vclxplugin.hxx @@ -29,7 +29,7 @@ #define LAYOUT_AWT_VCLXPLUGIN_HXX #include -#include +#include class Control; namespace layoutimpl diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx index e1f39cc78966..6be9fd8d42c5 100644 --- a/vcl/inc/vcl/field.hxx +++ b/vcl/inc/vcl/field.hxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include namespace com { namespace sun { namespace star { namespace lang { struct Locale; } } } } diff --git a/vcl/inc/vcl/fldunit.hxx b/vcl/inc/vcl/fldunit.hxx deleted file mode 100644 index aa76f34332d6..000000000000 --- a/vcl/inc/vcl/fldunit.hxx +++ /dev/null @@ -1,33 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _VCL_FLDUNIT_HXX -#define _VCL_FLDUNIT_HXX - -#include - -#endif // _VCL_FLDUNIT_HXX diff --git a/vcl/inc/vcl/mapmod.hxx b/vcl/inc/vcl/mapmod.hxx index b2ea32958e90..260a5f4f86c2 100644 --- a/vcl/inc/vcl/mapmod.hxx +++ b/vcl/inc/vcl/mapmod.hxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include class SvStream; diff --git a/vcl/inc/vcl/mapunit.hxx b/vcl/inc/vcl/mapunit.hxx deleted file mode 100644 index b4c757c538e6..000000000000 --- a/vcl/inc/vcl/mapunit.hxx +++ /dev/null @@ -1,33 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _VCL_MAPUNIT_HXX -#define _VCL_MAPUNIT_HXX - -#include - -#endif // _VCL_MAPUNIT_HXX diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h index c80cb45c2222..be6447194ad6 100644 --- a/vcl/inc/vcl/window.h +++ b/vcl/inc/vcl/window.h @@ -38,7 +38,7 @@ #ifndef _SV_POINTR_HXX #include #endif -#include +#include #include #include #include diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index 7c72f40d2767..f72036fadc35 100644 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -35,7 +35,7 @@ #ifndef _SV_POINTR_HXX #include #endif -#include +#include #ifndef _SV_APPTYPES_HXX #include #endif diff --git a/vcl/inc/vcl/wintypes.hxx b/vcl/inc/vcl/wintypes.hxx deleted file mode 100644 index 6da4e4e3d988..000000000000 --- a/vcl/inc/vcl/wintypes.hxx +++ /dev/null @@ -1,33 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SV_WINTYPES_HXX -#define _SV_WINTYPES_HXX - -#include - -#endif // _SV_WINTYPES_HXX - diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst index e28dc755e8a8..028118327e7b 100644 --- a/vcl/prj/d.lst +++ b/vcl/prj/d.lst @@ -42,7 +42,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl ..\inc\vcl\field.hxx %_DEST%\inc%_EXT%\vcl\field.hxx ..\inc\vcl\fixbrd.hxx %_DEST%\inc%_EXT%\vcl\fixbrd.hxx ..\inc\vcl\fixed.hxx %_DEST%\inc%_EXT%\vcl\fixed.hxx -..\inc\vcl\fldunit.hxx %_DEST%\inc%_EXT%\vcl\fldunit.hxx ..\inc\vcl\floatwin.hxx %_DEST%\inc%_EXT%\vcl\floatwin.hxx ..\inc\vcl\fntstyle.hxx %_DEST%\inc%_EXT%\vcl\fntstyle.hxx ..\inc\vcl\font.hxx %_DEST%\inc%_EXT%\vcl\font.hxx @@ -70,7 +69,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl ..\inc\vcl\lstbox.h %_DEST%\inc%_EXT%\vcl\lstbox.h ..\inc\vcl\lstbox.hxx %_DEST%\inc%_EXT%\vcl\lstbox.hxx ..\inc\vcl\mapmod.hxx %_DEST%\inc%_EXT%\vcl\mapmod.hxx -..\inc\vcl\mapunit.hxx %_DEST%\inc%_EXT%\vcl\mapunit.hxx ..\inc\vcl\menu.hxx %_DEST%\inc%_EXT%\vcl\menu.hxx ..\inc\vcl\menubtn.hxx %_DEST%\inc%_EXT%\vcl\menubtn.hxx ..\inc\vcl\metaact.hxx %_DEST%\inc%_EXT%\vcl\metaact.hxx @@ -128,7 +126,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl ..\inc\vcl\waitobj.hxx %_DEST%\inc%_EXT%\vcl\waitobj.hxx ..\inc\vcl\wall.hxx %_DEST%\inc%_EXT%\vcl\wall.hxx ..\inc\vcl\window.hxx %_DEST%\inc%_EXT%\vcl\window.hxx -..\inc\vcl\wintypes.hxx %_DEST%\inc%_EXT%\vcl\wintypes.hxx ..\inc\vcl\wrkwin.hxx %_DEST%\inc%_EXT%\vcl\wrkwin.hxx ..\inc\vcl\threadex.hxx %_DEST%\inc%_EXT%\vcl\threadex.hxx ..\inc\vcl\evntpost.hxx %_DEST%\inc%_EXT%\vcl\evntpost.hxx diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index e790b467350d..0c91d0a0bc16 100755 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -66,6 +66,7 @@ #include "unotools/fontcfg.hxx" #include "vcl/sysdata.hxx" #include "vcl/sallayout.hxx" +#include "vcl/salctype.hxx" #include "vcl/button.hxx" // Button::GetStandardText #include "vcl/taskpanelist.hxx" #include "com/sun/star/awt/XWindowPeer.hpp" diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk index d21e9dcb3eed..8d1de2ed30f0 100644 --- a/vcl/util/makefile.mk +++ b/vcl/util/makefile.mk @@ -125,7 +125,6 @@ HXXDEPNLST= $(INC)$/vcl$/accel.hxx \ $(INC)$/vcl$/virdev.hxx \ $(INC)$/vcl$/wall.hxx \ $(INC)$/vcl$/waitobj.hxx \ - $(INC)$/vcl$/wintypes.hxx \ $(INC)$/vcl$/window.hxx \ $(INC)$/vcl$/wrkwin.hxx -- cgit From 5b0573b9fbfe126f982e68fa93989239fd0874d2 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 18:41:04 +0100 Subject: vcl117: removed obsolete header --- basic/inc/pch/precompiled_basic.hxx | 2 +- basic/source/runtime/methods.cxx | 2 +- fpicker/source/office/OfficeFilePicker.hxx | 2 +- framework/inc/pch/precompiled_framework.hxx | 4 ++-- framework/inc/services/layoutmanager.hxx | 2 +- framework/source/helper/tagwindowasmodified.cxx | 2 +- framework/source/uielement/fontsizemenucontroller.cxx | 2 +- sfx2/inc/pch/precompiled_sfx2.hxx | 2 +- sfx2/inc/sfx2/mnumgr.hxx | 2 +- sfx2/inc/sfx2/module.hxx | 2 +- svx/inc/fmgridif.hxx | 2 +- svx/inc/pch/precompiled_svx.hxx | 4 ++-- svx/inc/svx/fmtools.hxx | 2 +- svx/source/unodraw/unoprov.cxx | 2 +- uui/source/iahndl.hxx | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/basic/inc/pch/precompiled_basic.hxx b/basic/inc/pch/precompiled_basic.hxx index e8f9e004ca6a..ae45c383c74d 100644 --- a/basic/inc/pch/precompiled_basic.hxx +++ b/basic/inc/pch/precompiled_basic.hxx @@ -272,7 +272,7 @@ #include "vcl/timer.hxx" #include "vcl/toolbox.hxx" #include "vcl/window.hxx" -#include "vcl/wintypes.hxx" +#include "tools/wintypes.hxx" #include "vcl/wrkwin.hxx" #include "vos/diagnose.hxx" diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 97f6ed227d47..cfd84567644a 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/fpicker/source/office/OfficeFilePicker.hxx b/fpicker/source/office/OfficeFilePicker.hxx index 21839554aefc..c203924f6e51 100644 --- a/fpicker/source/office/OfficeFilePicker.hxx +++ b/fpicker/source/office/OfficeFilePicker.hxx @@ -42,7 +42,7 @@ #endif -#include +#include #include "commonpicker.hxx" #include "pickercallbacks.hxx" diff --git a/framework/inc/pch/precompiled_framework.hxx b/framework/inc/pch/precompiled_framework.hxx index 45919a31047b..b4afb017ebab 100644 --- a/framework/inc/pch/precompiled_framework.hxx +++ b/framework/inc/pch/precompiled_framework.hxx @@ -463,7 +463,7 @@ #include "vcl/keycod.hxx" #include "vcl/keycodes.hxx" #include "vcl/lstbox.hxx" -#include "vcl/mapunit.hxx" +#include "tools/mapunit.hxx" #include "vcl/menu.hxx" #include "vcl/mnemonic.hxx" #include "vcl/morebtn.hxx" @@ -482,7 +482,7 @@ #include "vcl/timer.hxx" #include "vcl/wall.hxx" #include "vcl/window.hxx" -#include "vcl/wintypes.hxx" +#include "tools/wintypes.hxx" #include "vos/mutex.hxx" #include "vos/process.hxx" diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx index 2ccba9e7ffde..8631cd546eb8 100644 --- a/framework/inc/services/layoutmanager.hxx +++ b/framework/inc/services/layoutmanager.hxx @@ -79,7 +79,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/framework/source/helper/tagwindowasmodified.cxx b/framework/source/helper/tagwindowasmodified.cxx index a71c5263455b..67c047dfefd4 100644 --- a/framework/source/helper/tagwindowasmodified.cxx +++ b/framework/source/helper/tagwindowasmodified.cxx @@ -61,7 +61,7 @@ #include #include #include -#include +#include //_________________________________________________________________________________________________________________ // namespace diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx index 58cf3a3b02be..0b1a0d003133 100644 --- a/framework/source/uielement/fontsizemenucontroller.cxx +++ b/framework/source/uielement/fontsizemenucontroller.cxx @@ -51,7 +51,7 @@ #ifndef _VCL_MENU_HXX_ #include #endif -#include +#include #ifndef _VCL_SVAPP_HXX_ #include #endif diff --git a/sfx2/inc/pch/precompiled_sfx2.hxx b/sfx2/inc/pch/precompiled_sfx2.hxx index 1d4003fa44e6..45755cdd8799 100644 --- a/sfx2/inc/pch/precompiled_sfx2.hxx +++ b/sfx2/inc/pch/precompiled_sfx2.hxx @@ -654,7 +654,7 @@ #include "vcl/stdtext.hxx" #include "vcl/timer.hxx" #include "vcl/unohelp.hxx" -#include "vcl/wintypes.hxx" +#include "tools/wintypes.hxx" #include "vos/diagnose.hxx" #include "vos/module.hxx" #include "vos/mutex.hxx" diff --git a/sfx2/inc/sfx2/mnumgr.hxx b/sfx2/inc/sfx2/mnumgr.hxx index f1df0f0aa547..f5cc509dbf0a 100644 --- a/sfx2/inc/sfx2/mnumgr.hxx +++ b/sfx2/inc/sfx2/mnumgr.hxx @@ -32,7 +32,7 @@ #ifndef _MENU_HXX //autogen //wg. MENU_APPEND !!!! #include #endif -#include +#include #include #include #include diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx index ad83bb4a7418..3cf84cf6139e 100644 --- a/sfx2/inc/sfx2/module.hxx +++ b/sfx2/inc/sfx2/module.hxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include class ImageList; diff --git a/svx/inc/fmgridif.hxx b/svx/inc/fmgridif.hxx index 886db3280d60..df21245bc99b 100644 --- a/svx/inc/fmgridif.hxx +++ b/svx/inc/fmgridif.hxx @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include #include diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx index b53064312a38..e14ac49dc5c0 100644 --- a/svx/inc/pch/precompiled_svx.hxx +++ b/svx/inc/pch/precompiled_svx.hxx @@ -920,7 +920,7 @@ #include "vcl/cursor.hxx" #include "vcl/decoview.hxx" #include "vcl/dndhelp.hxx" -#include "vcl/fldunit.hxx" +#include "tools/fldunit.hxx" #include "vcl/fntstyle.hxx" #include "unotools/fontcvt.hxx" #include "vcl/gdimtf.hxx" @@ -939,7 +939,7 @@ #include "vcl/unohelp.hxx" #include "vcl/unohelp2.hxx" #include "vcl/wall.hxx" -#include "vcl/wintypes.hxx" +#include "tools/wintypes.hxx" #include "vos/mutex.hxx" #include "vos/ref.hxx" #include "vos/refernce.hxx" diff --git a/svx/inc/svx/fmtools.hxx b/svx/inc/svx/fmtools.hxx index b39f46e85d14..f98919fe47d8 100644 --- a/svx/inc/svx/fmtools.hxx +++ b/svx/inc/svx/fmtools.hxx @@ -71,7 +71,7 @@ #include #include -#include +#include #include #include #include diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index 4be296d51219..585a35a128b5 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index 6402653d3bda..b0630a5514b2 100755 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -42,7 +42,7 @@ #include "tools/solar.h" // USHORT #include "tools/errcode.hxx" // ErrCode #include "tools/rc.hxx" // Resource -#include "vcl/wintypes.hxx" // WinBits +#include "tools/wintypes.hxx" // WinBits namespace com { namespace sun { namespace star { namespace awt { -- cgit From 3e76c75b94d486bc1c1eafc6b3157f3634c93b42 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 18:41:04 +0100 Subject: vcl117: removed obsolete header --- starmath/source/document.cxx | 2 +- starmath/source/math_pch.cxx | 833 -------------------------------------- sw/inc/modcfg.hxx | 2 +- sw/inc/swmodule.hxx | 2 +- sw/source/filter/xml/xmliteme.cxx | 2 +- sw/source/ui/inc/uitool.hxx | 2 +- sw/source/ui/inc/usrpref.hxx | 2 +- 7 files changed, 6 insertions(+), 839 deletions(-) delete mode 100644 starmath/source/math_pch.cxx diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index ab1382b97879..87b0905d7888 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -76,7 +76,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/starmath/source/math_pch.cxx b/starmath/source/math_pch.cxx deleted file mode 100644 index bcb768fe600b..000000000000 --- a/starmath/source/math_pch.cxx +++ /dev/null @@ -1,833 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_starmath.hxx" - -#define SMDLL 1 - -#include "starmath.hrc" - -#define ITEMID_FONT 1 -#define ITEMID_FONTHEIGHT 2 -#define ITEMID_LRSPACE 3 -#define ITEMID_WEIGHT 4 - -//--------- ab hier die "generierten" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _SMART_COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTOR_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_FRAME_XDISPATCH_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_FRAME_XSTATUSLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_FRAME_FEATURESTATEEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_FRAME_DISPATCHDESCRIPTOR_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_FRAME_XFRAMEACTIONLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_FRAME_XFRAME_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_FRAME_FRAMEACTIONEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_FRAME_FRAMEACTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_UTIL_XURLTRANSFORMER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_TASK_XSTATUSINDICATORFACTORY_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_TASK_XSTATUSINDICATORSUPPLIER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_TASK_XSTATUSINDICATOR_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_FRAME_XBROWSEHISTORYREGISTRY_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_IO_BUFFERSIZEEXCEEDEDEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_IO_NOTCONNECTEDEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_IO_IOEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_IO_UNEXPECTEDEOFEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_IO_WRONGFORMATEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_SERVICENOTREGISTEREDEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_NULLPOINTEREXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_CLASSNOTFOUNDEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_NOSUCHMETHODEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_SECURITYEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_NOSUCHFIELDEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_ARRAYINDEXOUTOFBOUNDSEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_ILLEGALACCESSEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_INDEXOUTOFBOUNDSEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_NOSUPPORTEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_WRAPPEDTARGETEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_REFLECTION_PARAMINFO_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLARRAY_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLCLASSPROVIDER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_REFLECTION_FIELDACCESSMODE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLCLASS_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLFIELD_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_REFLECTION_PARAMMODE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_REFLECTION_METHODMODE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLMEMBER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLREFLECTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_REFLECTION_XIDLMETHOD_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_REFLECTION_INVOCATIONTARGETEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYVALUES_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYSET_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYVALUE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYSTATE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_XMULTIPROPERTYSET_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_XFASTPROPERTYSET_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_XVETOABLECHANGELISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYSTATE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYSTATECHANGELISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTIESCHANGELISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYACCESS_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_XPROPERTYCONTAINER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYSTATECHANGEEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYCHANGEEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_UNKNOWNPROPERTYEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_INTROSPECTIONEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYEXISTEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_ILLEGALTYPEEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_BEANS_PROPERTYVETOEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_CONTAINER_XENUMERATIONACCESS_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_CONTAINER_XHIERARCHICALNAMEACCESS_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_CONTAINER_XNAMEACCESS_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_CONTAINER_XCONTENTENUMERATIONACCESS_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_CONTAINER_XENUMERATION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_CONTAINER_XELEMENTACCESS_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_CONTAINER_XINDEXACCESS_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_XEVENTLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_EVENTOBJECT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_SCRIPT_XALLLISTENERADAPTERSERVICE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_SCRIPT_XALLLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_SCRIPT_ALLEVENTOBJECT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_CONTAINER_XCOMPONENTENUMERATION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_XCOMPONENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_CONTAINER_XCOMPONENTENUMERATIONACCESS_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_LISTENEREXISTEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_CONTAINER_ELEMENTEXISTEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_LANG_INVALIDLISTENEREXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_CONTAINER_NOSUCHELEMENTEXCEPTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XKEYLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XPAINTLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_KEYEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_KEYMODIFIER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XMOUSEMOTIONLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_FOCUSEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XWINDOWLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XACTIVATELISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_MOUSEEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XTOPWINDOWLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_PAINTEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_INPUTEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_KEYGROUP_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_KEY_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_WINDOWEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XMOUSELISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_KEYFUNCTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_FOCUSCHANGEREASON_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_MOUSEBUTTON_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XFOCUSLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XADJUSTMENTLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XACTIONLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XTEXTLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XSPINLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XITEMLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XVCLCONTAINERLISTENER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XFILEDIALOG_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XTEXTCOMPONENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XLISTBOX_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XPROGRESSMONITOR_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_TEXTALIGN_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XSCROLLBAR_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XVCLCONTAINERPEER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XTABCONTROLLERMODEL_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XMESSAGEBOX_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XTEXTEDITFIELD_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_STYLE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XTIMEFIELD_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XVCLWINDOWPEER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XCONTROLMODEL_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XSPINFIELD_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XUNOCONTROLCONTAINER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XTEXTLAYOUTCONSTRAINS_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XNUMERICFIELD_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XBUTTON_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XTEXTAREA_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XIMAGEBUTTON_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XFIXEDTEXT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XCONTROLCONTAINER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XDIALOG_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_SCROLLBARORIENTATION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XRADIOBUTTON_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XCURRENCYFIELD_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XPATTERNFIELD_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_VCLWINDOWPEERATTRIBUTE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XTABCONTROLLER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XVCLCONTAINER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XDATEFIELD_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XCOMBOBOX_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XCONTROL_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XCHECKBOX_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_MESSAGEBOXCOMMAND_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XLAYOUTCONSTRAINS_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XPROGRESSBAR_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_SIMPLEFONTMETRIC_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_FONTWEIGHT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_FONTSLANT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_CHARSET_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_FONTDESCRIPTOR_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_FONTWIDTH_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XFONT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_FONTTYPE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_FONTUNDERLINE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_FONTSTRIKEOUT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_FONTFAMILY_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_FONTPITCH_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XTOPWINDOW_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XWINDOW_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_POSSIZE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_VCLCONTAINEREVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_ITEMEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_SPINEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_TEXTEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_ADJUSTMENTTYPE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_ACTIONEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_ADJUSTMENTEVENT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_RECTANGLE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_SELECTION_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_SIZE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_WINDOWDESCRIPTOR_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_INVALIDATESTYLE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XTOOLKIT_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XWINDOWPEER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_WINDOWCLASS_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XSYSTEMDEPENDENTWINDOWPEER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_WINDOWATTRIBUTE_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XPOINTER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_SYSTEMPOINTER_HXX_ -#include -#endif -#ifndef _SMART_COM_SUN_STAR_AWT_XVIEW_HXX_ -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/sw/inc/modcfg.hxx b/sw/inc/modcfg.hxx index c5d67217ab2a..89c5a7a1a1be 100644 --- a/sw/inc/modcfg.hxx +++ b/sw/inc/modcfg.hxx @@ -28,7 +28,7 @@ #define _MODOPT_HXX #include -#include +#include #include #include #include diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index c8e601143877..da2fc80f33ad 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -28,7 +28,7 @@ #define _SWMODULE_HXX #include #include -#include +#include #include #include #include diff --git a/sw/source/filter/xml/xmliteme.cxx b/sw/source/filter/xml/xmliteme.cxx index 5645891c5b3c..05c30ce7b496 100644 --- a/sw/source/filter/xml/xmliteme.cxx +++ b/sw/source/filter/xml/xmliteme.cxx @@ -40,7 +40,7 @@ #include "xmlbrshe.hxx" #include #include -#include +#include #include #include #include "fmtornt.hxx" diff --git a/sw/source/ui/inc/uitool.hxx b/sw/source/ui/inc/uitool.hxx index e48f78f9aa96..c3dfd0f07b2a 100644 --- a/sw/source/ui/inc/uitool.hxx +++ b/sw/source/ui/inc/uitool.hxx @@ -27,7 +27,7 @@ #ifndef _UITOOL_HXX #define _UITOOL_HXX -#include +#include #include #include #include "swdllapi.h" diff --git a/sw/source/ui/inc/usrpref.hxx b/sw/source/ui/inc/usrpref.hxx index 7864bf135934..7b7e4cf8cb07 100644 --- a/sw/source/ui/inc/usrpref.hxx +++ b/sw/source/ui/inc/usrpref.hxx @@ -32,7 +32,7 @@ #include #include #include "viewopt.hxx" -#include +#include /* -----------------------------28.09.00 09:45-------------------------------- -- cgit From 7e82d6429cf459d440d01724e620ff31ccbfde12 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 18:41:04 +0100 Subject: vcl117: removed obsolete header --- sd/source/ui/dlg/dlgass.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index acbf70d8e687..82ca4d05b996 100755 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -49,7 +49,7 @@ #include #include "DrawDocShell.hxx" #include -#include +#include #include "docprev.hxx" #include #include -- cgit From 09493ee415a4a0d6d2d7bb3f7f8e2b1c5d38683e Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 18:41:04 +0100 Subject: vcl117: removed obsolete header --- chart2/source/controller/inc/ConfigurationAccess.hxx | 2 +- sc/source/core/inc/core_pch.hxx | 2 +- sc/source/filter/inc/filt_pch.hxx | 6 +++--- sc/source/filter/inc/xlescher.hxx | 2 +- sc/source/ui/cctrl/dpcontrol.cxx | 2 +- sc/source/ui/inc/ui_pch.hxx | 3 +-- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/chart2/source/controller/inc/ConfigurationAccess.hxx b/chart2/source/controller/inc/ConfigurationAccess.hxx index 0cc8180b3dd2..4b5196e7f902 100644 --- a/chart2/source/controller/inc/ConfigurationAccess.hxx +++ b/chart2/source/controller/inc/ConfigurationAccess.hxx @@ -29,7 +29,7 @@ #define _CHART2_CONFIGURATIONACCESS_HXX // header for enum FieldUnit -#include +#include //............................................................................. namespace chart diff --git a/sc/source/core/inc/core_pch.hxx b/sc/source/core/inc/core_pch.hxx index 899169154d8d..36595fe4c956 100644 --- a/sc/source/core/inc/core_pch.hxx +++ b/sc/source/core/inc/core_pch.hxx @@ -125,7 +125,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/filter/inc/filt_pch.hxx b/sc/source/filter/inc/filt_pch.hxx index 7ab2aadf1511..d624b7afeaf8 100644 --- a/sc/source/filter/inc/filt_pch.hxx +++ b/sc/source/filter/inc/filt_pch.hxx @@ -126,7 +126,7 @@ #include #include #include -#include +#include #include #include #include @@ -182,7 +182,7 @@ #include #include #include -#include +#include #include #include #include @@ -253,7 +253,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/filter/inc/xlescher.hxx b/sc/source/filter/inc/xlescher.hxx index 921da6b8741b..cba56eeccc9e 100644 --- a/sc/source/filter/inc/xlescher.hxx +++ b/sc/source/filter/inc/xlescher.hxx @@ -29,7 +29,7 @@ #define SC_XLESCHER_HXX #include -#include +#include #include "fapihelper.hxx" #include "xladdress.hxx" #include "xlstyle.hxx" diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index b90a51ed6bee..f9e5a4d7679b 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include "strload.hxx" #include "global.hxx" diff --git a/sc/source/ui/inc/ui_pch.hxx b/sc/source/ui/inc/ui_pch.hxx index 1ef2f02d405b..ec8da19ba5ea 100644 --- a/sc/source/ui/inc/ui_pch.hxx +++ b/sc/source/ui/inc/ui_pch.hxx @@ -81,7 +81,7 @@ #include #include #include -#include +#include #include #include #include @@ -185,7 +185,6 @@ #include #include //REMOVE #include -#include #include #include #include -- cgit From abe4496cfce679e999aa59d98649fc37f1dacc02 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 18:41:04 +0100 Subject: vcl117: removed obsolete header --- .../inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx | 2 +- accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx | 3 +-- automation/source/server/statemnt.cxx | 3 +-- automation/source/server/statemnt.hxx | 2 +- extensions/source/propctrlr/formcomponenthandler.hxx | 2 +- forms/inc/pch/precompiled_forms.hxx | 2 +- forms/source/component/Edit.cxx | 2 +- forms/source/component/Filter.cxx | 2 +- forms/source/component/FormattedField.cxx | 2 +- forms/source/richtext/richtextcontrol.hxx | 2 +- forms/source/richtext/richtextengine.cxx | 2 +- forms/source/richtext/richtextimplcontrol.cxx | 2 +- forms/source/richtext/rtattributehandler.cxx | 2 +- forms/source/solar/component/navbarcontrol.hxx | 2 +- 14 files changed, 14 insertions(+), 16 deletions(-) diff --git a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx b/accessibility/inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx index 5ab160535aa0..c2526cbec18d 100644 --- a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx @@ -34,7 +34,7 @@ #include "accessibility/extended/accessiblebrowseboxcell.hxx" #endif #include -#include +#include // ============================================================================ namespace accessibility { diff --git a/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx b/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx index 847896a14588..f5320c2fd20f 100644 --- a/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx +++ b/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx @@ -29,8 +29,7 @@ #include #include -#include -#include +#include namespace com { namespace sun { namespace star { namespace datatransfer { namespace clipboard { class XClipboard; diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index a288c3d4d3a7..1b22b32388ec 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -34,7 +34,7 @@ #include #include -#include +#include #ifndef _DIALOG_HXX //autogen #include #endif @@ -79,7 +79,6 @@ #include #include #include -#include #include #include #include diff --git a/automation/source/server/statemnt.hxx b/automation/source/server/statemnt.hxx index ada6c60a6b35..61f3ad52309e 100644 --- a/automation/source/server/statemnt.hxx +++ b/automation/source/server/statemnt.hxx @@ -40,7 +40,7 @@ #ifndef _STATEMNT_HXX #define _STATEMNT_HXX -#include +#include #include #include #include diff --git a/extensions/source/propctrlr/formcomponenthandler.hxx b/extensions/source/propctrlr/formcomponenthandler.hxx index ea724c61828c..01f56bd7ac0d 100644 --- a/extensions/source/propctrlr/formcomponenthandler.hxx +++ b/extensions/source/propctrlr/formcomponenthandler.hxx @@ -41,7 +41,7 @@ #include #include /** === end UNO includes === **/ -#include +#include #include #include diff --git a/forms/inc/pch/precompiled_forms.hxx b/forms/inc/pch/precompiled_forms.hxx index f75e8ca4316a..c510fa7379f3 100644 --- a/forms/inc/pch/precompiled_forms.hxx +++ b/forms/inc/pch/precompiled_forms.hxx @@ -392,7 +392,7 @@ #include "vcl/mapunit.hxx" #include "vcl/stdtext.hxx" #include "vcl/timer.hxx" -#include "vcl/wintypes.hxx" +#include "tools/wintypes.hxx" #include "vos/mutex.hxx" #include "vos/thread.hxx" diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx index 3a36078a7fed..c3f759696ef9 100644 --- a/forms/source/component/Edit.cxx +++ b/forms/source/component/Edit.cxx @@ -39,7 +39,7 @@ #include #include -#include +#include #include #include diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx index 9cbc5237cf95..9cba722789e8 100644 --- a/forms/source/component/Filter.cxx +++ b/forms/source/component/Filter.cxx @@ -71,7 +71,7 @@ #include #include #include -#include +#include //-------------------------------------------------------------------------- extern "C" void SAL_CALL createRegistryInfo_OFilterControl() diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index a35a300dda78..654a2e5a19b4 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/forms/source/richtext/richtextcontrol.hxx b/forms/source/richtext/richtextcontrol.hxx index a3f0da71aca7..e4dea25ec225 100644 --- a/forms/source/richtext/richtextcontrol.hxx +++ b/forms/source/richtext/richtextcontrol.hxx @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include "rtattributes.hxx" #include "attributedispatcher.hxx" diff --git a/forms/source/richtext/richtextengine.cxx b/forms/source/richtext/richtextengine.cxx index 1105f8a51c1c..3b220a2e222a 100644 --- a/forms/source/richtext/richtextengine.cxx +++ b/forms/source/richtext/richtextengine.cxx @@ -38,7 +38,7 @@ #define ITEMID_LANGUAGE EE_CHAR_LANGUAGE #include #include -#include +#include #include #include #include diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx index 3a82822f6701..7aac8918c877 100644 --- a/forms/source/richtext/richtextimplcontrol.cxx +++ b/forms/source/richtext/richtextimplcontrol.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include diff --git a/forms/source/richtext/rtattributehandler.cxx b/forms/source/richtext/rtattributehandler.cxx index c19fe516beb2..b56319f33dee 100644 --- a/forms/source/richtext/rtattributehandler.cxx +++ b/forms/source/richtext/rtattributehandler.cxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include diff --git a/forms/source/solar/component/navbarcontrol.hxx b/forms/source/solar/component/navbarcontrol.hxx index 1e7c6cd8b854..0040d5d4e6ad 100644 --- a/forms/source/solar/component/navbarcontrol.hxx +++ b/forms/source/solar/component/navbarcontrol.hxx @@ -39,7 +39,7 @@ #include #include #include -#include +#include //......................................................................... namespace frm -- cgit From 280d6e78fc41c5de56734d4e3621ff18ea09f546 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 18:41:04 +0100 Subject: vcl117: removed obsolete header --- reportdesign/source/ui/inspection/DataProviderHandler.cxx | 2 +- reportdesign/source/ui/inspection/GeometryHandler.cxx | 2 +- reportdesign/source/ui/inspection/ReportComponentHandler.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx index 8ac5053ff39f..dcc327060806 100644 --- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx +++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include "metadata.hxx" #include #include diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 084bd77f8d5b..c02683a97452 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -66,7 +66,7 @@ #include #include -#include +#include #include #include "ModuleHelper.hxx" diff --git a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx index 859c0da38709..d992206b6f54 100644 --- a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx +++ b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include "metadata.hxx" //........................................................................ -- cgit From da3abf30f38443096403ca77fb464aa6681235ae Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 18:41:04 +0100 Subject: vcl117: removed obsolete header --- soldep/inc/soldep/soldlg.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soldep/inc/soldep/soldlg.hxx b/soldep/inc/soldep/soldlg.hxx index ef57908b6913..63423a97fdaf 100644 --- a/soldep/inc/soldep/soldlg.hxx +++ b/soldep/inc/soldep/soldlg.hxx @@ -28,7 +28,7 @@ #ifndef _FMRWRK_SOLDLG_HXX #define _FMRWRK_SOLDLG_HXX -#include +#include #include #include #include -- cgit -- cgit From 2235846149e89dd9fe83cd4fbaf32908983aa571 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 18:50:48 +0100 Subject: vcl117: reduce duplication of enums --- rsc/inc/vclrsc.hxx | 178 +------------------------------------------ tools/inc/tools/fldunit.hxx | 1 - tools/inc/tools/mapunit.hxx | 1 - tools/inc/tools/wintypes.hxx | 3 - 4 files changed, 3 insertions(+), 180 deletions(-) diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx index d4084f2bc239..cc82a4dbaa54 100644 --- a/rsc/inc/vclrsc.hxx +++ b/rsc/inc/vclrsc.hxx @@ -30,154 +30,9 @@ #include #include - -// --------------- -// - Window-Bits - -// --------------- - -// from vcl/inc/wintypes.hxx -typedef sal_Int64 WinBits; - -// Window-Bits fuer Window -#define WB_CLIPCHILDREN ((WinBits)0x00000001) -#define WB_DIALOGCONTROL ((WinBits)0x00000002) -#define WB_NODIALOGCONTROL ((WinBits)0x00000004) -#define WB_BORDER ((WinBits)0x00000008) -#define WB_NOBORDER ((WinBits)0x00000010) -#define WB_SIZEABLE ((WinBits)0x00000020) -#define WB_3DLOOK ((WinBits)0x00000040) -#define WB_AUTOSIZE ((WinBits)0x00000080) - -// Window-Bits fuer SystemWindows -#define WB_MOVEABLE ((WinBits)0x00000100) -#define WB_ROLLABLE ((WinBits)0x00000200) -#define WB_CLOSEABLE ((WinBits)0x00000400) -#define WB_STANDALONE ((WinBits)0x00000800) -#define WB_APP ((WinBits)0x00001000) -#define WB_PINABLE ((WinBits)0x00002000) -#define WB_SYSTEMWINDOW ((WinBits)0x40000000) -#define WB_SIZEMOVE (WB_SIZEABLE | WB_MOVEABLE) - -// Standard-Window-Bits fuer ChildWindows -#define WB_TABSTOP ((WinBits)0x00000100) -#define WB_NOTABSTOP ((WinBits)0x00000200) -#define WB_GROUP ((WinBits)0x00000400) -#define WB_NOGROUP ((WinBits)0x00000800) -#define WB_HORZ ((WinBits)0x00001000) -#define WB_VERT ((WinBits)0x00002000) -#define WB_LEFT ((WinBits)0x00004000) -#define WB_CENTER ((WinBits)0x00008000) -#define WB_RIGHT ((WinBits)0x00010000) -#define WB_TOP ((WinBits)0x00020000) -#define WB_VCENTER ((WinBits)0x00040000) -#define WB_BOTTOM ((WinBits)0x00080000) -#define WB_DRAG ((WinBits)0x00100000) -#define WB_SPIN ((WinBits)0x00200000) -#define WB_REPEAT ((WinBits)0x00400000) -#define WB_NOPOINTERFOCUS ((WinBits)0x00800000) -#define WB_WORDBREAK ((WinBits)0x01000000) -#define WB_NOLABEL ((WinBits)0x02000000) -#define WB_SORT ((WinBits)0x04000000) -#define WB_DROPDOWN ((WinBits)0x08000000) -#define WB_AUTOHSCROLL ((WinBits)0x10000000) -#define WB_DOCKABLE ((WinBits)0x20000000) -#define WB_AUTOVSCROLL ((WinBits)0x40000000) - -#define WB_HIDE ((WinBits)0x80000000) -#define WB_HSCROLL WB_HORZ -#define WB_VSCROLL WB_VERT -#define WB_TOPIMAGE WB_TOP - -// Window-Bits for PushButtons -#define WB_DEFBUTTON ((WinBits)0x10000000) -#define WB_NOLIGHTBORDER ((WinBits)0x20000000) -#define WB_RECTSTYLE ((WinBits)0x08000000) -#define WB_SMALLSTYLE ((WinBits)0x04000000) - -// Window-Bits for FixedText -#define WB_INFO ((WinBits)0x20000000) -#define WB_PATHELLIPSIS ((WinBits)0x00100000) - -// Window-Bits for Edit -#define WB_PASSWORD ((WinBits)0x01000000) -#define WB_READONLY ((WinBits)0x02000000) -#define WB_NOHIDESELECTION ((WinBits)SAL_CONST_INT64(0x1000000000)) - -// Window-Bits for MultiLineEdit -#define WB_IGNORETAB ((WinBits)0x20000000) - -// Window-Bits for ListBox and MultiListBox -#define WB_SIMPLEMODE ((WinBits)0x20000000) - -// Window-Bits for FixedBitmap -#define WB_FAST ((WinBits)0x04000000) -#define WB_SCALE ((WinBits)0x08000000) -#define WB_TOPLEFTVISIBLE ((WinBits)0x10000000) - -// Window-Bits for ToolBox -#define WB_LINESPACING ((WinBits)0x01000000) -#define WB_SCROLL ((WinBits)0x02000000) - -// Window-Bits for TabControl -#define WB_SINGLELINE ((WinBits)0x02000000) - -// Window-Bits for DockingWindows -#define WB_DOCKBORDER ((WinBits)0x00001000) - -// Window-Bits for SplitWindow -#define WB_NOSPLITDRAW ((WinBits)0x01000000) -#define WB_FLATSPLITDRAW ((WinBits)0x02000000) - -// Window-Bits for MessageBoxen -#define WB_OK ((WinBits)0x00100000) -#define WB_OK_CANCEL ((WinBits)0x00200000) -#define WB_YES_NO ((WinBits)0x00400000) -#define WB_YES_NO_CANCEL ((WinBits)0x00800000) -#define WB_RETRY_CANCEL ((WinBits)0x01000000) -#define WB_DEF_OK ((WinBits)0x02000000) -#define WB_DEF_CANCEL ((WinBits)0x04000000) -#define WB_DEF_RETRY ((WinBits)0x08000000) -#define WB_DEF_YES ((WinBits)0x10000000) -#define WB_DEF_NO ((WinBits)0x20000000) -#define WB_ABORT_RETRY_IGNORE ((WinBits)SAL_CONST_INT64(0x1000000000)) -#define WB_DEF_IGNORE ((WinBits)SAL_CONST_INT64(0x2000000000)) - -// Standard-WinBits -#define WB_STDWORK (WB_SIZEMOVE | WB_CLOSEABLE) -#define WB_STDMDI (WB_CLOSEABLE) -#define WB_STDDOCKWIN (WB_DOCKABLE | WB_MOVEABLE | WB_CLOSEABLE) -#define WB_STDFLOATWIN (WB_SIZEMOVE | WB_CLOSEABLE | WB_ROLLABLE) -#define WB_STDDIALOG (WB_MOVEABLE | WB_CLOSEABLE) -#define WB_STDMODELESS (WB_STDDIALOG) -#define WB_STDMODAL (WB_STDDIALOG) -#define WB_STDTABDIALOG (WB_STDDIALOG) -#define WB_STDTABCONTROL 0 - -// For TreeListBox -#define WB_HASBUTTONS ((WinBits)0x00800000) -#define WB_HASLINES ((WinBits)0x01000000) -#define WB_HASLINESATROOT ((WinBits)0x02000000) - -// -------------- -// - Help-Types - -// -------------- - -#if 0 -// from vcl/inc/help.hxx -#define OOO_HELP_INDEX ".help:index" -#define OOO_HELP_HELPONHELP ".help:helponhelp" -#endif - -// -------------- -// - FieldTypes - -// -------------- - -// from vcl/inc/fldunit.hxx -enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM, - FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA, - FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM, - FUNIT_PERCENT, FUNIT_100TH_MM }; - +#include +#include +#include // from vcl/inc/vclenum.hxx #ifndef ENUM_TIMEFIELDFORMAT_DECLARED @@ -217,25 +72,6 @@ enum KeyFuncType { KEYFUNC_DONTKNOW, KEYFUNC_NEW, KEYFUNC_OPEN, KEYFUNC_SAVE, #endif -// ------------ -// - TriState - -// ------------ - -// from vcl/inc/wintypes.hxx -enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW }; - -// ----------------- -// - MapMode-Types - -// ----------------- - -// from vcl/inc/mapmod.hxx -enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM, - MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH, - MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT, - MAP_RELATIVE, MAP_REALAPPFONT }; - -// Das Resourcesystem benutzt den Wert 0xFFFF (freihalten) - // -------------------------- // - Bits fuer ToolBoxItems - @@ -272,14 +108,6 @@ typedef sal_uInt16 WindowBorderStyle; #define WINDOW_BORDER_MENU ((WindowBorderStyle)0x0010) #define WINDOW_BORDER_NOBORDER ((WindowBorderStyle)0x1000) -// --------------- -// - WindowAlign - -// --------------- - -// from vcl/inc/wintypes.hxx -enum WindowAlign { WINDOWALIGN_LEFT, WINDOWALIGN_TOP, WINDOWALIGN_RIGHT, WINDOWALIGN_BOTTOM }; -enum ImageAlign { IMAGEALIGN_LEFT, IMAGEALIGN_TOP, IMAGEALIGN_RIGHT, IMAGEALIGN_BOTTOM }; - // -------------- // - Menu-Types - // -------------- diff --git a/tools/inc/tools/fldunit.hxx b/tools/inc/tools/fldunit.hxx index 637539f6dd6f..0154b4403501 100644 --- a/tools/inc/tools/fldunit.hxx +++ b/tools/inc/tools/fldunit.hxx @@ -32,7 +32,6 @@ // - FieldTypes - // -------------- -// By changes you must also change: rsc/vclrsc.hxx enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM, FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA, FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM, diff --git a/tools/inc/tools/mapunit.hxx b/tools/inc/tools/mapunit.hxx index 0b5f5d044d19..b30d3865d862 100644 --- a/tools/inc/tools/mapunit.hxx +++ b/tools/inc/tools/mapunit.hxx @@ -32,7 +32,6 @@ // - MapMode-Types - // ----------------- -// By changes you must also change: rsc/vclrsc.hxx enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM, MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH, MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT, diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx index 7d6296b76e8c..b379a515d6da 100644 --- a/tools/inc/tools/wintypes.hxx +++ b/tools/inc/tools/wintypes.hxx @@ -124,7 +124,6 @@ typedef USHORT WindowType; // - Window-Bits - // --------------- -// By changes you must also change: rsc/vclrsc.hxx typedef sal_Int64 WinBits; // Window-Bits fuer Window @@ -298,7 +297,6 @@ typedef sal_Int64 WinBits; // - WindowAlign - // --------------- -// By changes you must also change: rsc/vclrsc.hxx enum WindowAlign { WINDOWALIGN_LEFT, WINDOWALIGN_TOP, WINDOWALIGN_RIGHT, WINDOWALIGN_BOTTOM }; enum ImageAlign { IMAGEALIGN_LEFT, IMAGEALIGN_TOP, IMAGEALIGN_RIGHT, IMAGEALIGN_BOTTOM, IMAGEALIGN_LEFT_TOP, IMAGEALIGN_LEFT_BOTTOM, IMAGEALIGN_TOP_LEFT, @@ -310,7 +308,6 @@ enum SymbolAlign { SYMBOLALIGN_LEFT, SYMBOLALIGN_RIGHT }; // - TriState - // ------------ -// By changes you must also change: rsc/vclrsc.hxx enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW }; -- cgit From c181a93a43634f25a3e99b274dfd9f0f6d3bcf81 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 24 Nov 2010 11:09:04 +0100 Subject: #i95645# fix obvious snafu with bitwise manipulation --- canvas/source/vcl/backbuffer.cxx | 2 +- canvas/source/vcl/bitmapbackbuffer.cxx | 2 +- canvas/source/vcl/spritedevicehelper.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/canvas/source/vcl/backbuffer.cxx b/canvas/source/vcl/backbuffer.cxx index 3820c4e42657..36888d038ceb 100644 --- a/canvas/source/vcl/backbuffer.cxx +++ b/canvas/source/vcl/backbuffer.cxx @@ -48,7 +48,7 @@ namespace vclcanvas // switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and // is not required to do AA. It would need to be adapted to use it correctly // (especially gradient painting). This will need extra work. - maVDev->SetAntialiasing( maVDev->GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW); + maVDev->SetAntialiasing( maVDev->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW); #endif } } diff --git a/canvas/source/vcl/bitmapbackbuffer.cxx b/canvas/source/vcl/bitmapbackbuffer.cxx index 31c78283a128..c09721a5cfaf 100644 --- a/canvas/source/vcl/bitmapbackbuffer.cxx +++ b/canvas/source/vcl/bitmapbackbuffer.cxx @@ -138,7 +138,7 @@ namespace vclcanvas // switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and // is not required to do AA. It would need to be adapted to use it correctly // (especially gradient painting). This will need extra work. - mpVDev->SetAntialiasing(mpVDev->GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW); + mpVDev->SetAntialiasing(mpVDev->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW); #endif } } diff --git a/canvas/source/vcl/spritedevicehelper.cxx b/canvas/source/vcl/spritedevicehelper.cxx index 4c0ea4fd6d3b..46561bc3f835 100644 --- a/canvas/source/vcl/spritedevicehelper.cxx +++ b/canvas/source/vcl/spritedevicehelper.cxx @@ -67,7 +67,7 @@ namespace vclcanvas // switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and // is not required to do AA. It would need to be adapted to use it correctly // (especially gradient painting). This will need extra work. - mpBackBuffer->getOutDev().SetAntialiasing(mpBackBuffer->getOutDev().GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW); + mpBackBuffer->getOutDev().SetAntialiasing(mpBackBuffer->getOutDev().GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW); #endif } -- cgit From 534ada849b5f8788b715b6f6a5357810acc834d5 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 24 Nov 2010 16:09:43 +0100 Subject: vcl117: header cleanup --- editeng/inc/pch/precompiled_editeng.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 editeng/inc/pch/precompiled_editeng.hxx diff --git a/editeng/inc/pch/precompiled_editeng.hxx b/editeng/inc/pch/precompiled_editeng.hxx old mode 100644 new mode 100755 index 9d432f73a731..74db944ea07b --- a/editeng/inc/pch/precompiled_editeng.hxx +++ b/editeng/inc/pch/precompiled_editeng.hxx @@ -854,7 +854,7 @@ #include "vcl/cursor.hxx" #include "vcl/decoview.hxx" #include "vcl/dndhelp.hxx" -#include "vcl/fldunit.hxx" +#include "tools/fldunit.hxx" #include "vcl/fntstyle.hxx" #include "unotools/fontcvt.hxx" #include "vcl/gdimtf.hxx" @@ -873,7 +873,7 @@ #include "vcl/unohelp.hxx" #include "vcl/unohelp2.hxx" #include "vcl/wall.hxx" -#include "vcl/wintypes.hxx" +#include "tools/wintypes.hxx" #include "vos/mutex.hxx" #include "vos/ref.hxx" #include "vos/refernce.hxx" -- cgit From c462e5c59780d3e002b205020b1aa792de785121 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 24 Nov 2010 16:09:43 +0100 Subject: vcl117: header cleanup --- sw/inc/pch/precompiled_sw.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 sw/inc/pch/precompiled_sw.hxx diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx old mode 100644 new mode 100755 index 39eb365b549c..9e86c1ec6110 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -913,7 +913,7 @@ #include "vcl/event.hxx" #include "vcl/field.hxx" #include "vcl/fixed.hxx" -#include "vcl/fldunit.hxx" +#include "tools/fldunit.hxx" #include "vcl/font.hxx" #include "unotools/fontcvt.hxx" #include "vcl/graph.hxx" @@ -950,7 +950,7 @@ #include "vcl/virdev.hxx" #include "vcl/waitobj.hxx" #include "vcl/window.hxx" -#include "vcl/wintypes.hxx" +#include "tools/wintypes.hxx" #include "vcl/wrkwin.hxx" #include "vos/mutex.hxx" -- cgit From 1a5df47d2902194e9d6bbaa702980cb4fb1b312f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 24 Nov 2010 16:09:43 +0100 Subject: vcl117: header cleanup --- sd/inc/pch/precompiled_sd.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 sd/inc/pch/precompiled_sd.hxx diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx old mode 100644 new mode 100755 index 7e92020eb88f..dd874680e887 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.hxx @@ -902,7 +902,7 @@ #include "vcl/virdev.hxx" #include "vcl/waitobj.hxx" #include "vcl/window.hxx" -#include "vcl/wintypes.hxx" +#include "tools/wintypes.hxx" #include "vcl/wrkwin.hxx" #include "vos/diagnose.hxx" -- cgit From 2d0f40ce04bdcc067793bed89395c4e1c3ebf348 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 24 Nov 2010 16:09:43 +0100 Subject: vcl117: header cleanup --- chart2/inc/pch/precompiled_chart2.hxx | 2 +- sc/inc/pch/precompiled_sc.hxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 chart2/inc/pch/precompiled_chart2.hxx mode change 100644 => 100755 sc/inc/pch/precompiled_sc.hxx diff --git a/chart2/inc/pch/precompiled_chart2.hxx b/chart2/inc/pch/precompiled_chart2.hxx old mode 100644 new mode 100755 index 199564a9f024..fed813c55c76 --- a/chart2/inc/pch/precompiled_chart2.hxx +++ b/chart2/inc/pch/precompiled_chart2.hxx @@ -268,7 +268,7 @@ #include "unotools/configitem.hxx" #include "unotools/eventlisteneradapter.hxx" -#include "vcl/fldunit.hxx" +#include "tools/fldunit.hxx" #include "vos/mutex.hxx" //---MARKER--- diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx old mode 100644 new mode 100755 index 048d7b638d57..e90a8c46b6a3 --- a/sc/inc/pch/precompiled_sc.hxx +++ b/sc/inc/pch/precompiled_sc.hxx @@ -218,7 +218,7 @@ #include #include #include -#include +#include #include #include #include @@ -235,7 +235,7 @@ #include #include #include -#include +#include #include #include #include -- cgit From bd6ee967cdf357ae485dea1611ed5b29d630ca96 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 24 Nov 2010 16:09:43 +0100 Subject: vcl117: header cleanup --- extensions/inc/pch/precompiled_extensions.hxx | 2 +- forms/inc/pch/precompiled_forms.hxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 extensions/inc/pch/precompiled_extensions.hxx mode change 100644 => 100755 forms/inc/pch/precompiled_forms.hxx diff --git a/extensions/inc/pch/precompiled_extensions.hxx b/extensions/inc/pch/precompiled_extensions.hxx old mode 100644 new mode 100755 index 676418c6729f..bed9dd749349 --- a/extensions/inc/pch/precompiled_extensions.hxx +++ b/extensions/inc/pch/precompiled_extensions.hxx @@ -533,7 +533,7 @@ #include "unotools/processfactory.hxx" -#include "vcl/fldunit.hxx" +#include "tools/fldunit.hxx" #include "vos/conditn.hxx" #include "vos/diagnose.hxx" diff --git a/forms/inc/pch/precompiled_forms.hxx b/forms/inc/pch/precompiled_forms.hxx old mode 100644 new mode 100755 index c510fa7379f3..c6c9cd5d5341 --- a/forms/inc/pch/precompiled_forms.hxx +++ b/forms/inc/pch/precompiled_forms.hxx @@ -389,7 +389,7 @@ #include "vcl/bmpacc.hxx" #include "vcl/cvtgrf.hxx" #include "vcl/mapmod.hxx" -#include "vcl/mapunit.hxx" +#include "tools/mapunit.hxx" #include "vcl/stdtext.hxx" #include "vcl/timer.hxx" #include "tools/wintypes.hxx" -- cgit From 696996791d1dbfd8f410236e30be5a1fb100de70 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 24 Nov 2010 18:39:49 +0100 Subject: vcl117: #i115686# remove old unused style setting --- rsc/inc/rscdb.hxx | 1 - rsc/inc/vclrsc.hxx | 3 - rsc/source/parser/rscicpx.cxx | 1 - rsc/source/parser/rscinit.cxx | 2 - svtools/inc/apearcfg.hxx | 20 ----- svtools/source/config/apearcfg.cxx | 87 ++++-------------- toolkit/source/awt/vclxwindows.cxx | 18 ++-- tools/inc/tools/wintypes.hxx | 3 - vcl/inc/vcl/button.hxx | 1 - vcl/inc/vcl/settings.hxx | 54 +---------- vcl/inc/vcl/svids.hrc | 6 +- vcl/inc/vcl/symbol.hxx | 3 - vcl/inc/vcl/tabctrl.hxx | 12 --- vcl/os2/source/window/salframe.cxx | 51 +++++------ vcl/source/app/settings.cxx | 46 ---------- vcl/source/control/button.cxx | 178 +------------------------------------ vcl/source/control/menubtn.cxx | 9 -- vcl/source/control/scrbar.cxx | 57 ------------ vcl/source/control/slider.cxx | 7 -- vcl/source/control/tabctrl.cxx | 149 ++----------------------------- vcl/source/src/images.src | 39 -------- vcl/source/window/decoview.cxx | 100 --------------------- vcl/win/source/window/salframe.cxx | 114 +++++++++++------------- 23 files changed, 113 insertions(+), 848 deletions(-) diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx index 51461cf356d6..cbdf5a326a43 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -142,7 +142,6 @@ class RscTypCont Atom nTopImageId; Atom nNoLabelId; Atom nVertId; - Atom nSingleLineId; Atom nSysWinId; void Init(); // Initialisiert Klassen und Tabelle diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx index cc82a4dbaa54..11b3f57c1dd2 100644 --- a/rsc/inc/vclrsc.hxx +++ b/rsc/inc/vclrsc.hxx @@ -166,9 +166,6 @@ typedef sal_uInt16 SymbolType; #define SYMBOL_DOCK ((SymbolType)32) #define SYMBOL_HIDE ((SymbolType)33) #define SYMBOL_HELP ((SymbolType)34) -#define SYMBOL_OS2CLOSE ((SymbolType)35) -#define SYMBOL_OS2FLOAT ((SymbolType)36) -#define SYMBOL_OS2HIDE ((SymbolType)37) #define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW) diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx index 1942711a4a47..1588ac1f0198 100644 --- a/rsc/source/parser/rscicpx.cxx +++ b/rsc/source/parser/rscicpx.cxx @@ -2277,7 +2277,6 @@ RscTop * RscTypCont::InitClassTabControl( RscTop * pSuper, pClassTabControl->SetVariable( nId, pCont, NULL, 0, RSC_TABCONTROL_ITEMLIST ); - INS_WINBIT( pClassTabControl, SingleLine ); INS_WINBIT( pClassTabControl, DropDown ); } diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx index 54a56a3840d2..aded8db5f865 100644 --- a/rsc/source/parser/rscinit.cxx +++ b/rsc/source/parser/rscinit.cxx @@ -372,8 +372,6 @@ void RscTypCont::Init() aWinBits.SetConstant( nNoLabelId, sal::static_int_cast(WB_NOLABEL) ); nVertId = pHS->getID( "WB_VERT" ); aWinBits.SetConstant( nVertId, sal::static_int_cast(WB_VERT) ); - nSingleLineId = pHS->getID( "WB_SINGLELINE" ); - aWinBits.SetConstant( nSingleLineId, sal::static_int_cast(WB_SINGLELINE) ); nSysWinId = pHS->getID( "WB_SYSTEMWINDOW" ); aWinBits.SetConstant( nSysWinId, sal::static_int_cast(WB_SYSTEMWINDOW) ); } diff --git a/svtools/inc/apearcfg.hxx b/svtools/inc/apearcfg.hxx index 8e6018424c4c..5dea74761e17 100644 --- a/svtools/inc/apearcfg.hxx +++ b/svtools/inc/apearcfg.hxx @@ -36,14 +36,6 @@ class Application; /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ -typedef enum { - LookStardivision = 0, - LookMotif, - LookWindows, - LookOSTwo, - LookMacintosh -} SystemLook; - typedef enum { SnapToButton = 0, SnapToMiddle, @@ -59,7 +51,6 @@ typedef enum { // MUST match the order chosen in ListBox LB_DRAG_MODE in optgdlg class SVT_DLLPUBLIC SvtTabAppearanceCfg : public utl::ConfigItem { - short nLookNFeel ; short nDragMode ; short nScaleFactor ; short nSnapMode ; @@ -69,8 +60,6 @@ class SVT_DLLPUBLIC SvtTabAppearanceCfg : public utl::ConfigItem #endif BOOL bMenuMouseFollow ; - BOOL bSingleLineTabCtrl ; - BOOL bColoredTabCtrl ; #if defined( UNX ) || defined ( FS_PRIV_DEBUG ) BOOL bFontAntialiasing ; #endif @@ -86,9 +75,6 @@ public: virtual void Commit(); virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& _rPropertyNames); - USHORT GetLookNFeel () const { return nLookNFeel; } - void SetLookNFeel ( USHORT nSet ); - USHORT GetDragMode () const { return nDragMode; } void SetDragMode ( USHORT nSet ); @@ -106,9 +92,6 @@ public: void SetMenuMouseFollow(BOOL bSet) {bMenuMouseFollow = bSet; SetModified();} BOOL IsMenuMouseFollow() const{return bMenuMouseFollow;} - void SetSingleLineTabCtrl(BOOL bSet) {bSingleLineTabCtrl = bSet; SetModified();} - BOOL IsSingleLineTabCtrl()const {return bSingleLineTabCtrl;} - #if defined( UNX ) || defined ( FS_PRIV_DEBUG ) void SetFontAntiAliasing( BOOL bSet ) { bFontAntialiasing = bSet; SetModified(); } BOOL IsFontAntiAliasing() const { return bFontAntialiasing; } @@ -117,9 +100,6 @@ public: void SetFontAntialiasingMinPixelHeight( USHORT _nMinHeight ) { nAAMinPixelHeight = _nMinHeight; SetModified(); } #endif - void SetColoredTabCtrl(BOOL bSet) {bColoredTabCtrl = bSet; SetModified();}; - BOOL IsColoredTabCtrl()const {return bColoredTabCtrl;} - static sal_Bool IsInitialized() { return bInitialized; } static void SetInitialized() { bInitialized = sal_True; } }; diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx index 316e6ab34656..bb8087fc53be 100644 --- a/svtools/source/config/apearcfg.cxx +++ b/svtools/source/config/apearcfg.cxx @@ -52,7 +52,6 @@ sal_Bool SvtTabAppearanceCfg::bInitialized = sal_False; --------------------------------------------------------------------*/ SvtTabAppearanceCfg::SvtTabAppearanceCfg() :ConfigItem(OUString::createFromAscii("Office.Common/View")) - ,nLookNFeel ( DEFAULT_LOOKNFEEL ) ,nDragMode ( DEFAULT_DRAGMODE ) ,nScaleFactor ( DEFAULT_SCALEFACTOR ) ,nSnapMode ( DEFAULT_SNAPMODE ) @@ -61,8 +60,6 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg() ,nAAMinPixelHeight ( DEFAULT_AAMINHEIGHT ) #endif ,bMenuMouseFollow(FALSE) - ,bSingleLineTabCtrl(FALSE) - ,bColoredTabCtrl(FALSE) #if defined( UNX ) || defined ( FS_PRIV_DEBUG ) ,bFontAntialiasing ( TRUE ) #endif @@ -83,16 +80,13 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg() switch(nProp) { case 0: *pValues >>= nScaleFactor; break; //"FontScaling", - case 1: *pValues >>= nLookNFeel; break; //"LookAndFeel", - case 2: *pValues >>= nDragMode; break; //"Window/Drag", - case 3: bMenuMouseFollow = *(sal_Bool*)pValues->getValue(); break; //"Menu/FollowMouse", - case 4: bSingleLineTabCtrl = *(sal_Bool*)pValues->getValue(); break; //"Dialog/SingleLineTab", - case 5: bColoredTabCtrl = *(sal_Bool*)pValues->getValue(); break; //"Dialog/ColoredTab", - case 6: *pValues >>= nSnapMode; break; //"Dialog/MousePositioning", - case 7: *pValues >>= nMiddleMouse; break; //"Dialog/MiddleMouseButton", + case 1: *pValues >>= nDragMode; break; //"Window/Drag", + case 2: bMenuMouseFollow = *(sal_Bool*)pValues->getValue(); break; //"Menu/FollowMouse", + case 3: *pValues >>= nSnapMode; break; //"Dialog/MousePositioning", + case 4: *pValues >>= nMiddleMouse; break; //"Dialog/MiddleMouseButton", #if defined( UNX ) || defined ( FS_PRIV_DEBUG ) - case 8: bFontAntialiasing = *(sal_Bool*)pValues->getValue(); break; // "FontAntialising/Enabled", - case 9: *pValues >>= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight", + case 5: bFontAntialiasing = *(sal_Bool*)pValues->getValue(); break; // "FontAntialising/Enabled", + case 6: *pValues >>= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight", #endif } } @@ -116,16 +110,13 @@ const Sequence& SvtTabAppearanceCfg::GetPropertyNames() static const sal_Char* aPropNames[] = { "FontScaling" // 0 - ,"LookAndFeel" // 1 - ,"Window/Drag" // 2 - ,"Menu/FollowMouse" // 3 - ,"Dialog/SingleLineTab" // 4 - ,"Dialog/ColoredTab" // 5 - ,"Dialog/MousePositioning" // 6 - ,"Dialog/MiddleMouseButton" // 7 + ,"Window/Drag" // 1 + ,"Menu/FollowMouse" // 2 + ,"Dialog/MousePositioning" // 3 + ,"Dialog/MiddleMouseButton" // 4 #if defined( UNX ) || defined ( FS_PRIV_DEBUG ) - ,"FontAntiAliasing/Enabled" // 8 - ,"FontAntiAliasing/MinPixelHeight" // 9 + ,"FontAntiAliasing/Enabled" // 5 + ,"FontAntiAliasing/MinPixelHeight" // 6 #endif }; const int nCount = sizeof( aPropNames ) / sizeof( aPropNames[0] ); @@ -153,16 +144,13 @@ void SvtTabAppearanceCfg::Commit() switch(nProp) { case 0: pValues[nProp] <<= nScaleFactor; break; // "FontScaling", - case 1: pValues[nProp] <<= nLookNFeel; break; //"LookAndFeel", - case 2: pValues[nProp] <<= nDragMode; break; //"Window/Drag", - case 3: pValues[nProp].setValue(&bMenuMouseFollow, rType); break; //"Menu/FollowMouse", - case 4: pValues[nProp].setValue(&bSingleLineTabCtrl, rType); break; //"Dialog/SingleLineTab", - case 5: pValues[nProp].setValue(&bColoredTabCtrl, rType); break; //"Dialog/ColoredTab", - case 6: pValues[nProp] <<= nSnapMode; break; //"Dialog/MousePositioning", - case 7: pValues[nProp] <<= nMiddleMouse; break; //"Dialog/MiddleMouseButton", + case 1: pValues[nProp] <<= nDragMode; break; //"Window/Drag", + case 2: pValues[nProp].setValue(&bMenuMouseFollow, rType); break; //"Menu/FollowMouse", + case 3: pValues[nProp] <<= nSnapMode; break; //"Dialog/MousePositioning", + case 4: pValues[nProp] <<= nMiddleMouse; break; //"Dialog/MiddleMouseButton", #if defined( UNX ) || defined ( FS_PRIV_DEBUG ) - case 8: pValues[nProp].setValue(&bFontAntialiasing, rType); break; // "FontAntialising/Enabled", - case 9: pValues[nProp] <<= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight", + case 5: pValues[nProp].setValue(&bFontAntialiasing, rType); break; // "FontAntialising/Enabled", + case 6: pValues[nProp] <<= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight", #endif } } @@ -173,16 +161,6 @@ void SvtTabAppearanceCfg::Notify( const com::sun::star::uno::Sequence< rtl::OUSt { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -void SvtTabAppearanceCfg::SetLookNFeel ( USHORT nSet ) -{ - nLookNFeel = nSet; - SetModified(); -} - /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ @@ -234,26 +212,7 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp ) // SetStandard...Styles() resets the UseSystemUIFonts flag, // but we don't want to change it now, so save the flag before ... BOOL bUseSystemUIFonts = hAppStyle.GetUseSystemUIFonts(); - - switch ( nLookNFeel ) - { - case LookMotif: - hAppStyle.SetStandardUnixStyles(); break; - - case LookOSTwo: - hAppStyle.SetStandardOS2Styles(); break; - - case LookMacintosh: - hAppStyle.SetStandardMacStyles(); break; - - case LookWindows: - hAppStyle.SetStandardWinStyles(); break; - - case LookStardivision: - default: - hAppStyle.SetStandardStyles(); break; - } - + hAppStyle.SetStandardStyles(); // and set it here hAppStyle.SetUseSystemUIFonts( bUseSystemUIFonts ); @@ -298,14 +257,6 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp ) else nFollow &= ~MOUSE_FOLLOW_MENU; hMouseSettings.SetFollow( nFollow ); - sal_uInt16 nTabStyle = 0; - if(bSingleLineTabCtrl) - nTabStyle |= STYLE_TABCONTROL_SINGLELINE; - - if(bColoredTabCtrl) - nTabStyle |= STYLE_TABCONTROL_COLOR; - hAppStyle.SetTabControlStyle(nTabStyle); - hAppSettings.SetMouseSettings( hMouseSettings ); diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 06c9167336a8..6c6b9dc4b2c8 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -173,7 +173,7 @@ namespace toolkit _pWindow->SetStyle( nStyle ); } - static void setVisualEffect( const Any& _rValue, Window* _pWindow, void (StyleSettings::*pSetter)( USHORT ), sal_Int16 _nFlatBits, sal_Int16 _n3DBits ) + static void setVisualEffect( const Any& _rValue, Window* _pWindow ) { AllSettings aSettings = _pWindow->GetSettings(); StyleSettings aStyleSettings = aSettings.GetStyleSettings(); @@ -183,22 +183,22 @@ namespace toolkit switch ( nStyle ) { case FLAT: - (aStyleSettings.*pSetter)( _nFlatBits ); + aStyleSettings.SetOptions( aStyleSettings.GetOptions() & ~STYLE_OPTION_MONO ); break; case LOOK3D: default: - (aStyleSettings.*pSetter)( _n3DBits ); + aStyleSettings.SetOptions( aStyleSettings.GetOptions() | STYLE_OPTION_MONO ); } aSettings.SetStyleSettings( aStyleSettings ); _pWindow->SetSettings( aSettings ); } - static Any getVisualEffect( Window* _pWindow, USHORT (StyleSettings::*pGetter)( ) const, sal_Int16 _nFlatBits ) + static Any getVisualEffect( Window* _pWindow ) { Any aEffect; StyleSettings aStyleSettings = _pWindow->GetSettings().GetStyleSettings(); - if ( (aStyleSettings.*pGetter)() == _nFlatBits ) + if ( (aStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) aEffect <<= (sal_Int16)FLAT; else aEffect <<= (sal_Int16)LOOK3D; @@ -961,7 +961,7 @@ void VCLXCheckBox::setProperty( const ::rtl::OUString& PropertyName, const ::com switch ( nPropType ) { case BASEPROPERTY_VISUALEFFECT: - ::toolkit::setVisualEffect( Value, pCheckBox, &StyleSettings::SetCheckBoxStyle, STYLE_CHECKBOX_MONO, STYLE_CHECKBOX_WIN ); + ::toolkit::setVisualEffect( Value, pCheckBox ); break; case BASEPROPERTY_TRISTATE: @@ -998,7 +998,7 @@ void VCLXCheckBox::setProperty( const ::rtl::OUString& PropertyName, const ::com switch ( nPropType ) { case BASEPROPERTY_VISUALEFFECT: - aProp = ::toolkit::getVisualEffect( pCheckBox, &StyleSettings::GetCheckBoxStyle, STYLE_CHECKBOX_MONO ); + aProp = ::toolkit::getVisualEffect( pCheckBox ); break; case BASEPROPERTY_TRISTATE: aProp <<= (sal_Bool)pCheckBox->IsTriStateEnabled(); @@ -1133,7 +1133,7 @@ void VCLXRadioButton::setProperty( const ::rtl::OUString& PropertyName, const :: switch ( nPropType ) { case BASEPROPERTY_VISUALEFFECT: - ::toolkit::setVisualEffect( Value, pButton, &StyleSettings::SetRadioButtonStyle, STYLE_RADIOBUTTON_MONO, STYLE_RADIOBUTTON_WIN ); + ::toolkit::setVisualEffect( Value, pButton ); break; case BASEPROPERTY_STATE: @@ -1176,7 +1176,7 @@ void VCLXRadioButton::setProperty( const ::rtl::OUString& PropertyName, const :: switch ( nPropType ) { case BASEPROPERTY_VISUALEFFECT: - aProp = ::toolkit::getVisualEffect( pButton, &StyleSettings::GetRadioButtonStyle, STYLE_RADIOBUTTON_MONO ); + aProp = ::toolkit::getVisualEffect( pButton ); break; case BASEPROPERTY_STATE: aProp <<= (sal_Int16) ( pButton->IsChecked() ? 1 : 0 ); diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx index b379a515d6da..2c69853aebed 100644 --- a/tools/inc/tools/wintypes.hxx +++ b/tools/inc/tools/wintypes.hxx @@ -238,9 +238,6 @@ typedef sal_Int64 WinBits; #define WB_SCROLL ((WinBits)0x02000000) #define WB_FORCETABCYCLE ((WinBits)0x04000000) -// Window-Bits for TabControl -#define WB_SINGLELINE ((WinBits)0x02000000) - // Window-Bits for DockingWindows #define WB_DOCKBORDER ((WinBits)0x00001000) diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx index ab92445b5e03..ddd023a3aaa4 100644 --- a/vcl/inc/vcl/button.hxx +++ b/vcl/inc/vcl/button.hxx @@ -78,7 +78,6 @@ public: ~Button(); virtual void Click(); - virtual void DataChanged( const DataChangedEvent& rDCEvt ); void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; } const Link& GetClickHdl() const { return maClickHdl; } diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx index 24fd30750501..cc5cbcbc4d0f 100644 --- a/vcl/inc/vcl/settings.hxx +++ b/vcl/inc/vcl/settings.hxx @@ -423,10 +423,6 @@ private: ULONG mnOptions; USHORT mnScreenZoom; USHORT mnScreenFontZoom; - USHORT mnRadioButtonStyle; - USHORT mnCheckBoxStyle; - USHORT mnPushButtonStyle; - USHORT mnTabControlStyle; USHORT mnHighContrast; USHORT mnUseSystemUIFonts; USHORT mnAutoMnemonic; @@ -457,11 +453,6 @@ private: #define STYLE_OPTION_SPINARROW ((ULONG)0x00000080) #define STYLE_OPTION_SPINUPDOWN ((ULONG)0x00000100) #define STYLE_OPTION_NOMNEMONICS ((ULONG)0x00000200) -#define STYLE_OPTION_WINSTYLE ((ULONG)0x00010000) -#define STYLE_OPTION_OS2STYLE ((ULONG)0x00020000) -#define STYLE_OPTION_MACSTYLE ((ULONG)0x00040000) -#define STYLE_OPTION_UNIXSTYLE ((ULONG)0x00080000) -#define STYLE_OPTION_SYSTEMSTYLE ((ULONG)0x000F0000) #define STYLE_OPTION_HIDEDISABLED ((ULONG)0x00100000) #define DRAGFULL_OPTION_WINDOWMOVE ((ULONG)0x00000001) @@ -488,28 +479,8 @@ private: #define DISPLAY_OPTION_AA_DISABLE ((ULONG)0x00000001) -#define STYLE_RADIOBUTTON_WIN ((USHORT)0x0001) -#define STYLE_RADIOBUTTON_OS2 ((USHORT)0x0002) -#define STYLE_RADIOBUTTON_MAC ((USHORT)0x0003) -#define STYLE_RADIOBUTTON_UNIX ((USHORT)0x0004) -#define STYLE_RADIOBUTTON_MONO ((USHORT)0x0005) -#define STYLE_RADIOBUTTON_STYLE ((USHORT)0x000F) - -#define STYLE_CHECKBOX_WIN ((USHORT)0x0001) -#define STYLE_CHECKBOX_OS2 ((USHORT)0x0002) -#define STYLE_CHECKBOX_MAC ((USHORT)0x0003) -#define STYLE_CHECKBOX_UNIX ((USHORT)0x0004) -#define STYLE_CHECKBOX_MONO ((USHORT)0x0005) -#define STYLE_CHECKBOX_STYLE ((USHORT)0x000F) - -#define STYLE_PUSHBUTTON_WIN ((USHORT)0x0001) -#define STYLE_PUSHBUTTON_OS2 ((USHORT)0x0002) -#define STYLE_PUSHBUTTON_MAC ((USHORT)0x0003) -#define STYLE_PUSHBUTTON_UNIX ((USHORT)0x0004) -#define STYLE_PUSHBUTTON_STYLE ((USHORT)0x000F) - -#define STYLE_TABCONTROL_SINGLELINE ((USHORT)0x0001) -#define STYLE_TABCONTROL_COLOR ((USHORT)0x0002) +#define STYLE_RADIOBUTTON_MONO ((USHORT)0x0001) // legacy +#define STYLE_CHECKBOX_MONO ((USHORT)0x0001) // legacy #define STYLE_TOOLBAR_ICONSIZE_UNKNOWN ((ULONG)0) #define STYLE_TOOLBAR_ICONSIZE_SMALL ((ULONG)1) @@ -813,23 +784,6 @@ public: const Font& GetIconFont() const { return mpData->maIconFont; } - void SetRadioButtonStyle( USHORT nStyle ) - { CopyData(); mpData->mnRadioButtonStyle = nStyle; } - USHORT GetRadioButtonStyle() const - { return mpData->mnRadioButtonStyle; } - void SetCheckBoxStyle( USHORT nStyle ) - { CopyData(); mpData->mnCheckBoxStyle = nStyle; } - USHORT GetCheckBoxStyle() const - { return mpData->mnCheckBoxStyle; } - void SetPushButtonStyle( USHORT nStyle ) - { CopyData(); mpData->mnPushButtonStyle = nStyle; } - USHORT GetPushButtonStyle() const - { return mpData->mnPushButtonStyle; } - void SetTabControlStyle( USHORT nStyle ) - { CopyData(); mpData->mnTabControlStyle = nStyle; } - USHORT GetTabControlStyle() const - { return mpData->mnTabControlStyle; } - void SetBorderSize( long nSize ) { CopyData(); mpData->mnBorderSize = nSize; } long GetBorderSize() const @@ -971,10 +925,6 @@ public: { CopyData(); mpData->maWorkspaceGradient = rWall; } void SetStandardStyles(); - void SetStandardWinStyles(); - void SetStandardOS2Styles(); - void SetStandardMacStyles(); - void SetStandardUnixStyles(); const StyleSettings& operator =( const StyleSettings& rSet ); diff --git a/vcl/inc/vcl/svids.hrc b/vcl/inc/vcl/svids.hrc index e915644aa8ec..432a30c3a748 100644 --- a/vcl/inc/vcl/svids.hrc +++ b/vcl/inc/vcl/svids.hrc @@ -31,11 +31,7 @@ #include "svl/solar.hrc" #define SV_RESID_STDOFFSET 0 -#define SV_RESID_WINOFFSET 1 -#define SV_RESID_OS2OFFSET 2 -#define SV_RESID_MACOFFSET 3 -#define SV_RESID_UNIXOFFSET 4 -#define SV_RESID_MONOOFFSET 5 +#define SV_RESID_MONOOFFSET 1 // Achtung: Diese Id's muessen min. 10 Werte auseinanderliegen, da // je nach Style noch ein Offset aufgerechnet wird diff --git a/vcl/inc/vcl/symbol.hxx b/vcl/inc/vcl/symbol.hxx index c7a745516856..0f0627fb41e3 100644 --- a/vcl/inc/vcl/symbol.hxx +++ b/vcl/inc/vcl/symbol.hxx @@ -71,9 +71,6 @@ typedef USHORT SymbolType; #define SYMBOL_DOCK ((SymbolType)32) #define SYMBOL_HIDE ((SymbolType)33) #define SYMBOL_HELP ((SymbolType)34) -#define SYMBOL_OS2CLOSE ((SymbolType)35) -#define SYMBOL_OS2FLOAT ((SymbolType)36) -#define SYMBOL_OS2HIDE ((SymbolType)37) #define SYMBOL_MENU SYMBOL_SPIN_DOWN #define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW) diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx index ad702ac4dc54..430a99235b52 100644 --- a/vcl/inc/vcl/tabctrl.hxx +++ b/vcl/inc/vcl/tabctrl.hxx @@ -63,13 +63,9 @@ private: long mnMaxPageWidth; USHORT mnActPageId; USHORT mnCurPageId; - USHORT mnFirstPagePos; - USHORT mnLastFirstPagePos; BOOL mbFormat; BOOL mbRestoreHelpId; BOOL mbRestoreUnqId; - BOOL mbSingleLine; - BOOL mbScroll; BOOL mbSmallInvalidate; BOOL mbExtraSpace; Link maActivateHdl; @@ -78,22 +74,17 @@ private: using Control::ImplInitSettings; SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); SAL_DLLPRIVATE ImplTabItem* ImplGetItem( USHORT nId ) const; - SAL_DLLPRIVATE void ImplScrollBtnsColor(); - SAL_DLLPRIVATE void ImplSetScrollBtnsState(); - SAL_DLLPRIVATE void ImplPosScrollBtns(); SAL_DLLPRIVATE Size ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ); SAL_DLLPRIVATE Rectangle ImplGetTabRect( USHORT nPos, long nWidth = -1, long nHeight = -1 ); SAL_DLLPRIVATE void ImplChangeTabPage( USHORT nId, USHORT nOldId ); SAL_DLLPRIVATE BOOL ImplPosCurTabPage(); SAL_DLLPRIVATE void ImplActivateTabPage( BOOL bNext ); - SAL_DLLPRIVATE void ImplSetFirstPagePos( USHORT nPagePos ); SAL_DLLPRIVATE void ImplShowFocus(); SAL_DLLPRIVATE void ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bool bLayout = false, bool bFirstInGroup = false, bool bLastInGroup = false, bool bIsCurrentItem = false ); SAL_DLLPRIVATE void ImplPaint( const Rectangle& rRect, bool bLayout = false ); SAL_DLLPRIVATE void ImplFreeLayoutData(); SAL_DLLPRIVATE long ImplHandleKeyEvent( const KeyEvent& rKeyEvent ); - DECL_DLLPRIVATE_LINK( ImplScrollBtnHdl, PushButton* pBtn ); DECL_DLLPRIVATE_LINK( ImplListBoxSelectHdl, ListBox* ); DECL_DLLPRIVATE_LINK( ImplWindowEventListener, VclSimpleEvent* ); @@ -156,9 +147,6 @@ public: void SetCurPageId( USHORT nPageId ); USHORT GetCurPageId() const; - void SetFirstPageId( USHORT nPageId ); - USHORT GetFirstPageId() const { return GetPageId( mnFirstPagePos ); } - void SelectTabPage( USHORT nPageId ); void SetMaxPageWidth( long nMaxWidth ) { mnMaxPageWidth = nMaxWidth; } diff --git a/vcl/os2/source/window/salframe.cxx b/vcl/os2/source/window/salframe.cxx index f3314c725255..f465dc741a60 100644 --- a/vcl/os2/source/window/salframe.cxx +++ b/vcl/os2/source/window/salframe.cxx @@ -2122,8 +2122,6 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings ) // --- Style settings --- StyleSettings aStyleSettings = rSettings.GetStyleSettings(); - BOOL bCompBorder = (aStyleSettings.GetOptions() & (STYLE_OPTION_MACSTYLE | STYLE_OPTION_UNIXSTYLE)) == 0; - // General settings LONG nDisplayTime = PrfQueryProfileInt( HINI_PROFILE, (PSZ)aControlPanel, (PSZ)"LogoDisplayTime", -1 ); ULONG nSalDisplayTime; @@ -2145,32 +2143,26 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings ) // Size settings aStyleSettings.SetScrollBarSize( WinQuerySysValue( HWND_DESKTOP, SV_CYHSCROLL ) ); - if ( bCompBorder ) - { - aStyleSettings.SetTitleHeight( WinQuerySysValue( HWND_DESKTOP, SV_CYTITLEBAR ) ); - } + aStyleSettings.SetTitleHeight( WinQuerySysValue( HWND_DESKTOP, SV_CYTITLEBAR ) ); // Color settings - if ( bCompBorder ) - { - aStyleSettings.SetFaceColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) ); - aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() ); - aStyleSettings.SetLightColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONLIGHT, 0 ) ) ); - aStyleSettings.SetLightBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) ); - aStyleSettings.SetShadowColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONDARK, 0 ) ) ); - aStyleSettings.SetDarkShadowColor( Color( COL_BLACK ) ); - aStyleSettings.SetDialogColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_DIALOGBACKGROUND, 0 ) ) ); - aStyleSettings.SetButtonTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) ); - aStyleSettings.SetActiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLE, 0 ) ) ); - aStyleSettings.SetActiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLETEXT, 0 ) ) ); - aStyleSettings.SetActiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVEBORDER, 0 ) ) ); - aStyleSettings.SetDeactiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLE, 0 ) ) ); - aStyleSettings.SetDeactiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLETEXT, 0 ) ) ); - aStyleSettings.SetDeactiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVEBORDER, 0 ) ) ); - aStyleSettings.SetMenuColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENU, 0 ) ) ); - aStyleSettings.SetMenuTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) ); - aStyleSettings.SetMenuBarTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) ); - } + aStyleSettings.SetFaceColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) ); + aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() ); + aStyleSettings.SetLightColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONLIGHT, 0 ) ) ); + aStyleSettings.SetLightBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) ); + aStyleSettings.SetShadowColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONDARK, 0 ) ) ); + aStyleSettings.SetDarkShadowColor( Color( COL_BLACK ) ); + aStyleSettings.SetDialogColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_DIALOGBACKGROUND, 0 ) ) ); + aStyleSettings.SetButtonTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) ); + aStyleSettings.SetActiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLE, 0 ) ) ); + aStyleSettings.SetActiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLETEXT, 0 ) ) ); + aStyleSettings.SetActiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVEBORDER, 0 ) ) ); + aStyleSettings.SetDeactiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLE, 0 ) ) ); + aStyleSettings.SetDeactiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLETEXT, 0 ) ) ); + aStyleSettings.SetDeactiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVEBORDER, 0 ) ) ); + aStyleSettings.SetMenuColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENU, 0 ) ) ); + aStyleSettings.SetMenuTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) ); + aStyleSettings.SetMenuBarTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) ); aStyleSettings.SetDialogTextColor( aStyleSettings.GetButtonTextColor() ); aStyleSettings.SetRadioCheckTextColor( aStyleSettings.GetButtonTextColor() ); aStyleSettings.SetGroupTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_WINDOWSTATICTEXT, 0 ) ) ); @@ -2187,11 +2179,8 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings ) Color aMenuHighColor = ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUHILITEBGND, 0 ) ); if ( ImplSalIsSameColor( aMenuHighColor, aStyleSettings.GetMenuColor() ) ) { - if ( bCompBorder ) - { - aStyleSettings.SetMenuHighlightColor( Color( COL_BLUE ) ); - aStyleSettings.SetMenuHighlightTextColor( Color( COL_WHITE ) ); - } + aStyleSettings.SetMenuHighlightColor( Color( COL_BLUE ) ); + aStyleSettings.SetMenuHighlightTextColor( Color( COL_WHITE ) ); } else { diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index b91afbbae9fe..dbc792039f80 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -419,10 +419,6 @@ ImplStyleData::ImplStyleData() mnCursorBlinkTime = STYLE_CURSOR_NOBLINKTIME; mnScreenZoom = 100; mnScreenFontZoom = 100; - mnRadioButtonStyle = 0; - mnCheckBoxStyle = 0; - mnPushButtonStyle = 0; - mnTabControlStyle = 0; mnLogoDisplayTime = LOGO_DISPLAYTIME_STARTTIME; mnDragFullOptions = DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE | DRAGFULL_OPTION_OBJECTMOVE | DRAGFULL_OPTION_OBJECTSIZE | @@ -523,10 +519,6 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) : mnCursorBlinkTime = rData.mnCursorBlinkTime; mnScreenZoom = rData.mnScreenZoom; mnScreenFontZoom = rData.mnScreenFontZoom; - mnRadioButtonStyle = rData.mnRadioButtonStyle; - mnCheckBoxStyle = rData.mnCheckBoxStyle; - mnPushButtonStyle = rData.mnPushButtonStyle; - mnTabControlStyle = rData.mnTabControlStyle; mnLogoDisplayTime = rData.mnLogoDisplayTime; mnDragFullOptions = rData.mnDragFullOptions; mnAnimationOptions = rData.mnAnimationOptions; @@ -617,12 +609,6 @@ void ImplStyleData::SetStandardStyles() maHighlightLinkColor = Color( COL_LIGHTBLUE ); maFontColor = Color( COL_BLACK ); - mnRadioButtonStyle &= ~STYLE_RADIOBUTTON_STYLE; - mnCheckBoxStyle &= ~STYLE_CHECKBOX_STYLE; - mnPushButtonStyle &= ~STYLE_PUSHBUTTON_STYLE; - mnTabControlStyle = 0; - - mnOptions &= ~(STYLE_OPTION_SYSTEMSTYLE | STDSYS_STYLE); mnBorderSize = 1; mnTitleHeight = 18; mnFloatTitleHeight = 13; @@ -874,34 +860,6 @@ void StyleSettings::SetStandardStyles() // ----------------------------------------------------------------------- -void StyleSettings::SetStandardWinStyles() -{ - return; // no more style changes since NWF -} - -// ----------------------------------------------------------------------- - -void StyleSettings::SetStandardOS2Styles() -{ - return; // no more style changes since NWF -} - -// ----------------------------------------------------------------------- - -void StyleSettings::SetStandardMacStyles() -{ - return; // no more style changes since NWF -} - -// ----------------------------------------------------------------------- - -void StyleSettings::SetStandardUnixStyles() -{ - return; // no more style changes since NWF -} - -// ----------------------------------------------------------------------- - Color StyleSettings::GetFaceGradientColor() const { // compute a brighter face color that can be used in gradients @@ -1036,10 +994,6 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const (mpData->mnAntialiasedMin == rSet.mpData->mnAntialiasedMin) && (mpData->mnScreenZoom == rSet.mpData->mnScreenZoom) && (mpData->mnScreenFontZoom == rSet.mpData->mnScreenFontZoom) && - (mpData->mnRadioButtonStyle == rSet.mpData->mnRadioButtonStyle) && - (mpData->mnCheckBoxStyle == rSet.mpData->mnCheckBoxStyle) && - (mpData->mnPushButtonStyle == rSet.mpData->mnPushButtonStyle) && - (mpData->mnTabControlStyle == rSet.mpData->mnTabControlStyle) && (mpData->mnHighContrast == rSet.mpData->mnHighContrast) && (mpData->mnUseSystemUIFonts == rSet.mpData->mnUseSystemUIFonts) && (mpData->mnUseFlatBorders == rSet.mpData->mnUseFlatBorders) && diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index db7649a90258..82bec2214dff 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -769,47 +769,6 @@ BOOL Button::IsTextDisplayEnabled() } // ----------------------------------------------------------------------- -void Button::DataChanged( const DataChangedEvent& rDCEvt ) -{ - Control::DataChanged( rDCEvt ); - - // The flag SETTINGS_IN_UPDATE_SETTINGS is set when the settings changed due to a - // Application::SettingsChanged event. In this scenario we want to keep the style settings - // of our radio buttons and our check boxes. - if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && - ( rDCEvt.GetFlags() & SETTINGS_IN_UPDATE_SETTINGS ) ) - - { - const AllSettings* pOldSettings = rDCEvt.GetOldSettings(); - if ( pOldSettings ) - { - BOOL bResetStyleSettings = FALSE; - AllSettings aAllSettings = GetSettings(); - StyleSettings aStyleSetting = aAllSettings.GetStyleSettings(); - - USHORT nCheckBoxStyle = aStyleSetting.GetCheckBoxStyle(); - if ( nCheckBoxStyle != pOldSettings->GetStyleSettings().GetCheckBoxStyle() ) - { - aStyleSetting.SetCheckBoxStyle( pOldSettings->GetStyleSettings().GetCheckBoxStyle() ); - bResetStyleSettings = TRUE; - } - - USHORT nRadioButtonStyle = aStyleSetting.GetRadioButtonStyle(); - if ( nRadioButtonStyle != pOldSettings->GetStyleSettings().GetRadioButtonStyle() ) - { - aStyleSetting.SetRadioButtonStyle( pOldSettings->GetStyleSettings().GetRadioButtonStyle() ); - bResetStyleSettings = TRUE; - } - - if ( bResetStyleSettings ) - { - aAllSettings.SetStyleSettings( pOldSettings->GetStyleSettings() ); - SetSettings( aAllSettings ); - } - } - } -} - void Button::SetSmallSymbol (bool small) { ImplSetSmallSymbol (small); @@ -925,125 +884,6 @@ void PushButton::ImplDrawPushButtonFrame( Window* pDev, StyleSettings aStyleSettings = pDev->GetSettings().GetStyleSettings(); if ( pDev->IsControlBackground() ) aStyleSettings.Set3DColors( pDev->GetControlBackground() ); - - USHORT nPushButtonSysStyle = aStyleSettings.GetPushButtonStyle() & STYLE_PUSHBUTTON_STYLE; - if ( nPushButtonSysStyle == STYLE_PUSHBUTTON_MAC ) - { - pDev->SetLineColor(); - pDev->SetFillColor( aStyleSettings.GetFaceColor() ); - pDev->DrawRect( rRect ); - - if ( (aStyleSettings.GetOptions() & STYLE_OPTION_MONO) || - (pDev->GetOutDevType() == OUTDEV_PRINTER) ) - nStyle |= BUTTON_DRAW_MONO; - - if ( nStyle & BUTTON_DRAW_DEFAULT ) - { - if ( nStyle & BUTTON_DRAW_MONO ) - pDev->SetLineColor( Color( COL_BLACK ) ); - else - pDev->SetLineColor( aStyleSettings.GetDarkShadowColor() ); - - pDev->DrawLine( Point( rRect.Left()+3, rRect.Top() ), - Point( rRect.Right()-3, rRect.Top() ) ); - pDev->DrawLine( Point( rRect.Left()+3, rRect.Bottom() ), - Point( rRect.Right()-3, rRect.Bottom() ) ); - pDev->DrawLine( Point( rRect.Left(), rRect.Top()+3 ), - Point( rRect.Left(), rRect.Bottom()-3 ) ); - pDev->DrawLine( Point( rRect.Right(), rRect.Top()+3 ), - Point( rRect.Right(), rRect.Bottom()-3 ) ); - pDev->DrawPixel( Point( rRect.Left()+2, rRect.Top()+1 ) ); - pDev->DrawPixel( Point( rRect.Left()+1, rRect.Top()+2 ) ); - pDev->DrawPixel( Point( rRect.Right()-2, rRect.Top()+1 ) ); - pDev->DrawPixel( Point( rRect.Right()-1, rRect.Top()+2 ) ); - pDev->DrawPixel( Point( rRect.Left()+2, rRect.Bottom()-1 ) ); - pDev->DrawPixel( Point( rRect.Left()+1, rRect.Bottom()-2 ) ); - pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-1 ) ); - pDev->DrawPixel( Point( rRect.Right()-1, rRect.Bottom()-2 ) ); - - if ( nStyle & BUTTON_DRAW_MONO ) - pDev->SetLineColor( Color( COL_BLACK ) ); - else - pDev->SetLineColor( aStyleSettings.GetShadowColor() ); - pDev->DrawLine( Point( rRect.Left()+3, rRect.Bottom()-1 ), - Point( rRect.Right()-3, rRect.Bottom()-1 ) ); - pDev->DrawLine( Point( rRect.Right()-1, rRect.Top()+3 ), - Point( rRect.Right()-1, rRect.Bottom()-3 ) ); - pDev->DrawPixel( Point( rRect.Right()-3, rRect.Bottom()-2 ) ); - pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-2 ) ); - pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-3 ) ); - } - - rRect.Left() += 2; - rRect.Top() += 2; - rRect.Right() -= 2; - rRect.Bottom() -= 2; - - if ( nStyle & BUTTON_DRAW_MONO ) - pDev->SetLineColor( Color( COL_BLACK ) ); - else - pDev->SetLineColor( aStyleSettings.GetDarkShadowColor() ); - - pDev->DrawLine( Point( rRect.Left()+2, rRect.Top() ), - Point( rRect.Right()-2, rRect.Top() ) ); - pDev->DrawLine( Point( rRect.Left()+2, rRect.Bottom() ), - Point( rRect.Right()-2, rRect.Bottom() ) ); - pDev->DrawLine( Point( rRect.Left(), rRect.Top()+2 ), - Point( rRect.Left(), rRect.Bottom()-2 ) ); - pDev->DrawLine( Point( rRect.Right(), rRect.Top()+2 ), - Point( rRect.Right(), rRect.Bottom()-2 ) ); - pDev->DrawPixel( Point( rRect.Left()+1, rRect.Top()+1 ) ); - pDev->DrawPixel( Point( rRect.Right()-1, rRect.Top()+1 ) ); - pDev->DrawPixel( Point( rRect.Left()+1, rRect.Bottom()-1 ) ); - pDev->DrawPixel( Point( rRect.Right()-1, rRect.Bottom()-1 ) ); - - pDev->SetLineColor(); - if ( nStyle & BUTTON_DRAW_CHECKED ) - pDev->SetFillColor( aStyleSettings.GetCheckedColor() ); - else - pDev->SetFillColor( aStyleSettings.GetFaceColor() ); - pDev->DrawRect( Rectangle( rRect.Left()+2, rRect.Top()+2, rRect.Right()-2, rRect.Bottom()-2 ) ); - - if ( !(nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED)) ) - { - if ( nStyle & BUTTON_DRAW_MONO ) - pDev->SetLineColor( Color( COL_BLACK ) ); - else - pDev->SetLineColor( aStyleSettings.GetShadowColor() ); - pDev->DrawLine( Point( rRect.Left()+2, rRect.Bottom()-1 ), - Point( rRect.Right()-2, rRect.Bottom()-1 ) ); - pDev->DrawLine( Point( rRect.Right()-1, rRect.Top()+2 ), - Point( rRect.Right()-1, rRect.Bottom()-2 ) ); - pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-2 ) ); - pDev->SetLineColor( aStyleSettings.GetLightColor() ); - } - else - pDev->SetLineColor( aStyleSettings.GetShadowColor() ); - - if ( !(nStyle & BUTTON_DRAW_MONO) ) - { - pDev->DrawLine( Point( rRect.Left()+2, rRect.Top()+1 ), - Point( rRect.Right()-2, rRect.Top()+1 ) ); - pDev->DrawLine( Point( rRect.Left()+1, rRect.Top()+2 ), - Point( rRect.Left()+1, rRect.Bottom()-2 ) ); - pDev->DrawPixel( Point( rRect.Top()+2, rRect.Right()+2 ) ); - } - - rRect.Left() += 2; - rRect.Top() += 2; - rRect.Right() -= 2; - rRect.Bottom() -= 2; - - if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) ) - { - rRect.Left()++; - rRect.Top()++; - rRect.Right()++; - rRect.Bottom()++; - } - - return; - } } DecorationView aDecoView( pDev ); @@ -1070,20 +910,6 @@ BOOL PushButton::ImplHitTestPushButton( Window* pDev, Point aTempPoint; Rectangle aTestRect( aTempPoint, pDev->GetOutputSizePixel() ); - if ( !(pDev->GetStyle() & (WB_RECTSTYLE | WB_SMALLSTYLE)) ) - { - const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings(); - - USHORT nPushButtonSysStyle = rStyleSettings.GetPushButtonStyle() & STYLE_PUSHBUTTON_STYLE; - if ( nPushButtonSysStyle == STYLE_PUSHBUTTON_MAC ) - { - aTestRect.Left() += 2; - aTestRect.Top() += 2; - aTestRect.Right() -= 2; - aTestRect.Bottom() -= 2; - } - } - return aTestRect.IsInside( rPos ); } @@ -3274,7 +3100,7 @@ Image RadioButton::GetRadioImage( const AllSettings& rSettings, USHORT nFlags ) { ImplSVData* pSVData = ImplGetSVData(); const StyleSettings& rStyleSettings = rSettings.GetStyleSettings(); - USHORT nStyle = rStyleSettings.GetRadioButtonStyle() & STYLE_RADIOBUTTON_STYLE; + USHORT nStyle = 0; if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO ) nStyle = STYLE_RADIOBUTTON_MONO; @@ -4192,7 +4018,7 @@ Image CheckBox::GetCheckImage( const AllSettings& rSettings, USHORT nFlags ) { ImplSVData* pSVData = ImplGetSVData(); const StyleSettings& rStyleSettings = rSettings.GetStyleSettings(); - USHORT nStyle = rStyleSettings.GetCheckBoxStyle() & STYLE_CHECKBOX_STYLE; + USHORT nStyle = 0; if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO ) nStyle = STYLE_CHECKBOX_MONO; diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx index 1c83779da1a9..c264d01916fc 100644 --- a/vcl/source/control/menubtn.cxx +++ b/vcl/source/control/menubtn.cxx @@ -78,15 +78,6 @@ void MenuButton::ImplExecuteMenu() Point aPos( 0, 1 ); Size aSize = GetSizePixel(); Rectangle aRect( aPos, aSize ); - const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - if ( !((GetStyle() & (WB_RECTSTYLE | WB_SMALLSTYLE)) || - !(rStyleSettings.GetOptions() & STYLE_OPTION_MACSTYLE)) ) - { - aRect.Left() += 2; - aRect.Top() += 2; - aRect.Right() -= 2; - aRect.Bottom() -= 2; - } SetPressed( TRUE ); EndSelection(); mnCurItemId = mpMenu->Execute( this, aRect, POPUPMENU_EXECUTE_DOWN ); diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 9c82bb096dec..4261965995fa 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -770,64 +770,7 @@ void ScrollBar::ImplDraw( USHORT nDrawFlags, OutputDevice* pOutDev ) if ( bEnabled ) { nStyle = BUTTON_DRAW_NOLIGHTBORDER; - // pressed thumbs only in OS2 style - if ( rStyleSettings.GetOptions() & STYLE_OPTION_OS2STYLE ) - if ( mnStateFlags & SCRBAR_STATE_THUMB_DOWN ) - nStyle |= BUTTON_DRAW_PRESSED; aTempRect = aDecoView.DrawButton( maThumbRect, nStyle ); - // OS2 style requires pattern on the thumb - if ( rStyleSettings.GetOptions() & STYLE_OPTION_OS2STYLE ) - { - if ( GetStyle() & WB_HORZ ) - { - if ( aTempRect.GetWidth() > 6 ) - { - long nX = aTempRect.Center().X(); - nX -= 6; - if ( nX < aTempRect.Left() ) - nX = aTempRect.Left(); - for ( int i = 0; i < 6; i++ ) - { - if ( nX > aTempRect.Right()-1 ) - break; - - pOutDev->SetLineColor( rStyleSettings.GetButtonTextColor() ); - pOutDev->DrawLine( Point( nX, aTempRect.Top()+1 ), - Point( nX, aTempRect.Bottom()-1 ) ); - nX++; - pOutDev->SetLineColor( rStyleSettings.GetLightColor() ); - pOutDev->DrawLine( Point( nX, aTempRect.Top()+1 ), - Point( nX, aTempRect.Bottom()-1 ) ); - nX++; - } - } - } - else - { - if ( aTempRect.GetHeight() > 6 ) - { - long nY = aTempRect.Center().Y(); - nY -= 6; - if ( nY < aTempRect.Top() ) - nY = aTempRect.Top(); - for ( int i = 0; i < 6; i++ ) - { - if ( nY > aTempRect.Bottom()-1 ) - break; - - pOutDev->SetLineColor( rStyleSettings.GetButtonTextColor() ); - pOutDev->DrawLine( Point( aTempRect.Left()+1, nY ), - Point( aTempRect.Right()-1, nY ) ); - nY++; - pOutDev->SetLineColor( rStyleSettings.GetLightColor() ); - pOutDev->DrawLine( Point( aTempRect.Left()+1, nY ), - Point( aTempRect.Right()-1, nY ) ); - nY++; - } - } - } - pOutDev->SetLineColor(); - } } else { diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index daf733a57a33..26a4c1cfd205 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -713,13 +713,6 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt ) mnMouseOff = rMousePos.X()-aCenterPos.X(); else mnMouseOff = rMousePos.Y()-aCenterPos.Y(); - - // Im OS2-Look geben wir den Thumb gedrueckt aus - if ( GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_OS2STYLE ) - { - mnStateFlags |= SLIDER_STATE_THUMB_DOWN; - ImplDraw( SLIDER_DRAW_THUMB ); - } } else if ( ImplIsPageUp( rMousePos ) ) { diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index e9696aa8c492..2c81b6af241b 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -75,8 +75,6 @@ struct ImplTabItem struct ImplTabCtrlData { - PushButton* mpLeftBtn; - PushButton* mpRightBtn; std::hash_map< int, int > maLayoutPageIdToLine; std::hash_map< int, int > maLayoutLineToPageId; std::vector< Rectangle > maTabRectangles; @@ -88,27 +86,6 @@ struct ImplTabCtrlData // ----------------------------------------------------------------------- -#if 0 -// not used -#define TABCOLORCOUNT 10 - -static ColorData aImplTabColorAry[TABCOLORCOUNT] = -{ - RGB_COLORDATA( 80, 216, 248 ), - RGB_COLORDATA( 128, 216, 168 ), - RGB_COLORDATA( 128, 144, 248 ), - RGB_COLORDATA( 208, 180, 168 ), - RGB_COLORDATA( 248, 252, 168 ), - RGB_COLORDATA( 168, 144, 168 ), - RGB_COLORDATA( 248, 144, 80 ), - RGB_COLORDATA( 248, 216, 80 ), - RGB_COLORDATA( 248, 180, 168 ), - RGB_COLORDATA( 248, 216, 168 ) -}; -#endif - -// ----------------------------------------------------------------------- - #define TAB_OFFSET 3 #define TAB_TABOFFSET_X 3 #define TAB_TABOFFSET_Y 3 @@ -132,9 +109,6 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle ) if ( !(nStyle & WB_NODIALOGCONTROL) ) nStyle |= WB_DIALOGCONTROL; - // no single line tabs since NWF - nStyle &= ~WB_SINGLELINE; - Control::ImplInit( pParent, nStyle, NULL ); mnLastWidth = 0; @@ -143,18 +117,12 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle ) mnMaxPageWidth = 0; mnActPageId = 0; mnCurPageId = 0; - mnFirstPagePos = 0; - mnLastFirstPagePos = 0; mbFormat = TRUE; mbRestoreHelpId = FALSE; mbRestoreUnqId = FALSE; - mbSingleLine = FALSE; - mbScroll = FALSE; mbSmallInvalidate = FALSE; mbExtraSpace = FALSE; mpTabCtrlData = new ImplTabCtrlData; - mpTabCtrlData->mpLeftBtn = NULL; - mpTabCtrlData->mpRightBtn = NULL; mpTabCtrlData->mpListBox = NULL; @@ -226,8 +194,6 @@ void TabControl::ImplInitSettings( BOOL bFont, SetBackground( pParent->GetBackground() ); } } - - ImplScrollBtnsColor(); } // ----------------------------------------------------------------------- @@ -299,10 +265,6 @@ TabControl::~TabControl() { if( mpTabCtrlData->mpListBox ) delete mpTabCtrlData->mpListBox; - if ( mpTabCtrlData->mpLeftBtn ) - delete mpTabCtrlData->mpLeftBtn; - if ( mpTabCtrlData->mpRightBtn ) - delete mpTabCtrlData->mpRightBtn; delete mpTabCtrlData; } } @@ -323,74 +285,6 @@ ImplTabItem* TabControl::ImplGetItem( USHORT nId ) const // ----------------------------------------------------------------------- -void TabControl::ImplScrollBtnsColor() -{ - if ( mpTabCtrlData && mpTabCtrlData->mpLeftBtn ) - { - mpTabCtrlData->mpLeftBtn->SetControlForeground(); - mpTabCtrlData->mpRightBtn->SetControlForeground(); - } -} - -// ----------------------------------------------------------------------- - -void TabControl::ImplSetScrollBtnsState() -{ - if ( mbScroll ) - { - mpTabCtrlData->mpLeftBtn->Enable( mnFirstPagePos != 0 ); - mpTabCtrlData->mpRightBtn->Enable( mnFirstPagePos < mnLastFirstPagePos ); - } -} - -// ----------------------------------------------------------------------- - -void TabControl::ImplPosScrollBtns() -{ - if ( mbScroll ) - { - if ( !mpTabCtrlData->mpLeftBtn ) - { - mpTabCtrlData->mpLeftBtn = new PushButton( this, WB_RECTSTYLE | WB_SMALLSTYLE | WB_NOPOINTERFOCUS | WB_REPEAT ); - mpTabCtrlData->mpLeftBtn->SetSymbol( SYMBOL_PREV ); - mpTabCtrlData->mpLeftBtn->SetClickHdl( LINK( this, TabControl, ImplScrollBtnHdl ) ); - } - if ( !mpTabCtrlData->mpRightBtn ) - { - mpTabCtrlData->mpRightBtn = new PushButton( this, WB_RECTSTYLE | WB_SMALLSTYLE | WB_NOPOINTERFOCUS | WB_REPEAT ); - mpTabCtrlData->mpRightBtn->SetSymbol( SYMBOL_NEXT ); - mpTabCtrlData->mpRightBtn->SetClickHdl( LINK( this, TabControl, ImplScrollBtnHdl ) ); - } - - Rectangle aRect = ImplGetTabRect( TAB_PAGERECT ); - aRect.Left() -= TAB_OFFSET; - aRect.Top() -= TAB_OFFSET; - aRect.Right() += TAB_OFFSET; - aRect.Bottom() += TAB_OFFSET; - long nX = aRect.Right()-mnBtnSize+1; - long nY = aRect.Top()-mnBtnSize; - mpTabCtrlData->mpRightBtn->SetPosSizePixel( nX, nY, mnBtnSize, mnBtnSize ); - nX -= mnBtnSize; - mpTabCtrlData->mpLeftBtn->SetPosSizePixel( nX, nY, mnBtnSize, mnBtnSize ); - ImplScrollBtnsColor(); - ImplSetScrollBtnsState(); - mpTabCtrlData->mpLeftBtn->Show(); - mpTabCtrlData->mpRightBtn->Show(); - } - else - { - if ( mpTabCtrlData ) - { - if ( mpTabCtrlData->mpLeftBtn ) - mpTabCtrlData->mpLeftBtn->Hide(); - if ( mpTabCtrlData->mpRightBtn ) - mpTabCtrlData->mpRightBtn->Hide(); - } - } -} - -// ----------------------------------------------------------------------- - Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) { pItem->maFormatText = pItem->maText; @@ -524,8 +418,6 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight nMaxWidth = mnMaxPageWidth; nMaxWidth -= GetItemsOffset().X(); - mbScroll = FALSE; - USHORT nLines = 0; USHORT nCurLine = 0; long nLineWidthAry[100]; @@ -650,8 +542,6 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight mnLastWidth = nWidth; mnLastHeight = nHeight; mbFormat = FALSE; - - ImplPosScrollBtns(); } return size_t(nItemPos) < mpTabCtrlData->maItemList.size() ? mpTabCtrlData->maItemList[nItemPos].maRect : Rectangle(); @@ -795,13 +685,6 @@ void TabControl::ImplActivateTabPage( BOOL bNext ) // ----------------------------------------------------------------------- -void TabControl::ImplSetFirstPagePos( USHORT ) -{ - return; // was only required for single line -} - -// ----------------------------------------------------------------------- - void TabControl::ImplShowFocus() { if ( !GetPageCount() || mpTabCtrlData->mpListBox ) @@ -1099,14 +982,6 @@ long TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent ) } -// ----------------------------------------------------------------------- - -IMPL_LINK( TabControl, ImplScrollBtnHdl, PushButton*, EMPTYARG ) -{ - ImplSetScrollBtnsState(); - return 0; -} - // ----------------------------------------------------------------------- IMPL_LINK( TabControl, ImplListBoxSelectHdl, ListBox*, EMPTYARG ) @@ -1387,19 +1262,14 @@ void TabControl::Resize() // Feststellen, was invalidiert werden muss Size aNewSize = Control::GetOutputSizePixel(); long nNewWidth = aNewSize.Width(); - if ( mbScroll ) - mbSmallInvalidate = FALSE; - else + for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin(); + it != mpTabCtrlData->maItemList.end(); ++it ) { - for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin(); - it != mpTabCtrlData->maItemList.end(); ++it ) + if ( !it->mbFullVisible || + (it->maRect.Right()-2 >= nNewWidth) ) { - if ( !it->mbFullVisible || - (it->maRect.Right()-2 >= nNewWidth) ) - { - mbSmallInvalidate = FALSE; - break; - } + mbSmallInvalidate = FALSE; + break; } } @@ -2013,13 +1883,6 @@ USHORT TabControl::GetCurPageId() const // ----------------------------------------------------------------------- -void TabControl::SetFirstPageId( USHORT ) -{ - return; // was only required for single line -} - -// ----------------------------------------------------------------------- - void TabControl::SelectTabPage( USHORT nPageId ) { if ( nPageId && (nPageId != mnCurPageId) ) diff --git a/vcl/source/src/images.src b/vcl/source/src/images.src index fdb1e755c86a..000d7215d80d 100644 --- a/vcl/source/src/images.src +++ b/vcl/source/src/images.src @@ -38,25 +38,6 @@ Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_STDOFFSET) File = "check.bmp"; }; -Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_WINOFFSET) -{ - File = "checkwin.bmp"; -}; - -Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_OS2OFFSET) -{ - File = "checkos2.bmp"; -}; - -Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_MACOFFSET) -{ - File = "checkmac.bmp"; -}; - -Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_UNIXOFFSET) -{ - File = "checkunx.bmp"; -}; Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_MONOOFFSET) { @@ -80,26 +61,6 @@ Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_STDOFFSET) File = "radio.bmp"; }; -Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_WINOFFSET) -{ - File = "radiowin.bmp"; -}; - -Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_OS2OFFSET) -{ - File = "radioos2.bmp"; -}; - -Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MACOFFSET) -{ - File = "radiomac.bmp"; -}; - -Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_UNIXOFFSET) -{ - File = "radiounx.bmp"; -}; - Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MONOOFFSET) { File = "radiomono.bmp"; diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index e5c3dc525cec..d51988d4d5d3 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -44,71 +44,6 @@ // ======================================================================= -void ImplDrawOS2Symbol( OutputDevice* pDev, const Rectangle& rRect, - USHORT nStyle, BOOL bClose ) -{ - DecorationView aView( pDev ); - const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings(); - Rectangle aRect = rRect; - Color aColor1; - Color aColor2; - - pDev->SetFillColor(); - - if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) ) - { - aColor1 = rStyleSettings.GetShadowColor(); - aColor2 = rStyleSettings.GetLightColor(); - } - else - { - aColor1 = rStyleSettings.GetLightColor(); - aColor2 = rStyleSettings.GetShadowColor(); - } - aView.DrawFrame( aRect, aColor1, aColor2 ); - - aRect.Left() += 2; - aRect.Top() += 2; - aRect.Right() -= 2; - aRect.Bottom() -= 2; - - if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) ) - pDev->SetLineColor( rStyleSettings.GetLightColor() ); - else - pDev->SetLineColor( rStyleSettings.GetShadowColor() ); - if ( bClose ) - { - pDev->DrawLine( aRect.TopLeft(), Point( aRect.Left(), aRect.Bottom()-2 ) ); - pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right()-2, aRect.Top() ) ); - pDev->DrawLine( Point( aRect.Left()+2, aRect.Bottom()-1 ), - Point( aRect.Right()-1, aRect.Top()+2 ) ); - } - else - { - pDev->DrawLine( aRect.TopLeft(), aRect.BottomLeft() ); - pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right()-1, aRect.Top() ) ); - } - - if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) ) - pDev->SetLineColor( rStyleSettings.GetShadowColor() ); - else - pDev->SetLineColor( rStyleSettings.GetLightColor() ); - if ( bClose ) - { - pDev->DrawLine( Point( aRect.Right(), aRect.Top()+2 ), aRect.BottomRight() ); - pDev->DrawLine( Point( aRect.Left()+2, aRect.Bottom() ), aRect.BottomRight() ); - pDev->DrawLine( Point( aRect.Right()-2, aRect.Top()+1 ), - Point( aRect.Left()+1, aRect.Bottom()-2 ) ); - } - else - { - pDev->DrawLine( aRect.TopRight(), aRect.BottomRight() ); - pDev->DrawLine( Point( aRect.Left()+1, aRect.Bottom() ), aRect.BottomRight() ); - } -} - -// ======================================================================= - static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect, SymbolType eType ) { @@ -630,41 +565,6 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect, pDev->DrawRect( aRect ); } break; - - case SYMBOL_OS2CLOSE: - { - Rectangle aRect( nCenterX-n2, nCenterY-n2, - nCenterX+n2, nCenterY+n2 ); - ImplDrawOS2Symbol( pDev, aRect, 0, TRUE ); - } - break; - - case SYMBOL_OS2FLOAT: - { - Rectangle aRect( nCenterX-n2+4, nCenterY-n2+4, - nCenterX+n2-4, nCenterY+n2-3 ); - ImplDrawOS2Symbol( pDev, aRect, 0, FALSE ); - DecorationView aDecoView( pDev ); - Rectangle aRect2( nCenterX-n2, nCenterY-n2, - nCenterX-n2+2, nCenterY+n2 ); - aDecoView.DrawFrame( aRect2, - pDev->GetSettings().GetStyleSettings().GetLightColor(), - pDev->GetSettings().GetStyleSettings().GetShadowColor() ); - Rectangle aRect3( nCenterX+n2-2, nCenterY-n2, - nCenterX+n2, nCenterY+n2 ); - aDecoView.DrawFrame( aRect3, - pDev->GetSettings().GetStyleSettings().GetLightColor(), - pDev->GetSettings().GetStyleSettings().GetShadowColor() ); - } - break; - - case SYMBOL_OS2HIDE: - { - Rectangle aRect( nCenterX-n2+3, nCenterY-n2+3, - nCenterX+n2-3, nCenterY+n2-3 ); - ImplDrawOS2Symbol( pDev, aRect, 0, FALSE ); - } - break; } } diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index df077cc4c4e5..89a191c99ef6 100755 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -2890,30 +2890,26 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) } StyleSettings aStyleSettings = rSettings.GetStyleSettings(); - BOOL bCompBorder = (aStyleSettings.GetOptions() & (STYLE_OPTION_MACSTYLE | STYLE_OPTION_UNIXSTYLE)) == 0; // TODO: once those options vanish: just set bCompBorder to TRUE // to have the system colors read aStyleSettings.SetScrollBarSize( GetSystemMetrics( SM_CXVSCROLL ) ); aStyleSettings.SetSpinSize( GetSystemMetrics( SM_CXVSCROLL ) ); aStyleSettings.SetCursorBlinkTime( GetCaretBlinkTime() ); - if ( bCompBorder ) - { - aStyleSettings.SetFloatTitleHeight( GetSystemMetrics( SM_CYSMCAPTION ) ); - aStyleSettings.SetTitleHeight( GetSystemMetrics( SM_CYCAPTION ) ); - aStyleSettings.SetActiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) ); - aStyleSettings.SetDeactiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVEBORDER ) ) ); - if ( aSalShlData.mnVersion >= 410 ) - { - aStyleSettings.SetActiveColor2( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTACTIVECAPTION ) ) ); - aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) ) ); - } - aStyleSettings.SetFaceColor( ImplWinColorToSal( GetSysColor( COLOR_3DFACE ) ) ); - aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() ); - aStyleSettings.SetLightColor( ImplWinColorToSal( GetSysColor( COLOR_3DHILIGHT ) ) ); - aStyleSettings.SetLightBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DLIGHT ) ) ); - aStyleSettings.SetShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) ); - aStyleSettings.SetDarkShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DDKSHADOW ) ) ); - } + aStyleSettings.SetFloatTitleHeight( GetSystemMetrics( SM_CYSMCAPTION ) ); + aStyleSettings.SetTitleHeight( GetSystemMetrics( SM_CYCAPTION ) ); + aStyleSettings.SetActiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) ); + aStyleSettings.SetDeactiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVEBORDER ) ) ); + if ( aSalShlData.mnVersion >= 410 ) + { + aStyleSettings.SetActiveColor2( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTACTIVECAPTION ) ) ); + aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) ) ); + } + aStyleSettings.SetFaceColor( ImplWinColorToSal( GetSysColor( COLOR_3DFACE ) ) ); + aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() ); + aStyleSettings.SetLightColor( ImplWinColorToSal( GetSysColor( COLOR_3DHILIGHT ) ) ); + aStyleSettings.SetLightBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DLIGHT ) ) ); + aStyleSettings.SetShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) ); + aStyleSettings.SetDarkShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DDKSHADOW ) ) ); aStyleSettings.SetWorkspaceColor( ImplWinColorToSal( GetSysColor( COLOR_APPWORKSPACE ) ) ); aStyleSettings.SetHelpColor( ImplWinColorToSal( GetSysColor( COLOR_INFOBK ) ) ); aStyleSettings.SetHelpTextColor( ImplWinColorToSal( GetSysColor( COLOR_INFOTEXT ) ) ); @@ -2935,54 +2931,52 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) aStyleSettings.SetHighlightTextColor( ImplWinColorToSal( GetSysColor( COLOR_HIGHLIGHTTEXT ) ) ); aStyleSettings.SetMenuHighlightColor( aStyleSettings.GetHighlightColor() ); aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetHighlightTextColor() ); + ImplSVData* pSVData = ImplGetSVData(); pSVData->maNWFData.mnMenuFormatExtraBorder = 0; pSVData->maNWFData.maMenuBarHighlightTextColor = Color( COL_TRANSPARENT ); GetSalData()->mbThemeMenuSupport = FALSE; - if ( bCompBorder ) - { - aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) ); - aStyleSettings.SetMenuBarColor( aStyleSettings.GetMenuColor() ); - aStyleSettings.SetMenuBorderColor( aStyleSettings.GetLightBorderColor() ); // overriden below for flat menus - aStyleSettings.SetUseFlatBorders( FALSE ); - aStyleSettings.SetUseFlatMenues( FALSE ); - aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) ); - aStyleSettings.SetMenuBarTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) ); - aStyleSettings.SetActiveColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVECAPTION ) ) ); - aStyleSettings.SetActiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_CAPTIONTEXT ) ) ); - aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTION ) ) ); - aStyleSettings.SetDeactiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTIONTEXT ) ) ); - if ( aSalShlData.mbWXP ) + aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) ); + aStyleSettings.SetMenuBarColor( aStyleSettings.GetMenuColor() ); + aStyleSettings.SetMenuBorderColor( aStyleSettings.GetLightBorderColor() ); // overriden below for flat menus + aStyleSettings.SetUseFlatBorders( FALSE ); + aStyleSettings.SetUseFlatMenues( FALSE ); + aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) ); + aStyleSettings.SetMenuBarTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) ); + aStyleSettings.SetActiveColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVECAPTION ) ) ); + aStyleSettings.SetActiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_CAPTIONTEXT ) ) ); + aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTION ) ) ); + aStyleSettings.SetDeactiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTIONTEXT ) ) ); + if ( aSalShlData.mbWXP ) + { + // only xp supports a different menu bar color + long bFlatMenues = 0; + SystemParametersInfo( SPI_GETFLATMENU, 0, &bFlatMenues, 0); + if( bFlatMenues ) { - // only xp supports a different menu bar color - long bFlatMenues = 0; - SystemParametersInfo( SPI_GETFLATMENU, 0, &bFlatMenues, 0); - if( bFlatMenues ) - { - aStyleSettings.SetUseFlatMenues( TRUE ); - aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( COLOR_MENUBAR ) ) ); - aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( COLOR_MENUHILIGHT ) ) ); - aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) ); - - // flat borders for our controls etc. as well in this mode (ie, no 3d borders) - // this is not active in the classic style appearance - aStyleSettings.SetUseFlatBorders( TRUE ); - } - } - // check if vista or newer runs - // in Aero theme (and similar ?) the menu text color does not change - // for selected items; also on WinXP and earlier menus are not themed - if( aSalShlData.maVersionInfo.dwMajorVersion >= 6 && - ImplDwmIsCompositionEnabled() - ) - { - // in aero menuitem highlight text is drawn in the same color as normal - aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetMenuTextColor() ); - pSVData->maNWFData.mnMenuFormatExtraBorder = 2; - pSVData->maNWFData.maMenuBarHighlightTextColor = aStyleSettings.GetMenuTextColor(); - GetSalData()->mbThemeMenuSupport = TRUE; + aStyleSettings.SetUseFlatMenues( TRUE ); + aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( COLOR_MENUBAR ) ) ); + aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( COLOR_MENUHILIGHT ) ) ); + aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) ); + + // flat borders for our controls etc. as well in this mode (ie, no 3d borders) + // this is not active in the classic style appearance + aStyleSettings.SetUseFlatBorders( TRUE ); } } + // check if vista or newer runs + // in Aero theme (and similar ?) the menu text color does not change + // for selected items; also on WinXP and earlier menus are not themed + if( aSalShlData.maVersionInfo.dwMajorVersion >= 6 && + ImplDwmIsCompositionEnabled() + ) + { + // in aero menuitem highlight text is drawn in the same color as normal + aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetMenuTextColor() ); + pSVData->maNWFData.mnMenuFormatExtraBorder = 2; + pSVData->maNWFData.maMenuBarHighlightTextColor = aStyleSettings.GetMenuTextColor(); + GetSalData()->mbThemeMenuSupport = TRUE; + } // Bei hellgrau geben wir die Farbe vor, damit es besser aussieht if ( aStyleSettings.GetFaceColor() == COL_LIGHTGRAY ) aStyleSettings.SetCheckedColor( Color( 0xCC, 0xCC, 0xCC ) ); -- cgit From 2b1b6ec0a537571bd7367446e5592d8954c10bbe Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 24 Nov 2010 18:39:49 +0100 Subject: vcl117: #i115686# remove old unused style setting --- desktop/source/app/app.cxx | 11 ----- .../schema/org/openoffice/Office/Common.xcs | 55 ---------------------- svx/source/fmcomp/gridcell.cxx | 11 +++-- 3 files changed, 7 insertions(+), 70 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index afc957275c35..3a59a165a60f 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2196,17 +2196,6 @@ void Desktop::SystemSettingsChanging( AllSettings& rSettings, Window* ) } hStyleSettings.SetUseImagesInMenus(bUseImagesInMenus); - sal_uInt16 nTabStyle = hStyleSettings.GetTabControlStyle(); - nTabStyle &= ~STYLE_TABCONTROL_SINGLELINE; - if( aAppearanceCfg.IsSingleLineTabCtrl() ) - nTabStyle |=STYLE_TABCONTROL_SINGLELINE; - - nTabStyle &= ~STYLE_TABCONTROL_COLOR; - if( aAppearanceCfg.IsColoredTabCtrl() ) - nTabStyle |= STYLE_TABCONTROL_COLOR; - - hStyleSettings.SetTabControlStyle(nTabStyle); - hStyleSettings.SetDragFullOptions( nDragFullOptions ); rSettings.SetStyleSettings ( hStyleSettings ); } diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 9bc07c592f0f..ae171230dd13 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -2600,39 +2600,6 @@ 100 - - - - - - PB - Determines the look and feel of the application. - - - - - - Standard - - - - - Macintosh - - - - - X Window - - - - - OS/2 - - - - 0 - CD @@ -2714,17 +2681,6 @@ true - - - - - - PB - Specifies TabDialogs with colored tab control (True) - - - false - @@ -2780,17 +2736,6 @@ 1 - - - - - - PB - Specifies TabDialogs with single line tab control (True). - - - false - diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index bb8afd502d43..33df3183065b 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1653,11 +1653,14 @@ DbCheckBox::DbCheckBox( DbGridColumn& _rColumn ) namespace { - void setCheckBoxStyle( Window* _pWindow, USHORT nStyle ) + void setCheckBoxStyle( Window* _pWindow, bool bMono ) { AllSettings aSettings = _pWindow->GetSettings(); StyleSettings aStyleSettings = aSettings.GetStyleSettings(); - aStyleSettings.SetCheckBoxStyle( nStyle ); + if( bMono ) + aStyleSettings.SetOptions( aStyleSettings.GetOptions() | STYLE_OPTION_MONO ); + else + aStyleSettings.SetOptions( aStyleSettings.GetOptions() & (~STYLE_OPTION_MONO) ); aSettings.SetStyleSettings( aStyleSettings ); _pWindow->SetSettings( aSettings ); } @@ -1683,8 +1686,8 @@ void DbCheckBox::Init( Window& rParent, const Reference< XRowSet >& xCursor ) sal_Int16 nStyle = awt::VisualEffect::LOOK3D; OSL_VERIFY( xModel->getPropertyValue( FM_PROP_VISUALEFFECT ) >>= nStyle ); - setCheckBoxStyle( m_pWindow, nStyle == awt::VisualEffect::FLAT ? STYLE_CHECKBOX_MONO : STYLE_CHECKBOX_WIN ); - setCheckBoxStyle( m_pPainter, nStyle == awt::VisualEffect::FLAT ? STYLE_CHECKBOX_MONO : STYLE_CHECKBOX_WIN ); + setCheckBoxStyle( m_pWindow, nStyle == awt::VisualEffect::FLAT ); + setCheckBoxStyle( m_pPainter, nStyle == awt::VisualEffect::FLAT ); sal_Bool bTristate = sal_True; OSL_VERIFY( xModel->getPropertyValue( FM_PROP_TRISTATE ) >>= bTristate ); -- cgit From 3d92e6c85264373fbbfc850d54de79c1363b87ca Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 24 Nov 2010 18:39:49 +0100 Subject: vcl117: #i115686# remove old unused style setting --- dbaccess/source/ui/dlg/UserAdminDlg.src | 1 - dbaccess/source/ui/dlg/advancedsettings.src | 1 - dbaccess/source/ui/dlg/dbadmin.src | 2 -- dbaccess/source/ui/dlg/dbadminsetup.src | 1 - 4 files changed, 5 deletions(-) diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.src b/dbaccess/source/ui/dlg/UserAdminDlg.src index faa7f33302d7..d3a59a511deb 100644 --- a/dbaccess/source/ui/dlg/UserAdminDlg.src +++ b/dbaccess/source/ui/dlg/UserAdminDlg.src @@ -49,7 +49,6 @@ TabDialog DLG_DATABASE_USERADMIN { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; String STR_PAGETITLE_USERADMIN { diff --git a/dbaccess/source/ui/dlg/advancedsettings.src b/dbaccess/source/ui/dlg/advancedsettings.src index f37c67148e18..7a94c0dafb4c 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.src +++ b/dbaccess/source/ui/dlg/advancedsettings.src @@ -351,7 +351,6 @@ TabDialog DLG_DATABASE_ADVANCED { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; String STR_GENERATED_VALUE diff --git a/dbaccess/source/ui/dlg/dbadmin.src b/dbaccess/source/ui/dlg/dbadmin.src index 1d8744f07b53..f16edc83a761 100644 --- a/dbaccess/source/ui/dlg/dbadmin.src +++ b/dbaccess/source/ui/dlg/dbadmin.src @@ -113,7 +113,6 @@ TabDialog DLG_DATABASE_ADMINISTRATION { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; //......................................................................... @@ -147,7 +146,6 @@ ModalDialog DLG_DATABASE_TYPE_CHANGE { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; Text [ en-US ] = "Database properties" ; }; diff --git a/dbaccess/source/ui/dlg/dbadminsetup.src b/dbaccess/source/ui/dlg/dbadminsetup.src index 5fc9cdc12f23..4d6812143598 100644 --- a/dbaccess/source/ui/dlg/dbadminsetup.src +++ b/dbaccess/source/ui/dlg/dbadminsetup.src @@ -56,7 +56,6 @@ ModalDialog DLG_DATABASE_WIZARD { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; String STR_DBWIZARDTITLE -- cgit From e6d57bcd5ec9d88ebbc6911fb93f3c013508f3bf Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 25 Nov 2010 13:09:33 +0100 Subject: vcl117: #i114937# fix DeInitVCL --- vcl/aqua/source/app/vclnsapp.mm | 70 ++++------------------------------------- 1 file changed, 6 insertions(+), 64 deletions(-) diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm index 6402f5c60d75..5a476e0a54cc 100755 --- a/vcl/aqua/source/app/vclnsapp.mm +++ b/vcl/aqua/source/app/vclnsapp.mm @@ -360,85 +360,27 @@ -(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app { - bool bCallDeInit = false; NSApplicationTerminateReply aReply = NSTerminateNow; { YIELD_GUARD; SalData* pSalData = GetSalData(); - #if 0 // currently do some really bad hack if( ! pSalData->maFrames.empty() ) { - /* #i92766# something really weird is going on with the retain count of - our windows; sometimes we get a duplicate free before exit on one of our - NSWindows. The reason is unclear; to avoid this currently we retain them once more - - FIXME: this is a really bad hack, relying on the system to catch the leaked - resources. Find out what really goes on here and fix it ! - */ - std::vector< NSWindow* > aHackRetainedWindows; - for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin(); - it != pSalData->maFrames.end(); ++it ) - { - #if OSL_DEBUG_LEVEL > 1 - Window* pWin = (*it)->GetWindow(); - String aTitle = pWin->GetText(); - Window* pClient = pWin->ImplGetClientWindow(); - fprintf( stderr, "retaining %p (old count %d) windowtype=%s clienttyp=%s title=%s\n", - (*it)->mpWindow, [(*it)->mpWindow retainCount], - typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "", - rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr() - ); - #endif - [(*it)->mpWindow retain]; - aHackRetainedWindows.push_back( (*it)->mpWindow ); - } - if( pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ) - { - for( std::vector< NSWindow* >::iterator it = aHackRetainedWindows.begin(); - it != aHackRetainedWindows.end(); ++it ) - { - // clean up the retaing count again from the shutdown workaround - #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "releasing %p\n", (*it) ); - #endif - [(*it) release]; - } - aReply = NSTerminateCancel; - } - #if OSL_DEBUG_LEVEL > 1 - for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin(); - it != pSalData->maFrames.end(); ++it ) - { - Window* pWin = (*it)->GetWindow(); - String aTitle = pWin->GetText(); - Window* pClient = pWin->ImplGetClientWindow(); - fprintf( stderr, "frame still alive: NSWindow %p windowtype=%s clienttyp=%s title=%s\n", - (*it)->mpWindow, typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "", - rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr() - ); - } - #endif - } - #else // the clean version follows - if( ! pSalData->maFrames.empty() ) + // the following QueryExit will likely present a message box, activate application + [NSApp activateIgnoringOtherApps: YES]; aReply = pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow; - #endif + } - if( aReply != NSTerminateNow ) - [NSApp activateIgnoringOtherApps: YES]; - else + if( aReply == NSTerminateNow ) { ApplicationEvent aEv( String(), ApplicationAddress(), ByteString( "PRIVATE:DOSHUTDOWN" ), String() ); GetpApp()->AppEvent( aEv ); - // call DeInitVCL only after our YIELD_GUARD has expired, - // else its Mutex will be alredy destroyed when it runs out of scope ! ImplImageTreeSingletonRef()->shutDown(); - bCallDeInit = true; + // DeInitVCL should be called in ImplSVMain - unless someon _exits first which + // can occur in Desktop::doShutdown for example } } - if( bCallDeInit ) - DeInitVCL(); return aReply; } -- cgit From 42c7da2dff4f7a59ad08416bd53ee9b78bf5e4e7 Mon Sep 17 00:00:00 2001 From: sj Date: Thu, 25 Nov 2010 15:56:35 +0100 Subject: impress204: #i115029# pict import, applied patch from osnola.. improving line and patterns --- filter/source/graphicfilter/ipict/ipict.cxx | 82 +++++++++++++++++------------ 1 file changed, 49 insertions(+), 33 deletions(-) diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index 244ca56971be..8533f9971377 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -165,7 +165,7 @@ private: Pattern eActPenPattern; Pattern eActFillPattern; Pattern eActBackPattern; - USHORT nActPenSize; + Size nActPenSize; // Note: Postscript mode is stored by setting eActRop to ROP_1 RasterOp eActROP; PictDrawingMethod eActMethod; @@ -220,6 +220,12 @@ private: ULONG ReadAndDrawRgn(PictDrawingMethod eMethod); ULONG ReadAndDrawSameRgn(PictDrawingMethod eMethod); + // returns true, if we do not need to print the shape/text/frame + bool IsInvisible(PictDrawingMethod eMethod) const { + if (eActROP == ROP_1) return true; + if (eMethod==PDM_FRAME && (nActPenSize.Width() == 0 || nActPenSize.Height() == 0)) return true; + return false; + } void DrawingMethod(PictDrawingMethod eMethod); ULONG ReadAndDrawText(); @@ -510,6 +516,8 @@ ULONG PictReader::ReadPixPattern(PictReader::Pattern &pattern) ULONG PictReader::ReadAndDrawRect(PictDrawingMethod eMethod) { ReadRectangle(aLastRect); + + if (IsInvisible(eMethod)) return 8; DrawingMethod(eMethod); pVirDev->DrawRect(aLastRect); return 8; @@ -517,6 +525,7 @@ ULONG PictReader::ReadAndDrawRect(PictDrawingMethod eMethod) ULONG PictReader::ReadAndDrawSameRect(PictDrawingMethod eMethod) { + if (IsInvisible(eMethod)) return 0; DrawingMethod(eMethod); pVirDev->DrawRect(aLastRect); return 0; @@ -525,6 +534,8 @@ ULONG PictReader::ReadAndDrawSameRect(PictDrawingMethod eMethod) ULONG PictReader::ReadAndDrawRoundRect(PictDrawingMethod eMethod) { ReadRectangle(aLastRoundRect); + + if (IsInvisible(eMethod)) return 8; DrawingMethod(eMethod); // Osnola: the corner's size is equal to aActOvalSize/2, see Quickdraw Drawing Reference 3-63 pVirDev->DrawRect(aLastRoundRect,(aActOvalSize.Width()+1)/2,(aActOvalSize.Height()+1)/2); @@ -533,6 +544,7 @@ ULONG PictReader::ReadAndDrawRoundRect(PictDrawingMethod eMethod) ULONG PictReader::ReadAndDrawSameRoundRect(PictDrawingMethod eMethod) { + if (IsInvisible(eMethod)) return 0; DrawingMethod(eMethod); pVirDev->DrawRect(aLastRoundRect,(aActOvalSize.Width()+1)/2,(aActOvalSize.Height()+1)/2); return 0; @@ -541,6 +553,8 @@ ULONG PictReader::ReadAndDrawSameRoundRect(PictDrawingMethod eMethod) ULONG PictReader::ReadAndDrawOval(PictDrawingMethod eMethod) { ReadRectangle(aLastOval); + + if (IsInvisible(eMethod)) return 8; DrawingMethod(eMethod); pVirDev->DrawEllipse(aLastOval); return 8; @@ -548,6 +562,7 @@ ULONG PictReader::ReadAndDrawOval(PictDrawingMethod eMethod) ULONG PictReader::ReadAndDrawSameOval(PictDrawingMethod eMethod) { + if (IsInvisible(eMethod)) return 0; DrawingMethod(eMethod); pVirDev->DrawEllipse(aLastOval); return 0; @@ -556,8 +571,9 @@ ULONG PictReader::ReadAndDrawSameOval(PictDrawingMethod eMethod) ULONG PictReader::ReadAndDrawPolygon(PictDrawingMethod eMethod) { ULONG nDataSize; - nDataSize=ReadPolygon(aLastPolygon); + + if (IsInvisible(eMethod)) return nDataSize; DrawingMethod(eMethod); if (eMethod==PDM_FRAME) pVirDev->DrawPolyLine(aLastPolygon); else pVirDev->DrawPolygon(aLastPolygon); @@ -566,6 +582,7 @@ ULONG PictReader::ReadAndDrawPolygon(PictDrawingMethod eMethod) ULONG PictReader::ReadAndDrawSamePolygon(PictDrawingMethod eMethod) { + if (IsInvisible(eMethod)) return 0; DrawingMethod(eMethod); if (eMethod==PDM_FRAME) pVirDev->DrawPolyLine(aLastPolygon); else pVirDev->DrawPolygon(aLastPolygon); @@ -585,6 +602,9 @@ ULONG PictReader::ReadAndDrawArc(PictDrawingMethod eMethod) nstartAngle = nstartAngle + narcAngle; narcAngle=-narcAngle; } + + if (IsInvisible(eMethod)) return 12; + DrawingMethod(eMethod); fAng1=((double)nstartAngle)/180.0*3.14159265359; fAng2=((double)(nstartAngle+narcAngle))/180.0*3.14159265359; aCenter=Point((aLastArcRect.Left()+aLastArcRect.Right())/2, @@ -593,7 +613,6 @@ ULONG PictReader::ReadAndDrawArc(PictDrawingMethod eMethod) aCenter.Y()+(long)(-cos(fAng2)*256.0)); aEndPt= Point(aCenter.X()+(long)( sin(fAng1)*256.0), aCenter.Y()+(long)(-cos(fAng1)*256.0)); - DrawingMethod(eMethod); if (eMethod==PDM_FRAME) pVirDev->DrawArc(aLastArcRect,aStartPt,aEndPt); else pVirDev->DrawPie(aLastArcRect,aStartPt,aEndPt); return 12; @@ -610,6 +629,8 @@ ULONG PictReader::ReadAndDrawSameArc(PictDrawingMethod eMethod) nstartAngle = nstartAngle + narcAngle; narcAngle=-narcAngle; } + if (IsInvisible(eMethod)) return 4; + DrawingMethod(eMethod); fAng1=((double)nstartAngle)/180.0*3.14159265359; fAng2=((double)(nstartAngle+narcAngle))/180.0*3.14159265359; aCenter=Point((aLastArcRect.Left()+aLastArcRect.Right())/2, @@ -618,7 +639,6 @@ ULONG PictReader::ReadAndDrawSameArc(PictDrawingMethod eMethod) aCenter.Y()+(long)(-cos(fAng2)*256.0)); aEndPt= Point(aCenter.X()+(long)( sin(fAng1)*256.0), aCenter.Y()+(long)(-cos(fAng1)*256.0)); - DrawingMethod(eMethod); if (eMethod==PDM_FRAME) pVirDev->DrawArc(aLastArcRect,aStartPt,aEndPt); else pVirDev->DrawPie(aLastArcRect,aStartPt,aEndPt); return 4; @@ -628,15 +648,17 @@ ULONG PictReader::ReadAndDrawRgn(PictDrawingMethod eMethod) { USHORT nSize; - DrawingMethod(eMethod); *pPict >> nSize; + if (IsInvisible(eMethod)) return (ULONG)nSize; + DrawingMethod(eMethod); // ...???... return (ULONG)nSize; } ULONG PictReader::ReadAndDrawSameRgn(PictDrawingMethod eMethod) { - DrawingMethod(eMethod); + if (IsInvisible(eMethod)) return 0; + DrawingMethod(eMethod); // ...???... return 0; } @@ -644,26 +666,12 @@ ULONG PictReader::ReadAndDrawSameRgn(PictDrawingMethod eMethod) void PictReader::DrawingMethod(PictDrawingMethod eMethod) { if( eActMethod==eMethod ) return; - if (eActROP == ROP_1) { - // Osnola: ignore postscript command - if (eMethod == PDM_TEXT) { - Font invisibleFont; - invisibleFont.SetColor(Color(COL_TRANSPARENT)); - invisibleFont.SetFillColor(Color(COL_TRANSPARENT)); - invisibleFont.SetTransparent(TRUE); - pVirDev->SetFont(invisibleFont); - } - else { - SetLineColor( Color(COL_TRANSPARENT) ); - SetFillColor( Color(COL_TRANSPARENT) ); - } - pVirDev->SetRasterOp(ROP_OVERPAINT); - eActMethod=eMethod; - return; - } switch (eMethod) { case PDM_FRAME: - SetLineColor( aActForeColor ); + if (eActPenPattern.isDefault()) + SetLineColor( aActForeColor ); + else + SetLineColor(eActPenPattern.getColor(aActBackColor, aActForeColor)); SetFillColor( Color(COL_TRANSPARENT) ); pVirDev->SetRasterOp(eActROP); break; @@ -715,11 +723,13 @@ ULONG PictReader::ReadAndDrawText() sal_uInt32 nLen, nDataLen; sal_Char sText[256]; - DrawingMethod(PDM_TEXT); *pPict >> nByteLen; nLen=((ULONG)nByteLen)&0x000000ff; nDataLen = nLen + 1; pPict->Read( &sText, nLen ); + if (IsInvisible(PDM_TEXT)) return nDataLen; + DrawingMethod(PDM_TEXT); + // Stoerende Steuerzeuichen wegnehmen: while ( nLen > 0 && ( (unsigned char)sText[ nLen - 1 ] ) < 32 ) nLen--; @@ -1269,9 +1279,7 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0007: { // PnSize - Size aSize; - aSize=ReadSize(); - nActPenSize=(USHORT)((aSize.Width()+aSize.Height())/2); + nActPenSize=ReadSize(); eActMethod=PDM_UNDEFINED; nDataSize=4; break; @@ -1402,34 +1410,42 @@ ULONG PictReader::ReadData(USHORT nOpcode) case 0x0020: // Line aPoint=ReadPoint(); aPenPosition=ReadPoint(); + nDataSize=8; + + if (IsInvisible(PDM_FRAME)) break; DrawingMethod(PDM_FRAME); pVirDev->DrawLine(aPoint,aPenPosition); - nDataSize=8; break; case 0x0021: // LineFrom aPoint=aPenPosition; aPenPosition=ReadPoint(); + nDataSize=4; + + if (IsInvisible(PDM_FRAME)) break; DrawingMethod(PDM_FRAME); pVirDev->DrawLine(aPoint,aPenPosition); - nDataSize=4; break; case 0x0022: // ShortLine aPoint=ReadPoint(); aPenPosition=ReadDeltaH(aPoint); aPenPosition=ReadDeltaV(aPenPosition); + nDataSize=6; + + if (IsInvisible(PDM_FRAME)) break; DrawingMethod(PDM_FRAME); pVirDev->DrawLine(aPoint,aPenPosition); - nDataSize=6; break; case 0x0023: // ShortLineFrom aPoint=aPenPosition; aPenPosition=ReadDeltaH(aPoint); aPenPosition=ReadDeltaV(aPenPosition); + nDataSize=2; + + if (IsInvisible(PDM_FRAME)) break; DrawingMethod(PDM_FRAME); pVirDev->DrawLine(aPoint,aPenPosition); - nDataSize=2; break; case 0x0024: // Reserved (n Bytes) @@ -1914,7 +1930,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile ) aActForeColor = Color(COL_BLACK); aActBackColor = Color(COL_WHITE); - nActPenSize = 1; + nActPenSize = Size(1,1); eActROP = ROP_OVERPAINT; eActMethod = PDM_UNDEFINED; aActOvalSize = Size(1,1); -- cgit From 1330d7936a7204d1266d83d75f8d2fb720790fd3 Mon Sep 17 00:00:00 2001 From: sj Date: Thu, 25 Nov 2010 16:26:36 +0100 Subject: impress204: #i115011# pict import, applied patch from osnola: improved filter detection --- filter/source/graphicfilter/ipict/ipict.cxx | 219 ++++++++++++++++------------ 1 file changed, 122 insertions(+), 97 deletions(-) diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index 8533f9971377..8b000a0ad9ca 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -734,7 +734,7 @@ ULONG PictReader::ReadAndDrawText() while ( nLen > 0 && ( (unsigned char)sText[ nLen - 1 ] ) < 32 ) nLen--; sText[ nLen ] = 0; - String aString( (const sal_Char*)&sText, aActFont.GetCharSet());// OSNOLA: gsl_getSystemTextEncoding() ); + String aString( (const sal_Char*)&sText, aActFont.GetCharSet()); pVirDev->DrawText( Point( aTextPosition.X(), aTextPosition.Y() ), aString ); return nDataLen; } @@ -1111,109 +1111,134 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab void PictReader::ReadHeader() { - char nC; short y1,x1,y2,x2; - sal_Char sBuf[ 3 ]; - pPict->SeekRel( 10 ); - pPict->Read( sBuf, 3 ); - if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && ( sBuf[ 2 ] == 0x01 || sBuf[ 2 ] == 0x02 ) ) - pPict->SeekRel( -13 ); // this maybe a pict from a ms document - else - pPict->SeekRel( 512 - 13 ); // 512 Bytes Muell am Anfang - - pPict->SeekRel(2); // Lo-16-bits von "picture size" - *pPict >> y1 >> x1 >> y2 >> x2; // Rahmen-Rechteck des Bildes - aBoundingRect=Rectangle( x1,y1, --x2, --y2 ); - - // Jetzt kommen x-beliebig viele Nullen - // (in manchen Dateien tatsaechlich mehr als eine): - do { *pPict >> nC; } while (nC==0 && pPict->IsEof()==FALSE); - - // dann sollte der Versions-Opcode 0x11 folgen, dann die Versionsnummer: - if (nC==0x11) - { - *pPict >> nC; - if ( nC == 0x01 ) - IsVersion2 = FALSE; // Version 1 - else // Version 2 oder hoeher - { - short nExtVer; - // 3 Bytes ueberspringen, um auf - // ExtVersion2 oder Version2 zu kommen - pPict->SeekRel( 3 ); - *pPict >> nExtVer; - - // nachsehen, ob wir einen Extended-Version2-Header (==-2) haben - // oder einen einfachen Version2-Header (==-1); - // dementsprechend Aufloesung einlesen oder nicht - if ( nExtVer == -2 ) - { - sal_Int16 nReserved; - sal_Int32 nHResFixed, nVResFixed; - *pPict >> nReserved >> nHResFixed >> nVResFixed; - double fHRes = nHResFixed; - fHRes /= 65536; - double fVRes = nVResFixed; - fVRes /= 65536; - aHRes /= fHRes; - aVRes /= fVRes; - *pPict >> y1 >> x1 >> y2 >> x2; // reading the optimal bounding rect - aBoundingRect=Rectangle( x1,y1, --x2, --y2 ); - pPict->SeekRel( -22 ); - } - else - { - pPict->SeekRel( -4 ); - } - IsVersion2=TRUE; + sal_Char sBuf[ 2 ]; + // previous code considers pPict->Tell() as the normal starting position, + // can we have nStartPos != 0 ? + ULONG nStartPos = pPict->Tell(); + // Standard: + // a picture file begins by 512 bytes (reserved to the application) followed by the picture data + // while clipboard, pictures stored in a document often contain only the picture data. + + // Special cases: + // - some Pict v.1 use 0x00 0x11 0x01 ( instead of 0x11 0x01) to store the version op + // (we consider here this as another standard for Pict. v.1 ) + // - some files seem to contain extra garbage data at the beginning + // - some picture data seem to contain extra NOP opcode(0x00) between the bounding box and the version opcode + + // This code looks hard to find a picture header, ie. it looks at positions + // - nStartPos+0, nStartPos+512 with potential extra NOP codes between bdbox and version (at most 9 extra NOP) + // - 512..1024 with more strict bdbox checking and no extra NOP codes + + // Notes: + // - if the header can begin at nStartPos+0 and at nStartPos+512, we try to choose the more + // <> ( using the variable confidence) + // - svtools/source/filter.vcl/filter/{filter.cxx,filter2.cxx} only check for standard Pict, + // this may cause future problems + int st; + sal_uInt32 nOffset; + int confidence[2] = { 0, 0}; + for ( st = 0; st < 3 + 513; st++ ) + { + int actualConfid = 20; // the actual confidence + pPict->ResetError(); + if (st < 2) nOffset = nStartPos+st*512; + else if (st == 2) { + // choose nStartPos+0 or nStartPos+512 even if there are a little dubious + int actPos = -1, actConf=0; + if (confidence[0] > 0) { actPos = 0; actConf = confidence[0]; } + if (confidence[1] > 0 && confidence[1] >= actConf) actPos = 1; + if (actPos < 0) continue; + nOffset = nStartPos+actPos*512; } - } - else { - // Eigentlich ist dies wohl kein Pict-File, aber es gibt tatsaechlich - // Dateien, bei denen mehr als 512 Bytes "Muell" am Anfang stehen. - // Somit koennte es theoretisch folgende Art von Header geben: - // - // <0x11> .. - // Da aber in so einem Fall die Position von kaum auszumachen ist, - // gehen wir nun davon aus, dass in einer Datei immer entweder genau 512 Bytes Muell - // am Anfang sind (wie oben versucht), oder (wie normalerweise ueblich) genau eine 0 zwischen - // Bounding-Rectangle und 0x11. Des weiteren mag es hoechstens 1024 Bytes Muell geben, - // und das Ganze nur fuer Version 1 oder 2. - // Somit suchen wir nun nach der Folge 0x00,0x11,0x01 oder 0x00,0x11,0x02 innerhalb der - // "zweiten" 512 Bytes, und nehmen an, dass davor das Bounding-Rect steht, und hoffen - // dass das alles so seine Richtigkeit hat. - BYTE n1,n2,n3; - USHORT i,Found; - pPict->Seek(522); - Found=0; - *pPict >> n1 >> n2 >> n3; - for (i=0; i<512; i++) { - if (n1==0x00 && n2==0x11 && (n3==0x01 || n3==0x02)) { Found=1; break; } - n1=n2; n2=n3; *pPict >> n3; + else { + nOffset = 509+st; // illogical : more logical will be nStartPos+509+st or to consider that nStartPos=0 + // a small test to check if versionOp code exists after the bdbox ( with no extra NOP codes) + pPict->Seek(nOffset+10); + pPict->Read( sBuf, 2 ); + if (pPict->IsEof() || pPict->GetError()) break; + if (sBuf[0] == 0x11 || (sBuf[0] == 0x00 && sBuf[1] == 0x11)) ; // maybe ok + else continue; } - if (Found!=0) { - pPict->SeekRel(-11); - *pPict >> y1 >> x1 >> y2 >> x2; - // Lieber nochmal nachsehen, ob das Bounding-Rectangle gut zu sein scheint: - if (x1+10=-2048 && x1>=-2048 && x2<=2048 && y2<=2048) { - aBoundingRect=Rectangle( x1, y1, --x2, --y2 ); - if (n3==0x01) { - pPict->SeekRel(3); - IsVersion2=FALSE; - } - else { - pPict->SeekRel(4); - IsVersion2=TRUE; - } - } - else pPict->SetError(SVSTREAM_FILEFORMAT_ERROR); + pPict->Seek(nOffset); + + // 2 bytes to store size ( version 1 ) ignored + pPict->SeekRel( 2 ); + *pPict >> y1 >> x1 >> y2 >> x2; // Rahmen-Rechteck des Bildes + if (x1 > x2 || y1 > y2) continue; // bad bdbox + if (x1 < -2048 || x2 > 2048 || y1 < -2048 || y2 > 2048 || // origin|dest is very small|large + (x1 == x2 && y1 == y2) ) // 1 pixel pict is dubious + actualConfid-=3; + else if (x2 < x1+8 || y2 < y1+8) // a little dubious + actualConfid-=1; + if (st >= 3 && actualConfid != 20) continue; + aBoundingRect=Rectangle( x1,y1, x2, y2 ); + + if (pPict->IsEof() || pPict->GetError()) continue; + // read version + pPict->Read( sBuf, 2 ); + // version 1 file + if ( sBuf[ 0 ] == 0x11 && sBuf[ 1 ] == 0x01 ) { + // pict v1 must be rare and we do only few tests + if (st < 2) { confidence[st] = --actualConfid; continue; } + IsVersion2 = FALSE; return; } - else pPict->SetError(SVSTREAM_FILEFORMAT_ERROR); - } + if (sBuf[0] != 0x00) continue; // unrecovable error + int numZero = 0; + do + { + numZero++; + pPict->SeekRel(-1); + pPict->Read( sBuf, 2 ); + } + while ( sBuf[0] == 0x00 && numZero < 10); + actualConfid -= (numZero-1); // extra nop are dubious + if (pPict->IsEof() || pPict->GetError()) continue; + if (sBuf[0] != 0x11) continue; // not a version opcode + // abnormal version 1 file + if (sBuf[1] == 0x01 ) { + // pict v1 must be rare and we do only few tests + if (st < 2) { confidence[st] = --actualConfid; continue; } + IsVersion2 = FALSE; return; + } + if (sBuf[1] != 0x02 ) continue; // not a version 2 file + + IsVersion2=TRUE; + short nExtVer, nReserved; + // 3 Bytes ignored : end of version arg 0x02FF (ie: 0xFF), HeaderOp : 0x0C00 + pPict->SeekRel( 3 ); + *pPict >> nExtVer >> nReserved; + if (pPict->IsEof() || pPict->GetError()) continue; + + if ( nExtVer == -2 ) // extended version 2 picture + { + sal_Int32 nHResFixed, nVResFixed; + *pPict >> nHResFixed >> nVResFixed; + *pPict >> y1 >> x1 >> y2 >> x2; // reading the optimal bounding rect + if (x1 > x2 || y1 > y2) continue; // bad bdbox + if (st < 2 && actualConfid != 20) { confidence[st] = actualConfid; continue; } + + double fHRes = nHResFixed; + fHRes /= 65536; + double fVRes = nVResFixed; + fVRes /= 65536; + aHRes /= fHRes; + aVRes /= fVRes; + aBoundingRect=Rectangle( x1,y1, x2, y2 ); + pPict->SeekRel( 4 ); // 4 bytes reserved + return; + } + else if (nExtVer == -1 ) { // basic version 2 picture + if (st < 2 && actualConfid != 20) { confidence[st] = actualConfid; continue; } + pPict->SeekRel( 16); // bdbox(4 fixed number) + pPict->SeekRel(4); // 4 bytes reserved + return; + } + } + pPict->SetError(SVSTREAM_FILEFORMAT_ERROR); } - ULONG PictReader::ReadData(USHORT nOpcode) { USHORT nUSHORT; -- cgit From 4e923f16a346335e972b85ab308e8d99cf2d8ae4 Mon Sep 17 00:00:00 2001 From: sj Date: Thu, 25 Nov 2010 16:32:50 +0100 Subject: impress204: #i115008# pict import, applied patch from osnola: code simplification and minor bugfix --- filter/source/graphicfilter/ipict/ipict.cxx | 177 ++++------------------------ 1 file changed, 21 insertions(+), 156 deletions(-) diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index 8b000a0ad9ca..b7122331d6e9 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -1244,6 +1244,15 @@ ULONG PictReader::ReadData(USHORT nOpcode) USHORT nUSHORT; Point aPoint; ULONG nDataSize=0; + PictDrawingMethod shapeDMethod = PDM_UNDEFINED; + switch (nOpcode & 7) { + case 0: shapeDMethod = PDM_FRAME; break; + case 1: shapeDMethod = PDM_PAINT; break; + case 2: shapeDMethod = PDM_ERASE; break; + case 3: shapeDMethod = PDM_INVERT; break; + case 4: shapeDMethod = PDM_FILL; break; + default: break; + } switch(nOpcode) { @@ -1538,23 +1547,11 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0030: // frameRect - nDataSize=ReadAndDrawRect(PDM_FRAME); - break; - case 0x0031: // paintRect - nDataSize=ReadAndDrawRect(PDM_PAINT); - break; - case 0x0032: // eraseRect - nDataSize=ReadAndDrawRect(PDM_ERASE); - break; - case 0x0033: // invertRect - nDataSize=ReadAndDrawRect(PDM_INVERT); - break; - case 0x0034: // fillRect - nDataSize=ReadAndDrawRect(PDM_FILL); + nDataSize=ReadAndDrawRect(shapeDMethod); break; case 0x0035: // Reserved (8 Bytes) @@ -1564,23 +1561,11 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0038: // frameSameRect - nDataSize=ReadAndDrawSameRect(PDM_FRAME); - break; - case 0x0039: // paintSameRect - nDataSize=ReadAndDrawSameRect(PDM_PAINT); - break; - case 0x003a: // eraseSameRect - nDataSize=ReadAndDrawSameRect(PDM_ERASE); - break; - case 0x003b: // invertSameRect - nDataSize=ReadAndDrawSameRect(PDM_INVERT); - break; - case 0x003c: // fillSameRect - nDataSize=ReadAndDrawSameRect(PDM_FILL); + nDataSize=ReadAndDrawSameRect(shapeDMethod); break; case 0x003d: // Reserved (0 Bytes) @@ -1590,23 +1575,11 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0040: // frameRRect - nDataSize=ReadAndDrawRoundRect(PDM_FRAME); - break; - case 0x0041: // paintRRect - nDataSize=ReadAndDrawRoundRect(PDM_PAINT); - break; - case 0x0042: // eraseRRect - nDataSize=ReadAndDrawRoundRect(PDM_ERASE); - break; - case 0x0043: // invertRRect - nDataSize=ReadAndDrawRoundRect(PDM_INVERT); - break; - case 0x0044: // fillRRect - nDataSize=ReadAndDrawRoundRect(PDM_FILL); + nDataSize=ReadAndDrawRoundRect(shapeDMethod); break; case 0x0045: // Reserved (8 Bytes) @@ -1616,23 +1589,11 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0048: // frameSameRRect - nDataSize=ReadAndDrawSameRoundRect(PDM_FRAME); - break; - case 0x0049: // paintSameRRect - nDataSize=ReadAndDrawSameRoundRect(PDM_PAINT); - break; - case 0x004a: // eraseSameRRect - nDataSize=ReadAndDrawSameRoundRect(PDM_ERASE); - break; - case 0x004b: // invertSameRRect - nDataSize=ReadAndDrawSameRoundRect(PDM_INVERT); - break; - case 0x004c: // fillSameRRect - nDataSize=ReadAndDrawSameRoundRect(PDM_FILL); + nDataSize=ReadAndDrawSameRoundRect(shapeDMethod); break; case 0x004d: // Reserved (0 Bytes) @@ -1642,23 +1603,11 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0050: // frameOval - nDataSize=ReadAndDrawOval(PDM_FRAME); - break; - case 0x0051: // paintOval - nDataSize=ReadAndDrawOval(PDM_PAINT); - break; - case 0x0052: // eraseOval - nDataSize=ReadAndDrawOval(PDM_ERASE); - break; - case 0x0053: // invertOval - nDataSize=ReadAndDrawOval(PDM_INVERT); - break; - case 0x0054: // fillOval - nDataSize=ReadAndDrawOval(PDM_FILL); + nDataSize=ReadAndDrawOval(shapeDMethod); break; case 0x0055: // Reserved (8 Bytes) @@ -1668,23 +1617,11 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0058: // frameSameOval - nDataSize=ReadAndDrawSameOval(PDM_FRAME); - break; - case 0x0059: // paintSameOval - nDataSize=ReadAndDrawSameOval(PDM_PAINT); - break; - case 0x005a: // eraseSameOval - nDataSize=ReadAndDrawSameOval(PDM_ERASE); - break; - case 0x005b: // invertSameOval - nDataSize=ReadAndDrawSameOval(PDM_INVERT); - break; - case 0x005c: // fillSameOval - nDataSize=ReadAndDrawSameOval(PDM_FILL); + nDataSize=ReadAndDrawSameOval(shapeDMethod); break; case 0x005d: // Reserved (0 Bytes) @@ -1694,23 +1631,11 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0060: // frameArc - nDataSize=ReadAndDrawArc(PDM_FRAME); - break; - case 0x0061: // paintArc - nDataSize=ReadAndDrawArc(PDM_PAINT); - break; - case 0x0062: // eraseArc - nDataSize=ReadAndDrawArc(PDM_ERASE); - break; - case 0x0063: // invertArc - nDataSize=ReadAndDrawArc(PDM_INVERT); - break; - case 0x0064: // fillArc - nDataSize=ReadAndDrawArc(PDM_FILL); + nDataSize=ReadAndDrawArc(shapeDMethod); break; case 0x0065: // Reserved (12 Bytes) @@ -1720,23 +1645,11 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0068: // frameSameArc - nDataSize=ReadAndDrawSameArc(PDM_FRAME); - break; - case 0x0069: // paintSameArc - nDataSize=ReadAndDrawSameArc(PDM_PAINT); - break; - case 0x006a: // eraseSameArc - nDataSize=ReadAndDrawSameArc(PDM_ERASE); - break; - case 0x006b: // invertSameArc - nDataSize=ReadAndDrawSameArc(PDM_INVERT); - break; - case 0x006c: // fillSameArc - nDataSize=ReadAndDrawSameArc(PDM_FILL); + nDataSize=ReadAndDrawSameArc(shapeDMethod); break; case 0x006d: // Reserved (4 Bytes) @@ -1746,23 +1659,11 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0070: // framePoly - nDataSize=ReadAndDrawPolygon(PDM_FRAME); - break; - case 0x0071: // paintPoly - nDataSize=ReadAndDrawPolygon(PDM_PAINT); - break; - case 0x0072: // erasePoly - nDataSize=ReadAndDrawPolygon(PDM_ERASE); - break; - case 0x0073: // invertPoly - nDataSize=ReadAndDrawPolygon(PDM_INVERT); - break; - case 0x0074: // fillPoly - nDataSize=ReadAndDrawPolygon(PDM_FILL); + nDataSize=ReadAndDrawPolygon(shapeDMethod); break; case 0x0075: // Reserved (Polygon-Size) @@ -1772,23 +1673,11 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0078: // frameSamePoly - nDataSize=ReadAndDrawSamePolygon(PDM_FRAME); - break; - case 0x0079: // paintSamePoly - nDataSize=ReadAndDrawSamePolygon(PDM_PAINT); - break; - case 0x007a: // eraseSamePoly - nDataSize=ReadAndDrawSamePolygon(PDM_ERASE); - break; - case 0x007b: // invertSamePoly - nDataSize=ReadAndDrawSamePolygon(PDM_INVERT); - break; - case 0x007c: // fillSamePoly - nDataSize=ReadAndDrawSamePolygon(PDM_FILL); + nDataSize=ReadAndDrawSamePolygon(shapeDMethod); break; case 0x007d: // Reserved (0 Bytes) @@ -1798,23 +1687,11 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0080: // frameRgn - nDataSize=ReadAndDrawRgn(PDM_FILL); - break; - case 0x0081: // paintRgn - nDataSize=ReadAndDrawRgn(PDM_PAINT); - break; - case 0x0082: // eraseRgn - nDataSize=ReadAndDrawRgn(PDM_ERASE); - break; - case 0x0083: // invertRgn - nDataSize=ReadAndDrawRgn(PDM_INVERT); - break; - case 0x0084: // fillRgn - nDataSize=ReadAndDrawRgn(PDM_FILL); + nDataSize=ReadAndDrawRgn(shapeDMethod); break; case 0x0085: // Reserved (Region-Size) @@ -1824,23 +1701,11 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0088: // frameSameRgn - nDataSize=ReadAndDrawSameRgn(PDM_FRAME); - break; - case 0x0089: // paintSameRgn - nDataSize=ReadAndDrawSameRgn(PDM_PAINT); - break; - case 0x008a: // eraseSameRgn - nDataSize=ReadAndDrawSameRgn(PDM_ERASE); - break; - case 0x008b: // invertSameRgn - nDataSize=ReadAndDrawSameRgn(PDM_INVERT); - break; - case 0x008c: // fillSameRgn - nDataSize=ReadAndDrawSameRgn(PDM_FILL); + nDataSize=ReadAndDrawSameRgn(shapeDMethod); break; case 0x008d: // Reserved (0 Bytes) -- cgit From 2b9074e2fc000b26394f8b7358f5f0d2f3f10aa9 Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 29 Nov 2010 17:12:58 +0100 Subject: impress204: #i115096# applied patch from osnola (pict import filter is now supporting thick lines) --- filter/prj/build.lst | 2 +- filter/source/graphicfilter/ipict/ipict.cxx | 112 +++++------ filter/source/graphicfilter/ipict/makefile.mk | 6 +- filter/source/graphicfilter/ipict/shape.cxx | 265 ++++++++++++++++++++++++++ filter/source/graphicfilter/ipict/shape.hxx | 60 ++++++ 5 files changed, 374 insertions(+), 71 deletions(-) create mode 100755 filter/source/graphicfilter/ipict/shape.cxx create mode 100755 filter/source/graphicfilter/ipict/shape.hxx diff --git a/filter/prj/build.lst b/filter/prj/build.lst index 065b4313c57b..5617d28856f7 100644 --- a/filter/prj/build.lst +++ b/filter/prj/build.lst @@ -1,4 +1,4 @@ -fl filter : l10n svtools unotools xmloff cppu tools cppuhelper sal svx javaunohelper XPDF:xpdf jvmaccess canvas SAXON:saxon LIBXSLT:libxslt NULL +fl filter : l10n svtools unotools xmloff cppu tools cppuhelper sal svx javaunohelper XPDF:xpdf jvmaccess canvas SAXON:saxon LIBXSLT:libxslt basegfx NULL fl filter usr1 - all fl_mkout NULL fl filter\prj get - all fl_prj NULL fl filter\inc nmake - all fl_inc NULL diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index b7122331d6e9..2a1992e246a3 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -36,6 +36,8 @@ #include #include +#include "shape.hxx" + namespace PictReaderInternal { //! utilitary class to store a pattern, ... class Pattern { @@ -461,8 +463,6 @@ void PictReader::ReadRectangle(Rectangle & rRect) aTopLeft=ReadPoint(); aBottomRight=ReadPoint(); - aBottomRight.X() -= 1; - aBottomRight.Y() -= 1; rRect=Rectangle(aTopLeft,aBottomRight); } @@ -516,10 +516,7 @@ ULONG PictReader::ReadPixPattern(PictReader::Pattern &pattern) ULONG PictReader::ReadAndDrawRect(PictDrawingMethod eMethod) { ReadRectangle(aLastRect); - - if (IsInvisible(eMethod)) return 8; - DrawingMethod(eMethod); - pVirDev->DrawRect(aLastRect); + ReadAndDrawSameRect(eMethod); return 8; } @@ -527,18 +524,14 @@ ULONG PictReader::ReadAndDrawSameRect(PictDrawingMethod eMethod) { if (IsInvisible(eMethod)) return 0; DrawingMethod(eMethod); - pVirDev->DrawRect(aLastRect); + PictReaderShape::drawRectangle(pVirDev, eMethod==PDM_FRAME, aLastRect, nActPenSize); return 0; } ULONG PictReader::ReadAndDrawRoundRect(PictDrawingMethod eMethod) { ReadRectangle(aLastRoundRect); - - if (IsInvisible(eMethod)) return 8; - DrawingMethod(eMethod); - // Osnola: the corner's size is equal to aActOvalSize/2, see Quickdraw Drawing Reference 3-63 - pVirDev->DrawRect(aLastRoundRect,(aActOvalSize.Width()+1)/2,(aActOvalSize.Height()+1)/2); + ReadAndDrawSameRoundRect(eMethod); return 8; } @@ -546,17 +539,14 @@ ULONG PictReader::ReadAndDrawSameRoundRect(PictDrawingMethod eMethod) { if (IsInvisible(eMethod)) return 0; DrawingMethod(eMethod); - pVirDev->DrawRect(aLastRoundRect,(aActOvalSize.Width()+1)/2,(aActOvalSize.Height()+1)/2); + PictReaderShape::drawRoundRectangle(pVirDev, eMethod==PDM_FRAME, aLastRoundRect, aActOvalSize, nActPenSize); return 0; } ULONG PictReader::ReadAndDrawOval(PictDrawingMethod eMethod) { ReadRectangle(aLastOval); - - if (IsInvisible(eMethod)) return 8; - DrawingMethod(eMethod); - pVirDev->DrawEllipse(aLastOval); + ReadAndDrawSameOval(eMethod); return 8; } @@ -564,7 +554,7 @@ ULONG PictReader::ReadAndDrawSameOval(PictDrawingMethod eMethod) { if (IsInvisible(eMethod)) return 0; DrawingMethod(eMethod); - pVirDev->DrawEllipse(aLastOval); + PictReaderShape::drawEllipse(pVirDev, eMethod==PDM_FRAME, aLastOval, nActPenSize); return 0; } @@ -572,11 +562,7 @@ ULONG PictReader::ReadAndDrawPolygon(PictDrawingMethod eMethod) { ULONG nDataSize; nDataSize=ReadPolygon(aLastPolygon); - - if (IsInvisible(eMethod)) return nDataSize; - DrawingMethod(eMethod); - if (eMethod==PDM_FRAME) pVirDev->DrawPolyLine(aLastPolygon); - else pVirDev->DrawPolygon(aLastPolygon); + ReadAndDrawSamePolygon(eMethod); return nDataSize; } @@ -584,37 +570,15 @@ ULONG PictReader::ReadAndDrawSamePolygon(PictDrawingMethod eMethod) { if (IsInvisible(eMethod)) return 0; DrawingMethod(eMethod); - if (eMethod==PDM_FRAME) pVirDev->DrawPolyLine(aLastPolygon); - else pVirDev->DrawPolygon(aLastPolygon); + PictReaderShape::drawPolygon(pVirDev, eMethod==PDM_FRAME, aLastPolygon, nActPenSize); return 0; } ULONG PictReader::ReadAndDrawArc(PictDrawingMethod eMethod) { - short nstartAngle, narcAngle; - double fAng1, fAng2; - Point aStartPt, aEndPt, aCenter; - ReadRectangle(aLastArcRect); - *pPict >> nstartAngle >> narcAngle; - if (narcAngle<0) { - nstartAngle = nstartAngle + narcAngle; - narcAngle=-narcAngle; - } - - if (IsInvisible(eMethod)) return 12; - DrawingMethod(eMethod); - fAng1=((double)nstartAngle)/180.0*3.14159265359; - fAng2=((double)(nstartAngle+narcAngle))/180.0*3.14159265359; - aCenter=Point((aLastArcRect.Left()+aLastArcRect.Right())/2, - (aLastArcRect.Top()+aLastArcRect.Bottom())/2); - aStartPt=Point(aCenter.X()+(long)( sin(fAng2)*256.0), - aCenter.Y()+(long)(-cos(fAng2)*256.0)); - aEndPt= Point(aCenter.X()+(long)( sin(fAng1)*256.0), - aCenter.Y()+(long)(-cos(fAng1)*256.0)); - if (eMethod==PDM_FRAME) pVirDev->DrawArc(aLastArcRect,aStartPt,aEndPt); - else pVirDev->DrawPie(aLastArcRect,aStartPt,aEndPt); + ReadAndDrawSameArc(eMethod); return 12; } @@ -622,25 +586,18 @@ ULONG PictReader::ReadAndDrawSameArc(PictDrawingMethod eMethod) { short nstartAngle, narcAngle; double fAng1, fAng2; - Point aStartPt, aEndPt, aCenter; *pPict >> nstartAngle >> narcAngle; + if (IsInvisible(eMethod)) return 4; + DrawingMethod(eMethod); + if (narcAngle<0) { nstartAngle = nstartAngle + narcAngle; narcAngle=-narcAngle; } - if (IsInvisible(eMethod)) return 4; - DrawingMethod(eMethod); fAng1=((double)nstartAngle)/180.0*3.14159265359; fAng2=((double)(nstartAngle+narcAngle))/180.0*3.14159265359; - aCenter=Point((aLastArcRect.Left()+aLastArcRect.Right())/2, - (aLastArcRect.Top()+aLastArcRect.Bottom())/2); - aStartPt=Point(aCenter.X()+(long)( sin(fAng2)*256.0), - aCenter.Y()+(long)(-cos(fAng2)*256.0)); - aEndPt= Point(aCenter.X()+(long)( sin(fAng1)*256.0), - aCenter.Y()+(long)(-cos(fAng1)*256.0)); - if (eMethod==PDM_FRAME) pVirDev->DrawArc(aLastArcRect,aStartPt,aEndPt); - else pVirDev->DrawPie(aLastArcRect,aStartPt,aEndPt); + PictReaderShape::drawArc(pVirDev, eMethod==PDM_FRAME, aLastArcRect,fAng1,fAng2, nActPenSize); return 4; } @@ -649,9 +606,21 @@ ULONG PictReader::ReadAndDrawRgn(PictDrawingMethod eMethod) USHORT nSize; *pPict >> nSize; - if (IsInvisible(eMethod)) return (ULONG)nSize; - DrawingMethod(eMethod); - // ...???... + // read the DATA + // + // a region data is a mask and is probably coded as + // - the first 8 bytes: bdbox ( which can be read by ReadRectangle ) + // - then a list of line modifiers: y_i, a_0, b_0, a_1, b_1, ..., a_{n_i}, b_{n_i}, 0x7fff + // - 0x7fff + // where y_i is the increasing sequences of line coordinates + // and on each line: a0 < b0 < a1 < b1 < ... < a_{n_i} < b_{n_i} + + // it can be probably decoded as : + // M=an empty mask: ie. (0, 0, ... ) with (left_box-right_box+1) zeroes + // then for each line (y_i): + // - takes M and inverts all values in [a_0,b_0-1], in [a_1,b_1-1] ... + // - sets M = new y_i line mask + ReadAndDrawSameRgn(eMethod); return (ULONG)nSize; } @@ -659,7 +628,7 @@ ULONG PictReader::ReadAndDrawSameRgn(PictDrawingMethod eMethod) { if (IsInvisible(eMethod)) return 0; DrawingMethod(eMethod); - // ...???... + // DISPLAY: ...???... return 0; } @@ -1265,6 +1234,13 @@ ULONG PictReader::ReadData(USHORT nOpcode) *pPict >> nUSHORT; nDataSize=nUSHORT; ReadRectangle(aRect); + // checkme: do we really want to extend the rectangle here ? + // I do that because the clipping is often used to clean a region, + // before drawing some text and also to draw this text. + // So using a too small region can lead to clip the end of the text ; + // but this can be discutable... + aRect.setWidth(aRect.getWidth()+1); + aRect.setHeight(aRect.getHeight()+1); pVirDev->SetClipRegion( Region( aRect ) ); break; } @@ -1448,7 +1424,7 @@ ULONG PictReader::ReadData(USHORT nOpcode) if (IsInvisible(PDM_FRAME)) break; DrawingMethod(PDM_FRAME); - pVirDev->DrawLine(aPoint,aPenPosition); + PictReaderShape::drawLine(pVirDev, aPoint,aPenPosition, nActPenSize); break; case 0x0021: // LineFrom @@ -1457,7 +1433,7 @@ ULONG PictReader::ReadData(USHORT nOpcode) if (IsInvisible(PDM_FRAME)) break; DrawingMethod(PDM_FRAME); - pVirDev->DrawLine(aPoint,aPenPosition); + PictReaderShape::drawLine(pVirDev, aPoint,aPenPosition, nActPenSize); break; case 0x0022: // ShortLine @@ -1468,7 +1444,7 @@ ULONG PictReader::ReadData(USHORT nOpcode) if (IsInvisible(PDM_FRAME)) break; DrawingMethod(PDM_FRAME); - pVirDev->DrawLine(aPoint,aPenPosition); + PictReaderShape::drawLine(pVirDev, aPoint,aPenPosition, nActPenSize); break; case 0x0023: // ShortLineFrom @@ -1479,7 +1455,7 @@ ULONG PictReader::ReadData(USHORT nOpcode) if (IsInvisible(PDM_FRAME)) break; DrawingMethod(PDM_FRAME); - pVirDev->DrawLine(aPoint,aPenPosition); + PictReaderShape::drawLine(pVirDev, aPoint,aPenPosition, nActPenSize); break; case 0x0024: // Reserved (n Bytes) @@ -1790,7 +1766,9 @@ ULONG PictReader::ReadData(USHORT nOpcode) if (nOpcode<=0x00af) { *pPict >> nUSHORT; nDataSize=2+nUSHORT; } else if (nOpcode<=0x00cf) { nDataSize=0; } else if (nOpcode<=0x00fe) { sal_uInt32 nTemp; *pPict >> nTemp ; nDataSize = nTemp; nDataSize+=4; } - else if (nOpcode==0x00ff) { nDataSize=2; } // OpEndPic + // Osnola: checkme: in the Quickdraw Ref examples ( for pict v2) + // 0x00ff(EndOfPict) is also not followed by any data... + else if (nOpcode==0x00ff) { nDataSize=IsVersion2 ? 2 : 0; } // OpEndPic else if (nOpcode<=0x01ff) { nDataSize=2; } else if (nOpcode<=0x0bfe) { nDataSize=4; } else if (nOpcode<=0x0bff) { nDataSize=22; } diff --git a/filter/source/graphicfilter/ipict/makefile.mk b/filter/source/graphicfilter/ipict/makefile.mk index 679fd79951ac..dd8dfbc400c2 100644 --- a/filter/source/graphicfilter/ipict/makefile.mk +++ b/filter/source/graphicfilter/ipict/makefile.mk @@ -41,18 +41,18 @@ DEPTARGET=vipict CDEFS+= -DEDITDEBUG .ENDIF .IF "$(L10N_framework)"=="" -SLOFILES = $(SLO)$/ipict.obj +SLOFILES = $(SLO)$/ipict.obj $(SLO)$/shape.obj # ========================================================================== SHL1TARGET= ipt$(DLLPOSTFIX) SHL1IMPLIB= ipict -SHL1STDLIBS= $(VCLLIB) $(TOOLSLIB) $(SALLIB) +SHL1STDLIBS= $(VCLLIB) $(TOOLSLIB) $(SALLIB) $(BASEGFXLIB) SHL1LIBS= $(SLB)$/ipict.lib .IF "$(GUI)" != "UNX" .IF "$(COM)" != "GCC" -SHL1OBJS= $(SLO)$/ipict.obj +SHL1OBJS= $(SLOFILES) .ENDIF .ENDIF diff --git a/filter/source/graphicfilter/ipict/shape.cxx b/filter/source/graphicfilter/ipict/shape.cxx new file mode 100755 index 000000000000..454a0dcb5b38 --- /dev/null +++ b/filter/source/graphicfilter/ipict/shape.cxx @@ -0,0 +1,265 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +/** Osnola: +IMPORTANT NOTE: some Quickdraw lines/frames can not be "quickly" drawn exactly: +for instance, when PenSize=(1,1), the line from (0,0) to (8,0) +corresponds to the rectangle (0,0)(0,1)(9,1)(9,0), which can only be drawn + by drawing a rectangle. Drawing a non horizontal/vertical will imply to draw +a polygon, ... +Similarly, drawing the frame of a rectangle (0,0)(0,1)(9,1)(9,0) when PenSize=(1,1), +will imply to draw a rectangle (0.5,0.5)(0.5,8.5)(8.5,8.5)(8.5,0.5) with linewidth=1... + +Here, we choose: +- for horizontal/vertical lines and line with length less than five to draw the real line, +- in the other case, we keep the same shape (even if this means some "bad" coordinates) +*/ + +#include +#include +#include "shape.hxx" + +namespace PictReaderShapePrivate { + /** returns an inside rectangle knowing the penSize in order to obtain the ``correct'' position + when we draw a frame in wide length*/ + Rectangle contractRectangle(bool drawFrame, Rectangle const &rect, Size const &pSize) { + if (!drawFrame) return rect; + int penSize=(pSize.Width()+pSize.Height())/2; + if (2*penSize > rect.Right()-rect.Left()) penSize = (rect.Right()-rect.Left()+1)/2; + if (2*penSize > rect.Bottom()-rect.Top()) penSize = (rect.Bottom()-rect.Top()+1)/2; + int const X[2] = { rect.Left()+penSize/2, rect.Right()-(penSize+1)/2 }; + int const Y[2] = { rect.Top()+penSize/2, rect.Bottom()-(penSize+1)/2 }; + return Rectangle(Point(X[0],Y[0]), Point(X[1], Y[1])); + } +} + +namespace PictReaderShape { + //--------- draws a horizontal/vertical/small line (by creating a "rectangle/polygon") --------- + bool drawLineHQ(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize) { + int dir[2] = { dest.X()-orig.X(), dest.Y()-orig.Y() }; + bool vertic = dir[0] == 0; + bool horiz = dir[1] == 0; + if (!horiz && !vertic && dir[0]*dir[0]+dir[1]*dir[1] > 25) return false; + + int X[2]={ orig.X(), dest.X() }, Y[2] = { orig.Y(), dest.Y() }; + using namespace basegfx; + B2DPolygon poly; + if (horiz || vertic) { + if (horiz) { + if (X[0] < X[1]) X[1]+=pSize.Width(); + else X[0]+=pSize.Width(); + Y[1] += pSize.Height(); + } + else { + if (Y[0] < Y[1]) Y[1]+=pSize.Height(); + else Y[0]+=pSize.Height(); + X[1] += pSize.Width(); + } + poly.append(B2DPoint(X[0], Y[0])); poly.append(B2DPoint(X[1], Y[0])); + poly.append(B2DPoint(X[1], Y[1])); poly.append(B2DPoint(X[0], Y[1])); + poly.append(B2DPoint(X[0], Y[0])); + } + else { + int origPt[4][2] = { { orig.X(), orig.Y() }, { orig.X()+pSize.Width(), orig.Y() }, + { orig.X()+pSize.Width(), orig.Y()+pSize.Height() }, + { orig.X(), orig.Y()+pSize.Height() }}; + int origAvoid = dir[0] > 0 ? (dir[1] > 0 ? 2 : 1) : (dir[1] > 0 ? 3 : 0); + int destPt[4][2] = { { dest.X(), dest.Y() }, { dest.X()+pSize.Width(), dest.Y() }, + { dest.X()+pSize.Width(), dest.Y()+pSize.Height() }, + { dest.X(), dest.Y()+pSize.Height() }}; + for (int w = origAvoid+1; w < origAvoid+4; w++) { + int wh = (w%4); + poly.append(B2DPoint(origPt[wh][0], origPt[wh][1])); + } + for (int w = origAvoid+3; w < origAvoid+6; w++) { + int wh = (w%4); + poly.append(B2DPoint(destPt[wh][0], destPt[wh][1])); + } + int wh = (origAvoid+1)%4; + poly.append(B2DPoint(origPt[wh][0], origPt[wh][1])); + } + + // HACK: here we use the line coloring when drawing the shape + // must be changed if other parameter are changed to draw + // a line/fill shape + Color oldFColor = dev->GetFillColor(), oldLColor = dev->GetLineColor(); + dev->SetFillColor(oldLColor); dev->SetLineColor(Color(COL_TRANSPARENT)); + dev->DrawPolygon(poly); + dev->SetLineColor(oldLColor); dev->SetFillColor(oldFColor); + return true; + } + + // + //-------------------- draws a line -------------------- + // + void drawLine(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize) { + if (drawLineHQ(dev,orig,dest,pSize)) return; + + int penSize=(pSize.Width()+pSize.Height())/2; + int decal[2] = { pSize.Width()/2, pSize.Height()/2}; + + using namespace basegfx; + B2DPolygon poly; + poly.append(B2DPoint(double(orig.X()+decal[0]), double(orig.Y()+decal[1]))); + poly.append(B2DPoint(double(dest.X()+decal[0]), double(dest.Y()+decal[1]))); + dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE); + } + + //-------------------- draws a rectangle -------------------- + /* Note(checkme): contradically with the QuickDraw's reference 3-23, it seems better to consider + that the frame/content of a rectangle appears inside the given rectangle. Does a conversion + appear between the pascal functions and the data stored in the file ? */ + void drawRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &pSize) { + int penSize=(pSize.Width()+pSize.Height())/2; + Rectangle rect = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); + double const X[2] = { rect.Left(), rect.Right() }; + double const Y[2] = { rect.Top(), rect.Bottom() }; + + using namespace basegfx; + B2DPolygon poly; + poly.append(B2DPoint(X[0], Y[0])); poly.append(B2DPoint(X[1], Y[0])); + poly.append(B2DPoint(X[1], Y[1])); poly.append(B2DPoint(X[0], Y[1])); + poly.append(B2DPoint(X[0], Y[0])); + + if (drawFrame) + dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE); + else + dev->DrawPolygon(poly); + } + + //-------------------- draws an ellipse -------------------- + void drawEllipse(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &pSize) { + int penSize=(pSize.Width()+pSize.Height())/2; + Rectangle oval = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); + using namespace basegfx; + double const X[2] = { oval.Left(), oval.Right() }; + double const Y[2] = { oval.Top(), oval.Bottom() }; + B2DPoint center(0.5*(X[1]+X[0]), 0.5*(Y[1]+Y[0])); + B2DPolygon poly = tools::createPolygonFromEllipse(center, 0.5*(X[1]-X[0]), 0.5*(Y[1]-Y[0])); + if (drawFrame) + dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE); + else + dev->DrawPolygon(poly); + } + + //-------------------- draws an arc/pie -------------------- + void drawArc(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, const double& angle1, const double& angle2, Size const &pSize) { + int penSize=(pSize.Width()+pSize.Height())/2; + Rectangle arc = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); + using namespace basegfx; + + double const PI2 = M_PI/2.0; + // pict angle are CW with 0 at twelve oclock ( with Y-axis inverted)... + double angl1 = angle1-PI2; + double angl2 = angle2-PI2; + double const X[2] = { arc.Left(), arc.Right() }; + double const Y[2] = { arc.Top(), arc.Bottom() }; + B2DPoint center(0.5*(X[1]+X[0]), 0.5*(Y[1]+Y[0])); + + // We must have angl1 between 0 and F_2PI + while (angl1 < 0.0) { angl1 += F_2PI; angl2 += F_2PI; } + while (angl1 >= F_2PI) { angl1 -= F_2PI; angl2 -= F_2PI; } + + // if this happen, we want a complete circle + // so we set angl2 slightly less than angl1 + if (angl2 >= angl1+F_2PI) angl2 = angl1-0.001; + + // We must have angl2 between 0 and F_2PI + while (angl2 < 0.0) angl2 += F_2PI; + while (angl2 >= F_2PI) angl2 -= F_2PI; + + B2DPolygon poly = tools::createPolygonFromEllipseSegment(center, 0.5*(X[1]-X[0]), 0.5*(Y[1]-Y[0]), angl1, angl2); + if (drawFrame) + dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE); + else { + // adds circle's center + poly.append(center); + dev->DrawPolygon(poly); + } + } + //-------------------- draws a rectangle with round corner -------------------- + void drawRoundRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &ovalSize, Size const &pSize) { + int penSize=(pSize.Width()+pSize.Height())/2; + Rectangle oval = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); + int ovalW=ovalSize.Width(), ovalH=ovalSize.Height(); + using namespace basegfx; + double const X[2] = { oval.Left(), oval.Right() }; + double const Y[2] = { oval.Top(), oval.Bottom() }; + double width = X[1] - X[0]; + double height = Y[1] - Y[0]; + if (ovalW > width) ovalW = width; + if (ovalH > height) ovalH = height; + + B2DRectangle rect(B2DPoint(X[0],Y[0]), B2DPoint(X[1],Y[1])); + B2DPolygon poly = tools::createPolygonFromRect(rect, (width != 0.0) ? ovalW/width : 0.0, (height != 0.0) ? ovalH/height : 0.0); + + if (drawFrame) + dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE); + else + dev->DrawPolygon(poly); + } + + //-------------------- draws a polygon -------------------- + void drawPolygon(VirtualDevice *dev, bool drawFrame, Polygon const &orig, Size const &pSize) { + int penSize=(pSize.Width()+pSize.Height())/2; + int decalTL[2] = {0, 0}, decalBR[2] = { pSize.Width(), pSize.Height()}; + if (drawFrame) { + decalTL[0] += penSize/2; decalTL[1] += penSize/2; + decalBR[0] -= (penSize+1)/2; decalBR[1] -= (penSize+1)/2; + } + // Quickdraw Drawing Reference 3-82: the pen size is only used for frame + else decalBR[0] = decalBR[1] = 0.0; + + + int numPt = orig.GetSize(); + if (numPt <= 1) return; + + // we compute a barycenter of the point to define the extended direction of each point + double bary[2] = { 0.0, 0.0 }; + for (int i = 0; i < numPt; i++) { + Point const &pt = orig.GetPoint(i); + bary[0] += double(pt.X()); bary[1] += double(pt.Y()); + } + bary[0]/=double(numPt); bary[1]/=double(numPt); + + using namespace basegfx; + B2DPolygon poly; + // Note: a polygon can be open, so we must not close it when we draw the frame + for (int i = 0; i < numPt; i++) { + Point const &pt = orig.GetPoint(i); + double x = (double(pt.X()) < bary[0]) ? pt.X()+decalTL[0] : pt.X()+decalBR[0]; + double y = (double(pt.Y()) < bary[1]) ? pt.Y()+decalTL[1] : pt.Y()+decalBR[1]; + poly.append(B2DPoint(x, y)); + } + if (drawFrame) + dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE); + else + dev->DrawPolygon(poly); + } + + +} diff --git a/filter/source/graphicfilter/ipict/shape.hxx b/filter/source/graphicfilter/ipict/shape.hxx new file mode 100755 index 000000000000..635a7cf06c1e --- /dev/null +++ b/filter/source/graphicfilter/ipict/shape.hxx @@ -0,0 +1,60 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include + +namespace PictReaderShape { + /** draws a line from orig to dest knowing penSize + + Attention: in order to draw horizontal/vertical/small lines, this function can instead draw a rectangle or + a polygon. In this case, we retrieve the line informations from VirtualDev ( GetLineColor ) + and we use them as fill informations ( SetFillColor ). We restore after the VirtualDev state. + + This implies also that this function must be modified if we use real pattern to draw these primitives. + */ + void drawLine(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize); + + /** draws a rectangle knowing penSize */ + void drawRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &rect, Size const &pSize); + + /** draws a polygon knowing penSize */ + void drawPolygon(VirtualDevice *dev, bool drawFrame, Polygon const &rect, Size const &pSize); + + /** draws an ellipse knowing penSize */ + void drawEllipse(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &pSize); + + /** draws a rounded rectangle knowing penSize + \note ovalSize is two time the size of the corner + */ + void drawRoundRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &ovalS, Size const &pSize); + + /** draws an arc in a b2dpolygon knowing penSize + \note - it supposes that angl1 < angl2 + */ + void drawArc(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, const double& angle1, const double& angle2, Size const &pSize); +} -- cgit From 6bb902fec45a524b16739263171ac32555e2c29f Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Tue, 30 Nov 2010 16:27:00 +0100 Subject: impressdefaults1: #i1113# also set copy while moving to true for draw --- officecfg/registry/schema/org/openoffice/Office/Draw.xcs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs index 7a6c649474ee..cdddf50d09b7 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs @@ -282,7 +282,7 @@ Indicates whether moving while holding the Control key makes a copy of the moved object. - false + true -- cgit From a2fa4ea9d8cf51b3cda79d135cafc6fa0031937e Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Tue, 30 Nov 2010 16:49:41 +0100 Subject: impressdefaults1: #i113015# #i113017# new defaults for shape filling, outline and shadows --- sd/source/core/drawdoc4.cxx | 20 ++++----- sd/source/core/stlpool.cxx | 4 +- sd/source/ui/func/fuconstr.cxx | 92 +++++++++++++++++++++++++++++------------- 3 files changed, 76 insertions(+), 40 deletions(-) diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 66700ace924b..c3fb301a0fc3 100755 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -163,7 +163,7 @@ void SdDrawDocument::CreateLayoutTemplates() String aNullStr; ::basegfx::B2DPolyPolygon aNullPolyPolygon; - Color aNullCol(RGB_Color(COL_BLACK)); + Color aNullCol(RGB_Color(COL_DEFAULT_SHAPE_STROKE)); XDash aNullDash; XGradient aNullGrad(aNullCol,RGB_Color(COL_WHITE)); @@ -173,20 +173,20 @@ void SdDrawDocument::CreateLayoutTemplates() // Linienattribute (Extended OutputDevice) rISet.Put(XLineStyleItem(XLINE_SOLID)); - rISet.Put(XLineColorItem(String(), RGB_Color(COL_BLACK))); + rISet.Put(XLineColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_STROKE))); rISet.Put(XLineWidthItem(0)); rISet.Put(XLineDashItem(pPool,aNullDash)); rISet.Put(XLineStartItem(pPool,aNullPolyPolygon)); rISet.Put(XLineEndItem(pPool,aNullPolyPolygon)); - rISet.Put(XLineStartWidthItem(300)); - rISet.Put(XLineEndWidthItem(300)); + rISet.Put(XLineStartWidthItem(200)); + rISet.Put(XLineEndWidthItem(200)); rISet.Put(XLineStartCenterItem()); rISet.Put(XLineEndCenterItem()); rISet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK)); // Fuellattribute (Extended OutputDevice) rISet.Put(XFillStyleItem(XFILL_SOLID)); - rISet.Put(XFillColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_FILLING))); // "Blue 8" + rISet.Put(XFillColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_FILLING))); rISet.Put(XFillGradientItem(pPool,aNullGrad)); rISet.Put(XFillHatchItem(pPool,aNullHatch)); @@ -199,8 +199,8 @@ void SdDrawDocument::CreateLayoutTemplates() // Schattenattribute (Drawing Engine) rISet.Put(SdrShadowItem(FALSE)); rISet.Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY))); - rISet.Put(SdrShadowXDistItem(300)); // 3 mm Schattendistanz - rISet.Put(SdrShadowYDistItem(300)); + rISet.Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz + rISet.Put(SdrShadowYDistItem(200)); Font aLatinFont, aCJKFont, aCTLFont; @@ -311,8 +311,8 @@ void SdDrawDocument::CreateLayoutTemplates() pISet->Put(SdrShadowItem(TRUE)); pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY))); - pISet->Put(SdrShadowXDistItem(300)); // 3 mm Schattendistanz - pISet->Put(SdrShadowYDistItem(300)); + pISet->Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz + pISet->Put(SdrShadowYDistItem(200)); // ---- Objekt ohne Fllung ------------------------------------------- @@ -323,6 +323,7 @@ void SdDrawDocument::CreateLayoutTemplates() pISet = &pSheet->GetItemSet(); pISet->Put(XFillStyleItem(XFILL_NONE)); + pISet->Put(XLineColorItem(String(), RGB_Color(COL_BLACK))); // ---- Text ---------------------------------------------------------- @@ -514,6 +515,7 @@ void SdDrawDocument::CreateLayoutTemplates() pISet = &pSheet->GetItemSet(); pISet->Put(XFillStyleItem(XFILL_NONE)); + pISet->Put(XLineColorItem(String(), RGB_Color(COL_BLACK))); pISet->Put(SvxFontHeightItem(423, 100, EE_CHAR_FONTHEIGHT )); // 12 pt diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index aaf594ce509d..0194e2f1d989 100755 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -519,8 +519,8 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo SfxItemSet& rBackgroundObjectsSet = pSheet->GetItemSet(); rBackgroundObjectsSet.Put(SdrShadowItem(FALSE)); rBackgroundObjectsSet.Put(SdrShadowColorItem(String(), Color(COL_GRAY))); - rBackgroundObjectsSet.Put(SdrShadowXDistItem(300)); // 3 mm Schattendistanz - rBackgroundObjectsSet.Put(SdrShadowYDistItem(300)); + rBackgroundObjectsSet.Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz + rBackgroundObjectsSet.Put(SdrShadowYDistItem(200)); // #i16874# enable kerning by default but only for new documents rBackgroundObjectsSet.Put( SvxAutoKernItem( TRUE, EE_CHAR_PAIRKERNING ) ); rBackgroundObjectsSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK)); diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx index c0d8235e97fb..a1ab9b853ff4 100755 --- a/sd/source/ui/func/fuconstr.cxx +++ b/sd/source/ui/func/fuconstr.cxx @@ -312,40 +312,74 @@ void FuConstruct::SetStyleSheet(SfxItemSet& rAttr, SdrObject* pObj) sal_Bool bUseFillStyle, bUseNoFillStyle; bUseFillStyle = bUseNoFillStyle = sal_False; - if (nSlotId == SID_DRAW_RECT || // Rechteck - nSlotId == SID_DRAW_RECT_ROUND || // Rechteck, rund - nSlotId == SID_DRAW_SQUARE || // Quadrat - nSlotId == SID_DRAW_SQUARE_ROUND || // Quadrat, rund - nSlotId == SID_DRAW_ELLIPSE || // Ellipse - nSlotId == SID_DRAW_PIE || // Ellipsensegment - nSlotId == SID_DRAW_ELLIPSECUT || // Ellipsenabschnitt - nSlotId == SID_DRAW_CIRCLE || // Kreis - nSlotId == SID_DRAW_CIRCLEPIE || // Kreissegment - nSlotId == SID_DRAW_CIRCLECUT || // Ellipsenabschnitt - nSlotId == SID_DRAW_POLYGON || // Polygon - nSlotId == SID_DRAW_XPOLYGON || // 45ø-Polygon - nSlotId == SID_DRAW_FREELINE || // Freihandlinie - nSlotId == SID_DRAW_BEZIER_FILL) // Bezier + switch( nSlotId ) + { + case SID_DRAW_RECT: + case SID_DRAW_RECT_ROUND: + case SID_DRAW_SQUARE: + case SID_DRAW_SQUARE_ROUND: + case SID_DRAW_ELLIPSE: + case SID_DRAW_PIE: + case SID_DRAW_ELLIPSECUT: + case SID_DRAW_CIRCLE: + case SID_DRAW_CIRCLEPIE: + case SID_DRAW_CIRCLECUT: + case SID_DRAW_POLYGON: + case SID_DRAW_XPOLYGON: + case SID_DRAW_FREELINE: + case SID_DRAW_BEZIER_FILL: { bUseFillStyle = sal_True; + break; } - else if - (nSlotId == SID_DRAW_RECT_NOFILL || // Rechteck - nSlotId == SID_DRAW_RECT_ROUND_NOFILL || // Rechteck, rund - nSlotId == SID_DRAW_SQUARE_NOFILL || // Quadrat - nSlotId == SID_DRAW_SQUARE_ROUND_NOFILL || // Quadrat, rund - nSlotId == SID_DRAW_ELLIPSE_NOFILL || // Ellipse - nSlotId == SID_DRAW_PIE_NOFILL || // Ellipsensegment - nSlotId == SID_DRAW_ELLIPSECUT_NOFILL || // Ellipsenabschnitt - nSlotId == SID_DRAW_CIRCLE_NOFILL || // Kreis - nSlotId == SID_DRAW_CIRCLEPIE_NOFILL || // Kreissegment - nSlotId == SID_DRAW_CIRCLECUT_NOFILL || // Ellipsenabschnitt - nSlotId == SID_DRAW_POLYGON_NOFILL || // Polygon - nSlotId == SID_DRAW_XPOLYGON_NOFILL || // 45ø-Polygon - nSlotId == SID_DRAW_FREELINE_NOFILL || // Freihandlinie - nSlotId == SID_DRAW_BEZIER_NOFILL) // Bezier + case SID_DRAW_RECT_NOFILL: + case SID_DRAW_RECT_ROUND_NOFILL: + case SID_DRAW_SQUARE_NOFILL: + case SID_DRAW_SQUARE_ROUND_NOFILL: + case SID_DRAW_ELLIPSE_NOFILL: + case SID_DRAW_PIE_NOFILL: + case SID_DRAW_ELLIPSECUT_NOFILL: + case SID_DRAW_CIRCLE_NOFILL: + case SID_DRAW_CIRCLEPIE_NOFILL: + case SID_DRAW_CIRCLECUT_NOFILL: + case SID_DRAW_POLYGON_NOFILL: + case SID_DRAW_XPOLYGON_NOFILL: + case SID_DRAW_FREELINE_NOFILL: + case SID_DRAW_LINE: + case SID_DRAW_XLINE: + case SID_CONNECTOR_ARROW_START: + case SID_CONNECTOR_ARROW_END: + case SID_CONNECTOR_ARROWS: + case SID_CONNECTOR_CIRCLE_START: + case SID_CONNECTOR_CIRCLE_END: + case SID_CONNECTOR_CIRCLES: + case SID_CONNECTOR_LINE: + case SID_CONNECTOR_LINE_ARROW_START: + case SID_CONNECTOR_LINE_ARROW_END: + case SID_CONNECTOR_LINE_ARROWS: + case SID_CONNECTOR_LINE_CIRCLE_START: + case SID_CONNECTOR_LINE_CIRCLE_END: + case SID_CONNECTOR_LINE_CIRCLES: + case SID_CONNECTOR_CURVE: + case SID_CONNECTOR_CURVE_ARROW_START: + case SID_CONNECTOR_CURVE_ARROW_END: + case SID_CONNECTOR_CURVE_ARROWS: + case SID_CONNECTOR_CURVE_CIRCLE_START: + case SID_CONNECTOR_CURVE_CIRCLE_END: + case SID_CONNECTOR_CURVE_CIRCLES: + case SID_CONNECTOR_LINES: + case SID_CONNECTOR_LINES_ARROW_START: + case SID_CONNECTOR_LINES_ARROW_END: + case SID_CONNECTOR_LINES_ARROWS: + case SID_CONNECTOR_LINES_CIRCLE_START: + case SID_CONNECTOR_LINES_CIRCLE_END: + case SID_CONNECTOR_LINES_CIRCLES: + case SID_DRAW_BEZIER_NOFILL: + case SID_LINE_ARROW_END: { bUseNoFillStyle = sal_True; + break; + } } SetStyleSheet( rAttr, pObj, bUseFillStyle, bUseNoFillStyle ); } -- cgit From 431938ca53fa85bfb2e3352b9779b2a254c40119 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Tue, 30 Nov 2010 16:49:41 +0100 Subject: impressdefaults1: #i113015# #i113017# new defaults for shape filling, outline and shadows --- svx/inc/svx/xdef.hxx | 3 ++- svx/source/xoutdev/xpool.cxx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/svx/inc/svx/xdef.hxx b/svx/inc/svx/xdef.hxx index 963e4935c617..dd0fbd802291 100644 --- a/svx/inc/svx/xdef.hxx +++ b/svx/inc/svx/xdef.hxx @@ -36,7 +36,8 @@ |* \************************************************************************/ -#define COL_DEFAULT_SHAPE_FILLING RGB_COLORDATA( 153, 204, 255 ) // blue 8 +#define COL_DEFAULT_SHAPE_FILLING RGB_COLORDATA( 0xCF, 0xE7, 0xE5 ) +#define COL_DEFAULT_SHAPE_STROKE RGB_COLORDATA( 128, 128, 128 ) #define XATTR_START 1000 diff --git a/svx/source/xoutdev/xpool.cxx b/svx/source/xoutdev/xpool.cxx index 47dda35245a4..f9df4c435040 100644 --- a/svx/source/xoutdev/xpool.cxx +++ b/svx/source/xoutdev/xpool.cxx @@ -52,8 +52,8 @@ XOutdevItemPool::XOutdevItemPool( const XubString aNullStr; const Bitmap aNullBmp; const basegfx::B2DPolyPolygon aNullPol; - const Color aNullLineCol(RGB_Color(COL_BLACK)); - const Color aNullFillCol(RGB_Color(COL_DEFAULT_SHAPE_FILLING)); // "Blue 8" + const Color aNullLineCol(RGB_Color(COL_DEFAULT_SHAPE_STROKE)); + const Color aNullFillCol(RGB_Color(COL_DEFAULT_SHAPE_FILLING)); const Color aNullShadowCol(RGB_Color(COL_LIGHTGRAY)); const XDash aNullDash; const XGradient aNullGrad(aNullLineCol, RGB_Color(COL_WHITE)); -- cgit From f14e4435dc362d5f64b56adcfeccd29b69de3dd9 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Tue, 30 Nov 2010 16:49:41 +0100 Subject: impressdefaults1: #i113015# #i113017# new defaults for shape filling, outline and shadows --- extras/source/palettes/standard.soc | 1 + 1 file changed, 1 insertion(+) diff --git a/extras/source/palettes/standard.soc b/extras/source/palettes/standard.soc index b275e95f2cdb..83cffa5d8edd 100644 --- a/extras/source/palettes/standard.soc +++ b/extras/source/palettes/standard.soc @@ -49,6 +49,7 @@ + -- cgit From ef238fc51189b007d5c4b20b6139c78984e18be0 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Wed, 1 Dec 2010 10:02:17 +0100 Subject: impressdefaults1: #i113018# use red as default pen color, enable pen context menu --- sd/source/ui/slideshow/makefile.mk | 3 +-- sd/source/ui/slideshow/slideshow.src | 16 +++++------ sd/source/ui/slideshow/slideshowimpl.cxx | 31 ++++++---------------- sd/source/ui/slideshow/slideshowimpl.hxx | 5 +--- slideshow/source/engine/color.cxx | 4 ++- slideshow/source/engine/makefile.mk | 2 +- slideshow/source/engine/shapes/shapeimporter.cxx | 7 ----- slideshow/source/engine/slide/slideimpl.cxx | 7 ----- slideshow/source/engine/slide/userpaintoverlay.cxx | 2 +- slideshow/source/engine/slideshowimpl.cxx | 4 --- 10 files changed, 22 insertions(+), 59 deletions(-) mode change 100644 => 100755 sd/source/ui/slideshow/makefile.mk mode change 100644 => 100755 sd/source/ui/slideshow/slideshow.src diff --git a/sd/source/ui/slideshow/makefile.mk b/sd/source/ui/slideshow/makefile.mk old mode 100644 new mode 100755 index ad4f4d306c6b..62062d7e5461 --- a/sd/source/ui/slideshow/makefile.mk +++ b/sd/source/ui/slideshow/makefile.mk @@ -40,8 +40,7 @@ AUTOSEG=true .INCLUDE : $(PRJ)$/util$/makefile.pmk .IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES" -RSCDEFS+=-DENABLE_PRESENTER_EXTRA_UI -ADDCDEFS+=-DENABLE_PRESENTER_EXTRA_UI +ENABLE_PRESENTER_EXTRA_UI is not used anymore .ENDIF # --- Files -------------------------------------------------------- diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src old mode 100644 new mode 100755 index 02c225fb5ea9..0925ca6617f4 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -71,7 +71,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU { Separator = TRUE; }; -#ifdef ENABLE_PRESENTER_EXTRA_UI MenuItem { Identifier = CM_PEN_MODE; @@ -153,8 +152,8 @@ Menu RID_SLIDESHOW_CONTEXTMENU Identifier = CM_ERASE_INK_PEN; Text [ en-US ] = "~Eraser Width" ; - SubMenu = Menu - { + SubMenu = Menu + { ItemList = { MenuItem @@ -185,11 +184,10 @@ Menu RID_SLIDESHOW_CONTEXTMENU }; }; }; -#endif - MenuItem - { - Separator = TRUE; - }; + MenuItem + { + Separator = TRUE; + }; MenuItem { Identifier = CM_SCREEN; @@ -216,6 +214,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU { Identifier = CM_ENDSHOW ; Text [ en-US ] = "~End Show" ; - }; + }; }; }; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index ee89da143910..384f10cb61b6 100755 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -554,15 +554,12 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, , mbInputFreeze(false) , mbActive(sal_False) , maPresSettings( pDoc->getPresentationSettings() ) -, mnUserPaintColor( 0x00000000L ) //User paint color is Black by default -#ifdef ENABLE_PRESENTER_EXTRA_UI +, mnUserPaintColor( 0x80ff0000L ) , mbSwitchPenMode(true) , mbSwitchEraserMode(false) -, mdUserPaintStrokeWidth ( 4.0 ) +, mdUserPaintStrokeWidth ( 150.0 ) , mbEraseAllInk(false) -//, mbEraseInk(false) , mnEraseInkSize(100) -#endif , mnEntryCounter(0) , mnLastSlideNumber(-1) , msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ) @@ -1130,7 +1127,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) beans::PropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintColor") ), // User paint color is black by default. - -1, Any( static_cast(0x00000000L) ), + -1, Any( mnUserPaintColor ), beans::PropertyState_DIRECT_VALUE ) ); } @@ -1461,14 +1458,14 @@ void SlideshowImpl::displayCurrentSlide (const bool bSkipAllMainSequenceEffects) void SlideshowImpl::endPresentation() { -#ifdef ENABLE_PRESENTER_EXTRA_UI +/* if( maPresSettings.mbMouseAsPen) { Reference< XMultiServiceFactory > xDocFactory(mpDoc->getUnoModel(), UNO_QUERY ); if( xDocFactory.is() ) mxShow->registerUserPaintPolygons(xDocFactory); } -#endif +*/ if( !mnEndShowEvent ) mnEndShowEvent = Application::PostUserEvent( LINK(this, SlideshowImpl, endPresentationHdl) ); } @@ -2203,7 +2200,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) PopupMenu* pMenu = new PopupMenu( SdResId( RID_SLIDESHOW_CONTEXTMENU ) ); -#ifdef ENABLE_PRESENTER_EXTRA_UI //adding button to contextual menu for erasing functionnalities for UserPaintOverlay pMenu->EnableItem( CM_ERASE_ALLINK, (maPresSettings.mbMouseAsPen)); // Adding button to contextual menu for changing pen color @@ -2212,7 +2208,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) pMenu->EnableItem( CM_PEN_MODE, (maPresSettings.mbMouseAsPen)); // Adding button to displau if in Erase Mode pMenu->EnableItem( CM_ERASE_MODE, (maPresSettings.mbMouseAsPen)); -#endif const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); pMenu->EnableItem( CM_NEXT_SLIDE, ( mpSlideController->getNextSlideIndex() != -1 ) ); @@ -2280,7 +2275,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) pBlankMenu->CheckItem( ( mpShowWindow->GetBlankColor() == Color( COL_WHITE ) ) ? CM_SCREEN_WHITE : CM_SCREEN_BLACK ); } } -#ifdef ENABLE_PRESENTER_EXTRA_UI PopupMenu* pWidthMenu = pMenu->GetPopupMenu( CM_WIDTH_PEN); @@ -2378,7 +2372,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) } } } -#endif pMenu->SetSelectHdl( LINK( this, SlideshowImpl, ContextMenuSelectHdl ) ); pMenu->Execute( mpShowWindow, maPopupMousePos ); @@ -2442,7 +2435,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) } } break; -#ifdef ENABLE_PRESENTER_EXTRA_UI if( maPresSettings.mbMouseAsPen ) { case CM_COLOR_PEN: @@ -2548,7 +2540,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) } break; } -#endif case CM_ENDSHOW: // in case the user cancels the presentation, switch to current slide @@ -3166,7 +3157,6 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc aPenProp.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintColor" )); aPenProp.Value = aValue; mxShow->setProperty( aPenProp ); -#ifdef ENABLE_PRESENTER_EXTRA_UI //for StrokeWidth : Any aValueWidth; if( maPresSettings.mbMouseAsPen ) @@ -3196,7 +3186,6 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc aPenPropEraseAllInk.Value = aValueEraseAllInk; mxShow->setProperty( aPenPropEraseAllInk ); mbEraseAllInk = false; // sets to false so not to have it applied again -#endif } catch( Exception& e ) { @@ -3210,7 +3199,6 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc } } -#ifdef ENABLE_PRESENTER_EXTRA_UI void SAL_CALL SlideshowImpl::setUseEraser( sal_Bool bMouseAsPen ) throw (RuntimeException) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); @@ -3267,7 +3255,7 @@ void SAL_CALL SlideshowImpl::setPenWidth( double dStrokeWidth ) throw (RuntimeEx if( maPresSettings.mbMouseAsPen ) setUsePen( sal_True ); // update color and width } -#endif + // -------------------------------------------------------------------- sal_Int32 SAL_CALL SlideshowImpl::getPenColor() throw (RuntimeException) @@ -3282,15 +3270,12 @@ void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor ) throw (RuntimeExcep { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); mnUserPaintColor = nColor; -#ifdef ENABLE_PRESENTER_EXTRA_UI mbSwitchPenMode = true; mbSwitchEraserMode = !mbSwitchPenMode; -#endif if( maPresSettings.mbMouseAsPen ) setUsePen( sal_True ); // update color } -#ifdef ENABLE_PRESENTER_EXTRA_UI // -------------------------------------------------------------------- void SAL_CALL SlideshowImpl::setPenMode( bool bSwitchPenMode ) throw (RuntimeException) @@ -3312,7 +3297,7 @@ void SAL_CALL SlideshowImpl::setEraserMode(bool bSwitchEraserMode ) throw (Runti { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); mbSwitchEraserMode = bSwitchEraserMode; - if(mbSwitchEraserMode = true){ + if(mbSwitchEraserMode == true){ mbSwitchPenMode = false; }else{ mbSwitchPenMode = true; @@ -3346,7 +3331,7 @@ void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 nEraseInkSize ) throw (Runti if( maPresSettings.mbMouseAsPen ) setUseEraser( sal_True ); // update erase ink size } -#endif + // -------------------------------------------------------------------- // XSlideShowController Methods // -------------------------------------------------------------------- diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index cb33c4a740c7..5068f1cf06b4 100755 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -198,7 +198,6 @@ public: virtual void SAL_CALL setUsePen( ::sal_Bool _usepen ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getPenColor() throw (css::uno::RuntimeException); virtual void SAL_CALL setPenColor( ::sal_Int32 _pencolor ) throw (css::uno::RuntimeException); -#ifdef ENABLE_PRESENTER_EXTRA_UI virtual void SAL_CALL setUseEraser( ::sal_Bool _usepen ) throw (css::uno::RuntimeException); virtual double SAL_CALL getPenWidth() throw (css::uno::RuntimeException); virtual void SAL_CALL setPenWidth( double dStrokeWidth ) throw (css::uno::RuntimeException); @@ -206,7 +205,6 @@ public: virtual void SAL_CALL setEraseInk( sal_Int32 nEraseInkSize ) throw (css::uno::RuntimeException); virtual void SAL_CALL setPenMode( bool bSwitchPenMode) throw (css::uno::RuntimeException); virtual void SAL_CALL setEraserMode( bool bSwitchEraserMode ) throw (css::uno::RuntimeException); -#endif virtual ::sal_Bool SAL_CALL isRunning( ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getSlideCount( ) throw (css::uno::RuntimeException); virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getSlideByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException); @@ -396,14 +394,13 @@ private: PresentationSettings maPresSettings; sal_Int32 mnUserPaintColor; -#ifdef ENABLE_PRESENTER_EXTRA_UI bool mbSwitchPenMode; bool mbSwitchEraserMode; double mdUserPaintStrokeWidth; bool mbEraseAllInk; // bool mbEraseInk; sal_Int32 mnEraseInkSize; -#endif + /// used in updateHdl to prevent recursive calls sal_Int32 mnEntryCounter; diff --git a/slideshow/source/engine/color.cxx b/slideshow/source/engine/color.cxx index e49f8e7e1b63..7b60a463dd1c 100644 --- a/slideshow/source/engine/color.cxx +++ b/slideshow/source/engine/color.cxx @@ -267,7 +267,9 @@ namespace slideshow RGBColor::RGBColor(const RGBColor& rLHS) { - RGBColor(rLHS.getRed(), rLHS.getGreen(), rLHS.getBlue()); + maRGBTriple.mnRed = rLHS.getRed(); + maRGBTriple.mnGreen = rLHS.getGreen(); + maRGBTriple.mnBlue = rLHS.getBlue(); } RGBColor& RGBColor::operator=( const RGBColor& rLHS ){ diff --git a/slideshow/source/engine/makefile.mk b/slideshow/source/engine/makefile.mk index beac66778518..fdc99cd1ad9f 100644 --- a/slideshow/source/engine/makefile.mk +++ b/slideshow/source/engine/makefile.mk @@ -38,7 +38,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : $(PRJ)$/util$/makefile.pmk .IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES" -CDEFS+=-DENABLE_PRESENTER_EXTRA_UI +ENABLE_PRESENTER_EXTRA_UI is not used anymore .ENDIF # --- Common ---------------------------------------------------------- diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx index 1c90e45943d1..93dab2c780f3 100644 --- a/slideshow/source/engine/shapes/shapeimporter.cxx +++ b/slideshow/source/engine/shapes/shapeimporter.cxx @@ -646,20 +646,13 @@ ShapeImporter::ShapeImporter( uno::Reference const& sal_Int32 nOrdNumStart, bool bConvertingMasterPage ) : mxPage( xActualPage ), -#ifdef ENABLE_PRESENTER_EXTRA_UI mxPagesSupplier( xPagesSupplier ), -#else - mxPagesSupplier( NULL ), -#endif mrContext( rContext ), maPolygons(), maShapesStack(), mnAscendingPrio( nOrdNumStart ), mbConvertingMasterPage( bConvertingMasterPage ) { -#ifndef ENABLE_PRESENTER_EXTRA_UI - (void)xPagesSupplier; -#endif uno::Reference const xShapes( xPage, uno::UNO_QUERY_THROW ); maShapesStack.push( XShapesEntry(xShapes) ); diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 55831ba1609f..d976ad4d9697 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -454,9 +454,7 @@ void SlideImpl::dispose() mpShapeManager.reset(); mxRootNode.clear(); mxDrawPage.clear(); -#ifndef ENABLE_PRESENTER_EXTRA_UI mxDrawPagesSupplier.clear(); -#endif } bool SlideImpl::prefetch() @@ -1259,12 +1257,7 @@ SlideSharedPtr createSlide( const uno::Reference< drawing::XDrawPage >& bool bIntrinsicAnimationsAllowed, bool bDisableAnimationZOrder ) { -#ifdef ENABLE_PRESENTER_EXTRA_UI boost::shared_ptr pRet( new SlideImpl( xDrawPage, xDrawPages, xRootNode, rEventQueue, -#else - (void)xDrawPages; - boost::shared_ptr pRet( new SlideImpl( xDrawPage, NULL, xRootNode, rEventQueue, -#endif rEventMultiplexer, rScreenUpdater, rActivitiesQueue, rUserEventQueue, rCursorManager, rViewContainer, diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx index 8d9fad06a3e3..98166c1ee5cf 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.cxx +++ b/slideshow/source/engine/slide/userpaintoverlay.cxx @@ -156,7 +156,7 @@ namespace slideshow ++aIter ) { // fully clear view content to background color - (*aIter)->getCanvas()->clear(); + //(*aIter)->getCanvas()->clear(); //get via SlideImpl instance the bitmap of the slide unmodified to redraw it SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( (*aIter) ) ); diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index d736c3f52d64..83ce94a4a184 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -1112,11 +1112,7 @@ void SlideShowImpl::displaySlide( // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); -#ifdef ENABLE_PRESENTER_EXTRA_UI mxDrawPagesSupplier = xDrawPages; -#else - mxDrawPagesSupplier = NULL; -#endif stopShow(); // MUST call that: results in // maUserEventQueue.clear(). What's more, -- cgit From 54a2692d06dd358e195452111ac7136fa45d8f06 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 2 Dec 2010 11:04:17 +0100 Subject: fix pch --- sw/inc/pch/precompiled_sw.hxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index 9e86c1ec6110..f03629facd0c 100755 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -659,7 +659,6 @@ #include "unotools/pathoptions.hxx" #include "svl/poolitem.hxx" #include "svtools/prgsbar.hxx" -#include "svtools/printdlg.hxx" #include "svtools/prnsetup.hxx" #include "svl/ptitem.hxx" #include "svl/rectitem.hxx" -- cgit From 9dba5eaadeba2789c6b9f563c9e148a7ac50c679 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 2 Dec 2010 11:04:17 +0100 Subject: fix pch --- sd/inc/pch/precompiled_sd.hxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx index dd874680e887..44dc28d64d73 100755 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.hxx @@ -530,7 +530,6 @@ #include "unotools/pathoptions.hxx" #include "svl/poolitem.hxx" #include "svtools/prgsbar.hxx" -#include "svtools/printdlg.hxx" #include "svl/ptitem.hxx" #include "svl/rectitem.hxx" #include "unotools/saveopt.hxx" -- cgit From c79a8e5b49efcace06ae56b00d435481cbd59c90 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 13:28:04 +0100 Subject: impressdefaults1: #i113019# lazy delete static canvas factory --- vcl/inc/vcl/lazydelete.hxx | 34 ++++++++++++++++++++++++++++++++++ vcl/source/window/window.cxx | 13 ++++++++----- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/vcl/inc/vcl/lazydelete.hxx b/vcl/inc/vcl/lazydelete.hxx index 4176d5b4454f..ab39147d03de 100644 --- a/vcl/inc/vcl/lazydelete.hxx +++ b/vcl/inc/vcl/lazydelete.hxx @@ -39,6 +39,8 @@ #include #endif +#include + namespace vcl { /* Helpers for lazy object deletion @@ -256,6 +258,38 @@ namespace vcl // ownership is transfered ! T* set( T* i_pNew ) { T* pOld = m_pT; m_pT = i_pNew; return pOld; } }; + + /** Similar to DeleteOnDeinit, the DeleteUnoReferenceOnDeinit + template class makes sure that a static UNO object is disposed + and released at the right time. + + Use like + static DeleteUnoReferenceOnDeinit + xStaticFactory (); + Reference xFactory (xStaticFactory.get()); + if (xFactory.is()) + + */ + template + class DeleteUnoReferenceOnDeinit : public ::vcl::DeleteOnDeinitBase + { + ::com::sun::star::uno::Reference m_xI; + virtual void doCleanup() { set(NULL); } + public: + DeleteUnoReferenceOnDeinit(const ::com::sun::star::uno::Reference& r_xI ) : m_xI( r_xI ) { + addDeinitContainer( this ); } + virtual ~DeleteUnoReferenceOnDeinit() {} + + ::com::sun::star::uno::Reference get (void) { return m_xI; } + + void set (const ::com::sun::star::uno::Reference& r_xNew ) + { + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> xComponent (m_xI, UNO_QUERY); + m_xI.clear(); + if (xComponent.is()) + xComponent->dispose(); + } + }; } #endif diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 77da205131ea..a1941bc5a1f6 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -9702,11 +9702,14 @@ Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSi // ========================================= if ( xFactory.is() ) { - static Reference xCanvasFactory( - xFactory->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star." - "rendering.CanvasFactory") ) ), UNO_QUERY ); + static ::vcl::DeleteUnoReferenceOnDeinit xStaticCanvasFactory( + Reference( + xFactory->createInstance( + OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.rendering.CanvasFactory") ) ), + UNO_QUERY )); + uno::Reference xCanvasFactory(xStaticCanvasFactory.get()); + if(xCanvasFactory.is()) { #ifdef WNT -- cgit From 119d17832036dd7430a15a1aa1e7d2ad7ebd9a7e Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 13:30:12 +0100 Subject: impressdefaults1: #i113019# new config entries for slideshow pen width and color --- .../schema/org/openoffice/Office/Impress.xcs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs index afcee251e91a..36bd09dcdbd1 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs @@ -537,6 +537,29 @@ 0 + + + + + + CL + Color of the pen during slideshow. + + + 16711680 + + + + + + + CL + Width of the pen during slideshow. + + + 150 + + Contains text editing related configuration items. -- cgit From 4f84e7bb10c7418472bceb5083ddc1302c9bcf2d Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 2 Dec 2010 13:30:14 +0100 Subject: vcl117: #i115056# fix dialog HelpID --- vcl/source/src/print.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src index 5a6a0964101c..dcc780f99b72 100644 --- a/vcl/source/src/print.src +++ b/vcl/source/src/print.src @@ -29,7 +29,7 @@ ModalDialog SV_DLG_PRINT { - HelpID = "vcl:ModalDialog:SV_DLG_PRINT"; + HelpID = ".HelpId:vcl:PrintDialog:Dialog"; Text [en-US] = "Print"; Closeable = TRUE; Sizeable = TRUE; -- cgit From a62d5eead2e06ace92395f0c4e2efa73c0c0988c Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 13:31:38 +0100 Subject: impressdefaults1: #i113019# fixed image for slot ShowAnnotations --- .../res/commandimagelist/lc_showannotation.png | Bin 4154 -> 0 bytes .../res/commandimagelist/lc_showannotations.png | Bin 0 -> 4154 bytes .../res/commandimagelist/lch_showannotation.png | Bin 3628 -> 0 bytes .../res/commandimagelist/lch_showannotations.png | Bin 0 -> 3628 bytes .../res/commandimagelist/sc_showannotation.png | Bin 3879 -> 0 bytes .../res/commandimagelist/sc_showannotations.png | Bin 0 -> 3879 bytes .../res/commandimagelist/sch_showannotation.png | Bin 3611 -> 0 bytes .../res/commandimagelist/sch_showannotations.png | Bin 0 -> 3611 bytes 8 files changed, 0 insertions(+), 0 deletions(-) delete mode 100755 default_images/res/commandimagelist/lc_showannotation.png create mode 100755 default_images/res/commandimagelist/lc_showannotations.png delete mode 100755 default_images/res/commandimagelist/lch_showannotation.png create mode 100755 default_images/res/commandimagelist/lch_showannotations.png delete mode 100755 default_images/res/commandimagelist/sc_showannotation.png create mode 100755 default_images/res/commandimagelist/sc_showannotations.png delete mode 100755 default_images/res/commandimagelist/sch_showannotation.png create mode 100755 default_images/res/commandimagelist/sch_showannotations.png diff --git a/default_images/res/commandimagelist/lc_showannotation.png b/default_images/res/commandimagelist/lc_showannotation.png deleted file mode 100755 index dd3d968a8faf..000000000000 Binary files a/default_images/res/commandimagelist/lc_showannotation.png and /dev/null differ diff --git a/default_images/res/commandimagelist/lc_showannotations.png b/default_images/res/commandimagelist/lc_showannotations.png new file mode 100755 index 000000000000..dd3d968a8faf Binary files /dev/null and b/default_images/res/commandimagelist/lc_showannotations.png differ diff --git a/default_images/res/commandimagelist/lch_showannotation.png b/default_images/res/commandimagelist/lch_showannotation.png deleted file mode 100755 index b298f8cf843d..000000000000 Binary files a/default_images/res/commandimagelist/lch_showannotation.png and /dev/null differ diff --git a/default_images/res/commandimagelist/lch_showannotations.png b/default_images/res/commandimagelist/lch_showannotations.png new file mode 100755 index 000000000000..b298f8cf843d Binary files /dev/null and b/default_images/res/commandimagelist/lch_showannotations.png differ diff --git a/default_images/res/commandimagelist/sc_showannotation.png b/default_images/res/commandimagelist/sc_showannotation.png deleted file mode 100755 index 4b987016b68b..000000000000 Binary files a/default_images/res/commandimagelist/sc_showannotation.png and /dev/null differ diff --git a/default_images/res/commandimagelist/sc_showannotations.png b/default_images/res/commandimagelist/sc_showannotations.png new file mode 100755 index 000000000000..4b987016b68b Binary files /dev/null and b/default_images/res/commandimagelist/sc_showannotations.png differ diff --git a/default_images/res/commandimagelist/sch_showannotation.png b/default_images/res/commandimagelist/sch_showannotation.png deleted file mode 100755 index cd3155082eed..000000000000 Binary files a/default_images/res/commandimagelist/sch_showannotation.png and /dev/null differ diff --git a/default_images/res/commandimagelist/sch_showannotations.png b/default_images/res/commandimagelist/sch_showannotations.png new file mode 100755 index 000000000000..cd3155082eed Binary files /dev/null and b/default_images/res/commandimagelist/sch_showannotations.png differ -- cgit From c5ef5762391ce310884567b3eaa3b474e1aaab9b Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 13:34:17 +0100 Subject: impressdefaults1: #i113019# fixes to make changing of user paint settings during slideshow work --- slideshow/source/engine/slide/slideimpl.cxx | 43 ++++++++--- slideshow/source/engine/slide/userpaintoverlay.cxx | 89 +++++++++++++++++----- slideshow/source/engine/slide/userpaintoverlay.hxx | 9 ++- slideshow/source/engine/slideshowimpl.cxx | 50 ++++-------- slideshow/source/inc/slide.hxx | 7 +- slideshow/util/makefile.pmk | 2 +- 6 files changed, 133 insertions(+), 67 deletions(-) diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index d976ad4d9697..2534b495ca90 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -139,6 +139,10 @@ public: virtual PolyPolygonVector getPolygons(); virtual void drawPolygons() const; virtual bool isPaintOverlayActive() const; + virtual void enablePaintOverlay(); + virtual void disablePaintOverlay(); + virtual void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ); + // TODO(F2): Rework SlideBitmap to no longer be based on XBitmap, // but on canvas-independent basegfx bitmaps @@ -156,6 +160,9 @@ private: virtual bool requestCursor( sal_Int16 nCursorShape ); virtual void resetCursor(); + void activatePaintOverlay(); + void deactivatePaintOverlay(); + /** Query whether the slide has animations at all If the slide doesn't have animations, show() displays @@ -174,9 +181,6 @@ private: */ bool isShowing() const; - void enablePaintOverlay(); - void disablePaintOverlay(); - /// Set all Shapes to their initial attributes for slideshow bool applyInitialShapeAttributes( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xRootAnimationNode ); @@ -419,6 +423,13 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra maContext.mrScreenUpdater.addViewUpdate(mpShapeManager); } +void SlideImpl::update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) +{ + maUserPaintColor = aUserPaintColor; + mdUserPaintStrokeWidth = dUserPaintStrokeWidth; + mbUserPaintOverlayEnabled = bUserPaintEnabled; +} + SlideImpl::~SlideImpl() { if( mpShapeManager ) @@ -540,7 +551,7 @@ bool SlideImpl::show( bool bSlideBackgoundPainted ) // --------------------------------------------------------------- // enable paint overlay, if maUserPaintColor is valid - enablePaintOverlay(); + activatePaintOverlay(); // --------------------------------------------------------------- @@ -564,7 +575,7 @@ void SlideImpl::hide() // disable user paint overlay under all circumstances, // this slide now ceases to be active. - disablePaintOverlay(); + deactivatePaintOverlay(); // --------------------------------------------------------------- @@ -886,19 +897,33 @@ bool SlideImpl::implPrefetchShow() void SlideImpl::enablePaintOverlay() { - if( mbUserPaintOverlayEnabled ) + if( !mbUserPaintOverlayEnabled || !mbPaintOverlayActive ) + { + mbUserPaintOverlayEnabled = true; + activatePaintOverlay(); + } +} + +void SlideImpl::disablePaintOverlay() +{ +} + +void SlideImpl::activatePaintOverlay() +{ + if( mbUserPaintOverlayEnabled || !maPolygons.empty() ) { mpPaintOverlay = UserPaintOverlay::create( maUserPaintColor, mdUserPaintStrokeWidth, maContext, - maPolygons ); + maPolygons, + mbUserPaintOverlayEnabled ); mbPaintOverlayActive = true; } } void SlideImpl::drawPolygons() const { - if( mbUserPaintOverlayEnabled ) + if( mpPaintOverlay ) mpPaintOverlay->drawPolygons(); } @@ -921,7 +946,7 @@ bool SlideImpl::isPaintOverlayActive() const return mbPaintOverlayActive; } -void SlideImpl::disablePaintOverlay() +void SlideImpl::deactivatePaintOverlay() { if(mbPaintOverlayActive) maPolygons = mpPaintOverlay->getPolygons(); diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx index 98166c1ee5cf..d0ab4e33a1e3 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.cxx +++ b/slideshow/source/engine/slide/userpaintoverlay.cxx @@ -70,8 +70,9 @@ namespace slideshow ActivitiesQueue& rActivitiesQueue, ScreenUpdater& rScreenUpdater, const UnoViewContainer& rViews, - Slide& rSlide, - const PolyPolygonVector& rPolygons ) : + Slide& rSlide, + const PolyPolygonVector& rPolygons, + bool bActive ) : mrActivitiesQueue( rActivitiesQueue ), mrScreenUpdater( rScreenUpdater ), maViews(), @@ -87,7 +88,8 @@ namespace slideshow //handle the "remove stroke by stroke" mode of erasing mbIsEraseModeActivated( false ), mrSlide(rSlide), - mnSize(100) + mnSize(100), + mbActive( bActive ) { std::for_each( rViews.begin(), rViews.end(), @@ -129,6 +131,8 @@ namespace slideshow bool colorChanged( RGBColor const& rUserColor ) { + mbIsLastPointValid = false; + mbActive = true; this->maStrokeColor = rUserColor; this->mbIsEraseModeActivated = false; return true; @@ -141,15 +145,8 @@ namespace slideshow return true; } - bool eraseAllInkChanged( bool const& rEraseAllInk ) + void repaintWithoutPolygons() { - this->mbIsEraseAllModeActivated= rEraseAllInk; - // if the erase all mode is activated it will remove all ink from slide, - // therefor destroy all the polygons stored - if(mbIsEraseAllModeActivated) - { - // The Erase Mode should be desactivated - mbIsEraseModeActivated = false; // must get access to the instance to erase all polygon for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end(); aIter!=aEnd; @@ -181,7 +178,19 @@ namespace slideshow mrScreenUpdater.notifyUpdate(*aIter,true); } - maPolygons.clear(); + } + + bool eraseAllInkChanged( bool const& rEraseAllInk ) + { + this->mbIsEraseAllModeActivated= rEraseAllInk; + // if the erase all mode is activated it will remove all ink from slide, + // therefor destroy all the polygons stored + if(mbIsEraseAllModeActivated) + { + // The Erase Mode should be desactivated + mbIsEraseModeActivated = false; + repaintWithoutPolygons(); + maPolygons.clear(); } mbIsEraseAllModeActivated=false; return true; @@ -198,18 +207,25 @@ namespace slideshow bool switchPenMode() { + mbIsLastPointValid = false; + mbActive = true; this->mbIsEraseModeActivated = false; return true; } bool switchEraserMode() { + mbIsLastPointValid = false; + mbActive = true; this->mbIsEraseModeActivated = true; return true; } bool disable() { + mbIsLastPointValid = false; + mbIsLastMouseDownPosValid = false; + mbActive = false; return true; } @@ -235,6 +251,9 @@ namespace slideshow // MouseEventHandler methods virtual bool handleMousePressed( const awt::MouseEvent& e ) { + if( !mbActive ) + return false; + if (e.Buttons == awt::MouseButton::RIGHT) { mbIsLastPointValid = false; @@ -255,6 +274,9 @@ namespace slideshow virtual bool handleMouseReleased( const awt::MouseEvent& e ) { + if( !mbActive ) + return false; + if (e.Buttons == awt::MouseButton::RIGHT) { mbIsLastPointValid = false; @@ -289,6 +311,9 @@ namespace slideshow virtual bool handleMouseEntered( const awt::MouseEvent& e ) { + if( !mbActive ) + return false; + mbIsLastPointValid = true; maLastPoint.setX( e.X ); maLastPoint.setY( e.Y ); @@ -298,6 +323,9 @@ namespace slideshow virtual bool handleMouseExited( const awt::MouseEvent& ) { + if( !mbActive ) + return false; + mbIsLastPointValid = false; mbIsLastMouseDownPosValid = false; @@ -306,7 +334,16 @@ namespace slideshow virtual bool handleMouseDragged( const awt::MouseEvent& e ) { - if(mbIsEraseModeActivated) + if( !mbActive ) + return false; + + if (e.Buttons == awt::MouseButton::RIGHT) + { + mbIsLastPointValid = false; + return false; + } + + if(mbIsEraseModeActivated) { //define the last point as an object //we suppose that there's no way this point could be valid @@ -421,6 +458,14 @@ namespace slideshow } + void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) + { + maStrokeColor = aUserPaintColor; + mnStrokeWidth = dUserPaintStrokeWidth; + mbActive = bUserPaintEnabled; + if( !mbActive ) + disable(); + } private: ActivitiesQueue& mrActivitiesQueue; @@ -438,17 +483,20 @@ namespace slideshow bool mbIsEraseModeActivated; Slide& mrSlide; sal_Int32 mnSize; + bool mbActive; }; UserPaintOverlaySharedPtr UserPaintOverlay::create( const RGBColor& rStrokeColor, double nStrokeWidth, const SlideShowContext& rContext, - const PolyPolygonVector& rPolygons ) + const PolyPolygonVector& rPolygons, + bool bActive ) { UserPaintOverlaySharedPtr pRet( new UserPaintOverlay( rStrokeColor, nStrokeWidth, rContext, - rPolygons )); + rPolygons, + bActive)); return pRet; } @@ -456,7 +504,8 @@ namespace slideshow UserPaintOverlay::UserPaintOverlay( const RGBColor& rStrokeColor, double nStrokeWidth, const SlideShowContext& rContext, - const PolyPolygonVector& rPolygons ) : + const PolyPolygonVector& rPolygons, + bool bActive ) : mpHandler( new PaintOverlayHandler( rStrokeColor, nStrokeWidth, rContext.mrActivitiesQueue, @@ -464,7 +513,7 @@ namespace slideshow rContext.mrViewContainer, //adding a link to Slide dynamic_cast(rContext.mrCursorManager), - rPolygons )), + rPolygons, bActive )), mrMultiplexer( rContext.mrEventMultiplexer ) { mrMultiplexer.addClickHandler( mpHandler, 3.0 ); @@ -483,6 +532,12 @@ namespace slideshow mpHandler->drawPolygons(); } + void UserPaintOverlay::update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) + { + mpHandler->update_settings( bUserPaintEnabled, aUserPaintColor, dUserPaintStrokeWidth ); + } + + UserPaintOverlay::~UserPaintOverlay() { try diff --git a/slideshow/source/engine/slide/userpaintoverlay.hxx b/slideshow/source/engine/slide/userpaintoverlay.hxx index b92f5f2539b0..3a8e14c600c5 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.hxx +++ b/slideshow/source/engine/slide/userpaintoverlay.hxx @@ -69,16 +69,21 @@ namespace slideshow static UserPaintOverlaySharedPtr create( const RGBColor& rStrokeColor, double nStrokeWidth, const SlideShowContext& rContext, - const PolyPolygonVector& rPolygons ); + const PolyPolygonVector& rPolygons, + bool bActive); ~UserPaintOverlay(); PolyPolygonVector getPolygons(); void drawPolygons(); + void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ); + + private: UserPaintOverlay( const RGBColor& rStrokeColor, double nStrokeWidth, const SlideShowContext& rContext, - const PolyPolygonVector& rPolygons ); + const PolyPolygonVector& rPolygons, + bool bActive ); ::boost::shared_ptr mpHandler; EventMultiplexer& mrMultiplexer; diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index 83ce94a4a184..a909ade61ee2 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -458,7 +458,7 @@ private: boost::optional maUserPaintColor; - boost::optional maUserPaintStrokeWidth; + double maUserPaintStrokeWidth; //changed for the eraser project boost::optional maEraseAllInk; @@ -950,7 +950,7 @@ SlideSharedPtr SlideShowImpl::makeSlide( maShapeCursors, (aIter != maPolygons.end()) ? aIter->second : PolyPolygonVector(), maUserPaintColor ? *maUserPaintColor : RGBColor(), - *maUserPaintStrokeWidth, + maUserPaintStrokeWidth, !!maUserPaintColor, mbImageAnimationsAllowed, mbDisableAnimationZOrder) ); @@ -1616,6 +1616,9 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) // enable user paint maUserPaintColor.reset( unoColor2RGBColor( nColor ) ); + if( mpCurrentSlide && !mpCurrentSlide->isPaintOverlayActive() ) + mpCurrentSlide->enablePaintOverlay(); + maEventMultiplexer.notifyUserPaintColor( *maUserPaintColor ); } else @@ -1623,10 +1626,11 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) // disable user paint maUserPaintColor.reset(); maEventMultiplexer.notifyUserPaintDisabled(); + if( mpCurrentSlide ) + mpCurrentSlide->disablePaintOverlay(); } - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); + resetCursor(); return true; } @@ -1645,15 +1649,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) maEraseAllInk.reset( nEraseAllInk ); maEventMultiplexer.notifyEraseAllInk( *maEraseAllInk ); } - else - { - // disable user paint - maEraseAllInk.reset(); - maEventMultiplexer.notifyUserPaintDisabled(); - } - - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); return true; } @@ -1673,9 +1668,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) maEventMultiplexer.notifySwitchPenMode(); } } - - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); return true; } @@ -1695,8 +1687,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) } } - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); return true; } @@ -1715,15 +1705,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) maEraseInk.reset( nEraseInk ); maEventMultiplexer.notifyEraseInkWidth( *maEraseInk ); } - else - { - // disable user paint - maEraseInk.reset(); - maEventMultiplexer.notifyUserPaintDisabled(); - } - - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); return true; } @@ -1737,17 +1718,10 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) { OSL_ENSURE( mbMouseVisible,"setProperty(): User paint overrides invisible mouse" ); // enable user paint stroke width - maUserPaintStrokeWidth.reset( nWidth ); - maEventMultiplexer.notifyUserPaintStrokeWidth( *maUserPaintStrokeWidth ); - } - else - { - // disable user paint stroke width - maUserPaintStrokeWidth.reset(); - maEventMultiplexer.notifyUserPaintDisabled(); + maUserPaintStrokeWidth = nWidth; + maEventMultiplexer.notifyUserPaintStrokeWidth( maUserPaintStrokeWidth ); } - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); + return true; } @@ -2210,6 +2184,8 @@ void SlideShowImpl::notifySlideTransitionEnded( bool bPaintSlide ) "notifySlideTransitionEnded(): Invalid current slide" ); if (mpCurrentSlide) { + mpCurrentSlide->update_settings( !!maUserPaintColor, maUserPaintColor ? *maUserPaintColor : RGBColor(), maUserPaintStrokeWidth ); + // first init show, to give the animations // the chance to register SlideStartEvents const bool bBackgroundLayerRendered( !bPaintSlide ); diff --git a/slideshow/source/inc/slide.hxx b/slideshow/source/inc/slide.hxx index 9f4e6b8f5055..d457d8e16f88 100644 --- a/slideshow/source/inc/slide.hxx +++ b/slideshow/source/inc/slide.hxx @@ -121,9 +121,14 @@ namespace slideshow ///Draw the slide Polygons virtual void drawPolygons() const = 0; - ///Check if slide is already active + ///Check if paint overlay is already active virtual bool isPaintOverlayActive() const = 0; + virtual void enablePaintOverlay() = 0; + virtual void disablePaintOverlay() = 0; + + virtual void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) = 0; + // Slide bitmaps // ------------------------------------------------------------------- diff --git a/slideshow/util/makefile.pmk b/slideshow/util/makefile.pmk index 53724522d5e8..765b5249e5a4 100644 --- a/slideshow/util/makefile.pmk +++ b/slideshow/util/makefile.pmk @@ -35,7 +35,7 @@ CDEFS += -DBOOST_SP_ENABLE_DEBUG_HOOKS .IF "$(COM)"=="MSC" # disable inlining for MSVC -CFLAGS += -Ob0 +#CFLAGS += -Ob0 .ENDIF .ENDIF # "$(debug)"!="" || "$(DEBUG)"!="" -- cgit From 03a5e096c8309ffce6fecc28d17062f3e5a9d4e0 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 14:05:23 +0100 Subject: impressdefaults1: #i113019# make user paint settings persistent and added context menu to change pen settings --- sd/source/ui/app/optsitem.cxx | 39 ++- sd/source/ui/inc/optsitem.hxx | 9 + sd/source/ui/slideshow/slideshow.hrc | 33 +- sd/source/ui/slideshow/slideshow.src | 66 +--- sd/source/ui/slideshow/slideshowimpl.cxx | 519 +++++++++++-------------------- sd/source/ui/slideshow/slideshowimpl.hxx | 6 +- 6 files changed, 247 insertions(+), 425 deletions(-) mode change 100755 => 100644 sd/source/ui/app/optsitem.cxx mode change 100644 => 100755 sd/source/ui/slideshow/slideshow.hrc diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx old mode 100755 new mode 100644 index 4355da3011c9..3366a0ea98db --- a/sd/source/ui/app/optsitem.cxx +++ b/sd/source/ui/app/optsitem.cxx @@ -46,6 +46,16 @@ using namespace ::com::sun::star::uno; #define B2U(_def_aStr) (OUString::createFromAscii(_def_aStr)) +template< class T > T getSafeValue( const Any& rAny ) +{ + T value = T(); + bool bOk = (rAny >>= value); + + DBG_ASSERT( bOk, "SdOptionsItem, wrong type from configuration!" ); + (void)bOk; + + return value; +} // ----------------- // - SdOptionsItem - @@ -503,6 +513,9 @@ SdOptionsMisc::SdOptionsMisc( USHORT nConfigId, BOOL bUseConfig ) : bPreviewChangedEffects( FALSE ), bPreviewTransitions( TRUE ), mnDisplay( 0 ), + mnPenColor( 0xff0000 ), + mnPenWidth( 150.0 ), + // The default for 6.1-and-above documents is to use printer-independent // formatting. mnPrinterIndependentLayout (1) @@ -541,7 +554,9 @@ BOOL SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) const IsPreviewChangedEffects() == rOpt.IsPreviewChangedEffects() && IsPreviewTransitions() == rOpt.IsPreviewTransitions() && GetDisplay() == rOpt.GetDisplay() && - IsShowComments() == rOpt.IsShowComments() + IsShowComments() == rOpt.IsShowComments() && + GetPresentationPenColor() == rOpt.GetPresentationPenColor() && + GetPresentationPenWidth() == rOpt.GetPresentationPenWidth() ); } @@ -583,10 +598,13 @@ void SdOptionsMisc::GetPropNameArray( const char**& ppNames, ULONG& rCount ) con "PreviewChangedEffects", "PreviewTransitions", - "Display" + "Display", + + "PenColor", + "PenWidth" }; - rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 25 : 16 ); + rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 27 : 16 ); ppNames = aPropNames; } @@ -641,6 +659,12 @@ BOOL SdOptionsMisc::ReadData( const Any* pValues ) if( pValues[24].hasValue() ) SetDisplay(*(sal_Int32*) pValues[ 24 ].getValue()); + + if( pValues[25].hasValue() ) + SetPresentationPenColor( getSafeValue< sal_Int32 >( pValues[ 25 ] ) ); + + if( pValues[26].hasValue() ) + SetPresentationPenWidth( getSafeValue< double >( pValues[ 26 ] ) ); } return TRUE; @@ -684,6 +708,9 @@ BOOL SdOptionsMisc::WriteData( Any* pValues ) const pValues[ 23 ] <<= IsPreviewTransitions(); pValues[ 24 ] <<= GetDisplay(); + + pValues[ 25 ] <<= GetPresentationPenColor(); + pValues[ 26 ] <<= GetPresentationPenWidth(); } return TRUE; @@ -725,6 +752,9 @@ SdOptionsMiscItem::SdOptionsMiscItem( USHORT _nWhich, SdOptions* pOpts, ::sd::Fr maOptionsMisc.SetDisplay(pOpts->GetDisplay()); maOptionsMisc.SetShowComments( pOpts->IsShowComments() ); + + maOptionsMisc.SetPresentationPenColor(pOpts->GetPresentationPenColor() ); + maOptionsMisc.SetPresentationPenWidth(pOpts->GetPresentationPenWidth() ); } if( pView ) @@ -813,6 +843,9 @@ void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const pOpts->SetPreviewTransitions( maOptionsMisc.IsPreviewTransitions() ); pOpts->SetDisplay( maOptionsMisc.GetDisplay() ); + + pOpts->SetPresentationPenColor( maOptionsMisc.GetPresentationPenColor() ); + pOpts->SetPresentationPenWidth( maOptionsMisc.GetPresentationPenWidth() ); } } diff --git a/sd/source/ui/inc/optsitem.hxx b/sd/source/ui/inc/optsitem.hxx index 13088dfc64cb..419f661b1405 100755 --- a/sd/source/ui/inc/optsitem.hxx +++ b/sd/source/ui/inc/optsitem.hxx @@ -279,6 +279,9 @@ private: sal_Int32 mnDisplay; + sal_Int32 mnPenColor; + double mnPenWidth; + /** This value controls the device to use for formatting documents. The currently supported values are 0 for the current printer or 1 for the printer independent virtual device the can be retrieved from @@ -336,6 +339,12 @@ public: sal_Int32 GetDisplay() const { Init(); return mnDisplay; } void SetDisplay( sal_Int32 nDisplay = 0 ) { if( mnDisplay != nDisplay ) { OptionsChanged(); mnDisplay = nDisplay; } } + sal_Int32 GetPresentationPenColor() const { Init(); return mnPenColor; } + void SetPresentationPenColor( sal_Int32 nPenColor ) { if( mnPenColor != nPenColor ) { OptionsChanged(); mnPenColor = nPenColor; } } + + double GetPresentationPenWidth() const { Init(); return mnPenWidth; } + void SetPresentationPenWidth( double nPenWidth ) { if( mnPenWidth != nPenWidth ) { OptionsChanged(); mnPenWidth = nPenWidth; } } + void SetStartWithTemplate( BOOL bOn = TRUE ) { if( bStartWithTemplate != bOn ) { OptionsChanged(); bStartWithTemplate = bOn; } } void SetMarkedHitMovesAlways( BOOL bOn = TRUE ) { if( bMarkedHitMovesAlways != bOn ) { OptionsChanged(); bMarkedHitMovesAlways = bOn; } } void SetMoveOnlyDragging( BOOL bOn = TRUE ) { if( bMoveOnlyDragging != bOn ) { OptionsChanged(); bMoveOnlyDragging = bOn; } } diff --git a/sd/source/ui/slideshow/slideshow.hrc b/sd/source/ui/slideshow/slideshow.hrc old mode 100644 new mode 100755 index 709e2a79146e..f086f52cb73f --- a/sd/source/ui/slideshow/slideshow.hrc +++ b/sd/source/ui/slideshow/slideshow.hrc @@ -37,25 +37,20 @@ #define CM_ENDSHOW 7 #define CM_FIRST_SLIDE 8 #define CM_LAST_SLIDE 9 -#define CM_SLIDES 10 + //CM for extra presenter UI -#define CM_ERASE_ALLINK 11 -#define CM_ERASE_INK 12 -#define CM_ERASE_INK_PEN 13 -#define CM_ERASE_INK_PEN_VERY_THIN 14 -#define CM_ERASE_INK_PEN_THIN 15 -#define CM_ERASE_INK_PEN_NORMAL 16 -#define CM_ERASE_INK_PEN_THICK 17 -#define CM_ERASE_INK_PEN_VERY_THICK 18 -#define CM_COLOR_PEN 19 -#define CM_WIDTH_PEN 20 -#define CM_WIDTH_PEN_VERY_THIN 21 -#define CM_WIDTH_PEN_THIN 22 -#define CM_WIDTH_PEN_NORMAL 23 -#define CM_WIDTH_PEN_THICK 24 -#define CM_WIDTH_PEN_VERY_THICK 25 -#define CM_PEN_MODE 26 -#define CM_ERASE_MODE 27 -#define CM_POINTER_OPTION 28 +#define CM_ERASE_ALLINK 10 +#define CM_COLOR_PEN 11 +#define CM_WIDTH_PEN 12 +#define CM_WIDTH_PEN_VERY_THIN 13 +#define CM_WIDTH_PEN_THIN 14 +#define CM_WIDTH_PEN_NORMAL 15 +#define CM_WIDTH_PEN_THICK 16 +#define CM_WIDTH_PEN_VERY_THICK 17 +#define CM_PEN_MODE 18 +#define CM_ERASE_MODE 19 +#define CM_POINTER_OPTION 20 + +#define CM_SLIDES 21 // this must be the last id! #endif diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src index 0925ca6617f4..78cd2aae0d9f 100755 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -74,16 +74,7 @@ Menu RID_SLIDESHOW_CONTEXTMENU MenuItem { Identifier = CM_PEN_MODE; - Text [ en-US ] = "~Pen Mode"; - }; - MenuItem - { - Identifier = CM_ERASE_MODE; - Text [ en-US ] = "~Eraser Mode"; - }; - MenuItem - { - Separator = TRUE; + Text [ en-US ] = "Mouse pointer as ~pen"; }; MenuItem { @@ -122,21 +113,9 @@ Menu RID_SLIDESHOW_CONTEXTMENU }; }; MenuItem - { - Separator = TRUE; - }; - MenuItem { Identifier = CM_COLOR_PEN ; - Text [ en-US ] = "~Change Pen Color" ; - }; - MenuItem - { - Separator = TRUE; - }; - MenuItem - { - Separator = TRUE; + Text [ en-US ] = "~Change Pen Color..." ; }; MenuItem { @@ -148,47 +127,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU Separator = TRUE; }; MenuItem - { - Identifier = CM_ERASE_INK_PEN; - Text [ en-US ] = "~Eraser Width" ; - - SubMenu = Menu - { - ItemList = - { - MenuItem - { - Identifier = CM_ERASE_INK_PEN_VERY_THIN; - Text [ en-US ] = "~Very thin"; - }; - MenuItem - { - Identifier = CM_ERASE_INK_PEN_THIN; - Text [ en-US ] = "~Thin"; - }; - MenuItem - { - Identifier = CM_ERASE_INK_PEN_NORMAL; - Text [ en-US ] = "~Normal"; - }; - MenuItem - { - Identifier = CM_ERASE_INK_PEN_THICK; - Text [ en-US ] = "~Thick"; - }; - MenuItem - { - Identifier = CM_ERASE_INK_PEN_VERY_THICK; - Text [ en-US ] = "~Very Thick"; - }; - }; - }; - }; - MenuItem - { - Separator = TRUE; - }; - MenuItem { Identifier = CM_SCREEN; Text [ en-US ] = "~Screen" ; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 384f10cb61b6..67ac7e94cadb 100755 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -555,11 +555,12 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, , mbActive(sal_False) , maPresSettings( pDoc->getPresentationSettings() ) , mnUserPaintColor( 0x80ff0000L ) -, mbSwitchPenMode(true) -, mbSwitchEraserMode(false) +, mbUsePen(false) , mdUserPaintStrokeWidth ( 150.0 ) -, mbEraseAllInk(false) +#ifdef ENABLE_ERASER_UI +, mbSwitchEraserMode(false) , mnEraseInkSize(100) +#endif , mnEntryCounter(0) , mnLastSlideNumber(-1) , msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ) @@ -588,10 +589,26 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, mbAutoSaveWasOn = true; Application::AddEventListener( LINK( this, SlideshowImpl, EventListenerHdl ) ); + + mbUsePen = maPresSettings.mbMouseAsPen; + + SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS); + if( pOptions ) + { + mnUserPaintColor = pOptions->GetPresentationPenColor(); + mdUserPaintStrokeWidth = pOptions->GetPresentationPenWidth(); + } } SlideshowImpl::~SlideshowImpl() { + SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS); + if( pOptions ) + { + pOptions->SetPresentationPenColor(mnUserPaintColor); + pOptions->SetPresentationPenWidth(mdUserPaintStrokeWidth); + } + Application::RemoveEventListener( LINK( this, SlideshowImpl, EventListenerHdl ) ); maDeactivateTimer.Stop(); @@ -1121,7 +1138,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) -1, Any( maPresSettings.mbManual != sal_False ), beans::PropertyState_DIRECT_VALUE ) ); - if( maPresSettings.mbMouseAsPen ) + if( mbUsePen ) { aProperties.push_back( beans::PropertyValue( @@ -1129,6 +1146,13 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) // User paint color is black by default. -1, Any( mnUserPaintColor ), beans::PropertyState_DIRECT_VALUE ) ); + + aProperties.push_back( + beans::PropertyValue( + OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintStrokeWidth") ), + // User paint color is black by default. + -1, Any( mdUserPaintStrokeWidth ), + beans::PropertyState_DIRECT_VALUE ) ); } if (mbRehearseTimings) { @@ -2200,14 +2224,8 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) PopupMenu* pMenu = new PopupMenu( SdResId( RID_SLIDESHOW_CONTEXTMENU ) ); - //adding button to contextual menu for erasing functionnalities for UserPaintOverlay - pMenu->EnableItem( CM_ERASE_ALLINK, (maPresSettings.mbMouseAsPen)); - // Adding button to contextual menu for changing pen color - pMenu->EnableItem( CM_COLOR_PEN, (maPresSettings.mbMouseAsPen)); // Adding button to display if in Pen mode - pMenu->EnableItem( CM_PEN_MODE, (maPresSettings.mbMouseAsPen)); - // Adding button to displau if in Erase Mode - pMenu->EnableItem( CM_ERASE_MODE, (maPresSettings.mbMouseAsPen)); + pMenu->CheckItem( CM_PEN_MODE, mbUsePen); const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); pMenu->EnableItem( CM_NEXT_SLIDE, ( mpSlideController->getNextSlideIndex() != -1 ) ); @@ -2281,95 +2299,36 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) // populate color width list if( pWidthMenu ) { - if(! maPresSettings.mbMouseAsPen) - { - pMenu->EnableItem( CM_WIDTH_PEN, FALSE ); - } - else - { - sal_Int32 nIterator; - double nWidth; + sal_Int32 nIterator; + double nWidth; - nWidth = 4.0; - for( nIterator = 1; nIterator < 6; nIterator++) - { - switch(nIterator) - { - case 1: - nWidth = 4.0; - break; - case 2: - nWidth = 100.0; - break; - case 3: - nWidth = 150.0; - break; - case 4: - nWidth = 200.0; - break; - case 5: - nWidth = 400.0; - break; - default: - break; - } - - pWidthMenu->EnableItem( (USHORT)(CM_WIDTH_PEN + nIterator), TRUE); - if( nWidth == mdUserPaintStrokeWidth) - pWidthMenu->CheckItem( (USHORT)(CM_WIDTH_PEN + nIterator) ); - - } - } - } - - - PopupMenu* pEraseWidthMenu = pMenu->GetPopupMenu( CM_ERASE_INK_PEN); - - // populate eraser width list - if( pEraseWidthMenu ) - { - if(! maPresSettings.mbMouseAsPen) - { - pMenu->EnableItem( CM_ERASE_INK_PEN, FALSE ); - } - else + nWidth = 4.0; + for( nIterator = 1; nIterator < 6; nIterator++) { - sal_Int32 nEIterator; - double nEWidth; - - nEWidth = 100.0; - for( nEIterator = 1; nEIterator < 6; nEIterator++) + switch(nIterator) { - switch(nEIterator) - { - case 1: - nEWidth = 100.0; - break; - case 2: - nEWidth = 200.0; - break; - case 3: - nEWidth = 300.0; - break; - case 4: - nEWidth = 400.0; - break; - case 5: - nEWidth = 500.0; - break; - default: - break; - } - - pEraseWidthMenu->EnableItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator), TRUE); - if( nEWidth == mnEraseInkSize) - pEraseWidthMenu->CheckItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator) ); - if( mbSwitchPenMode ) - pMenu->CheckItem( (USHORT)(CM_PEN_MODE)); - if( mbSwitchEraserMode ) - pMenu->CheckItem( (USHORT)(CM_ERASE_MODE)); - + case 1: + nWidth = 4.0; + break; + case 2: + nWidth = 100.0; + break; + case 3: + nWidth = 150.0; + break; + case 4: + nWidth = 200.0; + break; + case 5: + nWidth = 400.0; + break; + default: + break; } + + pWidthMenu->EnableItem( (USHORT)(CM_WIDTH_PEN + nIterator), TRUE); + if( nWidth == mdUserPaintStrokeWidth) + pWidthMenu->CheckItem( (USHORT)(CM_WIDTH_PEN + nIterator) ); } } @@ -2435,137 +2394,93 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) } } break; - if( maPresSettings.mbMouseAsPen ) - { - case CM_COLOR_PEN: - { - //Open a color picker based on SvColorDialog - ::Color aColor( mnUserPaintColor ); - SvColorDialog aColorDlg( mpShowWindow); - aColorDlg.SetColor( aColor ); - - if (aColorDlg.Execute() ) - { - aColor = aColorDlg.GetColor(); - mnUserPaintColor = aColor.GetColor(); - setPenColor(mnUserPaintColor); - } - mbWasPaused = false; - } - break; - - case CM_WIDTH_PEN_VERY_THIN: - { - setPenWidth(4.0); - mbWasPaused = false; - } - break; - - case CM_WIDTH_PEN_THIN: - { - setPenWidth(100.0); - mbWasPaused = false; - } - break; - - case CM_WIDTH_PEN_NORMAL: - { - setPenWidth(150.0); - mbWasPaused = false; - } - break; + case CM_COLOR_PEN: + { + //Open a color picker based on SvColorDialog + ::Color aColor( mnUserPaintColor ); + SvColorDialog aColorDlg( mpShowWindow); + aColorDlg.SetColor( aColor ); - case CM_WIDTH_PEN_THICK: + if (aColorDlg.Execute() ) { - setPenWidth(200.0); - mbWasPaused = false; + aColor = aColorDlg.GetColor(); + setPenColor(aColor.GetColor()); } - break; + mbWasPaused = false; + } + break; - case CM_WIDTH_PEN_VERY_THICK: - { - setPenWidth(400.0); - mbWasPaused = false; - } - break; - case CM_ERASE_ALLINK: - { - setEraseAllInk(true); - mbWasPaused = false; - } - break; - case CM_PEN_MODE: - { - setPenMode(true); - mbWasPaused = false; - } - break; - case CM_ERASE_MODE: - { - setEraserMode(true); - mbWasPaused = false; - } - break; - case CM_ERASE_INK_PEN_VERY_THIN: - { - setEraseInk(100); - mbWasPaused = false; - } - break; + case CM_WIDTH_PEN_VERY_THIN: + { + setPenWidth(4.0); + mbWasPaused = false; + } + break; - case CM_ERASE_INK_PEN_THIN: - { - setEraseInk(200); - mbWasPaused = false; - } - break; + case CM_WIDTH_PEN_THIN: + { + setPenWidth(100.0); + mbWasPaused = false; + } + break; - case CM_ERASE_INK_PEN_NORMAL: - { - setEraseInk(300); - mbWasPaused = false; - } - break; + case CM_WIDTH_PEN_NORMAL: + { + setPenWidth(150.0); + mbWasPaused = false; + } + break; - case CM_ERASE_INK_PEN_THICK: - { - setEraseInk(400); - mbWasPaused = false; - } - break; - case CM_ERASE_INK_PEN_VERY_THICK: - { - setEraseInk(500); - mbWasPaused = false; - } - break; - } + case CM_WIDTH_PEN_THICK: + { + setPenWidth(200.0); + mbWasPaused = false; + } + break; - case CM_ENDSHOW: - // in case the user cancels the presentation, switch to current slide - // in edit mode - if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) ) - { - if( mpSlideController->getCurrentSlideNumber() != -1 ) - { - mnRestoreSlide = mpSlideController->getCurrentSlideNumber(); - } - } - endPresentation(); - break; - default: - sal_Int32 nPageNumber = nMenuId - CM_SLIDES; - const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); - if( (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) ) - { - mpShowWindow->RestartShow( nPageNumber ); - } - else if( nPageNumber != mpSlideController->getCurrentSlideNumber() ) + case CM_WIDTH_PEN_VERY_THICK: + { + setPenWidth(400.0); + mbWasPaused = false; + } + break; + case CM_ERASE_ALLINK: + { + setEraseAllInk(true); + mbWasPaused = false; + } + break; + case CM_PEN_MODE: + { + setUsePen(!mbUsePen); + mbWasPaused = false; + } + break; + case CM_ENDSHOW: + // in case the user cancels the presentation, switch to current slide + // in edit mode + if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) ) + { + if( mpSlideController->getCurrentSlideNumber() != -1 ) { - displaySlideNumber( nPageNumber ); + mnRestoreSlide = mpSlideController->getCurrentSlideNumber(); } - mbWasPaused = false; - break; + } + endPresentation(); + break; + default: + sal_Int32 nPageNumber = nMenuId - CM_SLIDES; + const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); + if( (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) ) + { + mpShowWindow->RestartShow( nPageNumber ); + } + else if( nPageNumber != mpSlideController->getCurrentSlideNumber() ) + { + displaySlideNumber( nPageNumber ); + } + mbWasPaused = false; + break; } } @@ -2951,7 +2866,7 @@ void SlideshowImpl::receiveRequest(SfxRequest& rReq) switch ( rReq.GetSlot() ) { case SID_NAVIGATOR_PEN: - setUsePen(!maPresSettings.mbMouseAsPen); + setUsePen(!mbUsePen); break; case SID_NAVIGATOR_PAGE: @@ -3137,7 +3052,7 @@ void SAL_CALL SlideshowImpl::setMouseVisible( sal_Bool bVisible ) throw (Runtime sal_Bool SAL_CALL SlideshowImpl::getUsePen() throw (RuntimeException) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - return maPresSettings.mbMouseAsPen; + return mbUsePen; } // -------------------------------------------------------------------- @@ -3145,90 +3060,38 @@ sal_Bool SAL_CALL SlideshowImpl::getUsePen() throw (RuntimeException) void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeException) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - maPresSettings.mbMouseAsPen = bMouseAsPen; + mbUsePen = bMouseAsPen; if( mxShow.is() ) try { - // For Pencolor; + // For Pencolor; Any aValue; - if( maPresSettings.mbMouseAsPen ) - // TODO: take color from configuration - aValue <<= mnUserPaintColor; + if( mbUsePen ) + aValue <<= mnUserPaintColor; beans::PropertyValue aPenProp; aPenProp.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintColor" )); aPenProp.Value = aValue; mxShow->setProperty( aPenProp ); - //for StrokeWidth : - Any aValueWidth; - if( maPresSettings.mbMouseAsPen ) - aValueWidth <<= mdUserPaintStrokeWidth; - - beans::PropertyValue aPenPropWidth; - aPenPropWidth.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintStrokeWidth" )); - aPenPropWidth.Value = aValueWidth; - - mxShow->setProperty( aPenPropWidth ); - - // for Pen Mode - Any aValueSwitchPenMode; - if( maPresSettings.mbMouseAsPen ) - aValueSwitchPenMode <<= mbSwitchPenMode; - beans::PropertyValue aPenPropSwitchPenMode; - aPenPropSwitchPenMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchPenMode" )); - aPenPropSwitchPenMode.Value = aValueSwitchPenMode; - mxShow->setProperty( aPenPropSwitchPenMode ); - - //for EraseAllInk : - Any aValueEraseAllInk; - if( maPresSettings.mbMouseAsPen ) - aValueEraseAllInk <<= mbEraseAllInk; - beans::PropertyValue aPenPropEraseAllInk; - aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" )); - aPenPropEraseAllInk.Value = aValueEraseAllInk; - mxShow->setProperty( aPenPropEraseAllInk ); - mbEraseAllInk = false; // sets to false so not to have it applied again - } - catch( Exception& e ) - { - static_cast(e); - DBG_ERROR( - (OString("sd::SlideshowImpl::setUsePen(), " - "exception caught: ") + - rtl::OUStringToOString( - comphelper::anyToString( cppu::getCaughtException() ), - RTL_TEXTENCODING_UTF8 )).getStr() ); - } -} -void SAL_CALL SlideshowImpl::setUseEraser( sal_Bool bMouseAsPen ) throw (RuntimeException) -{ - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - maPresSettings.mbMouseAsPen = bMouseAsPen; - if( mxShow.is() ) try - { + //for StrokeWidth : + if( mbUsePen ) + { + beans::PropertyValue aPenPropWidth; + aPenPropWidth.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintStrokeWidth" )); + aPenPropWidth.Value <<= mdUserPaintStrokeWidth; + mxShow->setProperty( aPenPropWidth ); - //for EraseInk : - Any aValueEraseInk; - if( maPresSettings.mbMouseAsPen ) - aValueEraseInk <<= mnEraseInkSize; - beans::PropertyValue aPenPropEraseInk; - aPenPropEraseInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseInk" )); - aPenPropEraseInk.Value = aValueEraseInk; - mxShow->setProperty( aPenPropEraseInk ); - - // for Erase Mode - Any aValueSwitchEraserMode; - if( maPresSettings.mbMouseAsPen ) - aValueSwitchEraserMode <<= mbSwitchEraserMode; - beans::PropertyValue aPenPropSwitchEraserMode; - aPenPropSwitchEraserMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchEraserMode" )); - aPenPropSwitchEraserMode.Value = aValueSwitchEraserMode; - mxShow->setProperty( aPenPropSwitchEraserMode ); + // for Pen Mode + beans::PropertyValue aPenPropSwitchPenMode; + aPenPropSwitchPenMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchPenMode" )); + aPenPropSwitchPenMode.Value <<= sal_True; + mxShow->setProperty( aPenPropSwitchPenMode ); + } } catch( Exception& e ) { static_cast(e); DBG_ERROR( - (OString("sd::SlideshowImpl::setUseEraser(), " + (OString("sd::SlideshowImpl::setUsePen(), " "exception caught: ") + rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), @@ -3250,10 +3113,7 @@ void SAL_CALL SlideshowImpl::setPenWidth( double dStrokeWidth ) throw (RuntimeEx { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); mdUserPaintStrokeWidth = dStrokeWidth; - mbSwitchPenMode = true; - mbSwitchEraserMode = !mbSwitchPenMode; - if( maPresSettings.mbMouseAsPen ) - setUsePen( sal_True ); // update color and width + setUsePen( true ); // enable pen mode, update color and width } // -------------------------------------------------------------------- @@ -3270,66 +3130,57 @@ void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor ) throw (RuntimeExcep { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); mnUserPaintColor = nColor; - mbSwitchPenMode = true; - mbSwitchEraserMode = !mbSwitchPenMode; - if( maPresSettings.mbMouseAsPen ) - setUsePen( sal_True ); // update color + setUsePen( true ); // enable pen mode, update color } // -------------------------------------------------------------------- -void SAL_CALL SlideshowImpl::setPenMode( bool bSwitchPenMode ) throw (RuntimeException) +void SAL_CALL SlideshowImpl::setUseEraser( ::sal_Bool /*_usepen*/ ) throw (css::uno::RuntimeException) { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - mbSwitchPenMode = bSwitchPenMode; - - if(mbSwitchPenMode == true){ - mbSwitchEraserMode = false; - }else{ - mbSwitchEraserMode = true; - } - if( maPresSettings.mbMouseAsPen ) - setUsePen( sal_True ); // Switch to Pen Mode - } -void SAL_CALL SlideshowImpl::setEraserMode(bool bSwitchEraserMode ) throw (RuntimeException) +// -------------------------------------------------------------------- + +void SAL_CALL SlideshowImpl::setPenMode( bool bSwitchPenMode ) throw (RuntimeException) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - mbSwitchEraserMode = bSwitchEraserMode; - if(mbSwitchEraserMode == true){ - mbSwitchPenMode = false; - }else{ - mbSwitchPenMode = true; - } - - if( maPresSettings.mbMouseAsPen ) - setUseEraser( sal_True ); // Switch to EraseMode + setUsePen( bSwitchPenMode ); // SwitchPen Mode } - // -------------------------------------------------------------------- -void SAL_CALL SlideshowImpl::setEraseAllInk( bool bEraseAllInk ) throw (RuntimeException) +void SAL_CALL SlideshowImpl::setEraseAllInk(bool bEraseAllInk) throw (RuntimeException) { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - mbEraseAllInk=bEraseAllInk; - mbSwitchPenMode = true; - mbSwitchEraserMode = false; - if( maPresSettings.mbMouseAsPen ) - setUsePen( sal_True ); // update erase all ink bool + if( bEraseAllInk ) + { + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + if( mxShow.is() ) try + { + beans::PropertyValue aPenPropEraseAllInk; + aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" )); + aPenPropEraseAllInk.Value <<= bEraseAllInk; + mxShow->setProperty( aPenPropEraseAllInk ); + } + catch( Exception& e ) + { + static_cast(e); + DBG_ERROR( + (OString("sd::SlideshowImpl::setEraseAllInk(), " + "exception caught: ") + + rtl::OUStringToOString( + comphelper::anyToString( cppu::getCaughtException() ), + RTL_TEXTENCODING_UTF8 )).getStr() ); + } + } } +void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 /*nEraseInkSize*/ ) throw (css::uno::RuntimeException) +{ +} -void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 nEraseInkSize ) throw (RuntimeException) +void SAL_CALL SlideshowImpl::setEraserMode( bool /*bSwitchEraserMode*/ ) throw (css::uno::RuntimeException) { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - mnEraseInkSize=nEraseInkSize; - mbSwitchPenMode = false; - mbSwitchEraserMode = true; - if( maPresSettings.mbMouseAsPen ) - setUseEraser( sal_True ); // update erase ink size } // -------------------------------------------------------------------- diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index 5068f1cf06b4..98a34959e0b9 100755 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -394,12 +394,8 @@ private: PresentationSettings maPresSettings; sal_Int32 mnUserPaintColor; - bool mbSwitchPenMode; - bool mbSwitchEraserMode; + bool mbUsePen; double mdUserPaintStrokeWidth; - bool mbEraseAllInk; -// bool mbEraseInk; - sal_Int32 mnEraseInkSize; /// used in updateHdl to prevent recursive calls sal_Int32 mnEntryCounter; -- cgit From 2e96d3f5ac9ab252c01512969cd078d3a5abafae Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 15:23:19 +0100 Subject: impressdefaults1: #i113019# changing shurtcut for insert comments to CTRL+ALT+C --- .../registry/data/org/openoffice/Office/Accelerators.xcu | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) mode change 100755 => 100644 officecfg/registry/data/org/openoffice/Office/Accelerators.xcu diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu old mode 100755 new mode 100644 index 5c735744104b..2616566225b9 --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -1698,7 +1698,7 @@ .uno:Bold - + I10N SHORTCUTS - NO TRANSLATE .uno:InsertAnnotation @@ -1893,7 +1893,7 @@ - + I10N SHORTCUTS - NO TRANSLATE .uno:InsertAnnotation @@ -2739,7 +2739,7 @@ .uno:Bold - + I10N SHORTCUTS - NO TRANSLATE .uno:InsertAnnotation @@ -3374,7 +3374,7 @@ .uno:Bold - + I10N SHORTCUTS - NO TRANSLATE .uno:InsertAnnotation @@ -3979,7 +3979,7 @@ .uno:Bold - + I10N SHORTCUTS - NO TRANSLATE .uno:InsertAnnotation @@ -4589,7 +4589,7 @@ .uno:Bold - + I10N SHORTCUTS - NO TRANSLATE .uno:InsertAnnotation @@ -5204,7 +5204,7 @@ .uno:Bold - + I10N SHORTCUTS - NO TRANSLATE .uno:InsertAnnotation @@ -5567,7 +5567,7 @@ - + I10N SHORTCUTS - NO TRANSLATE .uno:InsertAnnotation -- cgit From 59955ea1fe300e0cd1cd8754993eb24b299417a1 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 19:07:23 +0100 Subject: impressdefaults1: #i114776# renamed 'Eyedropper' to 'Color Replacer'/'Pipette' in officecfg --- officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index ed1c8d587762..225a2ddcbc5d 100755 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -3412,7 +3412,7 @@ - ~Eyedropper + Color ~Replacer -- cgit From c47f821070a75540e738495f9bc4c2be02cc027f Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 19:07:32 +0100 Subject: impressdefaults1: #i114776# renamed 'Eyedropper' to 'Color Replacer'/'Pipette' in svx --- svx/source/dialog/bmpmask.src | 4 ++-- svx/source/dialog/contdlg.src | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/svx/source/dialog/bmpmask.src b/svx/source/dialog/bmpmask.src index a9cd2fe60b2f..7823007dbe7c 100644 --- a/svx/source/dialog/bmpmask.src +++ b/svx/source/dialog/bmpmask.src @@ -289,7 +289,7 @@ DockingWindow RID_SVXDLG_BMPMASK ImageBitmap = Bitmap { File = "sc10350.bmp" ; }; MASKCOLOR }; - Text [ en-US ] = "Eyedropper" ; + Text [ en-US ] = "Pipette" ; }; }; }; @@ -300,7 +300,7 @@ DockingWindow RID_SVXDLG_BMPMASK Pos = MAP_APPFONT ( 22 , 6 ) ; Size = MAP_APPFONT ( 43 , 14 ) ; }; - Text [ en-US ] = "Eyedropper" ; + Text [ en-US ] = "Color Replacer" ; Image IMG_PIPETTE { diff --git a/svx/source/dialog/contdlg.src b/svx/source/dialog/contdlg.src index bf587b3b1fda..989bdd93d336 100644 --- a/svx/source/dialog/contdlg.src +++ b/svx/source/dialog/contdlg.src @@ -170,7 +170,7 @@ FloatingWindow RID_SVXDLG_CONTOUR { Identifier = TBI_PIPETTE ; HelpId = HID_CONTDLG_PIPETTE ; - Text [ en-US ] = "Eyedropper" ; + Text [ en-US ] = "Pipette" ; AutoCheck = TRUE ; }; }; -- cgit From 57e64d8389d8e238a541cbad335a9da684010021 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 19:07:43 +0100 Subject: impressdefaults1: #i114776# renamed 'Eyedropper' to 'Color Replacer'/'Pipette' in sd --- sd/source/ui/app/strings.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src index 7e87b246d371..4fc88c3a6049 100755 --- a/sd/source/ui/app/strings.src +++ b/sd/source/ui/app/strings.src @@ -784,7 +784,7 @@ String STR_PUBLISH_OUTLINE }; String STR_EYEDROPPER { - Text [ en-US ] = "Eyedropper" ; + Text [ en-US ] = "Color Replacer" ; }; String STR_UNDO_MORPHING { -- cgit From 5d5325135c31f829fbaedbf9a1403f90474c2772 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 19:57:45 +0100 Subject: impressdefaults1: #i113014# animate by 1st level paragraph for text shapes by default --- sd/source/ui/animations/CustomAnimationPane.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) mode change 100644 => 100755 sd/source/ui/animations/CustomAnimationPane.cxx diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx old mode 100644 new mode 100755 index 8b96e08b4a8c..9cdbc2f0cfba --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -1953,6 +1953,16 @@ void CustomAnimationPane::onChange( bool bCreate ) { CustomAnimationEffectPtr pCreated = mpMainSequence->append( pDescriptor, (*aIter), fDuration ); + // if only one shape with text and no fill or outline is selected, animate only by first level paragraphs + if( bHasText && (aTargets.size() == 1) ) + { + Reference< XShape > xShape( (*aIter), UNO_QUERY ); + if( xShape.is() && !hasVisibleShape( xShape ) ) + { + mpMainSequence->createTextGroup( pCreated, 1, -1.0, sal_False, sal_False ); + } + } + if( bFirst ) bFirst = false; else -- cgit From 7d3aeadb8d2540442cd25193cc6df5cc04d9428f Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 19:59:58 +0100 Subject: impressdefaults1: #i111998# reset default for quickedit back to 'on' --- officecfg/registry/schema/org/openoffice/Office/Draw.xcs | 2 +- officecfg/registry/schema/org/openoffice/Office/Impress.xcs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs index cdddf50d09b7..6dd518250d4a 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs @@ -410,7 +410,7 @@ Indicates whether a simple click on a text object changes it to edit mode. - false + true diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs index 36bd09dcdbd1..871c5c2c1494 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs @@ -572,7 +572,7 @@ Indicates whether a simple click on a text object changes it to edit mode. - false + true -- cgit From 862b6214064cbde1e9fa5e5a93c2e49c17086dd5 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 20:26:50 +0100 Subject: impressdefaults1: #i112008# use space(s) for grid not point(s) --- svx/source/dialog/optgrid.cxx | 12 ++++-------- svx/source/dialog/optgrid.src | 4 +++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx index 7565539578df..2fc259ffd9e5 100644 --- a/svx/source/dialog/optgrid.cxx +++ b/svx/source/dialog/optgrid.cxx @@ -276,8 +276,8 @@ BOOL SvxGridTabPage::FillItemSet( SfxItemSet& rCoreSet ) aGridItem.nFldDrawX = (UINT32) nX; aGridItem.nFldDrawY = (UINT32) nY; - aGridItem.nFldDivisionX = static_cast(aNumFldDivisionX.GetValue()); - aGridItem.nFldDivisionY = static_cast(aNumFldDivisionY.GetValue()); + aGridItem.nFldDivisionX = static_cast(aNumFldDivisionX.GetValue()-1); + aGridItem.nFldDivisionY = static_cast(aNumFldDivisionY.GetValue()-1); rCoreSet.Put( aGridItem ); } @@ -303,12 +303,8 @@ void SvxGridTabPage::Reset( const SfxItemSet& rSet ) SetMetricValue( aMtrFldDrawX , pGridAttr->nFldDrawX, eUnit ); SetMetricValue( aMtrFldDrawY , pGridAttr->nFldDrawY, eUnit ); -// UINT32 nFineX = pGridAttr->nFldDivisionX; -// UINT32 nFineY = pGridAttr->nFldDivisionY; -// aNumFldDivisionX.SetValue( nFineX ? (pGridAttr->nFldDrawX / nFineX - 1) : 0 ); -// aNumFldDivisionY.SetValue( nFineY ? (pGridAttr->nFldDrawY / nFineY - 1) : 0 ); - aNumFldDivisionX.SetValue( pGridAttr->nFldDivisionX ); - aNumFldDivisionY.SetValue( pGridAttr->nFldDivisionY ); + aNumFldDivisionX.SetValue( pGridAttr->nFldDivisionX+1 ); + aNumFldDivisionY.SetValue( pGridAttr->nFldDivisionY+1 ); } ChangeGridsnapHdl_Impl( &aCbxUseGridsnap ); diff --git a/svx/source/dialog/optgrid.src b/svx/source/dialog/optgrid.src index 2bc7b430f807..0d65c63f5d2f 100644 --- a/svx/source/dialog/optgrid.src +++ b/svx/source/dialog/optgrid.src @@ -140,6 +140,7 @@ TabPage RID_SVXPAGE_GRID TabStop = TRUE ; Repeat = TRUE ; Spin = TRUE ; + Minimum = 1 ; Maximum = 99 ; Last = 99 ; StrictFormat = TRUE ; @@ -149,7 +150,7 @@ TabPage RID_SVXPAGE_GRID { Pos = MAP_APPFONT ( 223 , 56 ) ; Size = MAP_APPFONT ( 29 , 8 ) ; - Text [ en-US ] = "point(s)" ; + Text [ en-US ] = "space(s)" ; }; NumericField NUM_FLD_DIVISION_Y { @@ -160,6 +161,7 @@ TabPage RID_SVXPAGE_GRID TabStop = TRUE ; Repeat = TRUE ; Spin = TRUE ; + Minimum = 1 ; Maximum = 99 ; Last = 99 ; StrictFormat = TRUE ; -- cgit From 045d00e69a22d56c8327e03116ce59057726d30d Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 23:33:09 +0100 Subject: impressdefaults1: fixed compile warnings on unix --- vcl/inc/vcl/lazydelete.hxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/vcl/inc/vcl/lazydelete.hxx b/vcl/inc/vcl/lazydelete.hxx index ab39147d03de..f09614cc85e0 100644 --- a/vcl/inc/vcl/lazydelete.hxx +++ b/vcl/inc/vcl/lazydelete.hxx @@ -284,10 +284,15 @@ namespace vcl void set (const ::com::sun::star::uno::Reference& r_xNew ) { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> xComponent (m_xI, UNO_QUERY); - m_xI.clear(); - if (xComponent.is()) + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> xComponent (m_xI, ::com::sun::star::uno::UNO_QUERY); + m_xI = r_xNew; + if (xComponent.is()) try + { xComponent->dispose(); + } + catch( Exception& ) + { + } } }; } -- cgit From 8dd20306c4be9d0dfa0bc231a5c268efdba0aac3 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Fri, 3 Dec 2010 00:48:03 +0100 Subject: impressdefaults1: fixed linux compile error --- vcl/inc/vcl/lazydelete.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/inc/vcl/lazydelete.hxx b/vcl/inc/vcl/lazydelete.hxx index f09614cc85e0..dad10fb62b33 100644 --- a/vcl/inc/vcl/lazydelete.hxx +++ b/vcl/inc/vcl/lazydelete.hxx @@ -290,7 +290,7 @@ namespace vcl { xComponent->dispose(); } - catch( Exception& ) + catch( ::com::sun::star::uno::Exception& ) { } } -- cgit From 21015b5d04af5f27a41dd77215a29ba250599fe2 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Fri, 3 Dec 2010 13:48:55 +0100 Subject: impressdefaults1: #i111998# reverted string changes since quick text edit is defaulted to on again --- sd/source/core/glob.src | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) mode change 100755 => 100644 sd/source/core/glob.src diff --git a/sd/source/core/glob.src b/sd/source/core/glob.src old mode 100755 new mode 100644 index 3bceed7e904d..f1c7058ddf79 --- a/sd/source/core/glob.src +++ b/sd/source/core/glob.src @@ -122,23 +122,23 @@ String STR_PRESOBJ_MPNOTESTITLE }; String STR_PRESOBJ_MPNOTESTEXT { - Text [ en-US ] = "Double-click to edit the notes format" ; + Text [ en-US ] = "Click to edit the notes format" ; }; String STR_PRESOBJ_TITLE { - Text [ en-US ] = "Double-click to add title" ; + Text [ en-US ] = "Click to add title" ; }; String STR_PRESOBJ_OUTLINE { - Text [ en-US ] = "Double-click to add text" ; + Text [ en-US ] = "Click to add text" ; }; String STR_PRESOBJ_TEXT { - Text [ en-US ] = "Double-click to add text" ; + Text [ en-US ] = "Click to add text" ; }; String STR_PRESOBJ_NOTESTEXT { - Text [ en-US ] = "Double-click to add notes" ; + Text [ en-US ] = "Click to add notes" ; }; String STR_PRESOBJ_GRAPHIC { -- cgit From 5cefe89a5870b07017db265a074908a6009efbf5 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 7 Dec 2010 12:00:26 +0100 Subject: dr77: #i108420# SHEET spreadsheet function accepts empty parameter list --- oox/source/xls/formulabase.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 oox/source/xls/formulabase.cxx diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx old mode 100644 new mode 100755 index c0ad5d513709..ba8485d1f42b --- a/oox/source/xls/formulabase.cxx +++ b/oox/source/xls/formulabase.cxx @@ -759,7 +759,7 @@ static const FunctionData saFuncTableOdf[] = { "PERMUTATIONA", 0, NOID, NOID, 2, 2, V, { VR }, FUNCFLAG_MACROCALLODF }, { "PHI", 0, NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALLODF }, { "RRI", 0, NOID, NOID, 3, 3, V, { VR }, FUNCFLAG_MACROCALLODF }, - { "SHEET", 0, NOID, NOID, 1, 1, V, { RO }, FUNCFLAG_MACROCALLODF }, + { "SHEET", 0, NOID, NOID, 0, 1, V, { RO }, FUNCFLAG_MACROCALLODF }, { "SHEETS", 0, NOID, NOID, 0, 1, V, { RO }, FUNCFLAG_MACROCALLODF }, { "SKEWP", 0, NOID, NOID, 1, MX, V, { RX }, FUNCFLAG_MACROCALLODF }, { "UNICHAR", 0, NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALLODF }, -- cgit From c2582bb129a0368f5ca054ea8efcc075a75136e8 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 7 Dec 2010 12:00:26 +0100 Subject: dr77: #i108420# SHEET spreadsheet function accepts empty parameter list --- sc/source/filter/excel/xlformula.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 sc/source/filter/excel/xlformula.cxx diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx old mode 100644 new mode 100755 index d613f1279242..aad0061377c9 --- a/sc/source/filter/excel/xlformula.cxx +++ b/sc/source/filter/excel/xlformula.cxx @@ -393,7 +393,7 @@ static const XclFunctionInfo saFuncTable_Odf[] = EXC_FUNCENTRY_ODF( ocVariationen2, 2, 2, 0, "PERMUTATIONA" ), EXC_FUNCENTRY_ODF( ocPhi, 1, 1, 0, "PHI" ), EXC_FUNCENTRY_ODF( ocZGZ, 3, 3, 0, "RRI" ), - EXC_FUNCENTRY_ODF( ocTable, 1, 1, 0, "SHEET" ), + EXC_FUNCENTRY_ODF( ocTable, 0, 1, 0, "SHEET" ), EXC_FUNCENTRY_ODF( ocTables, 0, 1, 0, "SHEETS" ), EXC_FUNCENTRY_ODF( ocNoName, 1, MX, 0, "SKEWP" ), EXC_FUNCENTRY_ODF( ocUnichar, 1, 1, 0, "UNICHAR" ), -- cgit From 7530937426b6ec089899ee8a91b83808e42885a1 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Wed, 8 Dec 2010 10:42:58 +0100 Subject: impressdefaults1: #i112002# re enable text edit on double click with rotation mode on --- sd/source/ui/func/fusel.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 332f9971c611..9b3fb0e10de6 100755 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -160,6 +160,8 @@ FuSelection::~FuSelection() BOOL FuSelection::MouseButtonDown(const MouseEvent& rMEvt) { + OSL_TRACE("FuSelection::MouseButtonDown(), clicks=%d", rMEvt.GetClicks() ); + // Hack fuer #?????# bHideAndAnimate = FALSE; @@ -437,8 +439,11 @@ BOOL FuSelection::MouseButtonDown(const MouseEvent& rMEvt) } } - if( bMarked && (nSlotId == SID_OBJECT_ROTATE) && !rMEvt.IsShift() ) - mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SYNCHRON); + if( bMarked && bTempRotation && (nSlotId == SID_OBJECT_ROTATE) && !rMEvt.IsShift() && (rMEvt.GetClicks() != 2) ) + { + nSlotId = SID_OBJECT_SELECT; + Activate(); + } } } } @@ -645,6 +650,8 @@ BOOL FuSelection::MouseMove(const MouseEvent& rMEvt) BOOL FuSelection::MouseButtonUp(const MouseEvent& rMEvt) { + OSL_TRACE("FuSelection::MouseButtonUp(), clicks=%d", rMEvt.GetClicks() ); + BOOL bReturn = FALSE; // When the right mouse button is pressed then only select objects // (and deselect others) as a preparation for showing the context @@ -714,6 +721,8 @@ BOOL FuSelection::MouseButtonUp(const MouseEvent& rMEvt) if (nSlotId == SID_OBJECT_SELECT && mpView->IsRotateAllowed() + + && (rMEvt.GetClicks() != 2) && (mpViewShell->GetFrameView()->IsClickChangeRotation() || (pSingleObj && pSingleObj->GetObjInventor()==E3dInventor)) -- cgit From 041132b03eec68fae2fa73775a8085a754bf98ed Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Wed, 8 Dec 2010 10:56:28 +0100 Subject: impressdefaults1: #i112002# catching some null pointer access during double clicking on shapes --- svx/source/svdraw/svddrgmt.cxx | 38 ++++++++++++++++++++++++-------------- svx/source/svdraw/svdview.cxx | 2 -- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index d04bf8851795..2e7f2b09f50e 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -902,6 +902,9 @@ void SdrDragMovHdl::TakeSdrDragComment(XubString& rStr) const bool SdrDragMovHdl::BeginSdrDrag() { + if( !GetDragHdl() ) + return false; + DragStat().Ref1()=GetDragHdl()->GetPos(); DragStat().SetShown(!DragStat().IsShown()); SdrHdlKind eKind=GetDragHdl()->GetKind(); @@ -931,7 +934,7 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt) { Point aPnt(rNoSnapPnt); - if (DragStat().CheckMinMoved(rNoSnapPnt)) + if ( GetDragHdl() && DragStat().CheckMinMoved(rNoSnapPnt)) { if (GetDragHdl()->GetKind()==HDL_MIRX) { @@ -1042,22 +1045,25 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt) bool SdrDragMovHdl::EndSdrDrag(bool /*bCopy*/) { - switch (GetDragHdl()->GetKind()) + if( GetDragHdl() ) { - case HDL_REF1: - Ref1()=DragStat().GetNow(); - break; + switch (GetDragHdl()->GetKind()) + { + case HDL_REF1: + Ref1()=DragStat().GetNow(); + break; - case HDL_REF2: - Ref2()=DragStat().GetNow(); - break; + case HDL_REF2: + Ref2()=DragStat().GetNow(); + break; - case HDL_MIRX: - Ref1()+=DragStat().GetNow()-DragStat().GetStart(); - Ref2()+=DragStat().GetNow()-DragStat().GetStart(); - break; + case HDL_MIRX: + Ref1()+=DragStat().GetNow()-DragStat().GetStart(); + Ref2()+=DragStat().GetNow()-DragStat().GetStart(); + break; - default: break; + default: break; + } } return true; @@ -1066,7 +1072,11 @@ bool SdrDragMovHdl::EndSdrDrag(bool /*bCopy*/) void SdrDragMovHdl::CancelSdrDrag() { Hide(); - GetDragHdl()->SetPos(DragStat().GetRef1()); + + SdrHdl* pHdl = GetDragHdl(); + if( pHdl ) + pHdl->SetPos(DragStat().GetRef1()); + SdrHdl* pHM = GetHdlList().GetHdl(HDL_MIRX); if(pHM) diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 7a4305b9581f..acf0b988d2ca 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -988,8 +988,6 @@ Pointer SdrView::GetPreferedPointer(const Point& rMousePos, const OutputDevice* if ((IsDraggingPoints() || IsDraggingGluePoints()) && IsMouseHideWhileDraggingPoints()) return Pointer(POINTER_NULL); - OSL_TRACE("SdrView::GetPreferedPointer(%lx) %lx\n", this, mpCurrentSdrDragMethod); - return mpCurrentSdrDragMethod->GetSdrDragPointer(); } if (IsMarkObj() || IsMarkPoints() || IsMarkGluePoints() || IsEncirclement() || IsSetPageOrg()) return Pointer(POINTER_ARROW); -- cgit From 43aa5e0362693dfddbd9e8a44ca028f49428fd96 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 8 Dec 2010 12:35:53 +0100 Subject: impressdefaults1: #i112002# enter rotation mode after text edit when rotation mode is on --- sd/source/ui/func/fusel.cxx | 4 ---- sd/source/ui/func/futext.cxx | 11 +++++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 9b3fb0e10de6..5c380da547bc 100755 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -160,8 +160,6 @@ FuSelection::~FuSelection() BOOL FuSelection::MouseButtonDown(const MouseEvent& rMEvt) { - OSL_TRACE("FuSelection::MouseButtonDown(), clicks=%d", rMEvt.GetClicks() ); - // Hack fuer #?????# bHideAndAnimate = FALSE; @@ -650,8 +648,6 @@ BOOL FuSelection::MouseMove(const MouseEvent& rMEvt) BOOL FuSelection::MouseButtonUp(const MouseEvent& rMEvt) { - OSL_TRACE("FuSelection::MouseButtonUp(), clicks=%d", rMEvt.GetClicks() ); - BOOL bReturn = FALSE; // When the right mouse button is pressed then only select objects // (and deselect others) as a preparation for showing the context diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 2f3111665692..2835821796a1 100755 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -702,6 +702,17 @@ BOOL FuText::MouseButtonUp(const MouseEvent& rMEvt) mpView->EndDragObj( mpView->IsDragWithCopy() ); mpView->ForceMarkedToAnotherPage(); mpView->SetCurrentObj(OBJ_TEXT); + + USHORT nDrgLog = USHORT ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); + + if ( mpView->IsRotateAllowed() && mpViewShell->GetFrameView()->IsClickChangeRotation() && (rMEvt.GetClicks() != 2) && + !rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && !rMEvt.IsRight() && + Abs(aPnt.X() - aMDPos.X()) < nDrgLog && + Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) + { + // toggle to rotation mode + mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_OBJECT_ROTATE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD ); + } } else if( mpView && mpView->IsCreateObj() && rMEvt.IsLeft()) { -- cgit From 2af4a3ecb6f608fdf4cf306db861afb8f9c42c93 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 8 Dec 2010 16:14:33 +0100 Subject: vcl117: clean up helpid mismatch --- testautomation/global/win/edia_p_s.win | 168 ++++++++++++++++----------------- 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/testautomation/global/win/edia_p_s.win b/testautomation/global/win/edia_p_s.win index da1f30a7f696..a13bfb241355 100755 --- a/testautomation/global/win/edia_p_s.win +++ b/testautomation/global/win/edia_p_s.win @@ -114,91 +114,91 @@ Currency sym:WIZARDS_HID_DLGDEPOT_LSTMARKETS OKButton sym:WIZARDS_HID_DLGDEPOT_0_CMDGOON_HISTORY CancelButton sym:WIZARDS_HID_DLGDEPOT_0_CMDCANCEL_HISTORY -*Printing .HelpId:vcl:PrintDialog:Dialog -PreviewWindow .HelpId:vcl:PrintDialog:Preview -PreviewPageNumber .HelpId:vcl:PrintDialog:PageEdit -ScrollBackward .HelpId:vcl:PrintDialog:BackwardBtn -ScrollForward .HelpId:vcl:PrintDialog:ForwardBtn -Print .HelpId:vcl:PrintDialog:OK -Cancel .HelpId:vcl:PrintDialog:Cancel +*Printing .HelpID:vcl:PrintDialog:Dialog +PreviewWindow .HelpID:vcl:PrintDialog:Preview +PreviewPageNumber .HelpID:vcl:PrintDialog:PageEdit +ScrollBackward .HelpID:vcl:PrintDialog:BackwardBtn +ScrollForward .HelpID:vcl:PrintDialog:ForwardBtn +Print .HelpID:vcl:PrintDialog:OK +Cancel .HelpID:vcl:PrintDialog:Cancel -PrintingTabControl .HelpId:vcl:PrintDialog:TabPages -TabPrintGeneral .HelpId:vcl:PrintDialog:JobPage -TabApplication .HelpId:vcl:PrintDialog:TabPage:10 -TabLayout .HelpId:vcl:PrintDialog:NUpPage -TabOptions .HelpId:vcl:PrintDialog:OptPage - -*TabPrintGeneral .HelpId:vcl:PrintDialog:JobPage -PrinterList .HelpId:vcl:PrintDialog:JobPage:PrinterList -NumberOfCopies .HelpId:vcl:PrintDialog:JobPage:Copies -Collate .HelpId:vcl:PrintDialog:JobPage:Collate -PrintNotes .HelpId:vcl:PrintDialog:PrintAnnotationMode:ListBox -AllPages .HelpId:vcl:PrintDialog:PrintContent:RadioButton:0 -AllSlides .HelpId:vcl:PrintDialog:PrintContent:RadioButton:0 -AllSheets .HelpId:vcl:PrintDialog:PrintContent:RadioButton:0 -Pages .HelpId:vcl:PrintDialog:PrintContent:RadioButton:1 -Slides .HelpId:vcl:PrintDialog:PrintContent:RadioButton:1 -SelectedSheets .HelpId:vcl:PrintDialog:PrintContent:RadioButton:1 -PrintAllPages .HelpId:vcl:PrintDialog:PrintRange:RadioButton:0 -PrintPages .HelpId:vcl:PrintDialog:PrintRange:RadioButton:1 -PageRange .HelpId:vcl:PrintDialog:PageRange:Edit -Selection .HelpId:vcl:PrintDialog:PrintContent:RadioButton:2 -SelectedCells .HelpId:vcl:PrintDialog:PrintContent:RadioButton:2 -Details .HelpId:vcl:PrintDialog:JobPage:DetailsBtn -Properties .HelpId:vcl:PrintDialog:JobPage:Properties -PageCount .HelpId:vcl:PrintDialog:NumPagesText -PartsToPrint .HelpId:vcl:PrintDialog:PageContentType:ListBox -SlidesPerPage .HelpId:vcl:PrintDialog:SlidesPerPage:ListBox -ArrangeSlides .HelpId:vcl:PrintDialog:SlidesPerPageOrder:ListBox - -*TabApplication .HelpId:vcl:PrintDialog:TabPage:10 -PrintPageBackground .HelpId:vcl:PrintDialog:PrintPageBackground:CheckBox -PrintGraphicsAndDiagrams .HelpId:vcl:PrintDialog:PrintTablesGraphicsAndDiagrams:CheckBox -PrintPicturesAndObjects .HelpId:vcl:PrintDialog:PrintPicturesAndObjects:CheckBox -PrintHiddenText .HelpId:vcl:PrintDialog:PrintHiddenText:CheckBox -PrintTextPlaceholder .HelpId:vcl:PrintDialog:PrintTextPlaceholder:CheckBox -PrintFormControls .HelpId:vcl:PrintDialog:PrintControls:CheckBox -PrintTextInBlack .HelpId:vcl:PrintDialog:PrintBlackFonts:CheckBox -PrintBlankPages .HelpId:vcl:PrintDialog:PrintEmptyPages:CheckBox -IncludeEmptyPages .HelpId:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox -SlideName .HelpId:vcl:PrintDialog:IsPrintName:CheckBox -DateAndTime .HelpId:vcl:PrintDialog:IsPrintDateTime:CheckBox -HiddenPages .HelpId:vcl:PrintDialog:IsPrintHidden:CheckBox -TilePaper .HelpId:vcl:PrintDialog:PageOptions:RadioButton:3 -OriginalColors .HelpId:vcl:PrintDialog:Quality:RadioButton:0 -Grayscale .HelpId:vcl:PrintDialog:Quality:RadioButton:1 -BlackAndWhite .HelpId:vcl:PrintDialog:Quality:RadioButton:2 -MultiplePages .HelpId:vcl:PrintDialog:PageOptions:RadioButton:2 -TitleRow .HelpId:vcl:PrintDialog:TitleRow:CheckBox -FormulaText .HelpId:vcl:PrintDialog:FormulaText:CheckBox -Borders .HelpId:vcl:PrintDialog:Border:CheckBox -OriginalSize .HelpId:vcl:PrintDialog:PageOptions:RadioButton:0 -OriginalSizeMath .HelpId:vcl:PrintDialog:PrintFormat:RadioButton:0 -FitToPage .HelpId:vcl:PrintDialog:PageOptions:RadioButton:1 -FitToPageMath .HelpId:vcl:PrintDialog:PrintFormat:RadioButton:1 -Scaling .HelpId:vcl:PrintDialog:PrintFormat:RadioButton:2 -ScalingFactor .HelpId:vcl:PrintDialog:PrintScale:NumericField - -*TabLayout .HelpId:vcl:PrintDialog:NUpPage -PagesPerSheet .HelpId:vcl:PrintDialog:NUpPage:PagesPerSheet -NumberOfPages .HelpId:vcl:PrintDialog:NUpPage:PagesPerSheetBox -NumberOfColumns .HelpId:vcl:PrintDialog:NUpPage:ColumnsBox -NumberOfRows .HelpId:vcl:PrintDialog:NUpPage:RowsBox -BorderAroundPages .HelpId:vcl:PrintDialog:NUpPage:BorderBox -Brochure .HelpId:vcl:PrintDialog:NUpPage:Brochure -DistanceBetweenPages .HelpId:vcl:PrintDialog:NUpPage:PageMarginBox -MarginToSheetBorder .HelpId:vcl:PrintDialog:NUpPage:SheetMarginBox -PaperOrientation .HelpId:vcl:PrintDialog:NUpPage:OrientationBox -PrintOrder .HelpId:vcl:PrintDialog:NUpPage:OrderBox -IncludePages .HelpId:vcl:PrintDialog:PrintLeftRightPages:ListBox -PrintBrochureRTL .HelpId:vcl:PrintDialog:PrintProspectRTL:ListBox -BrochurePageSides .HelpId:vcl:PrintDialog:PrintProspectInclude:ListBox - -*TabOptions .HelpId:vcl:PrintDialog:OptPage -PrintToFile .HelpId:vcl:PrintDialog:OptPage:ToFile -PrintAsSingleJobs .HelpId:vcl:PrintDialog:OptPage:SingleJobs -PrintReverse .HelpId:vcl:PrintDialog:OptPage:Reverse -PaperTrayFromPrefs .HelpId:vcl:PrintDialog:PrintPaperFromSetup:CheckBox +PrintingTabControl .HelpID:vcl:PrintDialog:TabPages +TabPrintGeneral .HelpID:vcl:PrintDialog:JobPage +TabApplication .HelpID:vcl:PrintDialog:TabPage:10 +TabLayout .HelpID:vcl:PrintDialog:NUpPage +TabOptions .HelpID:vcl:PrintDialog:OptPage + +*TabPrintGeneral .HelpID:vcl:PrintDialog:JobPage +PrinterList .HelpID:vcl:PrintDialog:JobPage:PrinterList +NumberOfCopies .HelpID:vcl:PrintDialog:JobPage:Copies +Collate .HelpID:vcl:PrintDialog:JobPage:Collate +PrintNotes .HelpID:vcl:PrintDialog:PrintAnnotationMode:ListBox +AllPages .HelpID:vcl:PrintDialog:PrintContent:RadioButton:0 +AllSlides .HelpID:vcl:PrintDialog:PrintContent:RadioButton:0 +AllSheets .HelpID:vcl:PrintDialog:PrintContent:RadioButton:0 +Pages .HelpID:vcl:PrintDialog:PrintContent:RadioButton:1 +Slides .HelpID:vcl:PrintDialog:PrintContent:RadioButton:1 +SelectedSheets .HelpID:vcl:PrintDialog:PrintContent:RadioButton:1 +PrintAllPages .HelpID:vcl:PrintDialog:PrintRange:RadioButton:0 +PrintPages .HelpID:vcl:PrintDialog:PrintRange:RadioButton:1 +PageRange .HelpID:vcl:PrintDialog:PageRange:Edit +Selection .HelpID:vcl:PrintDialog:PrintContent:RadioButton:2 +SelectedCells .HelpID:vcl:PrintDialog:PrintContent:RadioButton:2 +Details .HelpID:vcl:PrintDialog:JobPage:DetailsBtn +Properties .HelpID:vcl:PrintDialog:JobPage:Properties +PageCount .HelpID:vcl:PrintDialog:NumPagesText +PartsToPrint .HelpID:vcl:PrintDialog:PageContentType:ListBox +SlidesPerPage .HelpID:vcl:PrintDialog:SlidesPerPage:ListBox +ArrangeSlides .HelpID:vcl:PrintDialog:SlidesPerPageOrder:ListBox + +*TabApplication .HelpID:vcl:PrintDialog:TabPage:10 +PrintPageBackground .HelpID:vcl:PrintDialog:PrintPageBackground:CheckBox +PrintGraphicsAndDiagrams .HelpID:vcl:PrintDialog:PrintTablesGraphicsAndDiagrams:CheckBox +PrintPicturesAndObjects .HelpID:vcl:PrintDialog:PrintPicturesAndObjects:CheckBox +PrintHiddenText .HelpID:vcl:PrintDialog:PrintHiddenText:CheckBox +PrintTextPlaceholder .HelpID:vcl:PrintDialog:PrintTextPlaceholder:CheckBox +PrintFormControls .HelpID:vcl:PrintDialog:PrintControls:CheckBox +PrintTextInBlack .HelpID:vcl:PrintDialog:PrintBlackFonts:CheckBox +PrintBlankPages .HelpID:vcl:PrintDialog:PrintEmptyPages:CheckBox +IncludeEmptyPages .HelpID:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox +SlideName .HelpID:vcl:PrintDialog:IsPrintName:CheckBox +DateAndTime .HelpID:vcl:PrintDialog:IsPrintDateTime:CheckBox +HiddenPages .HelpID:vcl:PrintDialog:IsPrintHidden:CheckBox +TilePaper .HelpID:vcl:PrintDialog:PageOptions:RadioButton:3 +OriginalColors .HelpID:vcl:PrintDialog:Quality:RadioButton:0 +Grayscale .HelpID:vcl:PrintDialog:Quality:RadioButton:1 +BlackAndWhite .HelpID:vcl:PrintDialog:Quality:RadioButton:2 +MultiplePages .HelpID:vcl:PrintDialog:PageOptions:RadioButton:2 +TitleRow .HelpID:vcl:PrintDialog:TitleRow:CheckBox +FormulaText .HelpID:vcl:PrintDialog:FormulaText:CheckBox +Borders .HelpID:vcl:PrintDialog:Border:CheckBox +OriginalSize .HelpID:vcl:PrintDialog:PageOptions:RadioButton:0 +OriginalSizeMath .HelpID:vcl:PrintDialog:PrintFormat:RadioButton:0 +FitToPage .HelpID:vcl:PrintDialog:PageOptions:RadioButton:1 +FitToPageMath .HelpID:vcl:PrintDialog:PrintFormat:RadioButton:1 +Scaling .HelpID:vcl:PrintDialog:PrintFormat:RadioButton:2 +ScalingFactor .HelpID:vcl:PrintDialog:PrintScale:NumericField + +*TabLayout .HelpID:vcl:PrintDialog:NUpPage +PagesPerSheet .HelpID:vcl:PrintDialog:NUpPage:PagesPerSheet +NumberOfPages .HelpID:vcl:PrintDialog:NUpPage:PagesPerSheetBox +NumberOfColumns .HelpID:vcl:PrintDialog:NUpPage:ColumnsBox +NumberOfRows .HelpID:vcl:PrintDialog:NUpPage:RowsBox +BorderAroundPages .HelpID:vcl:PrintDialog:NUpPage:BorderBox +Brochure .HelpID:vcl:PrintDialog:NUpPage:Brochure +DistanceBetweenPages .HelpID:vcl:PrintDialog:NUpPage:PageMarginBox +MarginToSheetBorder .HelpID:vcl:PrintDialog:NUpPage:SheetMarginBox +PaperOrientation .HelpID:vcl:PrintDialog:NUpPage:OrientationBox +PrintOrder .HelpID:vcl:PrintDialog:NUpPage:OrderBox +IncludePages .HelpID:vcl:PrintDialog:PrintLeftRightPages:ListBox +PrintBrochureRTL .HelpID:vcl:PrintDialog:PrintProspectRTL:ListBox +BrochurePageSides .HelpID:vcl:PrintDialog:PrintProspectInclude:ListBox + +*TabOptions .HelpID:vcl:PrintDialog:OptPage +PrintToFile .HelpID:vcl:PrintDialog:OptPage:ToFile +PrintAsSingleJobs .HelpID:vcl:PrintDialog:OptPage:SingleJobs +PrintReverse .HelpID:vcl:PrintDialog:OptPage:Reverse +PaperTrayFromPrefs .HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox *PurchaseStarOffice sym:TAB_HID_LICENSING_DIALOG TabPurchase sym:TAB_HID_TP_PURCHASE -- cgit From 8e96aa5f95a7694e3ffbbe0655cc5d947007dafa Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 8 Dec 2010 16:14:33 +0100 Subject: vcl117: clean up helpid mismatch --- vcl/source/src/print.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src index dcc780f99b72..cf7ede385e50 100644 --- a/vcl/source/src/print.src +++ b/vcl/source/src/print.src @@ -29,7 +29,7 @@ ModalDialog SV_DLG_PRINT { - HelpID = ".HelpId:vcl:PrintDialog:Dialog"; + HelpID = ".HelpID:vcl:PrintDialog:Dialog"; Text [en-US] = "Print"; Closeable = TRUE; Sizeable = TRUE; -- cgit From 32882eda3b8ecadbc23ca3f9598dfe18a55b0bfa Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 9 Dec 2010 11:30:23 +0100 Subject: vcl117: more HelpID cleanup --- testautomation/global/win/edia_p_s.win | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/global/win/edia_p_s.win b/testautomation/global/win/edia_p_s.win index a13bfb241355..6bf7cf3aa896 100755 --- a/testautomation/global/win/edia_p_s.win +++ b/testautomation/global/win/edia_p_s.win @@ -124,7 +124,7 @@ Cancel .HelpID:vcl:PrintDialog:Cancel PrintingTabControl .HelpID:vcl:PrintDialog:TabPages TabPrintGeneral .HelpID:vcl:PrintDialog:JobPage -TabApplication .HelpID:vcl:PrintDialog:TabPage:10 +TabApplication .HelpID:vcl:PrintDialog:TabPage:AppPage TabLayout .HelpID:vcl:PrintDialog:NUpPage TabOptions .HelpID:vcl:PrintDialog:OptPage -- cgit From 456861df0288465b642fbf777f70ac07cd53eba5 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 9 Dec 2010 11:30:23 +0100 Subject: vcl117: more HelpID cleanup --- vcl/source/src/print.src | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src index cf7ede385e50..04ab77f09288 100644 --- a/vcl/source/src/print.src +++ b/vcl/source/src/print.src @@ -130,7 +130,7 @@ ModalDialog SV_DLG_PRINT TabPage SV_PRINT_TAB_NUP { - HelpID = ".HelpID:vcl:PrintDialog:TabNUp"; + HelpID = ".HelpID:vcl:PrintDialog:NUpPage"; Text [en-US] = "Page Layout"; Hide = TRUE; @@ -307,7 +307,7 @@ ModalDialog SV_DLG_PRINT TabPage SV_PRINT_TAB_JOB { - HelpID = ".HelpID:vcl:PrintDialog:TabJob"; + HelpID = ".HelpID:vcl:PrintDialog:JobPage"; Text [en-US] = "General"; Hide = TRUE; @@ -418,7 +418,7 @@ ModalDialog SV_DLG_PRINT { Text [en-US] = "Options"; Hide = TRUE; - HelpID = ".HelpID:vcl:PrintDialog:TabOpt"; + HelpID = ".HelpID:vcl:PrintDialog:OptPage"; FixedLine SV_PRINT_OPT_PRINT_FL { -- cgit From ae9f639a1241cbf80bb3c2309c1aa64355fae056 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 9 Dec 2010 11:30:23 +0100 Subject: vcl117: more HelpID cleanup --- starmath/source/unomodel.cxx | 2 +- sw/source/core/view/printdata.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 6c5ecc999885..b57e4f4ff2e9 100755 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -100,7 +100,7 @@ SmPrintUIOptions::SmPrintUIOptions() String aAppGroupname( aLocalizedStrings.GetString( 0 ) ); aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), aOpt.GetModuleName( SvtModuleOptions::E_SMATH ) ); - m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() ); + m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TabPage:AppPage" ) ) ); // create subgroup for print options m_aUIProperties[1].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 1 ), rtl::OUString() ); diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index e486eb14a7a5..bc16348abaee 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -226,7 +226,7 @@ SwPrintUIOptions::SwPrintUIOptions( String aAppGroupname( aLocalizedStrings.GetString( 0 ) ); aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), aModOpt.GetModuleName( SvtModuleOptions::E_SWRITER ) ); - m_aUIProperties[ nIdx++ ].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() ); + m_aUIProperties[ nIdx++ ].Value = getGroupControlOpt( aAppGroupname, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TabPage:AppPage" ) ) ); // create sub section for Contents m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 1 ), rtl::OUString() ); -- cgit From 41137ed7095b7a46b071e50587f8bc081e361de1 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 9 Dec 2010 11:30:23 +0100 Subject: vcl117: more HelpID cleanup --- sd/source/ui/view/DocumentRenderer.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 5b47bd699054..230469cfe6b4 100755 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -436,7 +436,7 @@ namespace { aOpt.GetModuleName( mbImpress ? SvtModuleOptions::E_SIMPRESS : SvtModuleOptions::E_SDRAW ) ); AddDialogControl( vcl::PrinterOptionsHelper::getGroupControlOpt( aAppGroupname, - rtl::OUString() + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TabPage:AppPage" ) ) ) ); uno::Sequence< rtl::OUString > aHelpIds; -- cgit From e3c9000303f73558849a3e9b493b53ac67678f1f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 9 Dec 2010 11:30:23 +0100 Subject: vcl117: more HelpID cleanup --- sc/source/ui/unoobj/docuno.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 1805daa9b5ef..6057721a68b7 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -236,7 +236,7 @@ ScPrintUIOptions::ScPrintUIOptions() String aAppGroupname( aStrings.GetString( 9 ) ); aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), aOpt.GetModuleName( SvtModuleOptions::E_SCALC ) ); - m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() ); + m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TabPage:AppPage" ) ) ); // create subgroup for pages m_aUIProperties[1].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 0 ) ), rtl::OUString() ); -- cgit From 8fe0af98b60691ee1ab353b28753737b5570ea8a Mon Sep 17 00:00:00 2001 From: "Helge Delfs [hde]" Date: Thu, 9 Dec 2010 15:29:59 +0100 Subject: vcl117#i115056#adapted some helpids to changed ones in office --- testautomation/global/win/edia_p_s.win | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testautomation/global/win/edia_p_s.win b/testautomation/global/win/edia_p_s.win index 6bf7cf3aa896..7cd8e58ed94e 100755 --- a/testautomation/global/win/edia_p_s.win +++ b/testautomation/global/win/edia_p_s.win @@ -132,7 +132,7 @@ TabOptions .HelpID:vcl:PrintDialog:OptPage PrinterList .HelpID:vcl:PrintDialog:JobPage:PrinterList NumberOfCopies .HelpID:vcl:PrintDialog:JobPage:Copies Collate .HelpID:vcl:PrintDialog:JobPage:Collate -PrintNotes .HelpID:vcl:PrintDialog:PrintAnnotationMode:ListBox +PrintNotes .HelpID:vcl:PrintDialog:PrintAnnotationMode:FixedText AllPages .HelpID:vcl:PrintDialog:PrintContent:RadioButton:0 AllSlides .HelpID:vcl:PrintDialog:PrintContent:RadioButton:0 AllSheets .HelpID:vcl:PrintDialog:PrintContent:RadioButton:0 @@ -151,7 +151,7 @@ PartsToPrint .HelpID:vcl:PrintDialog:PageContentType:ListBox SlidesPerPage .HelpID:vcl:PrintDialog:SlidesPerPage:ListBox ArrangeSlides .HelpID:vcl:PrintDialog:SlidesPerPageOrder:ListBox -*TabApplication .HelpID:vcl:PrintDialog:TabPage:10 +*TabApplication .HelpID:vcl:PrintDialog:TabPage:AppPage PrintPageBackground .HelpID:vcl:PrintDialog:PrintPageBackground:CheckBox PrintGraphicsAndDiagrams .HelpID:vcl:PrintDialog:PrintTablesGraphicsAndDiagrams:CheckBox PrintPicturesAndObjects .HelpID:vcl:PrintDialog:PrintPicturesAndObjects:CheckBox @@ -197,7 +197,7 @@ BrochurePageSides .HelpID:vcl:PrintDialog:PrintProspectInclude:ListBox *TabOptions .HelpID:vcl:PrintDialog:OptPage PrintToFile .HelpID:vcl:PrintDialog:OptPage:ToFile PrintAsSingleJobs .HelpID:vcl:PrintDialog:OptPage:SingleJobs -PrintReverse .HelpID:vcl:PrintDialog:OptPage:Reverse +PrintReverse .HelpID:vcl:PrintDialog:OptPage:ToReverse PaperTrayFromPrefs .HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox *PurchaseStarOffice sym:TAB_HID_LICENSING_DIALOG -- cgit From 90caa1cd9c39fdaf4a94880cafbb7f242925e8a6 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 10 Dec 2010 11:39:42 +0100 Subject: vcl117: more help id woes --- vcl/source/window/printdlg.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index a7832aa191d9..f07ee9e51e8b 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -2139,8 +2139,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton ) Help* pHelp = Application::GetHelp(); if( pHelp ) { - // FIXME: find out proper help URL and use here - pHelp->Start( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ), GetParent() ); + pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:OK" ) ), &maOKButton ); } } else if( pButton == &maForwardBtn ) -- cgit From bf0495f4c868c4889f96e45db0da8d445560cc5b Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 10 Dec 2010 11:39:42 +0100 Subject: vcl117: more help id woes --- starmath/source/unomodel.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index b57e4f4ff2e9..6520f9e8acf7 100755 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -143,7 +143,7 @@ SmPrintUIOptions::SmPrintUIOptions() // create a numeric box for scale dependent on PrintFormat = "Scaling" (matches to SID_PRINTZOOM) vcl::PrinterOptionsHelper::UIControlOptions aRangeOpt( aPrintFormatProp, 2, sal_True ); m_aUIProperties[ 7 ].Value = getRangeControlOpt( rtl::OUString(), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintScale:NumericField," ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintScale:NumericField" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PRTUIOPT_PRINT_SCALE ) ), pConfig->GetPrintZoomFactor(), // initial value 10, // min value -- cgit From 8ea2ed193327f81b8713def96246b45c6bb0d196 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 10 Dec 2010 11:39:42 +0100 Subject: vcl117: more help id woes --- sd/source/ui/view/DocumentRenderer.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 230469cfe6b4..b0248647b3dc 100755 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -665,7 +665,7 @@ namespace { // create a an Edit dependent on "Pages" selected vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True ); AddDialogControl( vcl::PrinterOptionsHelper::getEditControlOpt( rtl::OUString(), - rtl::OUString(), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageRange:Edit" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ), rtl::OUString(), aPageRangeOpt ) -- cgit From aee56406b1a9db7049bda81802b225077174dc99 Mon Sep 17 00:00:00 2001 From: sj Date: Tue, 14 Dec 2010 13:48:38 +0100 Subject: impress204: fixed build problem (precompiled filter include was missing) --- filter/source/graphicfilter/ipict/shape.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/filter/source/graphicfilter/ipict/shape.cxx b/filter/source/graphicfilter/ipict/shape.cxx index 454a0dcb5b38..fdf32830b728 100755 --- a/filter/source/graphicfilter/ipict/shape.cxx +++ b/filter/source/graphicfilter/ipict/shape.cxx @@ -38,6 +38,7 @@ Here, we choose: - for horizontal/vertical lines and line with length less than five to draw the real line, - in the other case, we keep the same shape (even if this means some "bad" coordinates) */ +#include "precompiled_filter.hxx" #include #include -- cgit From 4027985c835cd23dd93afd28ed985c364abafd3f Mon Sep 17 00:00:00 2001 From: "Helge Delfs [hde]" Date: Wed, 15 Dec 2010 11:42:28 +0100 Subject: automationdev300m95#i116118#After restarting the office a new document will be opened --- testautomation/writer/tools/includes/w_tool6.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testautomation/writer/tools/includes/w_tool6.inc b/testautomation/writer/tools/includes/w_tool6.inc index 33ddca87709e..9bc7ed688d9b 100644 --- a/testautomation/writer/tools/includes/w_tool6.inc +++ b/testautomation/writer/tools/includes/w_tool6.inc @@ -38,6 +38,10 @@ sub wOfficeRestart FileExit "SynchronMode", TRUE Call hStartTheOffice + + ' Open new document + Call hNewDocument + end sub '-------------------------------------------------------------- -- cgit From 8ff295d5a5190890634cc68b69c9420daa601b85 Mon Sep 17 00:00:00 2001 From: "Helge Delfs [hde]" Date: Thu, 16 Dec 2010 11:59:14 +0100 Subject: automationdev300m95#i116147#turned qaerrorlogs into warnlogs and fixed closing dialog --- testautomation/global/required/includes/g_option.inc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/testautomation/global/required/includes/g_option.inc b/testautomation/global/required/includes/g_option.inc index 2f7b6aa33ac2..0c40d3c3d08e 100644 --- a/testautomation/global/required/includes/g_option.inc +++ b/testautomation/global/required/includes/g_option.inc @@ -756,7 +756,7 @@ testcase tToolsOptionsImprovementProgram Active.ok() else if ( NOT bImportDialogHasBeenDisplayed ) then - qaerrorlog( "#i97340# Show Data button enabled but no logged data found" ) + warnlog( "#i97340# Show Data button enabled but no logged data found" ) endif endif @@ -767,8 +767,13 @@ testcase tToolsOptionsImprovementProgram endif Kontext "OptionenDlg" - OptionenDlg.cancel() - + if OptionenDlg.Exists then + OptionenDlg.cancel() + endif + + if GetDocumentCount = 1 then + Call hCloseDocument + endif else ' hDeleteFile() returns FALSE if the file is still present for some weird reason ' We should warn about this because the test breaks at a later point then. -- cgit From e7db78122b88d7ecd3d76357fa1f7ff884b8ce38 Mon Sep 17 00:00:00 2001 From: "Helge Delfs [hde]" Date: Thu, 16 Dec 2010 11:59:34 +0100 Subject: automationdev300m95#i116147#turned qaerrorlogs into warnlogs --- testautomation/framework/optional/includes/f_usage_tracking.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/framework/optional/includes/f_usage_tracking.inc b/testautomation/framework/optional/includes/f_usage_tracking.inc index ef20c2a2f1e5..c52ae61c0945 100644 --- a/testautomation/framework/optional/includes/f_usage_tracking.inc +++ b/testautomation/framework/optional/includes/f_usage_tracking.inc @@ -100,7 +100,7 @@ testcase tUsageTracking3 kontext "Active" if ( Active.exists( 2 ) ) then - qaerrorlog( "Messagebox not required as control should not be enabled (see #i97340#)" ) + warnlog( "Messagebox not required as control should not be enabled (see #i97340#)" ) Active.ok() kontext "TextImport" -- cgit From 38af65d1b4f83de02e9d95f85349932990830947 Mon Sep 17 00:00:00 2001 From: "Helge Delfs [hde]" Date: Fri, 17 Dec 2010 09:52:23 +0100 Subject: automationdev300m95#i116157#added some sleeps --- testautomation/writer/optional/includes/textframes/w_textframes2.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testautomation/writer/optional/includes/textframes/w_textframes2.inc b/testautomation/writer/optional/includes/textframes/w_textframes2.inc index 4fca2bdbddb6..466b0c99ab15 100644 --- a/testautomation/writer/optional/includes/textframes/w_textframes2.inc +++ b/testautomation/writer/optional/includes/textframes/w_textframes2.inc @@ -868,7 +868,7 @@ testcase tTextframes_28 printlog "Insert a frame" Call fInsertFrame(30, 30, 60, 60) - + Sleep 2 printlog "Naming the frame" Call fFormatFrame("TabZusaetze") ObjektName.SetText sFrameName1 @@ -885,7 +885,7 @@ testcase tTextframes_28 printlog "Insert another frame" Call fInsertFrame(50, 50, 80, 80) - + Sleep 2 printlog "Naming the frame" Call fFormatFrame("TabZusaetze") ObjektName.SetText sFrameName2 -- cgit From dc7c582cb8a5aee16ac59557f3fc486903e04067 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Fri, 17 Dec 2010 15:37:26 +0100 Subject: oooimprovement7: #i116126# join logrotate thread upon terminate --- extensions/source/oooimprovement/onlogrotate_job.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/extensions/source/oooimprovement/onlogrotate_job.cxx b/extensions/source/oooimprovement/onlogrotate_job.cxx index c5f6b56be31a..1e36c711820d 100644 --- a/extensions/source/oooimprovement/onlogrotate_job.cxx +++ b/extensions/source/oooimprovement/onlogrotate_job.cxx @@ -158,16 +158,25 @@ namespace m_Thread->create(); } virtual ~OnLogRotateThreadWatcher() - { m_Thread->disposing()->terminate(); }; + { + m_Thread->disposing()->terminate(); + m_Thread->join(); + }; // XTerminateListener virtual void SAL_CALL queryTermination(const EventObject&) throw(RuntimeException) { }; virtual void SAL_CALL notifyTermination(const EventObject&) throw(RuntimeException) - { m_Thread->disposing()->terminate(); }; + { + m_Thread->disposing()->terminate(); + m_Thread->join(); + }; // XEventListener virtual void SAL_CALL disposing(const EventObject&) throw(RuntimeException) - { m_Thread->disposing()->terminate(); }; + { + m_Thread->disposing()->terminate(); + m_Thread->join(); + }; private: ::std::auto_ptr m_Thread; }; -- cgit From 3314946fde9aa5984af0b0bbc07dee686e51394b Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Fri, 17 Dec 2010 15:41:55 +0100 Subject: oooimprovement7: #i116158# catching all uno exceptions when logrotating --- extensions/source/oooimprovement/onlogrotate_job.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/source/oooimprovement/onlogrotate_job.cxx b/extensions/source/oooimprovement/onlogrotate_job.cxx index 1e36c711820d..53cc9bd7a2b9 100644 --- a/extensions/source/oooimprovement/onlogrotate_job.cxx +++ b/extensions/source/oooimprovement/onlogrotate_job.cxx @@ -132,8 +132,12 @@ namespace { if(Config(m_ServiceFactory).getInvitationAccepted()) { - packLogs(m_ServiceFactory); - uploadLogs(m_ServiceFactory); + try + { + packLogs(m_ServiceFactory); + uploadLogs(m_ServiceFactory); + } + catch( com::sun::star::uno::Exception) {} } else LogStorage(m_ServiceFactory).clear(); -- cgit From 1533e16e0085f383b08a66573f18b2844950d5ab Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Tue, 21 Dec 2010 14:45:06 +0100 Subject: oooimprovement7: #i116158# catching exceptions around whole block --- extensions/source/oooimprovement/onlogrotate_job.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/extensions/source/oooimprovement/onlogrotate_job.cxx b/extensions/source/oooimprovement/onlogrotate_job.cxx index 53cc9bd7a2b9..d83c43bfcfd8 100644 --- a/extensions/source/oooimprovement/onlogrotate_job.cxx +++ b/extensions/source/oooimprovement/onlogrotate_job.cxx @@ -128,21 +128,21 @@ namespace } { ::osl::Guard< ::osl::Mutex> service_factory_guard(m_ServiceFactoryMutex); - if(m_ServiceFactory.is()) + try { - if(Config(m_ServiceFactory).getInvitationAccepted()) + if(m_ServiceFactory.is()) { - try + if(Config(m_ServiceFactory).getInvitationAccepted()) { packLogs(m_ServiceFactory); uploadLogs(m_ServiceFactory); } - catch( com::sun::star::uno::Exception) {} + else + LogStorage(m_ServiceFactory).clear(); } - else - LogStorage(m_ServiceFactory).clear(); + m_ServiceFactory.clear(); } - m_ServiceFactory.clear(); + catch(...) {} } } -- cgit From 79d45a155b7819b87f4ef28b99fc9d44813a16f4 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 28 Dec 2010 17:59:34 +0100 Subject: dr77: post rebase fixes --- filter/prj/d.lst | 1 + filter/source/msfilter/makefile.mk | 12 +++++++++-- filter/source/msfilter/msfilter.component | 34 +++++++++++++++++++++++++++++++ filter/source/msfilter/services.cxx | 5 ----- oox/inc/oox/xls/worksheethelper.hxx | 5 ++--- oox/source/dump/dumperbase.cxx | 1 + oox/source/xls/biffcodec.cxx | 3 +++ oox/source/xls/drawingfragment.cxx | 11 ++++++++-- oox/source/xls/worksheethelper.cxx | 18 +++++----------- 9 files changed, 65 insertions(+), 25 deletions(-) create mode 100755 filter/source/msfilter/msfilter.component diff --git a/filter/prj/d.lst b/filter/prj/d.lst index 037bef1a3765..52d96f64cdf5 100644 --- a/filter/prj/d.lst +++ b/filter/prj/d.lst @@ -60,6 +60,7 @@ mkdir: %_DEST%\inc%_EXT%\filter\msfilter ..\%__SRC%\misc\XSLTValidate.component %_DEST%\xml%_EXT%\XSLTValidate.component ..\%__SRC%\misc\filterconfig1.component %_DEST%\xml%_EXT%\filterconfig1.component ..\%__SRC%\misc\flash.component %_DEST%\xml%_EXT%\flash.component +..\%__SRC%\misc\msfilter.component %_DEST%\xml%_EXT%\msfilter.component ..\%__SRC%\misc\pdffilter.component %_DEST%\xml%_EXT%\pdffilter.component ..\%__SRC%\misc\placeware.component %_DEST%\xml%_EXT%\placeware.component ..\%__SRC%\misc\svgfilter.component %_DEST%\xml%_EXT%\svgfilter.component diff --git a/filter/source/msfilter/makefile.mk b/filter/source/msfilter/makefile.mk index 1a8d27d85097..62ac9b5c90d4 100644 --- a/filter/source/msfilter/makefile.mk +++ b/filter/source/msfilter/makefile.mk @@ -25,11 +25,12 @@ # #************************************************************************* -PRJ=../.. +PRJ=..$/.. PRJNAME=filter TARGET=msfilter -ENABLE_EXCEPTIONS=true + +ENABLE_EXCEPTIONS=TRUE LIBTARGET=NO # --- Settings ----------------------------------------------------- @@ -81,7 +82,14 @@ SHL1STDLIBS= \ SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) +SHL1VERSIONMAP=$(SOLARENV)/src/component.map .INCLUDE : target.mk +ALLTAR : $(MISC)/msfilter.component +$(MISC)/msfilter.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + msfilter.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt msfilter.component diff --git a/filter/source/msfilter/msfilter.component b/filter/source/msfilter/msfilter.component new file mode 100755 index 000000000000..64128aa1385b --- /dev/null +++ b/filter/source/msfilter/msfilter.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/filter/source/msfilter/services.cxx b/filter/source/msfilter/services.cxx index cfe0bbdaaf12..09a303f72141 100755 --- a/filter/source/msfilter/services.cxx +++ b/filter/source/msfilter/services.cxx @@ -72,9 +72,4 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices ); } -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey ) -{ - return ::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, spServices ); -} - // ============================================================================ diff --git a/oox/inc/oox/xls/worksheethelper.hxx b/oox/inc/oox/xls/worksheethelper.hxx index d946818b0e5e..55bf1c044e30 100644 --- a/oox/inc/oox/xls/worksheethelper.hxx +++ b/oox/inc/oox/xls/worksheethelper.hxx @@ -389,9 +389,8 @@ public: void extendUsedArea( const ::com::sun::star::table::CellAddress& rAddress ); /** Extends the used area of this sheet by the passed cell range. */ void extendUsedArea( const ::com::sun::star::table::CellRangeAddress& rRange ); - /** Extends the shape bounding box by the position and size of the passed rectangle. */ - void extendShapeBoundingBox( - const ::com::sun::star::awt::Rectangle& rShapeRect ); + /** Extends the shape bounding box by the position and size of the passed rectangle (in 1/100 mm). */ + void extendShapeBoundingBox( const ::com::sun::star::awt::Rectangle& rShapeRect ); /** Sets base width for all columns (without padding pixels). This value is only used, if width has not been set with setDefaultColumnWidth(). */ diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index 32278e425664..f7c6c6102b1d 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -49,6 +49,7 @@ namespace dump { // ============================================================================ +using namespace ::com::sun::star::beans; using namespace ::com::sun::star::io; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::ucb; diff --git a/oox/source/xls/biffcodec.cxx b/oox/source/xls/biffcodec.cxx index 89b39ef4fc94..cb4829973fcc 100644 --- a/oox/source/xls/biffcodec.cxx +++ b/oox/source/xls/biffcodec.cxx @@ -37,6 +37,9 @@ namespace xls { // ============================================================================ +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::uno; + using ::oox::core::FilterBase; using ::rtl::OString; using ::rtl::OUString; diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx index e50883ec4fbc..e28608f728c6 100644 --- a/oox/source/xls/drawingfragment.cxx +++ b/oox/source/xls/drawingfragment.cxx @@ -601,8 +601,15 @@ void DrawingFragment::onEndElement() if( (aShapeRect.X >= 0) && (aShapeRect.Y >= 0) && (aShapeRect.Width >= 0) && (aShapeRect.Height >= 0) ) { mxShape->addShape( getOoxFilter(), &getTheme(), mxDrawPage, &aShapeRect ); - // collect all shape positions in the WorksheetHelper base class - extendShapeBoundingBox( aShapeRect ); + /* Collect all shape positions in the WorksheetHelper base + class. But first, scale EMUs to 1/100 mm. */ + const UnitConverter& rUnitConv = getUnitConverter(); + Rectangle aShapeRectHmm( + rUnitConv.scaleToMm100( aShapeRect.X, UNIT_EMU ), + rUnitConv.scaleToMm100( aShapeRect.Y, UNIT_EMU ), + rUnitConv.scaleToMm100( aShapeRect.Width, UNIT_EMU ), + rUnitConv.scaleToMm100( aShapeRect.Height, UNIT_EMU ) ); + extendShapeBoundingBox( aShapeRectHmm ); } } mxShape.reset(); diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx index 2bd8deeeae57..48ffac388cfd 100644 --- a/oox/source/xls/worksheethelper.cxx +++ b/oox/source/xls/worksheethelper.cxx @@ -997,25 +997,17 @@ void WorksheetData::extendUsedArea( const CellRangeAddress& rRange ) void WorksheetData::extendShapeBoundingBox( const Rectangle& rShapeRect ) { - // scale EMUs to 1/100 mm - const UnitConverter& rUnitConv = getUnitConverter(); - Rectangle aShapeRectHmm( - rUnitConv.scaleToMm100( rShapeRect.X, UNIT_EMU ), - rUnitConv.scaleToMm100( rShapeRect.Y, UNIT_EMU ), - rUnitConv.scaleToMm100( rShapeRect.Width, UNIT_EMU ), - rUnitConv.scaleToMm100( rShapeRect.Height, UNIT_EMU ) ); - if( (maShapeBoundingBox.Width == 0) && (maShapeBoundingBox.Height == 0) ) { // width and height of maShapeBoundingBox are assumed to be zero on first cell - maShapeBoundingBox = aShapeRectHmm; + maShapeBoundingBox = rShapeRect; } else { - sal_Int32 nEndX = ::std::max( maShapeBoundingBox.X + maShapeBoundingBox.Width, aShapeRectHmm.X + aShapeRectHmm.Width ); - sal_Int32 nEndY = ::std::max( maShapeBoundingBox.Y + maShapeBoundingBox.Height, aShapeRectHmm.Y + aShapeRectHmm.Height ); - maShapeBoundingBox.X = ::std::min( maShapeBoundingBox.X, aShapeRectHmm.X ); - maShapeBoundingBox.Y = ::std::min( maShapeBoundingBox.Y, aShapeRectHmm.Y ); + sal_Int32 nEndX = ::std::max( maShapeBoundingBox.X + maShapeBoundingBox.Width, rShapeRect.X + rShapeRect.Width ); + sal_Int32 nEndY = ::std::max( maShapeBoundingBox.Y + maShapeBoundingBox.Height, rShapeRect.Y + rShapeRect.Height ); + maShapeBoundingBox.X = ::std::min( maShapeBoundingBox.X, rShapeRect.X ); + maShapeBoundingBox.Y = ::std::min( maShapeBoundingBox.Y, rShapeRect.Y ); maShapeBoundingBox.Width = nEndX - maShapeBoundingBox.X; maShapeBoundingBox.Height = nEndY - maShapeBoundingBox.Y; } -- cgit From 7d6474a250ec1f05233ce5a1c457a3540ab30e18 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 28 Dec 2010 17:59:34 +0100 Subject: dr77: post rebase fixes --- scp2/source/ooo/file_library_ooo.scp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp index d4da0224a75d..228f70ee1391 100755 --- a/scp2/source/ooo/file_library_ooo.scp +++ b/scp2/source/ooo/file_library_ooo.scp @@ -1341,7 +1341,7 @@ STD_LIB_FILE( gid_File_Lib_Svx, svx) STD_LIB_FILE( gid_File_Lib_TextConversionDlgs, textconversiondlgs) STD_LIB_FILE( gid_File_Lib_Editeng, editeng) -STD_UNO_LIB_FILE( gid_File_Lib_Msfilter, msfilter) +STD_LIB_FILE( gid_File_Lib_Msfilter, msfilter) STD_LIB_FILE( gid_File_Lib_Sw , sw) STD_LIB_FILE( gid_File_Lib_Swui, swui) -- cgit From 0658973c1612c54af9bbb9e9ae67e9b5493978eb Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 28 Dec 2010 17:59:34 +0100 Subject: dr77: post rebase fixes --- sc/source/filter/excel/excimp8.cxx | 8 ++++++-- sc/source/filter/excel/xestream.cxx | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 53f850366551..60b8e20f9447 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -41,6 +41,11 @@ #include #include +#include +#include +#include +#include + #include #include #include @@ -58,8 +63,7 @@ #include #include -#include -#include +#include #include #include diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index b6b0c3051987..0a4e76a47e86 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -53,6 +54,7 @@ using ::rtl::OString; using ::rtl::OUString; +using ::rtl::OUStringBuffer; using ::utl::OStreamWrapper; using ::std::vector; -- cgit From 3e8b126b6cb77a2e993152d5bbd0def604e8ba06 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 28 Dec 2010 17:59:34 +0100 Subject: dr77: post rebase fixes --- postprocess/packcomponents/makefile.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/postprocess/packcomponents/makefile.mk b/postprocess/packcomponents/makefile.mk index 537a62be4ba5..3ca8a15296b4 100644 --- a/postprocess/packcomponents/makefile.mk +++ b/postprocess/packcomponents/makefile.mk @@ -109,6 +109,7 @@ my_components = \ log \ mcnttype \ migrationoo2 \ + msfilter \ msforms \ mysql \ odbc \ -- cgit From 7b0f5f6af3fa2d6c926cbd6fc34fc631bd250173 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Wed, 29 Dec 2010 10:50:43 +0100 Subject: dr77: copy/paste error --- filter/source/msfilter/makefile.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/filter/source/msfilter/makefile.mk b/filter/source/msfilter/makefile.mk index 62ac9b5c90d4..96a4a616bfb2 100644 --- a/filter/source/msfilter/makefile.mk +++ b/filter/source/msfilter/makefile.mk @@ -82,7 +82,6 @@ SHL1STDLIBS= \ SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) -SHL1VERSIONMAP=$(SOLARENV)/src/component.map .INCLUDE : target.mk -- cgit From 559bfa111b9bb8f9d9f6f52a350ed0e3b678a894 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Mon, 3 Jan 2011 13:11:06 +0100 Subject: #i116287# fix LIBMYSQL_PATH --- solenv/config/sdev300.ini | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/solenv/config/sdev300.ini b/solenv/config/sdev300.ini index 85a490af161b..ce459e176b77 100644 --- a/solenv/config/sdev300.ini +++ b/solenv/config/sdev300.ini @@ -662,7 +662,7 @@ unxlngi6 JDK14PATH %SOLAR_JDK14PATH% JDK15PATH %SOLAR_JDK15PATH% KDE_ROOT /so/env/kde/linux/kde-3.2.2 - LIBMYSQL_PATH %SOLAR_ENV_ROOT%/mysql-connector-c-6.0.2/unxlngi6 + LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxlngi6 NO_BSYMBOLIC True OJDK16PATH %SOLAR_OJDK16PATH% OS LINUX @@ -943,7 +943,7 @@ unxlngx6 JDK14PATH %SOLAR_JDK14PATH% JDK15PATH %SOLAR_JDK15PATH% KDE_ROOT /so/env/kde/linux-x64/kde-3.5.10 - LIBMYSQL_PATH %SOLAR_ENV_ROOT%/mysql-connector-c-6.0.2/unxlngx6 + LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxlngx6 NO_BSYMBOLIC True OJDK16PATH %SOLAR_OJDK16PATH% OS LINUX @@ -1238,7 +1238,7 @@ unxmacxi JDK13PATH %SOLAR_JDK13PATH% JDK14PATH %SOLAR_JDK15PATH% JDK15PATH %SOLAR_JDK15PATH% - LIBMYSQL_PATH %SOLAR_ENV_ROOT%/mysql-connector-c-6.0.2/unxmacxi + LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxmacxi NO_BSYMBOLIC True OS MACOSX OUTPATH unxmacxi @@ -1489,7 +1489,7 @@ unxsoli4 JDK13PATH %SOLAR_JDK13PATH% JDK14PATH %SOLAR_JDK14PATH% JDK15PATH %SOLAR_JDK15PATH% - LIBMYSQL_PATH %SOLAR_ENV_ROOT%/mysql-connector-c-6.0.2/unxsoli4 + LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxsoli4 OJDK16PATH %SOLAR_OJDK16PATH% OS SOLARIS OUTPATH unxsoli4 @@ -1751,7 +1751,7 @@ unxsols4 JDK13PATH %SOLAR_JDK13PATH% JDK14PATH %SOLAR_JDK14PATH% JDK15PATH %SOLAR_JDK15PATH% - LIBMYSQL_PATH %SOLAR_ENV_ROOT%/mysql-connector-c-6.0.2/unxsols4 + LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxsols4 LM_LICENSE_FILE %SOLAR_LICENSE_FILE% OJDK16PATH %SOLAR_OJDK16PATH% OS SOLARIS @@ -2815,7 +2815,7 @@ wntmsci12 GUIBASE WIN GVER NT351 INPATH wntmsci12%PROEXT% - LIBMYSQL_PATH %SOLAR_ENV_ROOT%$/mysql-connector-c-6.0.2$/wntmsci12 + LIBMYSQL_PATH %SOLARROOT%$/mysql-connector-c-6.0.2$/wntmsci12 MOZILLABUILD %SOLARROOT%/mozilla-build-1.3 OS WNT OUTPATH wntmsci12 -- cgit From b4c21506e335f8d419d85f55b70508d805ee3d8b Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Tue, 4 Jan 2011 15:06:50 +0100 Subject: jl160 resolve merge conflicts --- desktop/source/deployment/manager/dp_extensionmanager.cxx | 8 ++++---- desktop/source/deployment/registry/component/dp_component.cxx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index fb01dc838459..6eb547c4e98a 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -662,9 +662,9 @@ Reference ExtensionManager::addExtension( //Determine the repository to use Reference xPackageManager; if (repository.equals(OUSTR("user"))) - xPackageManager = m_userRepository; + xPackageManager = getUserRepository(); else if (repository.equals(OUSTR("shared"))) - xPackageManager = m_sharedRepository; + xPackageManager = getSharedRepository(); else throw lang::IllegalArgumentException( OUSTR("No valid repository name provided."), @@ -677,7 +677,7 @@ Reference ExtensionManager::addExtension( getTempExtension(url, xAbortChannel, xCmdEnv); //Make sure the extension is removed from the tmp repository in case //of an exception - ExtensionRemoveGuard tmpExtensionRemoveGuard(xTmpExtension, m_tmpRepository); + ExtensionRemoveGuard tmpExtensionRemoveGuard(xTmpExtension, getTmpRepository()); const OUString sIdentifier = dp_misc::getIdentifier(xTmpExtension); const OUString sFileName = xTmpExtension->getName(); Reference xOldExtension; @@ -721,7 +721,7 @@ Reference ExtensionManager::addExtension( //the xTmpExtension //no command environment supplied, only this class shall interact //with the user! - xExtensionBackup = getTmpRepository->importExtension( + xExtensionBackup = getTmpRepository()->importExtension( xOldExtension, Reference(), Reference()); tmpExtensionRemoveGuard.reset(xExtensionBackup); diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index f094925a45a7..650a7585d929 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -1818,7 +1818,7 @@ void BackendImpl::ComponentsPackageImpl::processPackage_( that->componentLiveRemoval(that->readDataFromDb(url)); } that->releaseObject(url); - that->deleteDataFromDb(url); + that->revokeEntryFromDb(url); } } -- cgit From 143a9a5ae8da0629ee0a74a2c81cd4fc42881ed0 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Tue, 4 Jan 2011 17:41:10 +0100 Subject: ause129: #i116298# add some flexibility to source and destination --- solenv/gbuild/AllLangResTarget.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk index 2d7495026400..b879e4dc921c 100644 --- a/solenv/gbuild/AllLangResTarget.mk +++ b/solenv/gbuild/AllLangResTarget.mk @@ -211,21 +211,21 @@ $(call gb_ResTarget_get_target,%) : $(gb_Helper_MISCDUMMY) | $(gb_ResTarget_RSCT $(call gb_Output_announce,$*,$(true),RES,2) $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(dir $@) $(OUTDIR)/bin \ - $(dir $(call gb_ResTarget_get_imagelist_target,$(1))) && \ + $(dir $(call gb_ResTarget_get_imagelist_target,$*)) && \ RESPONSEFILE=`$(gb_MKTEMP) $(gb_Helper_MISC)` && \ echo "-r -p \ -lg$(LANGUAGE) \ -fs=$@ \ - -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst/$(LANGUAGE) \ - -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst \ - -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res/$(LANGUAGE) \ - -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res \ - -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION) \ + -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst/$(LANGUAGE)) \ + -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst) \ + -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res/$(LANGUAGE)) \ + -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res) \ + -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)) \ -lip=$(gb_ResTarget_DEFIMAGESLOCATION)res/$(LANGUAGE) \ -lip=$(gb_ResTarget_DEFIMAGESLOCATION)res \ - -subMODULE=$(gb_ResTarget_DEFIMAGESLOCATION) \ + -subMODULE=$(dir $(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION))) \ -subGLOBALRES=$(gb_ResTarget_DEFIMAGESLOCATION)res \ - -oil=$(dir $(call gb_ResTarget_get_imagelist_target,$(1))) \ + -oil=$(dir $(call gb_ResTarget_get_imagelist_target,$*)) \ $(filter-out $(gb_Helper_MISCDUMMY),$^)" > $${RESPONSEFILE} && \ $(gb_ResTarget_RSCCOMMAND) @$${RESPONSEFILE} && \ rm -f $${RESPONSEFILE}) -- cgit From 7cfa19e5cb42a033e323aab1403495be2181af4b Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 5 Jan 2011 09:35:43 +0100 Subject: sb135: #i116308# missing solenv/gbuild/platform/solaris.mk settings --- solenv/gbuild/platform/solaris.mk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index 457f86e795ea..b2e4ab3b8b44 100755 --- a/solenv/gbuild/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -53,16 +53,16 @@ gb_COMPILERDEFS := \ # -D$(CVER) \ # -DCVER=$(CVER) \ -ifeq ($(CPUNAME),INTEL) -gb_CPUDEFS := -else # ifeq ($(CPUNAME),SPARC) -gb_CPUDEFS := -D__sparcv8plus +gb_CPUDEFS := -D$(CPUNAME) +ifeq ($(CPUNAME),SPARC) +gb_CPUDEFS += -D__sparcv8plus endif gb_CFLAGS := \ -temp=/tmp \ -KPIC \ -mt \ + -xldscope=hidden \ -xCC \ -xc99=none \ @@ -70,6 +70,7 @@ gb_CXXFLAGS := \ -temp=/tmp \ -KPIC \ -mt \ + -xldscope=hidden \ -features=no%altspell \ -library=no%Cstd \ +w2 \ -- cgit From 9dc4a4bb35101a091d78801b62051b7f76e0d365 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 5 Jan 2011 14:04:43 +0100 Subject: ause129: remove unused file that triggers build.pl detcetion of migrated modules --- svx/prj/makefile.mk | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 svx/prj/makefile.mk diff --git a/svx/prj/makefile.mk b/svx/prj/makefile.mk deleted file mode 100644 index 2a0b99e72fd5..000000000000 --- a/svx/prj/makefile.mk +++ /dev/null @@ -1,2 +0,0 @@ -all: - cd .. && make -srj9 -- cgit From b47ebb540b1ad0ce440cc097ce332aff2a897337 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 6 Jan 2011 12:00:56 +0100 Subject: remove printdlg also in new build system --- svtools/AllLangResTarget_svt.mk | 1 - svtools/Library_svt.mk | 1 - svtools/Package_inc.mk | 1 - 3 files changed, 3 deletions(-) diff --git a/svtools/AllLangResTarget_svt.mk b/svtools/AllLangResTarget_svt.mk index 511cdb4ed13e..ab0895dea07f 100644 --- a/svtools/AllLangResTarget_svt.mk +++ b/svtools/AllLangResTarget_svt.mk @@ -57,7 +57,6 @@ $(eval $(call gb_SrsTarget_add_files,svt/res,\ svtools/source/dialogs/colrdlg.src \ svtools/source/dialogs/filedlg2.src \ svtools/source/dialogs/formats.src \ - svtools/source/dialogs/printdlg.src \ svtools/source/dialogs/prnsetup.src \ svtools/source/dialogs/so3res.src \ svtools/source/dialogs/wizardmachine.src \ diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index 545690bd0f12..80226851dd6a 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -159,7 +159,6 @@ $(eval $(call gb_Library_add_exception_objects,svt,\ svtools/source/dialogs/filedlg2 \ svtools/source/dialogs/insdlg \ svtools/source/dialogs/mcvmath \ - svtools/source/dialogs/printdlg \ svtools/source/dialogs/prnsetup \ svtools/source/dialogs/property \ svtools/source/dialogs/roadmapwizard \ diff --git a/svtools/Package_inc.mk b/svtools/Package_inc.mk index ef656f9ba061..f6a48e845679 100644 --- a/svtools/Package_inc.mk +++ b/svtools/Package_inc.mk @@ -113,7 +113,6 @@ $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/parrtf.hxx,svtools/par $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/popupmenucontrollerbase.hxx,svtools/popupmenucontrollerbase.hxx)) $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/popupwindowcontroller.hxx,svtools/popupwindowcontroller.hxx)) $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/prgsbar.hxx,svtools/prgsbar.hxx)) -$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/printdlg.hxx,svtools/printdlg.hxx)) $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/printoptions.hxx,svtools/printoptions.hxx)) $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/prnsetup.hxx,svtools/prnsetup.hxx)) $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/roadmap.hxx,svtools/roadmap.hxx)) -- cgit From d384a2a1f25e1c868a7fe1f3b31157c2ceaf4542 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Thu, 6 Jan 2011 12:31:18 +0100 Subject: ause129: #i116289# set MACOSX_DEPLOYMENT_TARGET in environment for use in dmake and gnumake build --- set_soenv.in | 10 ++++++++++ solenv/gbuild/platform/macosx.mk | 4 ++-- solenv/inc/unxmacx.mk | 5 +++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/set_soenv.in b/set_soenv.in index 0f31cc3e1a8e..8a99842291de 100644 --- a/set_soenv.in +++ b/set_soenv.in @@ -1698,6 +1698,16 @@ ToFile( "DYNAMIC_CRT", $DYNAMIC_CRT, "e" ); ToFile( "SET_EXCEPTIONS", $SET_EXCEPTIONS, "e" ); ToFile( "use_shl_versions", $use_shl_versions, "e" ); ToFile( "FLIPCMD", $FLIPCMD, "e" ); +if ( $platform =~ m/darwin/ ) +{ +# MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build, +# build can assume functions/libraries of that version to be available +# unless you want to do runtime checks for 10.5 api, you also want to use the 10.4 sdk +# (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro) +# http://developer.apple.com/technotes/tn2002/tn2064.html + ToFile( "MACOSX_DEPLOYMENT_TARGET", "10.4", "e" ); +} + # # Writing the variables to file. # (c = comment, e = environment variable, a = alias, n = newline ) diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk index 230371907324..742d2aef82fc 100755 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -63,7 +63,7 @@ else # ifeq ($(CPUNAME),POWERPC) gb_CPUDEFS := -DPOWERPC -DPPC endif -ifeq ($(SYSBASE), "") +ifeq ($(strip $(SYSBASE)),) gb_SDKDIR := /Developer/SDKs/MacOSX10.4u.sdk else gb_SDKDIR := $(SYSBASE)/MacOSX10.4u.sdk @@ -274,7 +274,7 @@ gb_Library__FRAMEWORKS += \ gb_Library_PLAINLIBS_NONE += \ Cocoa \ - objc \ + objc \ jpeg \ m \ pthread \ diff --git a/solenv/inc/unxmacx.mk b/solenv/inc/unxmacx.mk index 77a348138e30..ce049a672d23 100644 --- a/solenv/inc/unxmacx.mk +++ b/solenv/inc/unxmacx.mk @@ -48,8 +48,9 @@ CDEFS+=-DX_LOCALE # unless you want to do runtime checks for 10.5 api, you also want to use the 10.4 sdk # (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro) # http://developer.apple.com/technotes/tn2002/tn2064.html -MACOSX_DEPLOYMENT_TARGET=10.4 -.EXPORT: MACOSX_DEPLOYMENT_TARGET +# done in setsolar/configure now. left here for documentation +#MACOSX_DEPLOYMENT_TARGET=10.4 +#.EXPORT: MACOSX_DEPLOYMENT_TARGET CDEFS+=-DQUARTZ EXTRA_CDEFS*=-isysroot /Developer/SDKs/MacOSX10.4u.sdk .ENDIF -- cgit From f37e09084c60834aca7413bcf0245e8be4bb07d3 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Thu, 6 Jan 2011 12:34:08 +0100 Subject: ause129: #i116325# don't process ..xcu, created on mac --- postprocess/packregistry/makefile.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postprocess/packregistry/makefile.mk b/postprocess/packregistry/makefile.mk index a6881783776a..4109bfdaae97 100644 --- a/postprocess/packregistry/makefile.mk +++ b/postprocess/packregistry/makefile.mk @@ -522,7 +522,7 @@ $(MISC)/lang/fcfg_langpack_%.xcd .ERRREMOVE : cd $(MISC)/$(@:b).unzip && unzip $(SOLARPCKDIR)/$(@:b).zip - $(RM) $(MISC)/$(@:b).list echo '' $(foreach,i,$(shell cd $(MISC) && \ - find $(@:b).unzip -name \*.xcu -size +0c -print) \ + find $(@:b).unzip -name [^.]\*.xcu -size +0c -print) \ '$i') '' > $(MISC)/$(@:b).list $(XSLTPROC) --nonet --stringparam prefix $(PWD)/$(MISC)/ -o $@ \ $(SOLARENV)/bin/packregistry.xslt $(MISC)/$(@:b).list @@ -541,7 +541,7 @@ $(MISC)/lang/registry_%.xcd .ERRREMOVE : unzip $(SOLARPCKDIR)/fcfg_drivers_$*.zip - $(RM) $(MISC)/$(@:b).list echo '' $(foreach,i,$(shell cd $(MISC) && \ - find $(@:b).unzip fcfg_drivers_$*.unzip -name \*.xcu -print) \ + find $(@:b).unzip fcfg_drivers_$*.unzip -name [^.]\*.xcu -print) \ '$i') '' > $(MISC)/$(@:b).list $(XSLTPROC) --nonet --stringparam prefix $(PWD)/$(MISC)/ -o $@ \ $(SOLARENV)/bin/packregistry.xslt $(MISC)/$(@:b).list -- cgit From 731c4a20b2e21afd5e239dff00c1ca840fff20d1 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Thu, 6 Jan 2011 15:44:47 +0100 Subject: ause129: #i116298# move toolkit images --- solenv/gbuild/AllLangResTarget.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk index b879e4dc921c..b937ac7a35b5 100644 --- a/solenv/gbuild/AllLangResTarget.mk +++ b/solenv/gbuild/AllLangResTarget.mk @@ -216,6 +216,7 @@ $(call gb_ResTarget_get_target,%) : $(gb_Helper_MISCDUMMY) | $(gb_ResTarget_RSCT echo "-r -p \ -lg$(LANGUAGE) \ -fs=$@ \ + -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/$(LIBRARY)) \ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst/$(LANGUAGE)) \ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst) \ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res/$(LANGUAGE)) \ -- cgit From ec297b77de621fb7dd6b29045269a1b7402771d1 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Thu, 6 Jan 2011 15:44:47 +0100 Subject: ause129: #i116298# move toolkit images --- toolkit/AllLangResTarget_tk.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/AllLangResTarget_tk.mk b/toolkit/AllLangResTarget_tk.mk index 571d5dfbff70..784063934112 100644 --- a/toolkit/AllLangResTarget_tk.mk +++ b/toolkit/AllLangResTarget_tk.mk @@ -27,7 +27,7 @@ $(eval $(call gb_AllLangResTarget_AllLangResTarget,tk)) -$(eval $(call gb_AllLangResTarget_set_reslocation,tk,toolkit/source/awt)) +$(eval $(call gb_AllLangResTarget_set_reslocation,tk,toolkit)) $(eval $(call gb_AllLangResTarget_add_srs,tk,\ toolkit/awt \ -- cgit From 827fcc68aa45b3567afdbe082717e5eaa151a9dd Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Thu, 6 Jan 2011 15:44:47 +0100 Subject: ause129: #i116298# move toolkit images --- default_images/toolkit/source/awt/spinner03-32-hc_01.png | Bin 441 -> 0 bytes default_images/toolkit/source/awt/spinner03-32-hc_02.png | Bin 436 -> 0 bytes default_images/toolkit/source/awt/spinner03-32-hc_03.png | Bin 435 -> 0 bytes default_images/toolkit/source/awt/spinner03-32-hc_04.png | Bin 435 -> 0 bytes default_images/toolkit/source/awt/spinner03-32-hc_05.png | Bin 439 -> 0 bytes default_images/toolkit/source/awt/spinner03-32-hc_06.png | Bin 443 -> 0 bytes default_images/toolkit/source/awt/spinner03-32-hc_07.png | Bin 444 -> 0 bytes default_images/toolkit/source/awt/spinner03-32-hc_08.png | Bin 439 -> 0 bytes default_images/toolkit/source/awt/spinner03-32-hc_09.png | Bin 427 -> 0 bytes default_images/toolkit/source/awt/spinner03-32-hc_10.png | Bin 429 -> 0 bytes default_images/toolkit/source/awt/spinner03-32-hc_11.png | Bin 429 -> 0 bytes default_images/toolkit/source/awt/spinner03-32-hc_12.png | Bin 435 -> 0 bytes default_images/toolkit/source/awt/spinner03-grey_01.png | Bin 666 -> 0 bytes default_images/toolkit/source/awt/spinner03-grey_02.png | Bin 668 -> 0 bytes default_images/toolkit/source/awt/spinner03-grey_03.png | Bin 678 -> 0 bytes default_images/toolkit/source/awt/spinner03-grey_04.png | Bin 680 -> 0 bytes default_images/toolkit/source/awt/spinner03-grey_05.png | Bin 671 -> 0 bytes default_images/toolkit/source/awt/spinner03-grey_06.png | Bin 676 -> 0 bytes default_images/toolkit/source/awt/spinner03-grey_07.png | Bin 692 -> 0 bytes default_images/toolkit/source/awt/spinner03-grey_08.png | Bin 682 -> 0 bytes default_images/toolkit/source/awt/spinner03-grey_09.png | Bin 675 -> 0 bytes default_images/toolkit/source/awt/spinner03-grey_10.png | Bin 673 -> 0 bytes default_images/toolkit/source/awt/spinner03-grey_11.png | Bin 679 -> 0 bytes default_images/toolkit/source/awt/spinner03-grey_12.png | Bin 676 -> 0 bytes default_images/toolkit/tk/spinner03-32-hc_01.png | Bin 0 -> 441 bytes default_images/toolkit/tk/spinner03-32-hc_02.png | Bin 0 -> 436 bytes default_images/toolkit/tk/spinner03-32-hc_03.png | Bin 0 -> 435 bytes default_images/toolkit/tk/spinner03-32-hc_04.png | Bin 0 -> 435 bytes default_images/toolkit/tk/spinner03-32-hc_05.png | Bin 0 -> 439 bytes default_images/toolkit/tk/spinner03-32-hc_06.png | Bin 0 -> 443 bytes default_images/toolkit/tk/spinner03-32-hc_07.png | Bin 0 -> 444 bytes default_images/toolkit/tk/spinner03-32-hc_08.png | Bin 0 -> 439 bytes default_images/toolkit/tk/spinner03-32-hc_09.png | Bin 0 -> 427 bytes default_images/toolkit/tk/spinner03-32-hc_10.png | Bin 0 -> 429 bytes default_images/toolkit/tk/spinner03-32-hc_11.png | Bin 0 -> 429 bytes default_images/toolkit/tk/spinner03-32-hc_12.png | Bin 0 -> 435 bytes default_images/toolkit/tk/spinner03-grey_01.png | Bin 0 -> 666 bytes default_images/toolkit/tk/spinner03-grey_02.png | Bin 0 -> 668 bytes default_images/toolkit/tk/spinner03-grey_03.png | Bin 0 -> 678 bytes default_images/toolkit/tk/spinner03-grey_04.png | Bin 0 -> 680 bytes default_images/toolkit/tk/spinner03-grey_05.png | Bin 0 -> 671 bytes default_images/toolkit/tk/spinner03-grey_06.png | Bin 0 -> 676 bytes default_images/toolkit/tk/spinner03-grey_07.png | Bin 0 -> 692 bytes default_images/toolkit/tk/spinner03-grey_08.png | Bin 0 -> 682 bytes default_images/toolkit/tk/spinner03-grey_09.png | Bin 0 -> 675 bytes default_images/toolkit/tk/spinner03-grey_10.png | Bin 0 -> 673 bytes default_images/toolkit/tk/spinner03-grey_11.png | Bin 0 -> 679 bytes default_images/toolkit/tk/spinner03-grey_12.png | Bin 0 -> 676 bytes 48 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 default_images/toolkit/source/awt/spinner03-32-hc_01.png delete mode 100644 default_images/toolkit/source/awt/spinner03-32-hc_02.png delete mode 100644 default_images/toolkit/source/awt/spinner03-32-hc_03.png delete mode 100644 default_images/toolkit/source/awt/spinner03-32-hc_04.png delete mode 100644 default_images/toolkit/source/awt/spinner03-32-hc_05.png delete mode 100644 default_images/toolkit/source/awt/spinner03-32-hc_06.png delete mode 100644 default_images/toolkit/source/awt/spinner03-32-hc_07.png delete mode 100644 default_images/toolkit/source/awt/spinner03-32-hc_08.png delete mode 100644 default_images/toolkit/source/awt/spinner03-32-hc_09.png delete mode 100644 default_images/toolkit/source/awt/spinner03-32-hc_10.png delete mode 100644 default_images/toolkit/source/awt/spinner03-32-hc_11.png delete mode 100644 default_images/toolkit/source/awt/spinner03-32-hc_12.png delete mode 100644 default_images/toolkit/source/awt/spinner03-grey_01.png delete mode 100644 default_images/toolkit/source/awt/spinner03-grey_02.png delete mode 100644 default_images/toolkit/source/awt/spinner03-grey_03.png delete mode 100644 default_images/toolkit/source/awt/spinner03-grey_04.png delete mode 100644 default_images/toolkit/source/awt/spinner03-grey_05.png delete mode 100644 default_images/toolkit/source/awt/spinner03-grey_06.png delete mode 100644 default_images/toolkit/source/awt/spinner03-grey_07.png delete mode 100644 default_images/toolkit/source/awt/spinner03-grey_08.png delete mode 100644 default_images/toolkit/source/awt/spinner03-grey_09.png delete mode 100644 default_images/toolkit/source/awt/spinner03-grey_10.png delete mode 100644 default_images/toolkit/source/awt/spinner03-grey_11.png delete mode 100644 default_images/toolkit/source/awt/spinner03-grey_12.png create mode 100644 default_images/toolkit/tk/spinner03-32-hc_01.png create mode 100644 default_images/toolkit/tk/spinner03-32-hc_02.png create mode 100644 default_images/toolkit/tk/spinner03-32-hc_03.png create mode 100644 default_images/toolkit/tk/spinner03-32-hc_04.png create mode 100644 default_images/toolkit/tk/spinner03-32-hc_05.png create mode 100644 default_images/toolkit/tk/spinner03-32-hc_06.png create mode 100644 default_images/toolkit/tk/spinner03-32-hc_07.png create mode 100644 default_images/toolkit/tk/spinner03-32-hc_08.png create mode 100644 default_images/toolkit/tk/spinner03-32-hc_09.png create mode 100644 default_images/toolkit/tk/spinner03-32-hc_10.png create mode 100644 default_images/toolkit/tk/spinner03-32-hc_11.png create mode 100644 default_images/toolkit/tk/spinner03-32-hc_12.png create mode 100644 default_images/toolkit/tk/spinner03-grey_01.png create mode 100644 default_images/toolkit/tk/spinner03-grey_02.png create mode 100644 default_images/toolkit/tk/spinner03-grey_03.png create mode 100644 default_images/toolkit/tk/spinner03-grey_04.png create mode 100644 default_images/toolkit/tk/spinner03-grey_05.png create mode 100644 default_images/toolkit/tk/spinner03-grey_06.png create mode 100644 default_images/toolkit/tk/spinner03-grey_07.png create mode 100644 default_images/toolkit/tk/spinner03-grey_08.png create mode 100644 default_images/toolkit/tk/spinner03-grey_09.png create mode 100644 default_images/toolkit/tk/spinner03-grey_10.png create mode 100644 default_images/toolkit/tk/spinner03-grey_11.png create mode 100644 default_images/toolkit/tk/spinner03-grey_12.png diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_01.png b/default_images/toolkit/source/awt/spinner03-32-hc_01.png deleted file mode 100644 index c3596c19f276..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-32-hc_01.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_02.png b/default_images/toolkit/source/awt/spinner03-32-hc_02.png deleted file mode 100644 index e2ca6b965d23..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-32-hc_02.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_03.png b/default_images/toolkit/source/awt/spinner03-32-hc_03.png deleted file mode 100644 index 6609d3a6d300..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-32-hc_03.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_04.png b/default_images/toolkit/source/awt/spinner03-32-hc_04.png deleted file mode 100644 index e70a393be204..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-32-hc_04.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_05.png b/default_images/toolkit/source/awt/spinner03-32-hc_05.png deleted file mode 100644 index 63eb3e10375c..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-32-hc_05.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_06.png b/default_images/toolkit/source/awt/spinner03-32-hc_06.png deleted file mode 100644 index c072e397cc00..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-32-hc_06.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_07.png b/default_images/toolkit/source/awt/spinner03-32-hc_07.png deleted file mode 100644 index 801ea3b36f9e..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-32-hc_07.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_08.png b/default_images/toolkit/source/awt/spinner03-32-hc_08.png deleted file mode 100644 index 60635b1e47e1..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-32-hc_08.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_09.png b/default_images/toolkit/source/awt/spinner03-32-hc_09.png deleted file mode 100644 index 0a4513daa636..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-32-hc_09.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_10.png b/default_images/toolkit/source/awt/spinner03-32-hc_10.png deleted file mode 100644 index 06fbd02faf7f..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-32-hc_10.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_11.png b/default_images/toolkit/source/awt/spinner03-32-hc_11.png deleted file mode 100644 index 89e14cd33786..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-32-hc_11.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-32-hc_12.png b/default_images/toolkit/source/awt/spinner03-32-hc_12.png deleted file mode 100644 index 2ced9380408e..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-32-hc_12.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-grey_01.png b/default_images/toolkit/source/awt/spinner03-grey_01.png deleted file mode 100644 index 2c6b6937f8b2..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-grey_01.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-grey_02.png b/default_images/toolkit/source/awt/spinner03-grey_02.png deleted file mode 100644 index 4662ddf54924..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-grey_02.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-grey_03.png b/default_images/toolkit/source/awt/spinner03-grey_03.png deleted file mode 100644 index 8c1a0be53da5..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-grey_03.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-grey_04.png b/default_images/toolkit/source/awt/spinner03-grey_04.png deleted file mode 100644 index ba323f36244d..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-grey_04.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-grey_05.png b/default_images/toolkit/source/awt/spinner03-grey_05.png deleted file mode 100644 index f733dd17266c..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-grey_05.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-grey_06.png b/default_images/toolkit/source/awt/spinner03-grey_06.png deleted file mode 100644 index bbaebc36f565..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-grey_06.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-grey_07.png b/default_images/toolkit/source/awt/spinner03-grey_07.png deleted file mode 100644 index d005cb55b4eb..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-grey_07.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-grey_08.png b/default_images/toolkit/source/awt/spinner03-grey_08.png deleted file mode 100644 index bda1e7192809..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-grey_08.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-grey_09.png b/default_images/toolkit/source/awt/spinner03-grey_09.png deleted file mode 100644 index 3e688421d95e..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-grey_09.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-grey_10.png b/default_images/toolkit/source/awt/spinner03-grey_10.png deleted file mode 100644 index d43e8866e10e..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-grey_10.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-grey_11.png b/default_images/toolkit/source/awt/spinner03-grey_11.png deleted file mode 100644 index d67c895a2c7d..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-grey_11.png and /dev/null differ diff --git a/default_images/toolkit/source/awt/spinner03-grey_12.png b/default_images/toolkit/source/awt/spinner03-grey_12.png deleted file mode 100644 index 9c3c4a849c6f..000000000000 Binary files a/default_images/toolkit/source/awt/spinner03-grey_12.png and /dev/null differ diff --git a/default_images/toolkit/tk/spinner03-32-hc_01.png b/default_images/toolkit/tk/spinner03-32-hc_01.png new file mode 100644 index 000000000000..c3596c19f276 Binary files /dev/null and b/default_images/toolkit/tk/spinner03-32-hc_01.png differ diff --git a/default_images/toolkit/tk/spinner03-32-hc_02.png b/default_images/toolkit/tk/spinner03-32-hc_02.png new file mode 100644 index 000000000000..e2ca6b965d23 Binary files /dev/null and b/default_images/toolkit/tk/spinner03-32-hc_02.png differ diff --git a/default_images/toolkit/tk/spinner03-32-hc_03.png b/default_images/toolkit/tk/spinner03-32-hc_03.png new file mode 100644 index 000000000000..6609d3a6d300 Binary files /dev/null and b/default_images/toolkit/tk/spinner03-32-hc_03.png differ diff --git a/default_images/toolkit/tk/spinner03-32-hc_04.png b/default_images/toolkit/tk/spinner03-32-hc_04.png new file mode 100644 index 000000000000..e70a393be204 Binary files /dev/null and b/default_images/toolkit/tk/spinner03-32-hc_04.png differ diff --git a/default_images/toolkit/tk/spinner03-32-hc_05.png b/default_images/toolkit/tk/spinner03-32-hc_05.png new file mode 100644 index 000000000000..63eb3e10375c Binary files /dev/null and b/default_images/toolkit/tk/spinner03-32-hc_05.png differ diff --git a/default_images/toolkit/tk/spinner03-32-hc_06.png b/default_images/toolkit/tk/spinner03-32-hc_06.png new file mode 100644 index 000000000000..c072e397cc00 Binary files /dev/null and b/default_images/toolkit/tk/spinner03-32-hc_06.png differ diff --git a/default_images/toolkit/tk/spinner03-32-hc_07.png b/default_images/toolkit/tk/spinner03-32-hc_07.png new file mode 100644 index 000000000000..801ea3b36f9e Binary files /dev/null and b/default_images/toolkit/tk/spinner03-32-hc_07.png differ diff --git a/default_images/toolkit/tk/spinner03-32-hc_08.png b/default_images/toolkit/tk/spinner03-32-hc_08.png new file mode 100644 index 000000000000..60635b1e47e1 Binary files /dev/null and b/default_images/toolkit/tk/spinner03-32-hc_08.png differ diff --git a/default_images/toolkit/tk/spinner03-32-hc_09.png b/default_images/toolkit/tk/spinner03-32-hc_09.png new file mode 100644 index 000000000000..0a4513daa636 Binary files /dev/null and b/default_images/toolkit/tk/spinner03-32-hc_09.png differ diff --git a/default_images/toolkit/tk/spinner03-32-hc_10.png b/default_images/toolkit/tk/spinner03-32-hc_10.png new file mode 100644 index 000000000000..06fbd02faf7f Binary files /dev/null and b/default_images/toolkit/tk/spinner03-32-hc_10.png differ diff --git a/default_images/toolkit/tk/spinner03-32-hc_11.png b/default_images/toolkit/tk/spinner03-32-hc_11.png new file mode 100644 index 000000000000..89e14cd33786 Binary files /dev/null and b/default_images/toolkit/tk/spinner03-32-hc_11.png differ diff --git a/default_images/toolkit/tk/spinner03-32-hc_12.png b/default_images/toolkit/tk/spinner03-32-hc_12.png new file mode 100644 index 000000000000..2ced9380408e Binary files /dev/null and b/default_images/toolkit/tk/spinner03-32-hc_12.png differ diff --git a/default_images/toolkit/tk/spinner03-grey_01.png b/default_images/toolkit/tk/spinner03-grey_01.png new file mode 100644 index 000000000000..2c6b6937f8b2 Binary files /dev/null and b/default_images/toolkit/tk/spinner03-grey_01.png differ diff --git a/default_images/toolkit/tk/spinner03-grey_02.png b/default_images/toolkit/tk/spinner03-grey_02.png new file mode 100644 index 000000000000..4662ddf54924 Binary files /dev/null and b/default_images/toolkit/tk/spinner03-grey_02.png differ diff --git a/default_images/toolkit/tk/spinner03-grey_03.png b/default_images/toolkit/tk/spinner03-grey_03.png new file mode 100644 index 000000000000..8c1a0be53da5 Binary files /dev/null and b/default_images/toolkit/tk/spinner03-grey_03.png differ diff --git a/default_images/toolkit/tk/spinner03-grey_04.png b/default_images/toolkit/tk/spinner03-grey_04.png new file mode 100644 index 000000000000..ba323f36244d Binary files /dev/null and b/default_images/toolkit/tk/spinner03-grey_04.png differ diff --git a/default_images/toolkit/tk/spinner03-grey_05.png b/default_images/toolkit/tk/spinner03-grey_05.png new file mode 100644 index 000000000000..f733dd17266c Binary files /dev/null and b/default_images/toolkit/tk/spinner03-grey_05.png differ diff --git a/default_images/toolkit/tk/spinner03-grey_06.png b/default_images/toolkit/tk/spinner03-grey_06.png new file mode 100644 index 000000000000..bbaebc36f565 Binary files /dev/null and b/default_images/toolkit/tk/spinner03-grey_06.png differ diff --git a/default_images/toolkit/tk/spinner03-grey_07.png b/default_images/toolkit/tk/spinner03-grey_07.png new file mode 100644 index 000000000000..d005cb55b4eb Binary files /dev/null and b/default_images/toolkit/tk/spinner03-grey_07.png differ diff --git a/default_images/toolkit/tk/spinner03-grey_08.png b/default_images/toolkit/tk/spinner03-grey_08.png new file mode 100644 index 000000000000..bda1e7192809 Binary files /dev/null and b/default_images/toolkit/tk/spinner03-grey_08.png differ diff --git a/default_images/toolkit/tk/spinner03-grey_09.png b/default_images/toolkit/tk/spinner03-grey_09.png new file mode 100644 index 000000000000..3e688421d95e Binary files /dev/null and b/default_images/toolkit/tk/spinner03-grey_09.png differ diff --git a/default_images/toolkit/tk/spinner03-grey_10.png b/default_images/toolkit/tk/spinner03-grey_10.png new file mode 100644 index 000000000000..d43e8866e10e Binary files /dev/null and b/default_images/toolkit/tk/spinner03-grey_10.png differ diff --git a/default_images/toolkit/tk/spinner03-grey_11.png b/default_images/toolkit/tk/spinner03-grey_11.png new file mode 100644 index 000000000000..d67c895a2c7d Binary files /dev/null and b/default_images/toolkit/tk/spinner03-grey_11.png differ diff --git a/default_images/toolkit/tk/spinner03-grey_12.png b/default_images/toolkit/tk/spinner03-grey_12.png new file mode 100644 index 000000000000..9c3c4a849c6f Binary files /dev/null and b/default_images/toolkit/tk/spinner03-grey_12.png differ -- cgit From 159c878063d472e8cb33b0d3891dbe6e513af983 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Thu, 6 Jan 2011 16:43:52 +0100 Subject: ause129: #i116326# own pch dependency file for debug case --- solenv/gbuild/TargetLocations.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 03ff66523835..933fc48c09d4 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -55,9 +55,11 @@ gb_LinkTarget_get_external_headers_target = $(WORKDIR)/ExternalHeaders/$(1) gb_LinkTarget_get_headers_target = $(WORKDIR)/Headers/$(1) gb_LinkTarget_get_target = $(WORKDIR)/LinkTarget/$(1) gb_Module_get_target = $(WORKDIR)/Module/$(1) +gb_NoexPrecompiledHeader_get_dep_target = $(WORKDIR)/Dep/NoexPrecompiledHeader/$(gb_NoexPrecompiledHeader_DEBUGDIR)/$(1).hxx.pch.d gb_NoexPrecompiledHeader_get_target = $(WORKDIR)/NoexPrecompiledHeader/$(gb_NoexPrecompiledHeader_DEBUGDIR)/$(1).hxx.pch gb_ObjCxxObject_get_target = $(WORKDIR)/ObjCxxObject/$(1).o gb_Package_get_target = $(WORKDIR)/Package/$(1) +gb_PrecompiledHeader_get_dep_target = $(WORKDIR)/Dep/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/$(1).hxx.pch.d gb_PrecompiledHeader_get_target = $(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/$(1).hxx.pch gb_ResTarget_get_imagelist_target = $(WORKDIR)/ResTarget/$(1).ilst gb_ResTarget_get_target = $(WORKDIR)/ResTarget/$(1).res @@ -109,8 +111,6 @@ $(eval $(call gb_Helper_make_dep_targets,\ LinkTarget \ SrsPartTarget \ SrsTarget \ - PrecompiledHeader \ - NoexPrecompiledHeader \ )) -- cgit From 143f3034d17306416ac8ceade8437ef56059e239 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Sat, 8 Jan 2011 11:30:31 +0100 Subject: #100000# Remove obsolete file --- udkapi/prj/makefile.mk | 61 -------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 udkapi/prj/makefile.mk diff --git a/udkapi/prj/makefile.mk b/udkapi/prj/makefile.mk deleted file mode 100644 index 0b1e9335ed44..000000000000 --- a/udkapi/prj/makefile.mk +++ /dev/null @@ -1,61 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=. -PRJNAME:=udkapi - -# --- Settings ----------------------------------------------------- - -OUT!:=$(PRJ)$/out - -# ------------------------------------------------------------------ - -INCLUDES= \ - com$/sun$/star$/container$/makefile.mk \ - com$/sun$/star$/io$/makefile.mk \ - com$/sun$/star$/reflection$/makefile.mk \ - com$/sun$/star$/beans$/makefile.mk \ - com$/sun$/star$/lang$/makefile.mk \ - com$/sun$/star$/uno$/makefile.mk \ - com$/sun$/star$/uno$/util$/logging$/makefile.mk \ - com$/sun$/star$/corba$/makefile.mk \ - com$/sun$/star$/corba$/iop$/makefile.mk \ - com$/sun$/star$/corba$/giop$/makefile.mk \ - com$/sun$/star$/corba$/iiop$/makefile.mk \ - com$/sun$/star$/script$/makefile.mk \ - com$/sun$/star$/test$/makefile.mk \ - com$/sun$/star$/registry$/makefile.mk \ - com$/sun$/star$/loader$/makefile.mk \ - com$/sun$/star$/bridge$/makefile.mk - -.INCLUDE: $(INCLUDES) - -out$/$(PRJNAME).rdb:: $(ALLIDLFILES) - unoidl @$(mktmp -I$(PRJ) -Burd -OHout $(ALLIDLFILES:+"\n")) - regmerge @$(mktmp $@ /UCR out$/{$(?:f:s/.idl/.urd/:+"\n")} ) - touch $@ - -- cgit From 80f34936da1a8665dcd60865db5c16094c9ec5c8 Mon Sep 17 00:00:00 2001 From: Release Engineering Date: Sat, 8 Jan 2011 12:39:26 +0100 Subject: DEV300 --- solenv/inc/minor.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk index 678878c86663..108e841a72f4 100644 --- a/solenv/inc/minor.mk +++ b/solenv/inc/minor.mk @@ -1,5 +1,5 @@ RSCVERSION=300 -RSCREVISION=300m96(Build:9560) -BUILD=9560 -LAST_MINOR=m96 +RSCREVISION=300m97(Build:9566) +BUILD=9566 +LAST_MINOR=m97 SOURCEVERSION=DEV300 -- cgit