diff options
author | Thorsten Behrens <tbehrens@novell.com> | 2011-04-27 01:31:35 +0200 |
---|---|---|
committer | Thorsten Behrens <tbehrens@novell.com> | 2011-04-27 01:31:35 +0200 |
commit | 48c61f72dd9e205f3d44838ae21cde0419538f1c (patch) | |
tree | 22eb884e19dd4f7c5b7dfaa0ba10bb77e12e3f19 /oox/source/dump | |
parent | f433a86839499662cfc1356882b0538f01d850b6 (diff) | |
parent | 275e5c6544ff2f90cf6bd57b6a8a6293fe10943c (diff) |
Merge commit 'ooo/DEV300_m106' into integration/dev300_m106
Conflicts:
binfilter/bf_svtools/source/filter.vcl/jpeg/svt_jpegc.c
filter/source/config/fragments/filters/SVG___Scalable_Vector_Graphics.xcu
filter/source/config/fragments/internalgraphicfilters/svg_Import.xcu
filter/source/config/fragments/types/svg_Scalable_Vector_Graphics.xcu
filter/source/graphicfilter/eos2met/eos2met.cxx
filter/source/msfilter/msvbahelper.cxx
filter/source/svg/makefile.mk
filter/source/svg/svgexport.cxx
filter/source/svg/svgfilter.cxx
filter/source/svg/svgfilter.hxx
filter/source/svg/svgfontexport.cxx
filter/source/svg/svgfontexport.hxx
filter/source/svg/svgwriter.cxx
filter/source/svg/svgwriter.hxx
oox/inc/oox/core/relations.hxx
oox/inc/oox/core/relationshandler.hxx
oox/inc/oox/dump/biffdumper.hxx
oox/inc/oox/dump/dffdumper.hxx
oox/inc/oox/dump/dumperbase.hxx
oox/inc/oox/dump/oledumper.hxx
oox/inc/oox/dump/pptxdumper.hxx
oox/inc/oox/helper/containerhelper.hxx
oox/inc/oox/helper/propertyset.hxx
oox/inc/oox/xls/commentsbuffer.hxx
oox/inc/oox/xls/sharedformulabuffer.hxx
oox/source/drawingml/shape.cxx
oox/source/dump/oledumper.cxx
oox/source/helper/binaryinputstream.cxx
oox/source/helper/binaryoutputstream.cxx
oox/source/helper/binarystreambase.cxx
oox/source/helper/propertyset.cxx
oox/source/ole/vbacontrol.cxx
oox/source/ole/vbaproject.cxx
oox/source/token/namespaces.hxx.tail
oox/source/vml/vmlshape.cxx
oox/source/xls/commentsbuffer.cxx
oox/source/xls/condformatbuffer.cxx
oox/source/xls/drawingfragment.cxx
oox/source/xls/formulaparser.cxx
oox/source/xls/pivotcachebuffer.cxx
oox/source/xls/richstring.cxx
oox/source/xls/sharedformulabuffer.cxx
oox/source/xls/sheetdatacontext.cxx
oox/source/xls/worksheethelper.cxx
writerfilter/source/dmapper/DomainMapper_Impl.cxx
Diffstat (limited to 'oox/source/dump')
-rw-r--r-- | oox/source/dump/biffdumper.cxx | 58 | ||||
-rw-r--r-- | oox/source/dump/biffdumper.ini | 28 | ||||
-rw-r--r-- | oox/source/dump/dffdumper.ini | 53 | ||||
-rw-r--r-- | oox/source/dump/dumperbase.cxx | 360 | ||||
-rwxr-xr-x[-rw-r--r--] | oox/source/dump/makefile.mk | 0 | ||||
-rw-r--r-- | oox/source/dump/oledumper.cxx | 48 | ||||
-rw-r--r-- | oox/source/dump/pptxdumper.cxx | 25 | ||||
-rw-r--r-- | oox/source/dump/xlsbdumper.cxx | 31 | ||||
-rw-r--r-- | oox/source/dump/xlsbdumper.ini | 1 |
9 files changed, 300 insertions, 304 deletions
diff --git a/oox/source/dump/biffdumper.cxx b/oox/source/dump/biffdumper.cxx index fd7c3ac0193f..976ae644ca0d 100644 --- a/oox/source/dump/biffdumper.cxx +++ b/oox/source/dump/biffdumper.cxx @@ -167,7 +167,7 @@ void BiffCtlsStreamObject::implDump() { IndentGuard aIndGuard( mxOut ); mxStrm->seek( mnStartPos ); - RelativeInputStreamRef xRelStrm( new RelativeInputStream( *mxStrm, mnLength ) ); + BinaryInputStreamRef xRelStrm( new RelativeInputStream( *mxStrm, mnLength ) ); FormControlStreamObject( *this, xRelStrm ).dump(); } writeEmptyItem( "CTLS-END" ); @@ -357,7 +357,7 @@ bool BiffObjectBase::implStartRecord( BinaryInputStream&, sal_Int64& ornRecPos, break; } - ornRecSize = mxBiffStrm->getLength(); + ornRecSize = mxBiffStrm->size(); return bValid; } @@ -811,7 +811,7 @@ void FormulaObject::implDump() if( mnSize == 0 ) return; sal_Int64 nStartPos = mxStrm->tell(); - sal_Int64 nEndPos = ::std::min< sal_Int64 >( nStartPos + mnSize, mxStrm->getLength() ); + sal_Int64 nEndPos = ::std::min< sal_Int64 >( nStartPos + mnSize, mxStrm->size() ); bool bValid = mxTokens.get(); mxStack.reset( new FormulaStack ); @@ -1604,7 +1604,7 @@ void WorkbookStreamObject::implDumpRecordBody() { BiffInputStream& rStrm = getBiffStream(); sal_uInt16 nRecId = rStrm.getRecId(); - sal_Int64 nRecSize = rStrm.getLength(); + sal_Int64 nRecSize = rStrm.size(); BiffType eBiff = getBiff(); switch( nRecId ) @@ -1930,7 +1930,7 @@ void WorkbookStreamObject::implDumpRecordBody() case BIFF_ID_CHPICFORMAT: dumpDec< sal_uInt16 >( "bitmap-mode", "CHPICFORMAT-BITMAP-MODE" ); - dumpDec< sal_uInt16 >( "image-format", "CHPICFORMAT-IMAGE-FORMAT" ); + dumpUnused( 2 ); dumpHex< sal_uInt16 >( "flags", "CHPICFORMAT-FLAGS" ); dumpDec< double >( "scaling-factor" ); break; @@ -2573,6 +2573,12 @@ void WorkbookStreamObject::implDumpRecordBody() dumpDec< sal_Int32 >( "sst-idx" ); break; + case BIFF_ID_MERGEDCELLS: + mxOut->resetItemIndex(); + for( sal_uInt16 nIdx = 0, nCount = dumpDec< sal_uInt16 >( "count" ); !rStrm.isEof() && (nIdx < nCount); ++nIdx ) + dumpRange( "#range" ); + break; + case BIFF_ID_MSODRAWING: case BIFF_ID_MSODRAWINGGROUP: case BIFF_ID_MSODRAWINGSEL: @@ -2626,14 +2632,32 @@ void WorkbookStreamObject::implDumpRecordBody() { dumpHex< sal_uInt16 >( "flags", "NOTE-FLAGS" ); dumpDec< sal_uInt16 >( "obj-id" ); + dumpUniString( "author" ); + dumpUnused( 1 ); } else { - sal_uInt16 nTextLen = ::std::min( dumpDec< sal_uInt16 >( "text-len" ), static_cast< sal_uInt16 >( rStrm.getRemaining() ) ); + sal_uInt16 nTextLen = dumpDec< sal_uInt16 >( "text-len" ); + nTextLen = ::std::min( nTextLen, static_cast< sal_uInt16 >( rStrm.getRemaining() ) ); writeStringItem( "note-text", rStrm.readCharArrayUC( nTextLen, getBiffData().getTextEncoding(), true ) ); } break; + case BIFF_ID_NOTESOUND: + dumpHex< sal_uInt32 >( "identifier" ); + dumpDec< sal_uInt32 >( "total-data-size" ); + dumpDec< sal_uInt32 >( "wave-data-size" ); + if( dumpDec< sal_uInt32 >( "fmt-size" ) >= 16 ) + { + dumpDec< sal_uInt16 >( "format", "NOTESOUND-FORMAT" ); + dumpDec< sal_uInt16 >( "channels" ); + dumpDec< sal_uInt32 >( "sampling-rate" ); + dumpDec< sal_uInt32 >( "data-rate" ); + dumpDec< sal_uInt16 >( "data-block-size" ); + dumpDec< sal_uInt16 >( "bits-per-sample" ); + } + break; + case BIFF2_ID_NUMBER: case BIFF3_ID_NUMBER: dumpCellHeader( nRecId == BIFF2_ID_NUMBER ); @@ -2672,6 +2696,16 @@ void WorkbookStreamObject::implDumpRecordBody() } break; + case BIFF_ID_PALETTE: + mxOut->resetItemIndex( 8 ); + for( sal_uInt16 nIdx = 0, nCount = dumpDec< sal_uInt16 >( "count" ); !rStrm.isEof() && (nIdx < nCount); ++nIdx ) + { + OUStringBuffer aColorName; + StringHelper::appendHex( aColorName, dumpColorABGR( "#color" ) ); + mxColors->setName( nIdx + 8, aColorName.makeStringAndClear() ); + } + break; + case BIFF_ID_PANE: dumpDec< sal_uInt16 >( "x-pos", "CONV-TWIP-TO-CM" ); dumpDec< sal_uInt16 >( "y-pos", "CONV-TWIP-TO-CM" ); @@ -4491,7 +4525,7 @@ RootStorageObject::RootStorageObject( const DumperBase& rParent ) addPreferredStream( "Workbook" ); } -void RootStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) +void RootStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) { if( (rStrgPath.getLength() == 0) && (rStrmName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Book" ) ) || rStrmName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Workbook" ) )) ) WorkbookStreamObject( *this, rxStrm, rSysFileName ).dump(); @@ -4529,13 +4563,13 @@ Dumper::Dumper( const FilterBase& rFilter ) DumperBase::construct( xCfg ); } -Dumper::Dumper( const Reference< XMultiServiceFactory >& rxFactory, const Reference< XInputStream >& rxInStrm, const OUString& rSysFileName ) +Dumper::Dumper( const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& rxInStrm, const OUString& rSysFileName ) { - if( rxFactory.is() && rxInStrm.is() ) + if( rxContext.is() && rxInStrm.is() ) { - StorageRef xStrg( new ::oox::ole::OleStorage( rxFactory, rxInStrm, true ) ); + StorageRef xStrg( new ::oox::ole::OleStorage( rxContext, rxInStrm, true ) ); MediaDescriptor aMediaDesc; - ConfigRef xCfg( new Config( DUMP_BIFF_CONFIG_ENVVAR, rxFactory, xStrg, rSysFileName, aMediaDesc ) ); + ConfigRef xCfg( new Config( DUMP_BIFF_CONFIG_ENVVAR, rxContext, xStrg, rSysFileName, aMediaDesc ) ); DumperBase::construct( xCfg ); } } @@ -4554,4 +4588,4 @@ void Dumper::implDump() #endif -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini index 2e25ff81c890..02f70261ee0d 100644 --- a/oox/source/dump/biffdumper.ini +++ b/oox/source/dump/biffdumper.ini @@ -324,7 +324,7 @@ multilist=RECORD-NAMES-BIFF4 exclude=0x0206,0x0209,0x001E,0x0243 0x0085=SHEET 0x0088=,,,,,,SHEETSOFFSET,SHEETHEADER - 0x0090=,,,,,SOUND,SYNC + 0x0090=,,,,,,NOTESOUND,SYNC 0x0098=LPR,STANDARDWIDTH,FNGROUPNAME,,FNGROUPCOUNT,,, 0x00A0=SCL,PAGESETUP,FNPROTO,PROJEXTSHEET,,,, 0x00A8=DRAGDROP,COORDLIST,,GCW,,,, @@ -358,7 +358,7 @@ multilist=RECORD-NAMES-BIFF5 # chart records exclude=0x1004,0x102D,0x102F,0x1036,0x1037,0x1038,0x103B 0x1040=CHRADARAREA,CHAXESSET,,CHLEGENDENTRY,CHPROPERTIES,CHSERGROUP,CHUSEDAXESSETS, - 0x1048=CHPIVOTREF,,CHSERPARENT,CHSERTRENDLINE,,,CHFORMAT,CHFRAMEPOS + 0x1048=CHPIVOTRANGE,,CHSERPARENT,CHSERTRENDLINE,,,CHFORMAT,CHFRAMEPOS 0x1050=CHFORMATRUNS,CHSOURCELINK,,,,,, 0x1058=,,,CHSERERRORBAR,,CHSERIESFORMAT,, end @@ -1049,17 +1049,7 @@ end shortlist=CHPICFORMAT-BITMAP-MODE,1,stretched,stacked,stacked-scaled -constlist=CHPICFORMAT-IMAGE-FORMAT - 2=wmf - 9=bmp - 19=?emf -end - -shortlist=CHPICFORMAT-ENV,1,windows,apple - combilist=CHPICFORMAT-FLAGS - 0x00FF=uint16,dec,environment,CHPICFORMAT-ENV - 0x0100=format-only 0x0200=top-bottom 0x0400=front-back 0x0800=left-right @@ -1511,6 +1501,18 @@ shortlist=IMGDATA-ENV,1,windows,apple flagslist=NOTE-FLAGS-BIFF8 0x0002=visible + 0x0080=row-hidden + 0x0100=col-hidden +end + +# NOTESOUND ------------------------------------------------------------------ + +constlist=NOTESOUND-FORMAT + 1=pcm + 3=ieee-float + 6=a-law + 7=mu-law + 0xFFFE=extensible end # OBJ ------------------------------------------------------------------------ @@ -2344,7 +2346,7 @@ combilist=XF-FILLCOLOR-BIFF8 0x3F80=uint8,dec,bg-color-idx,COLORS end -# BIFF2 XF index field ------------------------------------------------------- +# BIFF2 cell records ---------------------------------------------------------- constlist=XFINDEX-BIFF2 default= diff --git a/oox/source/dump/dffdumper.ini b/oox/source/dump/dffdumper.ini index 5526663e0e15..02bce03b69f6 100644 --- a/oox/source/dump/dffdumper.ini +++ b/oox/source/dump/dffdumper.ini @@ -79,6 +79,9 @@ end shortlist=DFF-COLORMOD-TYPE,0,none,shade,tint +unitconverter=DFF-OPACITY,/655.36,% +unitconverter=DFF-DEGREES,/65536,° + # DFFBSE --------------------------------------------------------------------- combilist=DFFBSE-RECORD-INST @@ -136,8 +139,8 @@ multilist=DFFOPT-PROPERTY-NAMES # 0x0100-0x013F: picture (BLIP) 0x0100=blip-crop-top,blip-crop-bottom,blip-crop-left,blip-crop-right,blip-id,blip-name,blip-opt,blip-transparency-color 0x0108=blip-contrast,blip-brightness,blip-gamma,blip-ole-id,blip-double-cr-mod,blip-fill-cr-mod,blip-line-cr-mod,blip-print-id - 0x0110=blip-print-name,blip-print-opt,blip-movie,,,blip-transparency-color-ext,,blip-transparency-color-ext-mod - 0x0118,,blip-recolor,blip-recolor,blip-recolor-ext,,blip-recolor-ext-mod + 0x0110=blip-print-name,blip-print-opt,blip-movie,,,blip-transparency-color-ext,reserved,blip-transparency-color-ext-mod + 0x0118=reserved,reserved,blip-recolor,blip-recolor-ext,reserved,blip-recolor-ext-mod,reserved,reserved 0x013F=blip-flags # 0x0140-0x017F: shape geometry 0x0140=geo-left,geo-top,geo-right,geo-bottom,geo-shape-path,geo-vertices,geo-segment-info,geo-adjust-1 @@ -149,20 +152,21 @@ multilist=DFFOPT-PROPERTY-NAMES 0x0180=fill-type,fill-color,fill-opacity,fill-back-color,fill-back-opacity,fill-cr-mod,fill-blip,fill-blip-name 0x0188=fill-blip-opt,fill-width,fill-height,fill-angle,fill-focus,fill-to-left,fill-to-top,fill-to-right 0x0190=fill-to-bottom,fill-rect-left,fill-rect-top,fill-rect-right,fill-rect-bottom,fill-dz-type,fill-shade-preset,fill-shade-colors - 0x0198=fill-origin-x,fill-origin-y,fill-shape-origin-x,fill-shape-origin-y,fill-shade-type,,fill-color-ext, - 0x01A0=fill-color-ext-mod,,fill-back-color-ext,,fill-back-color-ext-mod + 0x0198=fill-origin-x,fill-origin-y,fill-shape-origin-x,fill-shape-origin-y,fill-shade-type,,fill-color-ext,reserved + 0x01A0=fill-color-ext-mod,reserved,fill-back-color-ext,reserved,fill-back-color-ext-mod,reserved,reserved,reserved 0x01BF=fill-flags # 0x01C0-0x01FF: line style 0x01C0=line-color,line-opacity,line-back-color,line-cr-mod,line-type,line-fill-blip,line-fill-blip-name,line-fill-blip-opt 0x01C8=line-fill-width,line-fill-height,line-fill-dz-type,line-width,line-miter-limit,line-style,line-dash,line-dash-style 0x01D0=line-start-arrow-head,line-end-arrow-head,line-start-arrow-width,line-start-arrow-length,line-end-arrow-width,line-end-arrow-length,line-join-style,line-end-cap-style - 0x01D8=,line-color-ext,,line-color-ext-mod,,line-back-color-ext,,line-back-color-ext-mod + 0x01D8=,line-color-ext,reserved,line-color-ext-mod,reserved,line-back-color-ext,reserved,line-back-color-ext-mod + 0x01E0=reserved,reserved,reserved 0x01FF=line-flags # 0x0200-0x023F: shadow style 0x0200=shadow-type,shadow-color,shadow-highlight,shadow-cr-mod,shadow-opacity,shadow-offset-x,shadow-offset-y,shadow-2nd-offset-x 0x0208=shadow-2nd-offset-y,,,,,,, - 0x0210=shadow-origin-x,shadow-origin-y,shadow-color-ext,,shadow-color-ext-mod,,shadow-highlight-ext, - 0x0218=shadow-highlight-ext-mod + 0x0210=shadow-origin-x,shadow-origin-y,shadow-color-ext,reserved,shadow-color-ext-mod,reserved,shadow-highlight-ext,reserved + 0x0218=shadow-highlight-ext-mod,reserved,reserved,reserved 0x023F=shadow-flags # 0x0240-0x027F: perspective 0x0240=persp-type,persp-offset-x,persp-offsety,persp-scale-x-to-x,persp-scale-y-to-x,persp-scale-x-to-y,persp-scale-y-to-y,persp-persp-x @@ -170,7 +174,7 @@ multilist=DFFOPT-PROPERTY-NAMES 0x027F=persp-flags # 0x0280-0x02BF: 3d object 0x0280=3dobj-specular-amt,3dobj-diffuse-amt,3dobj-shininess,3dobj-edge-thickness,3dobj-extrude-forward,3dobj-extrude-backward,3dobj-extrude-plane,3dobj-extrusion-color - 0x0288=3dobj-cr-mod,3dobj-extrusion-color-ext,,3dobj-extrusion-color-ext-mod + 0x0288=3dobj-cr-mod,3dobj-extrusion-color-ext,reserved,3dobj-extrusion-color-ext-mod,reserved,reserved 0x02BF=3dobj-flags # 0x02C0-0x02FF: 3d style 0x02C0=3dstyle-y-rotation,3dstyle-x-rotation,3dstyle-rotation-axis-x,3dstyle-rotation-axis-y,3dstyle-rotation-axis-z,3dstyle-rotation,3dstyle-rotation-center-x,3dstyle-rotation-center-y @@ -208,25 +212,29 @@ multilist=DFFOPT-PROPERTY-NAMES 0x0540=lline-color,lline-opacity,lline-back-color,lline-cr-mod,lline-type,lline-fill-blip,lline-fill-blip-name,lline-fill-blip-opt 0x0548=lline-fill-width,lline-fill-height,lline-fill-dz-type,lline-width,lline-miter-limit,lline-style,lline-dash,lline-dash-style 0x0550=lline-start-arrow-head,lline-end-arrow-head,lline-start-arrow-width,lline-start-arrow-length,lline-end-arrow-width,lline-end-arrow-length,lline-join-style,lline-end-cap-style - 0x0558=,lline-color-ext,,lline-color-ext-mod,,lline-back-color-ext,,lline-back-color-ext-mod + 0x0558=,lline-color-ext,reserved,lline-color-ext-mod,reserved,lline-back-color-ext,reserved,lline-back-color-ext-mod + 0x0560=reserved,reserved,reserved 0x057F=lline-flags # 0x0580-0x05BF: top line style 0x0580=tline-color,tline-opacity,tline-back-color,tline-cr-mod,tline-type,tline-fill-blip,tline-fill-blip-name,tline-fill-blip-opt 0x0588=tline-fill-width,tline-fill-height,tline-fill-dz-type,tline-width,tline-miter-limit,tline-style,tline-dash,tline-dash-style 0x0590=tline-start-arrow-head,tline-end-arrow-head,tline-start-arrow-width,tline-start-arrow-length,tline-end-arrow-width,tline-end-arrow-length,tline-join-style,tline-end-cap-style - 0x0598=,tline-color-ext,,tline-color-ext-mod,,tline-back-color-ext,,tline-back-color-ext-mod + 0x0598=,tline-color-ext,reserved,tline-color-ext-mod,reserved,tline-back-color-ext,reserved,tline-back-color-ext-mod + 0x05A0=reserved,reserved,reserved 0x05BF=tline-flags # 0x05C0-0x05FF: right line style 0x05C0=rline-color,rline-opacity,rline-back-color,rline-cr-mod,rline-type,rline-fill-blip,rline-fill-blip-name,rline-fill-blip-opt 0x05C8=rline-fill-width,rline-fill-height,rline-fill-dz-type,rline-width,rline-miter-limit,rline-style,rline-dash,rline-dash-style 0x05D0=rline-start-arrow-head,rline-end-arrow-head,rline-start-arrow-width,rline-start-arrow-length,rline-end-arrow-width,rline-end-arrow-length,rline-join-style,rline-end-cap-style - 0x05D8=,rline-color-ext,,rline-color-ext-mod,,rline-back-color-ext,,rline-back-color-ext-mod + 0x05D8=,rline-color-ext,reserved,rline-color-ext-mod,reserved,rline-back-color-ext,reserved,rline-back-color-ext-mod + 0x05E0=reserved,reserved,reserved 0x05FF=rline-flags # 0x0600-0x063F: bottom line style 0x0600=bline-color,bline-opacity,bline-back-color,bline-cr-mod,bline-type,bline-fill-blip,bline-fill-blip-name,bline-fill-blip-opt 0x0608=bline-fill-width,bline-fill-height,bline-fill-dz-type,bline-width,bline-miter-limit,bline-style,bline-dash,bline-dash-style 0x0610=bline-start-arrow-head,bline-end-arrow-head,bline-start-arrow-width,bline-start-arrow-length,bline-end-arrow-width,bline-end-arrow-length,bline-join-style,bline-end-cap-style - 0x0618=,bline-color-ext,,bline-color-ext-mod,,bline-back-color-ext,,bline-back-color-ext-mod + 0x0618=,bline-color-ext,reserved,bline-color-ext-mod,reserved,bline-back-color-ext,reserved,bline-back-color-ext-mod + 0x0620=reserved,reserved,reserved 0x063F=bline-flags # 0x0680-0x06BF: web component 0x0680=webcomp-html,webcomp-name,webcomp-url @@ -258,7 +266,7 @@ constlist=DFFOPT-SIMPLE-PROPERTIES # fill style 0x0180=uint32,dec,type,DFFOPT-FILL-TYPE 0x0181=uint32,hex,color,DFF-COLOR - 0x0182=int32,fix,opacity,CONV-FLOAT-TO-PERC + 0x0182=int32,fix,opacity,DFF-OPACITY 0x0183=uint32,hex,color,DFF-COLOR 0x0184=int32,fix,opacity,DFF-OPACITY 0x0185=uint32,hex,color,DFF-COLOR @@ -266,22 +274,22 @@ constlist=DFFOPT-SIMPLE-PROPERTIES 0x0188=uint32,dec,blip-opt,DFFOPT-BLIPOPT 0x0189=int32,dec,width 0x018A=int32,dec,height - 0x018B=int32,fix,angle,CONV-DEG + 0x018B=int32,fix,angle,DFF-DEGREES 0x018C=int32,dec,focus,CONV-PERCENT - 0x018D=int32,fix,size,CONV-FLOAT-TO-PERC - 0x018E=int32,fix,size,CONV-FLOAT-TO-PERC - 0x018F=int32,fix,size,CONV-FLOAT-TO-PERC - 0x0190=int32,fix,size,CONV-FLOAT-TO-PERC + 0x018D=int32,fix,size,DFF-OPACITY + 0x018E=int32,fix,size,DFF-OPACITY + 0x018F=int32,fix,size,DFF-OPACITY + 0x0190=int32,fix,size,DFF-OPACITY 0x0191=int32,fix,size,CONV-EMU-TO-CM 0x0192=int32,fix,size,CONV-EMU-TO-CM 0x0193=int32,fix,size,CONV-EMU-TO-CM 0x0194=int32,fix,size,CONV-EMU-TO-CM 0x0195=uint32,dec,type,DFFOPT-FILL-DZTYPE 0x0196=int32,dec,preset - 0x0198=int32,fix,pos,CONV-FLOAT-TO-PERC - 0x0199=int32,fix,pos,CONV-FLOAT-TO-PERC - 0x019A=int32,fix,pos,CONV-FLOAT-TO-PERC - 0x019B=int32,fix,pos,CONV-FLOAT-TO-PERC + 0x0198=int32,fix,pos,DFF-OPACITY + 0x0199=int32,fix,pos,DFF-OPACITY + 0x019A=int32,fix,pos,DFF-OPACITY + 0x019B=int32,fix,pos,DFF-OPACITY 0x019C=uint32,hex,type,DFFOPT-FILL-SHADETYPE 0x019E=uint32,hex,color,DFF-COLOR 0x01A0=uint32,hex,color-mod,DFF-COLORMOD @@ -443,6 +451,7 @@ shortlist=DFFOPT-FILL-DZTYPE-UNIT,0,unused,emu,pixel,shape-size-rel shortlist=DFFOPT-FILL-DZTYPE-ASPECT,0,none,fixed,prefer-largest flagslist=DFFOPT-FILL-SHADETYPE + ignore=0x40000000 0x00000001=none 0x00000002=gamma 0x00000004=sigma-transfer diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index 9eb999bcdbdb..81bc3fbd8db9 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -30,14 +30,13 @@ #include <algorithm> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/io/XActiveDataSink.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> -#include <com/sun/star/io/XTextInputStream.hpp> #include <com/sun/star/io/XTextOutputStream.hpp> #include <com/sun/star/ucb/XSimpleFileAccess.hpp> #include <comphelper/docpasswordhelper.hxx> #include <osl/file.hxx> #include <rtl/math.hxx> +#include <rtl/tencinfo.h> #include "oox/core/filterbase.hxx" #include "oox/helper/binaryoutputstream.hxx" #include "oox/helper/textinputstream.hxx" @@ -113,20 +112,14 @@ OUString InputOutputHelper::getFileNameExtension( const OUString& rFileUrl ) // input streams -------------------------------------------------------------- -Reference< XInputStream > InputOutputHelper::getXInputStream( BinaryInputStream& rStrm ) -{ - if( BinaryXInputStream* pXStrm = dynamic_cast< BinaryXInputStream* >( &rStrm ) ) - return pXStrm->getXInputStream(); - return 0; -} - Reference< XInputStream > InputOutputHelper::openInputStream( - const Reference< XMultiServiceFactory >& rxFactory, const OUString& rFileName ) + const Reference< XComponentContext >& rxContext, const OUString& rFileName ) { Reference< XInputStream > xInStrm; - if( rxFactory.is() ) try + if( rxContext.is() ) try { - Reference< XSimpleFileAccess > xFileAccess( rxFactory->createInstance( CREATE_OUSTRING( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY_THROW ); + Reference< XMultiServiceFactory > xFactory( rxContext->getServiceManager(), UNO_QUERY_THROW ); + Reference< XSimpleFileAccess > xFileAccess( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY_THROW ); xInStrm = xFileAccess->openFileRead( rFileName ); } catch( Exception& ) @@ -135,38 +128,16 @@ Reference< XInputStream > InputOutputHelper::openInputStream( return xInStrm; } -Reference< XTextInputStream > InputOutputHelper::openTextInputStream( - const Reference< XMultiServiceFactory >& rxFactory, const Reference< XInputStream >& rxInStrm, const OUString& rEncoding ) -{ - Reference< XTextInputStream > xTextInStrm; - if( rxFactory.is() && rxInStrm.is() ) try - { - Reference< XActiveDataSink > xDataSink( rxFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TextInputStream" ) ), UNO_QUERY_THROW ); - xDataSink->setInputStream( rxInStrm ); - xTextInStrm.set( xDataSink, UNO_QUERY_THROW ); - xTextInStrm->setEncoding( rEncoding ); - } - catch( Exception& ) - { - } - return xTextInStrm; -} - -Reference< XTextInputStream > InputOutputHelper::openTextInputStream( - const Reference< XMultiServiceFactory >& rxFactory, const OUString& rFileName, const OUString& rEncoding ) -{ - return openTextInputStream( rxFactory, openInputStream( rxFactory, rFileName ), rEncoding ); -} - // output streams ------------------------------------------------------------- Reference< XOutputStream > InputOutputHelper::openOutputStream( - const Reference< XMultiServiceFactory >& rxFactory, const OUString& rFileName ) + const Reference< XComponentContext >& rxContext, const OUString& rFileName ) { Reference< XOutputStream > xOutStrm; - if( rxFactory.is() ) try + if( rxContext.is() ) try { - Reference< XSimpleFileAccess > xFileAccess( rxFactory->createInstance( CREATE_OUSTRING( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY_THROW ); + Reference< XMultiServiceFactory > xFactory( rxContext->getServiceManager(), UNO_QUERY_THROW ); + Reference< XSimpleFileAccess > xFileAccess( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY_THROW ); xOutStrm = xFileAccess->openFileWrite( rFileName ); } catch( Exception& ) @@ -176,15 +147,17 @@ Reference< XOutputStream > InputOutputHelper::openOutputStream( } Reference< XTextOutputStream > InputOutputHelper::openTextOutputStream( - const Reference< XMultiServiceFactory >& rxFactory, const Reference< XOutputStream >& rxOutStrm, const OUString& rEncoding ) + const Reference< XComponentContext >& rxContext, const Reference< XOutputStream >& rxOutStrm, rtl_TextEncoding eTextEnc ) { Reference< XTextOutputStream > xTextOutStrm; - if( rxFactory.is() && rxOutStrm.is() ) try + const char* pcCharset = rtl_getMimeCharsetFromTextEncoding( eTextEnc ); + if( rxContext.is() && rxOutStrm.is() && pcCharset ) try { - Reference< XActiveDataSource > xDataSource( rxFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TextOutputStream" ) ), UNO_QUERY_THROW ); + Reference< XMultiServiceFactory > xFactory( rxContext->getServiceManager(), UNO_QUERY_THROW ); + Reference< XActiveDataSource > xDataSource( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TextOutputStream" ) ), UNO_QUERY_THROW ); xDataSource->setOutputStream( rxOutStrm ); xTextOutStrm.set( xDataSource, UNO_QUERY_THROW ); - xTextOutStrm->setEncoding( rEncoding ); + xTextOutStrm->setEncoding( OUString::createFromAscii( pcCharset ) ); } catch( Exception& ) { @@ -193,9 +166,9 @@ Reference< XTextOutputStream > InputOutputHelper::openTextOutputStream( } Reference< XTextOutputStream > InputOutputHelper::openTextOutputStream( - const Reference< XMultiServiceFactory >& rxFactory, const OUString& rFileName, const OUString& rEncoding ) + const Reference< XComponentContext >& rxContext, const OUString& rFileName, rtl_TextEncoding eTextEnc ) { - return openTextOutputStream( rxFactory, openOutputStream( rxFactory, rFileName ), rEncoding ); + return openTextOutputStream( rxContext, openOutputStream( rxContext, rFileName ), eTextEnc ); } // ============================================================================ @@ -1532,9 +1505,9 @@ NameListRef NameListWrapper::getNameList( const Config& rCfg ) const // ============================================================================ SharedConfigData::SharedConfigData( const OUString& rFileName, - const Reference< XMultiServiceFactory >& rxFactory, const StorageRef& rxRootStrg, + const Reference< XComponentContext >& rxContext, const StorageRef& rxRootStrg, const OUString& rSysFileName, MediaDescriptor& rMediaDesc ) : - mxFactory( rxFactory ), + mxContext( rxContext ), mxRootStrg( rxRootStrg ), maSysFileName( rSysFileName ), mrMediaDesc( rMediaDesc ), @@ -1601,7 +1574,7 @@ Sequence< NamedValue > SharedConfigData::requestEncryptionData( ::comphelper::ID bool SharedConfigData::implIsValid() const { - return mbLoaded && mxFactory.is() && mxRootStrg.get() && (maSysFileName.getLength() > 0); + return mbLoaded && mxContext.is() && mxRootStrg.get() && (maSysFileName.getLength() > 0); } void SharedConfigData::implProcessConfigItemStr( @@ -1630,9 +1603,8 @@ bool SharedConfigData::readConfigFile( const OUString& rFileUrl ) bool bLoaded = maConfigFiles.count( rFileUrl ) > 0; if( !bLoaded ) { - Reference< XInputStream > xInStrm = InputOutputHelper::openInputStream( mxFactory, rFileUrl ); - BinaryXInputStream aInStrm( xInStrm, true ); - TextInputStream aTxtStrm( aInStrm, RTL_TEXTENCODING_UTF8 ); + Reference< XInputStream > xInStrm = InputOutputHelper::openInputStream( mxContext, rFileUrl ); + TextInputStream aTxtStrm( mxContext, xInStrm, RTL_TEXTENCODING_UTF8 ); if( !aTxtStrm.isEof() ) { maConfigFiles.insert( rFileUrl ); @@ -1699,9 +1671,9 @@ Config::Config( const sal_Char* pcEnvVar, const FilterBase& rFilter ) construct( pcEnvVar, rFilter ); } -Config::Config( const sal_Char* pcEnvVar, const Reference< XMultiServiceFactory >& rxFactory, const StorageRef& rxRootStrg, const OUString& rSysFileName, MediaDescriptor& rMediaDesc ) +Config::Config( const sal_Char* pcEnvVar, const Reference< XComponentContext >& rxContext, const StorageRef& rxRootStrg, const OUString& rSysFileName, MediaDescriptor& rMediaDesc ) { - construct( pcEnvVar, rxFactory, rxRootStrg, rSysFileName, rMediaDesc ); + construct( pcEnvVar, rxContext, rxRootStrg, rSysFileName, rMediaDesc ); } Config::~Config() @@ -1716,14 +1688,14 @@ void Config::construct( const Config& rParent ) void Config::construct( const sal_Char* pcEnvVar, const FilterBase& rFilter ) { if( rFilter.getFileUrl().getLength() > 0 ) - construct( pcEnvVar, rFilter.getServiceFactory(), rFilter.getStorage(), rFilter.getFileUrl(), rFilter.getMediaDescriptor() ); + construct( pcEnvVar, rFilter.getComponentContext(), 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 ) +void Config::construct( const sal_Char* pcEnvVar, const Reference< XComponentContext >& rxContext, const StorageRef& rxRootStrg, const OUString& rSysFileName, MediaDescriptor& rMediaDesc ) { if( pcEnvVar && rxRootStrg.get() && (rSysFileName.getLength() > 0) ) if( const sal_Char* pcFileName = ::getenv( pcEnvVar ) ) - mxCfgData.reset( new SharedConfigData( OUString::createFromAscii( pcFileName ), rxFactory, rxRootStrg, rSysFileName, rMediaDesc ) ); + mxCfgData.reset( new SharedConfigData( OUString::createFromAscii( pcFileName ), rxContext, rxRootStrg, rSysFileName, rMediaDesc ) ); } void Config::setStringOption( const String& rKey, const String& rData ) @@ -1796,14 +1768,16 @@ NameListRef Config::implGetNameList( const OUString& rListName ) const // ============================================================================ // ============================================================================ -Output::Output( const Reference< XTextOutputStream >& rxStrm ) -{ - construct( rxStrm ); -} - -Output::Output( const Reference< XMultiServiceFactory >& rxFactory, const OUString& rFileName ) +Output::Output( const Reference< XComponentContext >& rxContext, const OUString& rFileName ) : + mxStrm( InputOutputHelper::openTextOutputStream( rxContext, rFileName, RTL_TEXTENCODING_UTF8 ) ), + mnCol( 0 ), + mnItemLevel( 0 ), + mnMultiLevel( 0 ), + mnItemIdx( 0 ), + mnLastItem( 0 ) { - construct( InputOutputHelper::openTextOutputStream( rxFactory, rFileName, CREATE_OUSTRING( "UTF-8" ) ) ); + if( mxStrm.is() ) + mxStrm->writeString( OUString( OOX_DUMP_BOM ) ); } // ---------------------------------------------------------------------------- @@ -2085,19 +2059,6 @@ void Output::writeRangeList( const RangeList& rRanges ) // ---------------------------------------------------------------------------- -void Output::construct( const Reference< XTextOutputStream >& rxStrm ) -{ - mxStrm = rxStrm; - mnCol = mnItemLevel = mnMultiLevel = 0; - mnItemIdx = 0; - mnLastItem = 0; - if( mxStrm.is() ) - { - writeChar( OOX_DUMP_BOM ); - newLine(); - } -} - bool Output::implIsValid() const { return mxStrm.is(); @@ -2241,7 +2202,8 @@ void StorageObjectBase::implDump() if( bIsRoot ) try { aSysOutPath += OOX_DUMP_DUMPEXT; - Reference< XSimpleFileAccess > xFileAccess( getFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY_THROW ); + Reference< XMultiServiceFactory > xFactory( getContext()->getServiceManager(), UNO_QUERY_THROW ); + Reference< XSimpleFileAccess > xFileAccess( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY_THROW ); xFileAccess->kill( aSysOutPath ); } catch( Exception& ) @@ -2260,7 +2222,7 @@ void StorageObjectBase::implDump() } } -void StorageObjectBase::implDumpStream( const BinaryInputStreamRef&, const OUString&, const OUString&, const OUString& ) +void StorageObjectBase::implDumpStream( const Reference< XInputStream >&, const OUString&, const OUString&, const OUString& ) { } @@ -2306,12 +2268,12 @@ void StorageObjectBase::extractStream( StorageBase& rStrg, const OUString& rStrg BinaryXInputStream aInStrm( rStrg.openInputStream( rStrmName ), true ); if( !aInStrm.isEof() ) { - BinaryXOutputStream aOutStrm( InputOutputHelper::openOutputStream( getFactory(), rSysFileName ), true ); + BinaryXOutputStream aOutStrm( InputOutputHelper::openOutputStream( getContext(), rSysFileName ), true ); if( !aOutStrm.isEof() ) aInStrm.copyToStream( aOutStrm ); } - BinaryXInputStreamRef xDumpStrm( new BinaryXInputStream( InputOutputHelper::openInputStream( getFactory(), rSysFileName ), true ) ); - if( !xDumpStrm->isEof() ) + Reference< XInputStream > xDumpStrm = InputOutputHelper::openInputStream( getContext(), rSysFileName ); + if( xDumpStrm.is() ) implDumpStream( xDumpStrm, rStrgPath, rStrmName, rSysFileName ); } @@ -2367,13 +2329,10 @@ void OutputObjectBase::construct( const ObjectBase& rParent, const OUString& rSy { ObjectBase::construct( rParent ); if( ObjectBase::implIsValid() ) - mxOut.reset( new Output( getFactory(), rSysFileName + OOX_DUMP_DUMPEXT ) ); -} - -void OutputObjectBase::construct( const ObjectBase& rParent, const OutputRef& rxOut ) -{ - ObjectBase::construct( rParent ); - mxOut = rxOut; + { + maSysFileName = rSysFileName; + mxOut.reset( new Output( getContext(), rSysFileName + OOX_DUMP_DUMPEXT ) ); + } } void OutputObjectBase::construct( const OutputObjectBase& rParent ) @@ -2552,12 +2511,6 @@ void InputObjectBase::construct( const ObjectBase& rParent, const BinaryInputStr mxStrm = rxStrm; } -void InputObjectBase::construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OutputRef& rxOut ) -{ - OutputObjectBase::construct( rParent, rxOut ); - mxStrm = rxStrm; -} - void InputObjectBase::construct( const OutputObjectBase& rParent, const BinaryInputStreamRef& rxStrm ) { OutputObjectBase::construct( rParent ); @@ -2576,7 +2529,7 @@ bool InputObjectBase::implIsValid() const void InputObjectBase::skipBlock( sal_Int64 nBytes, bool bShowSize ) { - sal_Int64 nEndPos = ::std::min< sal_Int64 >( mxStrm->tell() + nBytes, mxStrm->getLength() ); + sal_Int64 nEndPos = ::std::min< sal_Int64 >( mxStrm->tell() + nBytes, mxStrm->size() ); if( mxStrm->tell() < nEndPos ) { if( bShowSize ) @@ -2596,8 +2549,8 @@ void InputObjectBase::dumpRawBinary( sal_Int64 nBytes, bool bShowOffset, bool bS sal_Int64 nMaxShowSize = cfg().getIntOption< sal_Int64 >( bStream ? "max-binary-stream-size" : "max-binary-data-size", SAL_MAX_INT64 ); - bool bSeekable = mxStrm->getLength() >= 0; - sal_Int64 nEndPos = bSeekable ? ::std::min< sal_Int64 >( mxStrm->tell() + nBytes, mxStrm->getLength() ) : 0; + bool bSeekable = mxStrm->size() >= 0; + sal_Int64 nEndPos = bSeekable ? ::std::min< sal_Int64 >( mxStrm->tell() + nBytes, mxStrm->size() ) : 0; sal_Int64 nDumpEnd = bSeekable ? ::std::min< sal_Int64 >( mxStrm->tell() + nMaxShowSize, nEndPos ) : nMaxShowSize; sal_Int64 nPos = bSeekable ? mxStrm->tell() : 0; bool bLoop = true; @@ -2672,12 +2625,12 @@ void InputObjectBase::dumpRemainingTo( sal_Int64 nPos ) void InputObjectBase::dumpRemainingStream() { - dumpRemainingTo( mxStrm->getLength() ); + dumpRemainingTo( mxStrm->size() ); } void InputObjectBase::dumpArray( const String& rName, sal_Int32 nBytes, sal_Unicode cSep ) { - sal_Int32 nDumpSize = getLimitedValue< sal_Int32, sal_Int64 >( mxStrm->getLength() - mxStrm->tell(), 0, nBytes ); + sal_Int32 nDumpSize = getLimitedValue< sal_Int32, sal_Int64 >( mxStrm->size() - mxStrm->tell(), 0, nBytes ); if( nDumpSize > OOX_DUMP_MAXARRAY ) { dumpBinary( rName, nBytes, false ); @@ -2713,7 +2666,7 @@ sal_Unicode InputObjectBase::dumpUnicode( const String& rName ) OUString InputObjectBase::dumpCharArray( const String& rName, sal_Int32 nLen, rtl_TextEncoding eTextEnc, bool bHideTrailingNul ) { - sal_Int32 nDumpSize = getLimitedValue< sal_Int32, sal_Int64 >( mxStrm->getLength() - mxStrm->tell(), 0, nLen ); + sal_Int32 nDumpSize = getLimitedValue< sal_Int32, sal_Int64 >( mxStrm->size() - mxStrm->tell(), 0, nLen ); OUString aString; if( nDumpSize > 0 ) { @@ -2893,7 +2846,7 @@ BinaryStreamObject::BinaryStreamObject( const OutputObjectBase& rParent, const B void BinaryStreamObject::dumpBinaryStream( bool bShowOffset ) { mxStrm->seekToStart(); - dumpRawBinary( mxStrm->getLength(), bShowOffset, true ); + dumpRawBinary( mxStrm->size(), bShowOffset, true ); mxOut->emptyLine(); } @@ -2903,42 +2856,70 @@ void BinaryStreamObject::implDump() } // ============================================================================ +// ============================================================================ -TextStreamObject::TextStreamObject( const ObjectBase& rParent, +void TextStreamObjectBase::construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, rtl_TextEncoding eTextEnc, const OUString& rSysFileName ) { InputObjectBase::construct( rParent, rxStrm, rSysFileName ); - if( rxStrm.get() ) - mxTextStrm.reset( new TextInputStream( *rxStrm, eTextEnc ) ); + constructTextStrmObj( eTextEnc ); } -TextStreamObject::TextStreamObject( const OutputObjectBase& rParent, +void TextStreamObjectBase::construct( const OutputObjectBase& rParent, const BinaryInputStreamRef& rxStrm, rtl_TextEncoding eTextEnc ) { InputObjectBase::construct( rParent, rxStrm ); - if( rxStrm.get() ) - mxTextStrm.reset( new TextInputStream( *rxStrm, eTextEnc ) ); + constructTextStrmObj( eTextEnc ); +} + +void TextStreamObjectBase::construct( const InputObjectBase& rParent, rtl_TextEncoding eTextEnc ) +{ + InputObjectBase::construct( rParent ); + constructTextStrmObj( eTextEnc ); } -bool TextStreamObject::implIsValid() const +bool TextStreamObjectBase::implIsValid() const { return InputObjectBase::implIsValid() && mxTextStrm.get(); } -void TextStreamObject::implDump() +void TextStreamObjectBase::implDump() +{ + implDumpText( *mxTextStrm ); +} + +void TextStreamObjectBase::constructTextStrmObj( rtl_TextEncoding eTextEnc ) +{ + if( mxStrm.get() ) + mxTextStrm.reset( new TextInputStream( getContext(), *mxStrm, eTextEnc ) ); +} + +// ============================================================================ + +TextLineStreamObject::TextLineStreamObject( const ObjectBase& rParent, + const BinaryInputStreamRef& rxStrm, rtl_TextEncoding eTextEnc, const OUString& rSysFileName ) +{ + TextStreamObjectBase::construct( rParent, rxStrm, eTextEnc, rSysFileName ); +} + +TextLineStreamObject::TextLineStreamObject( const OutputObjectBase& rParent, + const BinaryInputStreamRef& rxStrm, rtl_TextEncoding eTextEnc ) +{ + TextStreamObjectBase::construct( rParent, rxStrm, eTextEnc ); +} + +void TextLineStreamObject::implDumpText( TextInputStream& rTextStrm ) { - OUString aLine; sal_uInt32 nLine = 0; - while( !mxTextStrm->isEof() ) + while( !rTextStrm.isEof() ) { - aLine = mxTextStrm->readLine(); - if( !mxTextStrm->isEof() ) + OUString aLine = rTextStrm.readLine(); + if( !rTextStrm.isEof() || (aLine.getLength() > 0) ) implDumpLine( aLine, ++nLine ); } - mxOut->emptyLine(); } -void TextStreamObject::implDumpLine( const OUString& rLine, sal_uInt32 nLine ) +void TextLineStreamObject::implDumpLine( const OUString& rLine, sal_uInt32 nLine ) { TableGuard aTabGuard( mxOut, 8 ); mxOut->writeDec( nLine, 6 ); @@ -2949,110 +2930,93 @@ void TextStreamObject::implDumpLine( const OUString& rLine, sal_uInt32 nLine ) // ============================================================================ -XmlStreamObject::XmlStreamObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName ) : - TextStreamObject( rParent, rxStrm, RTL_TEXTENCODING_UTF8, rSysFileName ) +XmlStreamObject::XmlStreamObject( const ObjectBase& rParent, + const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName ) { + TextStreamObjectBase::construct( rParent, rxStrm, RTL_TEXTENCODING_UTF8, rSysFileName ); } -void XmlStreamObject::implDump() +XmlStreamObject::XmlStreamObject( const OutputObjectBase& rParent, const BinaryInputStreamRef& rxStrm ) { - maIncompleteLine = OUString(); - TextStreamObject::implDump(); - if( maIncompleteLine.getLength() > 0 ) - { - mxOut->resetIndent(); - mxOut->writeString( maIncompleteLine ); - mxOut->emptyLine(); - writeInfoItem( "stream-state", OOX_DUMP_ERR_STREAM ); - } + TextStreamObjectBase::construct( rParent, rxStrm, RTL_TEXTENCODING_UTF8 ); } -void XmlStreamObject::implDumpLine( const OUString& rLine, sal_uInt32 ) +void XmlStreamObject::implDumpText( TextInputStream& rTextStrm ) { - // build input line from cached incomplete element and new text data - OUStringBuffer aLine; - if( maIncompleteLine.getLength() > 0 ) - aLine.append( maIncompleteLine ).append( sal_Unicode( ' ' ) ); - aLine.append( rLine ); - maIncompleteLine = OUString(); + /* Buffers a start element and the following element text. Needed to dump + matching start/end elements and the element text on the same line. */ + OUStringBuffer aOldStartElem; + // special handling for VML + bool bIsVml = InputOutputHelper::getFileNameExtension( maSysFileName ).equalsIgnoreAsciiCaseAscii( "vml" ); - if( aLine.getLength() == 0 ) + while( !rTextStrm.isEof() ) { - mxOut->newLine(); - return; - } + // get the next element and the following element text from text stream + OUString aElem = rTextStrm.readToChar( '>', true ).trim(); + OUString aText = rTextStrm.readToChar( '<', false ); - const sal_Unicode* pcPos = aLine.getStr(); - const sal_Unicode* pcEnd = pcPos + aLine.getLength(); - while( pcPos < pcEnd ) - { - OUStringBuffer aOutLine; - bool bIsStartElement = false; - bool bIsComplElement = false; - bool bIsEndElement = false; - - /* check for start element at beginning of the line - pcEnd and thus (pcPos+1) - are dereferenceable, because OUStringBuffer::getStr is null-terminated. */ - if( (*pcPos == '<') && (pcPos[ 1 ] != '/') ) + // remove multiple whitespace from element + sal_Int32 nPos = 0; + while( nPos < aElem.getLength() ) { - const sal_Unicode* pcElementEnd = ::std::find( pcPos, pcEnd, '>' ); - if( pcElementEnd == pcEnd ) - { - // incomplete start element - maIncompleteLine = OUString( pcPos, static_cast< sal_Int32 >( pcEnd - pcPos ) ); - pcPos = pcEnd; - } - else - { - bIsComplElement = (pcPos[ 1 ] == '?') || (pcPos[ 1 ] == '!') || (pcElementEnd[ -1 ] == '/'); - bIsStartElement = !bIsComplElement; - ++pcElementEnd; - aOutLine.append( pcPos, static_cast< sal_Int32 >( pcElementEnd - pcPos ) ); - pcPos = pcElementEnd; - } + while( (nPos < aElem.getLength()) && (aElem[ nPos ] >= 32) ) ++nPos; + if( nPos < aElem.getLength() ) + aElem = OUStringBuffer( aElem.copy( 0, nPos ) ).append( sal_Unicode( ' ' ) ).append( aElem.copy( nPos ).trim() ).makeStringAndClear(); + ++nPos; } - // check for following element text - if( !bIsComplElement && (pcPos < pcEnd) ) + sal_Int32 nElemLen = aElem.getLength(); + if( (nElemLen >= 2) && (aElem[ 0 ] == '<') && (aElem[ nElemLen - 1 ] == '>') ) { - const sal_Unicode* pcElementStart = ::std::find( pcPos, pcEnd, '<' ); - // append text between elements - if( pcPos < pcElementStart ) + // determine type of the element + bool bSimpleElem = (aElem[ 1 ] == '!') || (aElem[ 1 ] == '?') || (aElem[ nElemLen - 2 ] == '/') || + (bIsVml && (nElemLen == 4) && (aElem[ 1 ] == 'b') && (aElem[ 2 ] == 'r')); + bool bStartElem = !bSimpleElem && (aElem[ 1 ] != '/'); + bool bEndElem = !bSimpleElem && !bStartElem; + + /* Start element or simple element: flush old start element and + its text from previous iteration, and start a new indentation + level for the new element. Trim whitespace and line breaks from + the text of the old start element. */ + if( (bSimpleElem || bStartElem) && (aOldStartElem.getLength() > 0) ) { - OUString aText( pcPos, static_cast< sal_Int32 >( pcElementStart - pcPos ) ); - if( aText.trim().getLength() > 0 ) - aOutLine.append( aText ); - pcPos = pcElementStart; + mxOut->writeString( aOldStartElem.makeStringAndClear().trim() ); + mxOut->newLine(); + mxOut->incIndent(); } - } - // check for stand-alone or following end element - if( !bIsComplElement && (pcPos < pcEnd) && (pcPos[ 1 ] == '/') ) - { - const sal_Unicode* pcElementEnd = ::std::find( pcPos, pcEnd, '>' ); - if( pcElementEnd == pcEnd ) + /* Start element: remember it and its text, to be able to print the + matching end element on the same line in the next iteration. */ + if( bStartElem ) { - // incomplete end element - aOutLine.append( pcPos, static_cast< sal_Int32 >( pcEnd - pcPos ) ); - maIncompleteLine = aOutLine.makeStringAndClear(); - pcPos = pcEnd; + aOldStartElem.append( aElem ).append( aText ); } else { - bIsEndElement = true; - ++pcElementEnd; - aOutLine.append( pcPos, static_cast< sal_Int32 >( pcElementEnd - pcPos ) ); - pcPos = pcElementEnd; - } - } + /* End element: if a start element has been remembered in the + previous iteration, write it out here untrimmed, to show + all whitespace in the element text, and without trailing + line break. Code below will add the end element right after + it. Otherwise, return to previous indentation level. */ + if( bEndElem ) + { + if( aOldStartElem.getLength() == 0 ) + mxOut->decIndent(); + else + mxOut->writeString( aOldStartElem.makeStringAndClear() ); + } - // flush output line - if( maIncompleteLine.getLength() == 0 ) - { - if( !bIsStartElement && bIsEndElement ) mxOut->decIndent(); - mxOut->writeString( aOutLine.makeStringAndClear() ); - mxOut->newLine(); - if( bIsStartElement && !bIsEndElement ) mxOut->incIndent(); + /* Write the element. Write following element text in a new + line, but only, if it does not contain of white space + entirely. */ + mxOut->writeString( aElem ); + mxOut->newLine(); + if( aText.trim().getLength() > 0 ) + { + mxOut->writeString( aText ); + mxOut->newLine(); + } + } } } } @@ -3168,7 +3132,7 @@ bool SequenceRecordObjectBase::implStartRecord( BinaryInputStream& rBaseStrm, sa { ornRecPos = rBaseStrm.tell(); // do not try to overread seekable streams, may cause assertions - bValid = ornRecPos < rBaseStrm.getLength(); + bValid = ornRecPos < rBaseStrm.size(); } // read the record header @@ -3217,4 +3181,4 @@ void DumperBase::construct( const ConfigRef& rxConfig ) #endif -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/dump/makefile.mk b/oox/source/dump/makefile.mk index 1e5f615675cc..1e5f615675cc 100644..100755 --- a/oox/source/dump/makefile.mk +++ b/oox/source/dump/makefile.mk diff --git a/oox/source/dump/oledumper.cxx b/oox/source/dump/oledumper.cxx index b2ac450bf667..a7c0daf85a7a 100644 --- a/oox/source/dump/oledumper.cxx +++ b/oox/source/dump/oledumper.cxx @@ -470,9 +470,9 @@ void OlePropertyStreamObject::dumpCodePageProperty( sal_uInt32 nStartPos ) if( nType == OLEPROP_TYPE_INT16 ) { sal_uInt16 nCodePage = dumpDec< sal_uInt16 >( "codepage", "CODEPAGES" ); - rtl_TextEncoding nNewTextEnc = rtl_getTextEncodingFromWindowsCodePage( nCodePage ); - if( nNewTextEnc != RTL_TEXTENCODING_DONTKNOW ) - meTextEnc = nNewTextEnc; + rtl_TextEncoding eNewTextEnc = rtl_getTextEncodingFromWindowsCodePage( nCodePage ); + if( eNewTextEnc != RTL_TEXTENCODING_DONTKNOW ) + meTextEnc = eNewTextEnc; mbIsUnicode = nCodePage == CODEPAGE_UNICODE; } else @@ -587,15 +587,8 @@ OUString OlePropertyStreamObject::dumpString8( const String& rName ) OUString OlePropertyStreamObject::dumpCharArray8( const String& rName, sal_Int32 nLen ) { - OUString aData; - size_t nNewLen = getLimitedValue< size_t, sal_Int32 >( nLen, 0, 1024 ); - if( nNewLen > 0 ) - { - ::std::vector< sal_Char > aBuffer( nNewLen + 1 ); - mxStrm->readMemory( &aBuffer.front(), nNewLen ); - aBuffer[ nNewLen ] = 0; - aData = OStringToOUString( OString( &aBuffer.front() ), meTextEnc ); - } + sal_Int32 nNewLen = getLimitedValue< sal_Int32, sal_Int32 >( nLen, 0, 1024 ); + OUString aData = mxStrm->readCharArrayUC( nNewLen, meTextEnc ); writeStringItem( rName, aData ); return aData; } @@ -608,13 +601,8 @@ OUString OlePropertyStreamObject::dumpString16( const String& rName ) OUString OlePropertyStreamObject::dumpCharArray16( const String& rName, sal_Int32 nLen ) { - size_t nNewLen = getLimitedValue< size_t, sal_Int32 >( nLen, 0, 1024 ); - ::std::vector< sal_Unicode > aBuffer; - aBuffer.reserve( nNewLen + 1 ); - for( size_t nIdx = 0; nIdx < nNewLen; ++nIdx ) - aBuffer.push_back( static_cast< sal_Unicode >( mxStrm->readuInt16() ) ); - aBuffer.push_back( 0 ); - OUString aData( &aBuffer.front() ); + sal_Int32 nNewLen = getLimitedValue< sal_Int32, sal_Int32 >( nLen, 0, 1024 ); + OUString aData = mxStrm->readUnicodeArray( nNewLen ); writeStringItem( rName, aData ); if( nNewLen & 1 ) dumpUnused( 2 ); // always padding to 32bit return aData; @@ -688,7 +676,7 @@ void OleStorageObject::construct( const ObjectBase& rParent ) StorageObjectBase::construct( rParent ); } -void OleStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, const OUString& /*rStrgPath*/, const OUString& rStrmName, const OUString& rSysFileName ) +void OleStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& /*rStrgPath*/, const OUString& rStrmName, const OUString& rSysFileName ) { if( rStrmName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "\001CompObj" ) ) ) OleCompObjObject( *this, rxStrm, rSysFileName ).dump(); @@ -1927,7 +1915,7 @@ void VbaFStreamObject::dumpSiteData() sal_uInt32 nSiteCount = dumpDec< sal_uInt32 >( "site-count" ); sal_uInt32 nSiteLength = dumpDec< sal_uInt32 >( "site-data-size" ); sal_Int64 nEndPos = mxStrm->tell() + nSiteLength; - if( ensureValid( nEndPos <= mxStrm->getLength() ) ) + if( ensureValid( nEndPos <= mxStrm->size() ) ) { mxOut->resetItemIndex(); sal_uInt32 nSiteIdx = 0; @@ -1985,7 +1973,7 @@ void VbaOStreamObject::implDump() writeDecItem( "control-id", aIt->mnId ); writeInfoItem( "prog-id", aIt->maProgId ); IndentGuard aIndGuard( mxOut ); - RelativeInputStreamRef xRelStrm( new RelativeInputStream( *mxStrm, aIt->mnLength ) ); + BinaryInputStreamRef xRelStrm( new RelativeInputStream( *mxStrm, aIt->mnLength ) ); FormControlStreamObject( *this, xRelStrm, &aIt->maProgId ).dump(); } } @@ -2069,7 +2057,7 @@ VbaContainerStorageObject::VbaContainerStorageObject( const ObjectBase& rParent, addPreferredStream( "f" ); } -void VbaContainerStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) +void VbaContainerStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) { if( rStrmName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "f" ) ) ) VbaFStreamObject( *this, rxStrm, rSysFileName, maFormData ).dump(); @@ -2281,7 +2269,7 @@ void VbaModuleStreamObject::implDump() writeEmptyItem( "source-code" ); IndentGuard aIndGuard( mxOut ); BinaryInputStreamRef xVbaStrm( new ::oox::ole::VbaInputStream( *mxStrm ) ); - TextStreamObject( *this, xVbaStrm, mrVbaData.meTextEnc ).dump(); + TextLineStreamObject( *this, xVbaStrm, mrVbaData.meTextEnc ).dump(); } // ============================================================================ @@ -2293,7 +2281,7 @@ VbaStorageObject::VbaStorageObject( const ObjectBase& rParent, const StorageRef& addPreferredStream( "dir" ); } -void VbaStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) +void VbaStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) { if( (rStrgPath.getLength() == 0) && rStrmName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "dir" ) ) ) VbaDirStreamObject( *this, rxStrm, rSysFileName, mrVbaData ).dump(); @@ -2311,10 +2299,10 @@ VbaFormStorageObject::VbaFormStorageObject( const ObjectBase& rParent, const Sto { } -void VbaFormStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) +void VbaFormStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) { if( rStrmName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "\003VBFrame" ) ) ) - TextStreamObject( *this, rxStrm, mrVbaData.meTextEnc, rSysFileName ).dump(); + TextLineStreamObject( *this, rxStrm, mrVbaData.meTextEnc, rSysFileName ).dump(); else VbaContainerStorageObject::implDumpStream( rxStrm, rStrgPath, rStrmName, rSysFileName ); } @@ -2327,10 +2315,10 @@ VbaProjectStorageObject::VbaProjectStorageObject( const ObjectBase& rParent, con addPreferredStorage( "VBA" ); } -void VbaProjectStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) +void VbaProjectStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) { if( (rStrgPath.getLength() == 0) && rStrmName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PROJECT" ) ) ) - TextStreamObject( *this, rxStrm, maVbaData.meTextEnc, rSysFileName ).dump(); + TextLineStreamObject( *this, rxStrm, maVbaData.meTextEnc, rSysFileName ).dump(); else OleStorageObject::implDumpStream( rxStrm, rStrgPath, rStrmName, rSysFileName ); } @@ -2364,4 +2352,4 @@ void ActiveXStorageObject::implDumpBaseStream( const BinaryInputStreamRef& rxStr #endif -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/dump/pptxdumper.cxx b/oox/source/dump/pptxdumper.cxx index 4ed747ad792b..798d805ae5e5 100644 --- a/oox/source/dump/pptxdumper.cxx +++ b/oox/source/dump/pptxdumper.cxx @@ -57,14 +57,13 @@ RootStorageObject::RootStorageObject( const DumperBase& rParent ) StorageObjectBase::construct( rParent ); } -void RootStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) +void RootStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) { OUString aExt = InputOutputHelper::getFileNameExtension( rStrmName ); - Reference< XInputStream > xInStrm = InputOutputHelper::getXInputStream( *rxStrm ); if( aExt.equalsIgnoreAsciiCaseAscii( "pptx" ) || aExt.equalsIgnoreAsciiCaseAscii( "potx" ) ) { - Dumper( getFactory(), xInStrm, rSysFileName ).dump(); + Dumper( getContext(), rxStrm, rSysFileName ).dump(); } else if( aExt.equalsIgnoreAsciiCaseAscii( "xlsb" ) || @@ -73,7 +72,7 @@ void RootStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, cons aExt.equalsIgnoreAsciiCaseAscii( "xltm" ) || aExt.equalsIgnoreAsciiCaseAscii( "xltx" ) ) { - ::oox::dump::xlsb::Dumper( getFactory(), xInStrm, rSysFileName ).dump(); + ::oox::dump::xlsb::Dumper( getContext(), rxStrm, rSysFileName ).dump(); } else if( aExt.equalsIgnoreAsciiCaseAscii( "xla" ) || @@ -83,7 +82,7 @@ void RootStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, cons aExt.equalsIgnoreAsciiCaseAscii( "xlt" ) || aExt.equalsIgnoreAsciiCaseAscii( "xlw" ) ) { - ::oox::dump::biff::Dumper( getFactory(), xInStrm, rSysFileName ).dump(); + ::oox::dump::biff::Dumper( getContext(), rxStrm, rSysFileName ).dump(); } else if( aExt.equalsIgnoreAsciiCaseAscii( "xml" ) || @@ -96,17 +95,17 @@ void RootStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, cons { if( rStrgPath.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ppt" ) ) && rStrmName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "vbaProject.bin" ) ) ) { - StorageRef xStrg( new ::oox::ole::OleStorage( getFactory(), xInStrm, false ) ); + StorageRef xStrg( new ::oox::ole::OleStorage( getContext(), rxStrm, false ) ); VbaProjectStorageObject( *this, xStrg, rSysFileName ).dump(); } else if( rStrgPath.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ppt/embeddings" ) ) ) { - StorageRef xStrg( new ::oox::ole::OleStorage( getFactory(), xInStrm, false ) ); + StorageRef xStrg( new ::oox::ole::OleStorage( getContext(), rxStrm, false ) ); OleStorageObject( *this, xStrg, rSysFileName ).dump(); } else if( rStrgPath.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ppt/activeX" ) ) ) { - StorageRef xStrg( new ::oox::ole::OleStorage( getFactory(), xInStrm, true ) ); + StorageRef xStrg( new ::oox::ole::OleStorage( getContext(), rxStrm, true ) ); ActiveXStorageObject( *this, xStrg, rSysFileName ).dump(); } else @@ -126,13 +125,13 @@ Dumper::Dumper( const FilterBase& rFilter ) DumperBase::construct( xCfg ); } -Dumper::Dumper( const Reference< XMultiServiceFactory >& rxFactory, const Reference< XInputStream >& rxInStrm, const OUString& rSysFileName ) +Dumper::Dumper( const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& rxInStrm, const OUString& rSysFileName ) { - if( rxFactory.is() && rxInStrm.is() ) + if( rxContext.is() && rxInStrm.is() ) { - StorageRef xStrg( new ZipStorage( rxFactory, rxInStrm ) ); + StorageRef xStrg( new ZipStorage( rxContext, rxInStrm ) ); MediaDescriptor aMediaDesc; - ConfigRef xCfg( new Config( DUMP_PPTX_CONFIG_ENVVAR, rxFactory, xStrg, rSysFileName, aMediaDesc ) ); + ConfigRef xCfg( new Config( DUMP_PPTX_CONFIG_ENVVAR, rxContext, xStrg, rSysFileName, aMediaDesc ) ); DumperBase::construct( xCfg ); } } @@ -150,4 +149,4 @@ void Dumper::implDump() #endif -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/dump/xlsbdumper.cxx b/oox/source/dump/xlsbdumper.cxx index b511fd43562c..9a13d973fb3b 100644 --- a/oox/source/dump/xlsbdumper.cxx +++ b/oox/source/dump/xlsbdumper.cxx @@ -369,7 +369,7 @@ void FormulaObject::implDump() if( mnSize < 0 ) return; sal_Int64 nStartPos = mxStrm->tell(); - sal_Int64 nEndPos = ::std::min< sal_Int64 >( nStartPos + mnSize, mxStrm->getLength() ); + sal_Int64 nEndPos = ::std::min< sal_Int64 >( nStartPos + mnSize, mxStrm->size() ); bool bValid = mxTokens.get(); mxStack.reset( new FormulaStack ); @@ -890,8 +890,8 @@ bool FormulaObject::dumpAttrToken() void FormulaObject::dumpAddTokenData() { mxOut->resetItemIndex(); - sal_Int32 nAddDataSize = (mxStrm->getLength() - mxStrm->tell() >= 4) ? dumpDec< sal_Int32 >( "add-data-size" ) : 0; - sal_Int64 nEndPos = ::std::min< sal_Int64 >( mxStrm->tell() + nAddDataSize, mxStrm->getLength() ); + sal_Int32 nAddDataSize = (mxStrm->size() - mxStrm->tell() >= 4) ? dumpDec< sal_Int32 >( "add-data-size" ) : 0; + sal_Int64 nEndPos = ::std::min< sal_Int64 >( mxStrm->tell() + nAddDataSize, mxStrm->size() ); for( AddDataTypeVec::const_iterator aIt = maAddData.begin(), aEnd = maAddData.end(); (aIt != aEnd) && !mxStrm->isEof() && (mxStrm->tell() < nEndPos); ++aIt ) { AddDataType eType = *aIt; @@ -2232,10 +2232,9 @@ RootStorageObject::RootStorageObject( const DumperBase& rParent ) StorageObjectBase::construct( rParent ); } -void RootStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) +void RootStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) { OUString aExt = InputOutputHelper::getFileNameExtension( rStrmName ); - Reference< XInputStream > xInStrm = InputOutputHelper::getXInputStream( *rxStrm ); if( aExt.equalsIgnoreAsciiCaseAscii( "xlsb" ) || aExt.equalsIgnoreAsciiCaseAscii( "xlsm" ) || @@ -2243,7 +2242,7 @@ void RootStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, cons aExt.equalsIgnoreAsciiCaseAscii( "xltm" ) || aExt.equalsIgnoreAsciiCaseAscii( "xltx" ) ) { - Dumper( getFactory(), xInStrm, rSysFileName ).dump(); + Dumper( getContext(), rxStrm, rSysFileName ).dump(); } else if( aExt.equalsIgnoreAsciiCaseAscii( "xla" ) || @@ -2253,13 +2252,13 @@ void RootStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, cons aExt.equalsIgnoreAsciiCaseAscii( "xlt" ) || aExt.equalsIgnoreAsciiCaseAscii( "xlw" ) ) { - ::oox::dump::biff::Dumper( getFactory(), xInStrm, rSysFileName ).dump(); + ::oox::dump::biff::Dumper( getContext(), rxStrm, rSysFileName ).dump(); } else if( aExt.equalsIgnoreAsciiCaseAscii( "pptx" ) || aExt.equalsIgnoreAsciiCaseAscii( "potx" ) ) { - ::oox::dump::pptx::Dumper( getFactory(), xInStrm, rSysFileName ).dump(); + ::oox::dump::pptx::Dumper( getContext(), rxStrm, rSysFileName ).dump(); } else if( aExt.equalsIgnoreAsciiCaseAscii( "xml" ) || @@ -2272,12 +2271,12 @@ void RootStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, cons { if( rStrgPath.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "xl" ) ) && rStrmName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "vbaProject.bin" ) ) ) { - StorageRef xStrg( new ::oox::ole::OleStorage( getFactory(), xInStrm, false ) ); + StorageRef xStrg( new ::oox::ole::OleStorage( getContext(), rxStrm, false ) ); VbaProjectStorageObject( *this, xStrg, rSysFileName ).dump(); } else if( rStrgPath.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "xl/embeddings" ) ) ) { - StorageRef xStrg( new ::oox::ole::OleStorage( getFactory(), xInStrm, false ) ); + StorageRef xStrg( new ::oox::ole::OleStorage( getContext(), rxStrm, false ) ); OleStorageObject( *this, xStrg, rSysFileName ).dump(); } else if( @@ -2296,7 +2295,7 @@ void RootStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, cons } else if( rStrgPath.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "xl/activeX" ) ) ) { - StorageRef xStrg( new ::oox::ole::OleStorage( getFactory(), xInStrm, true ) ); + StorageRef xStrg( new ::oox::ole::OleStorage( getContext(), rxStrm, true ) ); ActiveXStorageObject( *this, xStrg, rSysFileName ).dump(); } else @@ -2316,13 +2315,13 @@ Dumper::Dumper( const FilterBase& rFilter ) DumperBase::construct( xCfg ); } -Dumper::Dumper( const Reference< XMultiServiceFactory >& rxFactory, const Reference< XInputStream >& rxInStrm, const OUString& rSysFileName ) +Dumper::Dumper( const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& rxInStrm, const OUString& rSysFileName ) { - if( rxFactory.is() && rxInStrm.is() ) + if( rxContext.is() && rxInStrm.is() ) { - StorageRef xStrg( new ZipStorage( rxFactory, rxInStrm ) ); + StorageRef xStrg( new ZipStorage( getContext(), rxInStrm ) ); MediaDescriptor aMediaDesc; - ConfigRef xCfg( new Config( DUMP_XLSB_CONFIG_ENVVAR, rxFactory, xStrg, rSysFileName, aMediaDesc ) ); + ConfigRef xCfg( new Config( DUMP_XLSB_CONFIG_ENVVAR, rxContext, xStrg, rSysFileName, aMediaDesc ) ); DumperBase::construct( xCfg ); } } @@ -2340,4 +2339,4 @@ void Dumper::implDump() #endif -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/dump/xlsbdumper.ini b/oox/source/dump/xlsbdumper.ini index 3490111c4ba5..16b97172d5c8 100644 --- a/oox/source/dump/xlsbdumper.ini +++ b/oox/source/dump/xlsbdumper.ini @@ -278,6 +278,7 @@ end # ARRAY ---------------------------------------------------------------------- flagslist=ARRAY-FLAGS + ignore=0xFE 0x01=recalc-always end |