diff options
author | Daniel Rentz <dr@openoffice.org> | 2009-08-11 11:31:30 +0000 |
---|---|---|
committer | Daniel Rentz <dr@openoffice.org> | 2009-08-11 11:31:30 +0000 |
commit | 2be6a1367647d57da39bac601b5bca7d4d85312a (patch) | |
tree | 15dff907557d020396cc35aceb7dca402aab762b /oox/source | |
parent | 46bbd9fafc5ae37d606389454723189d4c9804fd (diff) |
DFF dumper: extended OPT property set support
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/dump/biffdumper.ini | 2 | ||||
-rw-r--r-- | oox/source/dump/dffdumper.cxx | 172 | ||||
-rw-r--r-- | oox/source/dump/dffdumper.ini | 612 | ||||
-rw-r--r-- | oox/source/dump/dumperbase.cxx | 180 | ||||
-rw-r--r-- | oox/source/dump/dumperbase.ini | 41 | ||||
-rw-r--r-- | oox/source/dump/oledumper.cxx | 10 | ||||
-rw-r--r-- | oox/source/dump/oledumper.ini | 34 |
7 files changed, 653 insertions, 398 deletions
diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini index a6273cad1b22..2b4782c7197b 100644 --- a/oox/source/dump/biffdumper.ini +++ b/oox/source/dump/biffdumper.ini @@ -891,7 +891,7 @@ shortlist=CHTEXT-HORALIGN,1,left,center,right,block,distribute shortlist=CHTEXT-VERALIGN,1,top,center,bottom,block,distribute shortlist=CHTEXT-FILLMODE,1,transparent,opaque -combilist=CHTEXT-FLAGS-BIFF2 +flagslist=CHTEXT-FLAGS-BIFF2 0x0001=auto-color 0x0002=show-symbol 0x0004=show-value diff --git a/oox/source/dump/dffdumper.cxx b/oox/source/dump/dffdumper.cxx index 9380b008ea6c..4cdf12985dbe 100644 --- a/oox/source/dump/dffdumper.cxx +++ b/oox/source/dump/dffdumper.cxx @@ -54,6 +54,11 @@ const sal_uInt16 DFF_ID_SP = 0xF00A; /// Shape. const sal_uInt16 DFF_ID_SPGR = 0xF009; /// Shape group. const sal_uInt16 DFF_ID_SPLITMENUCOLORS = 0xF11E; /// Current toolbar colors. +const sal_uInt16 DFF_OPT_IDMASK = 0x3FFF; +const sal_uInt16 DFF_OPT_PICTURE = 0x4000; +const sal_uInt16 DFF_OPT_COMPLEX = 0x8000; +const sal_uInt16 DFF_OPT_FLAGSMASK = 0x003F; + } // namespace // ============================================================================ @@ -150,16 +155,7 @@ void DffStreamObject::implDumpRecordBody() case DFF_ID_OPT: case DFF_ID_OPT2: case DFF_ID_OPT3: - { - sal_uInt16 nPropCount = getInst(); - out().resetItemIndex(); - for( sal_uInt16 nPropIdx = 0; !in().isEof() && (nPropIdx < nPropCount); ++nPropIdx ) - { - sal_uInt16 nPropId = dumpDffOptPropHeader(); - IndentGuard aIndent( out() ); - dumpDffOptPropValue( nPropId, in().readuInt32() ); - } - } + dumpDffOpt(); break; case DFF_ID_SP: @@ -175,10 +171,10 @@ void DffStreamObject::implDumpRecordBody() break; case DFF_ID_SPLITMENUCOLORS: - dumpDffColor( "fill-color" ); - dumpDffColor( "line-color" ); - dumpDffColor( "shadow-color" ); - dumpDffColor( "3d-color" ); + dumpDffSimpleColor( "fill-color" ); + dumpDffSimpleColor( "line-color" ); + dumpDffSimpleColor( "shadow-color" ); + dumpDffSimpleColor( "3d-color" ); break; } } @@ -191,6 +187,16 @@ void DffStreamObject::constructDffObj() { mnInstVer = 0; mnRealSize = 0; + if( SequenceRecordObjectBase::implIsValid() ) + { + maSimpleProps.insertFormats( cfg().getNameList( "DFFOPT-SIMPLE-PROPERTIES" ) ); + maComplexProps.insertFormats( cfg().getNameList( "DFFOPT-COMPLEX-PROPERTIES" ) ); + } +} + +sal_uInt32 DffStreamObject::dumpDffSimpleColor( const String& rName ) +{ + return dumpHex< sal_uInt32 >( rName, "DFF-SIMPLE-COLOR" ); } sal_uInt32 DffStreamObject::dumpDffColor( const String& rName ) @@ -198,6 +204,111 @@ sal_uInt32 DffStreamObject::dumpDffColor( const String& rName ) return dumpHex< sal_uInt32 >( rName, "DFF-COLOR" ); } +namespace { + +enum PropType { PROPTYPE_BINARY, PROPTYPE_STRING, PROPTYPE_BLIP, PROPTYPE_COLORARRAY }; + +struct PropInfo +{ + OUString maName; + PropType meType; + sal_uInt16 mnId; + sal_uInt32 mnSize; + inline explicit PropInfo( const OUString& rName, PropType eType, sal_uInt16 nId, sal_uInt32 nSize ) : + maName( rName ), meType( eType ), mnId( nId ), mnSize( nSize ) {} +}; + +typedef ::std::vector< PropInfo > PropInfoVector; + +} // namespace + +void DffStreamObject::dumpDffOpt() +{ + sal_uInt16 nPropCount = getInst(); + PropInfoVector aPropInfos; + out().resetItemIndex(); + for( sal_uInt16 nPropIdx = 0; !in().isEof() && (nPropIdx < nPropCount); ++nPropIdx ) + { + sal_uInt16 nPropId = dumpDffOptPropHeader(); + sal_uInt16 nBaseId = nPropId & DFF_OPT_IDMASK; + sal_uInt32 nValue = in().readuInt32(); + + IndentGuard aIndent( out() ); + if( getFlag( nPropId, DFF_OPT_COMPLEX ) ) + { + writeHexItem( "complex-size", nValue, "CONV-DEC" ); + String aName; + PropType eType = PROPTYPE_BINARY; + ItemFormatMap::const_iterator aIt = maComplexProps.find( nBaseId ); + if( aIt != maComplexProps.end() ) + { + const ItemFormat& rItemFmt = aIt->second; + aName = rItemFmt.maItemName; + if( rItemFmt.maListName.equalsAscii( "binary" ) ) + eType = PROPTYPE_BINARY; + else if( rItemFmt.maListName.equalsAscii( "string" ) ) + eType = PROPTYPE_STRING; + else if( rItemFmt.maListName.equalsAscii( "blip" ) ) + eType = PROPTYPE_BLIP; + else if( rItemFmt.maListName.equalsAscii( "colorarray" ) ) + eType = PROPTYPE_COLORARRAY; + } + aPropInfos.push_back( PropInfo( aName( "property-data" ), eType, nBaseId, nValue ) ); + } + else + { + ItemFormatMap::const_iterator aIt = maSimpleProps.find( nBaseId ); + if( aIt != maSimpleProps.end() ) + { + const ItemFormat& rItemFmt = aIt->second; + // flags always at end of block of 64 properties + if( (nBaseId & DFF_OPT_FLAGSMASK) == DFF_OPT_FLAGSMASK ) + { + FlagsList* pFlagsList = dynamic_cast< FlagsList* >( cfg().getNameList( rItemFmt.maListName ).get() ); + sal_Int64 nOldIgnoreFlags = 0; + if( pFlagsList ) + { + nOldIgnoreFlags = pFlagsList->getIgnoreFlags(); + pFlagsList->setIgnoreFlags( nOldIgnoreFlags | 0xFFFF0000 | ~(nValue >> 16) ); + } + writeValueItem( rItemFmt, nValue ); + if( pFlagsList ) + pFlagsList->setIgnoreFlags( nOldIgnoreFlags ); + } + else + writeValueItem( rItemFmt, nValue ); + } + else + writeHexItem( "value", nValue ); + } + } + + out().resetItemIndex(); + for( PropInfoVector::iterator aIt = aPropInfos.begin(), aEnd = aPropInfos.end(); !in().isEof() && (aIt != aEnd); ++aIt ) + { + out().startMultiItems(); + writeEmptyItem( "#complex-data" ); + writeHexItem( "id", aIt->mnId, "DFFOPT-PROPERTY-NAMES" ); + out().endMultiItems(); + IndentGuard aIndent( out() ); + switch( aIt->meType ) + { + case PROPTYPE_BINARY: + dumpBinary( aIt->maName, aIt->mnSize ); + break; + case PROPTYPE_STRING: + dumpUnicodeArray( aIt->maName, aIt->mnSize / 2, true ); + break; + case PROPTYPE_BLIP: + dumpBinary( aIt->maName, aIt->mnSize ); + break; + case PROPTYPE_COLORARRAY: + dumpBinary( aIt->maName, aIt->mnSize ); + break; + } + } +} + sal_uInt16 DffStreamObject::dumpDffOptPropHeader() { MultiItemsGuard aMultiGuard( out() ); @@ -206,39 +317,6 @@ sal_uInt16 DffStreamObject::dumpDffOptPropHeader() return dumpHex< sal_uInt16 >( "id", "DFFOPT-PROPERTY-ID" ); } -void DffStreamObject::dumpDffOptPropValue( sal_uInt16 nPropId, sal_uInt32 nValue ) -{ - switch( nPropId & 0x3FFF ) - { - case 0x003F: writeHexItem( "flags", nValue, "DFFOPT-TRANSFORM-FLAGS" ); break; - case 0x007F: writeHexItem( "flags", nValue, "DFFOPT-PROTECTION-FLAGS" ); break; - case 0x00BF: writeHexItem( "flags", nValue, "DFFOPT-TEXT-FLAGS" ); break; - case 0x00FF: writeHexItem( "flags", nValue, "DFFOPT-TEXTGEO-FLAGS" ); break; - case 0x013F: writeHexItem( "flags", nValue, "DFFOPT-BLIP-FLAGS" ); break; - case 0x017F: writeHexItem( "flags", nValue, "DFFOPT-GEO-FLAGS" ); break; - case 0x01BF: writeHexItem( "flags", nValue, "DFFOPT-FILL-FLAGS" ); break; - case 0x01FF: writeHexItem( "flags", nValue, "DFFOPT-LINE-FLAGS" ); break; - case 0x023F: writeHexItem( "flags", nValue, "DFFOPT-SHADOW-FLAGS" ); break; - case 0x027F: writeHexItem( "flags", nValue, "DFFOPT-PERSP-FLAGS" ); break; - case 0x02BF: writeHexItem( "flags", nValue, "DFFOPT-3DOBJ-FLAGS" ); break; - case 0x02FF: writeHexItem( "flags", nValue, "DFFOPT-3DSTYLE-FLAGS" ); break; - case 0x033F: writeHexItem( "flags", nValue, "DFFOPT-SHAPE-FLAGS" ); break; - case 0x037F: writeHexItem( "flags", nValue, "DFFOPT-CALLOUT-FLAGS" ); break; - case 0x03BF: writeHexItem( "flags", nValue, "DFFOPT-GROUP-FLAGS" ); break; - case 0x03FF: writeHexItem( "flags", nValue, "DFFOPT-TRANSFORM-FLAGS" ); break; - case 0x043F: writeHexItem( "flags", nValue, "DFFOPT-UHTML-FLAGS" ); break; - case 0x053F: writeHexItem( "flags", nValue, "DFFOPT-DIAGRAM-FLAGS" ); break; - case 0x057F: writeHexItem( "flags", nValue, "DFFOPT-LINE-FLAGS" ); break; - case 0x05BF: writeHexItem( "flags", nValue, "DFFOPT-LINE-FLAGS" ); break; - case 0x05FF: writeHexItem( "flags", nValue, "DFFOPT-LINE-FLAGS" ); break; - case 0x063F: writeHexItem( "flags", nValue, "DFFOPT-LINE-FLAGS" ); break; - case 0x06BF: writeHexItem( "flags", nValue, "DFFOPT-WEBCOMP-FLAGS" ); break; - case 0x073F: writeHexItem( "flags", nValue, "DFFOPT-INK-FLAGS" ); break; - case 0x07BF: writeHexItem( "flags", nValue, "DFFOPT-SIGLINE-FLAGS" ); break; - default: writeHexItem( "value", nValue ); - } -} - // ============================================================================ } // namespace dump diff --git a/oox/source/dump/dffdumper.ini b/oox/source/dump/dffdumper.ini index d992efb4c0bd..c33d733c6bd8 100644 --- a/oox/source/dump/dffdumper.ini +++ b/oox/source/dump/dffdumper.ini @@ -25,14 +25,60 @@ constlist=DFF-RECORD-VERSION 15=container end -combilist=DFF-COLOR - 0x000000FF=uint8,dec,red - 0x0000FF00=uint8,dec,green - 0x00FF0000=uint8,dec,blue - 0x08000000=!rgb!scheme - ignore=0x10000000 +combilist=DFF-SIMPLE-COLOR + 0x000000FF=uint8,dec,red,,filter=0x10000000~0x00000000 + 0x0000FF00=uint8,dec,green,,filter=0x10000000~0x00000000 + 0x00FF0000=uint8,dec,blue,,filter=0x10000000~0x00000000 + 0x000000FF=uint8,dec,scheme-idx,,filter=0x10000000~0x10000000 + 0x10000000=!rgb!scheme + ignore=0x08000000 end +combilist=DFF-COLOR + 0x0000FFFF=uint16,dec,palette-idx,,filter=0xFF000000~0x01000000 + 0x000000FF=uint8,dec,red,,filter=0xF9000000~0x00000000 + 0x0000FF00=uint8,dec,green,,filter=0xF9000000~0x00000000 + 0x00FF0000=uint8,dec,blue,,filter=0xF9000000~0x00000000 + 0x000000FF=uint8,dec,scheme-idx,,filter=0xFF000000~0x08000000 + 0x0000FFFF=uint16,dec,system-idx,DFF-SYSTEMCOLOR,filter=0xFF000000~0x10000000 + 0x00FF0000=uint16,dec,mod-by,,filter=0xFF000000~0x10000000 + 0x01000000=palette-idx + 0x02000000=palette-rgb + 0x04000000=system-rgb + 0x08000000=scheme-idx + 0x10000000=system-idx +end + +combilist=DFF-SYSTEMCOLOR + 0x00FF=uint8,dec,color-id,DFF-SYSTEMCOLOR-ID + 0x0F00=uint8,dec,mod,DFF-SYSTEMCOLOR-MOD + 0x2000=invert-after + 0x4000=half-invert-after + 0x8000=grey-before +end + +constlist=DFF-SYSTEMCOLOR-ID + include=SYSTEMCOLOR + 0xF0=shape-fill + 0xF1=shape-line-or-fill + 0xF2=shape-line + 0xF3=shape-shadow + 0xF4=current-or-last-used + 0xF5=shape-fill-back + 0xF6=shape-line-back + 0xF7=shape-fill-or-line +end + +shortlist=DFF-SYSTEMCOLOR-MOD,0,none,darken-by,lighten-by,add-grey-by,sub-grey-by,reverse-sub-grey-by,monochrome-by + +combilist=DFF-COLORMOD + 0x00000300=uint8,dec,type,DFF-COLORMOD-TYPE + 0x00FF0000=uint8,dec,level + ignore=0x200000FF +end + +shortlist=DFF-COLORMOD-TYPE,0,none,shade,tint + # DFFBSE --------------------------------------------------------------------- combilist=DFFBSE-RECORD-INST @@ -75,7 +121,7 @@ combilist=DFFOPT-PROPERTY-ID end multilist=DFFOPT-PROPERTY-NAMES - # 0x0000-0x003F: transform + # 0x0000-0x003F: transformation 0x0000=transf-left,transf-top,transf-right,transf-bottom,transf-rotation,transf-page 0x003F=transf-flags # 0x0040-0x007F: protection @@ -88,12 +134,12 @@ multilist=DFFOPT-PROPERTY-NAMES 0x00C0=textgeo-unicode-string,textgeo-rtf-string,textgeo-curve-align,textgeo-def-size,textgeo-spacing,textgeo-font,textgeo-css-font 0x00FF=textgeo-flags # 0x0100-0x013F: picture (BLIP) - 0x0100=blip-crop-top,blip-crop-bottom,blip-crop-left,blip-crop-right,blip-id,blip-name,blip-flags,blip-transparency-color + 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-flags,blip-movie,,,blip-transparency-color-ext,,blip-transparency-color-ext-mod + 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 0x013F=blip-flags - # 0x0140-0x017F: geometry + # 0x0140-0x017F: shape geometry 0x0140=geo-left,geo-top,geo-right,geo-bottom,geo-shape-path,geo-vertices,geo-segment-info,geo-adjust-1 0x0148=geo-adjust-2,geo-adjust-3,geo-adjust-4,geo-adjust-5,geo-adjust-6,geo-adjust-7,geo-adjust-8, 0x0150=,geo-connect-sites,geo-connect-sites-dir,geo-stretch-x,geo-stretch-y,geo-handles,geo-guides,geo-inscribe @@ -101,13 +147,13 @@ multilist=DFFOPT-PROPERTY-NAMES 0x017F=geo-flags # 0x0180-0x01BF: fill style 0x0180=fill-type,fill-color,fill-opacity,fill-back-color,fill-back-opacity,fill-cr-mod,fill-blip,fill-blip-name - 0x0188=fill-blip-flags,fill-width,fill-height,fill-angle,fill-focus,fill-to-left,fill-to-top,fill-to-right + 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 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-flags + 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 @@ -147,7 +193,7 @@ multilist=DFFOPT-PROPERTY-NAMES 0x03A0=group-table-row-props,,,,,group-web-bot,, 0x03A8=,group-metro-blob,group-rel-z-order, 0x03BF=group-flags - # 0x03C0-0x03FF: relative transform + # 0x03C0-0x03FF: relative transformation 0x03C0=reltransf-left,reltransf-top,reltransf-right,reltransf-bottom,reltransf-rotation,reltransf-page 0x03FF=reltransf-flags # 0x0400-0x043F: unknown HTML @@ -159,25 +205,25 @@ multilist=DFFOPT-PROPERTY-NAMES 0x0508=dia-constrain-bounds,dia-base-text-scale 0x053F=dia-flags # 0x0540-0x057F: left line style - 0x0540=lline-color,lline-opacity,lline-back-color,lline-cr-mod,lline-type,lline-fill-blip,lline-fill-blip-name,lline-fill-blip-flags + 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 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-flags + 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 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-flags + 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 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-flags + 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 @@ -196,302 +242,358 @@ multilist=DFFOPT-PROPERTY-NAMES 0x07C0=group2-rel-width,group2-rel-height,group2-rel-pos-x,group2-rel-pos-y,group2-size-rel-h,group2-size-rel-v end +constlist=DFFOPT-SIMPLE-PROPERTIES + # transformation + 0x003F=uint32,hex,flags,DFFOPT-TRANSFORM-FLAGS + # protection + 0x007F=uint32,hex,flags,DFFOPT-PROTECTION-FLAGS + # text + 0x00BF=uint32,hex,flags,DFFOPT-TEXT-FLAGS + # text geometry + 0x00FF=uint32,hex,flags,DFFOPT-TEXTGEO-FLAGS + # picture (BLIP) + 0x013F=uint32,hex,flags,DFFOPT-BLIP-FLAGS + # shape geometry + 0x017F=uint32,hex,flags,DFFOPT-GEO-FLAGS + # fill style + 0x0180=uint32,dec,type,DFFOPT-FILL-TYPE + 0x0181=uint32,hex,color,DFF-COLOR + 0x0182=int32,fix,opacity,CONV-FLOAT-TO-PERC + 0x0183=uint32,hex,color,DFF-COLOR + 0x0184=int32,fix,opacity,DFF-OPACITY + 0x0185=uint32,hex,color,DFF-COLOR + 0x0186=uint32,dec,blip-id + 0x0188=uint32,dec,blip-opt,DFFOPT-BLIPOPT + 0x0189=int32,dec,width + 0x018A=int32,dec,height + 0x018B=int32,fix,angle,CONV-DEG + 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 + 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 + 0x019C=uint32,hex,type,DFFOPT-FILL-SHADETYPE + 0x019E=uint32,hex,color,DFF-COLOR + 0x01A0=uint32,hex,color-mod,DFF-COLORMOD + 0x01A2=uint32,hex,color,DFF-COLOR + 0x01A4=uint32,hex,color-mod,DFF-COLORMOD + 0x01BF=uint32,hex,flags,DFFOPT-FILL-FLAGS + # line style + 0x01C0=uint32,hex,color,DFF-COLOR + 0x01C2=uint32,hex,color,DFF-COLOR + 0x01FF=uint32,hex,flags,DFFOPT-LINE-FLAGS + # shadow style + 0x0201=uint32,hex,color,DFF-COLOR + 0x023F=uint32,hex,flags,DFFOPT-SHADOW-FLAGS + # perspective + 0x027F=uint32,hex,flags,DFFOPT-PERSP-FLAGS + # 3d object + 0x02BF=uint32,hex,flags,DFFOPT-3DOBJ-FLAGS + # 3d style + 0x02FF=uint32,hex,flags,DFFOPT-3DSTYLE-FLAGS + # shape + 0x033F=uint32,hex,flags,DFFOPT-SHAPE-FLAGS + # callout + 0x037F=uint32,hex,flags,DFFOPT-CALLOUT-FLAGS + # group or shape + 0x03BF=uint32,hex,flags,DFFOPT-GROUP-FLAGS + # relative transformation + 0x03FF=uint32,hex,flags,DFFOPT-TRANSFORM-FLAGS + # unknown HTML + 0x043F=uint32,hex,flags,DFFOPT-UHTML-FLAGS + # diagram + 0x053F=uint32,hex,flags,DFFOPT-DIAGRAM-FLAGS + # left line style + 0x0540=uint32,hex,color,DFF-COLOR + 0x0542=uint32,hex,color,DFF-COLOR + 0x057F=uint32,hex,flags,DFFOPT-LINE-FLAGS + # top line style + 0x0580=uint32,hex,color,DFF-COLOR + 0x0582=uint32,hex,color,DFF-COLOR + 0x05BF=uint32,hex,flags,DFFOPT-LINE-FLAGS + # right line style + 0x05C0=uint32,hex,color,DFF-COLOR + 0x05C2=uint32,hex,color,DFF-COLOR + 0x05FF=uint32,hex,flags,DFFOPT-LINE-FLAGS + # bottom line style + 0x0600=uint32,hex,color,DFF-COLOR + 0x0602=uint32,hex,color,DFF-COLOR + 0x063F=uint32,hex,flags,DFFOPT-LINE-FLAGS + # web component + 0x06BF=uint32,hex,flags,DFFOPT-WEBCOMP-FLAGS + # ink data + 0x073F=uint32,hex,flags,DFFOPT-INK-FLAGS + # signature line + 0x07BF=uint32,hex,flags,DFFOPT-SIGLINE-FLAGS + # group or shape #2 +end + +constlist=DFFOPT-COMPLEX-PROPERTIES + 0x0186=uint32,hex,blip,blip + 0x0187=uint32,hex,blip-name,string + 0x0197=uint32,hex,shade-colors,colorarray + 0x0380=uint32,hex,shape-name,string +end + +# common + +combilist=DFFOPT-BLIPOPT + 0x00000003=uint8,dec,type,DFFOPT-BLIPOPT-TYPE + 0x00000004=do-not-save + 0x00000008=linked +end + +shortlist=DFFOPT-BLIPOPT-TYPE,0,comment,file,url + +# transformation + flagslist=DFFOPT-TRANSFORM-FLAGS - 0x00000001=flip-h - 0x00000002=flip-v - 0x00010000=use-flip-h - 0x00020000=use-flip-v + 0x0001=:flip-h + 0x0002=:flip-v end +# protection + flagslist=DFFOPT-PROTECTION-FLAGS - 0x00000001=lock-against-grouping - 0x00000002=lock-adjust-handles - 0x00000004=lock-text - 0x00000008=lock-vertices - 0x00000010=lock-cropping - 0x00000020=lock-against-select - 0x00000040=lock-position - 0x00000080=lock-aspect-ratio - 0x00000100=lock-rotation - 0x00000200=lock-against-ungrouping - 0x00010000=use-lock-against-grouping - 0x00020000=use-lock-adjust-handles - 0x00040000=use-lock-text - 0x00080000=use-lock-vertices - 0x00100000=use-lock-cropping - 0x00200000=use-lock-against-select - 0x00400000=use-lock-position - 0x00800000=use-lock-aspect-ratio - 0x01000000=use-lock-rotation - 0x02000000=use-lock-against-ungrouping + 0x0001=:lock-against-grouping + 0x0002=:lock-adjust-handles + 0x0004=:lock-text + 0x0008=:lock-vertices + 0x0010=:lock-cropping + 0x0020=:lock-against-select + 0x0040=:lock-position + 0x0080=:lock-aspect-ratio + 0x0100=:lock-rotation + 0x0200=:lock-against-ungrouping end +# text + flagslist=DFFOPT-TEXT-FLAGS - 0x00000002=fit-shape-to-text - 0x00000008=auto-text-margin - 0x00000010=select-text - 0x00020000=use-fit-shape-to-text - 0x00080000=use-auto-text-margin - 0x00100000=use-select-text + 0x0002=:fit-shape-to-text + 0x0008=:auto-text-margin + 0x0010=:select-text + ignore=0x0005 end +# text geometry + flagslist=DFFOPT-TEXTGEO-FLAGS - 0x00000001=strike-through - 0x00000002=small-caps - 0x00000004=shadow - 0x00000008=underline - 0x00000010=italic - 0x00000020=bold - 0x00000040=no-measure-along-path - 0x00000080=normalize - 0x00000100=best-fit - 0x00000200=shrink-to-fit - 0x00000400=stretch-to-fit - 0x00000800=tightening - 0x00001000=kerning - 0x00002000=vertical - 0x00004000=has-effect - 0x00008000=reverse-rows - 0x00010000=use-strike-through - 0x00020000=use-small-caps - 0x00040000=use-shadow - 0x00080000=use-underline - 0x00100000=use-italic - 0x00200000=use-bold - 0x00400000=use-no-measure-along-path - 0x00800000=use-normalize - 0x01000000=use-best-fit - 0x02000000=use-shrink-to-fit - 0x04000000=use-stretch-to-fit - 0x08000000=use-tightening - 0x10000000=use-kerning - 0x20000000=use-vertical - 0x40000000=use-has-effect - 0x80000000=use-reverse-rows -end + 0x0001=:strike-through + 0x0002=:small-caps + 0x0004=:shadow + 0x0008=:underline + 0x0010=:italic + 0x0020=:bold + 0x0040=:no-measure-along-path + 0x0080=:normalize + 0x0100=:best-fit + 0x0200=:shrink-to-fit + 0x0400=:stretch-to-fit + 0x0800=:tightening + 0x1000=:kerning + 0x2000=:vertical + 0x4000=:has-effect + 0x8000=:reverse-rows +end + +# picture (BLIP) flagslist=DFFOPT-BLIP-FLAGS - 0x00000001=ole-alive - 0x00000002=bi-level-display - 0x00000004=grayscale - 0x00000008=no-hit-test - 0x00000010=loop-anim - 0x00000020=rewind-anim - 0x00000040=preserve-gray - 0x00010000=use-ole-alive - 0x00020000=use-bi-level-display - 0x00040000=use-grayscale - 0x00080000=use-no-hit-test - 0x00100000=use-loop-anim - 0x00200000=use-rewind-anim - 0x00400000=use-preserve-gray + 0x0001=:ole-alive + 0x0002=:bi-level-display + 0x0004=:grayscale + 0x0008=:no-hit-test + 0x0010=:loop-anim + 0x0020=:rewind-anim + 0x0040=:preserve-gray end +# shape geometry + flagslist=DFFOPT-GEO-FLAGS - 0x00000001=fill-support - 0x00000002=fill-shade-shape-support - 0x00000004=fontwork-support - 0x00000008=line-support - 0x00000010=3d-support - 0x00000020=shadow-support - 0x00010000=use-fill-support - 0x00020000=use-fill-shade-shape-support - 0x00040000=use-fontwork-support - 0x00080000=use-line-support - 0x00100000=use-3d-support - 0x00200000=use-shadow-support + 0x0001=:fill-support + 0x0002=:fill-shade-shape-support + 0x0004=:fontwork-support + 0x0008=:line-support + 0x0010=:3d-support + 0x0020=:shadow-support +end + +# fill style + +shortlist=DFFOPT-FILL-TYPE,0,solid,pattern,texture,picture,edge-shade,linear-shade,shape-shade,point-shade,title-shade,background + +combilist=DFFOPT-FILL-DZTYPE + 0x00000003=uint8,dec,unit,DFFOPT-FILL-DZTYPE-UNIT + 0x0000000C=uint8,dec,aspect,DFFOPT-FILL-DZTYPE-ASPECT +end + +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 + 0x00000001=none + 0x00000002=gamma + 0x00000004=sigma-transfer + 0x00000008=flat-band + 0x00000010=one-color end flagslist=DFFOPT-FILL-FLAGS - 0x00000001=no-fill-hit-test - 0x00000002=fill-to-rect - 0x00000004=fill-rel-to-shape - 0x00000008=hit-test-fill - 0x00000010=has-fill - 0x00000020=shape-anchor - 0x00000040=recolor-as-pic - 0x00010000=use-no-fill-hit-test - 0x00020000=use-fill-to-rect - 0x00040000=use-fill-rel-to-shape - 0x00080000=use-hit-test-fill - 0x00100000=use-has-fill - 0x00200000=use-shape-anchor - 0x00400000=use-recolor-as-pic + 0x0001=:no-fill-hit-test + 0x0002=:fill-to-rect + 0x0004=:fill-rel-to-shape + 0x0008=:hit-test-fill + 0x0010=:has-fill + 0x0020=:shape-anchor + 0x0040=:recolor-as-pic end +# line style + flagslist=DFFOPT-LINE-FLAGS - 0x00000001=draw-dash-for-invisible - 0x00000002=fill-rel-to-shape - 0x00000004=hit-test-line - 0x00000008=has-line - 0x00000010=arrowhead-support - 0x00000020=inset-pen-support - 0x00000040=inset-pen - 0x00000200=opaque-back-line - 0x00010000=use-draw-dash-for-invisible - 0x00020000=use-fill-rel-to-shape - 0x00040000=use-hit-test-line - 0x00080000=use-has-line - 0x00100000=use-arrowhead-support - 0x00200000=use-inset-pen-support - 0x00400000=use-inset-pen - 0x02000000=use-opaque-back-line + 0x0001=:draw-dash-for-invisible + 0x0002=:fill-rel-to-shape + 0x0004=:hit-test-line + 0x0008=:has-line + 0x0010=:arrowhead-support + 0x0020=:inset-pen-support + 0x0040=:inset-pen + 0x0200=:opaque-back-line end +# shadow style + flagslist=DFFOPT-SHADOW-FLAGS - 0x00000001=obscured-shadow - 0x00000002=has-shadow - 0x00010000=use-obscured-shadow - 0x00020000=use-has-shadow + 0x0001=:obscured-shadow + 0x0002=:has-shadow end +# perspective + flagslist=DFFOPT-PERSP-FLAGS - 0x00000001=has-perspective - 0x00010000=use-has-perspective + 0x0001=:has-perspective end +# 3d object + flagslist=DFFOPT-3DOBJ-FLAGS - 0x00000001=light-face - 0x00000002=extrusion-color - 0x00000004=metallic - 0x00000008=has-3d - 0x00010000=use-light-face - 0x00020000=use-extrusion-color - 0x00040000=use-metallic - 0x00080000=use-has-3d + 0x0001=:light-face + 0x0002=:extrusion-color + 0x0004=:metallic + 0x0008=:has-3d end +# 3d style + flagslist=DFFOPT-3DSTYLE-FLAGS - 0x00000001=fill-color-harsh - 0x00000002=key-color-harsh - 0x00000004=parallel - 0x00000008=rotation-center-auto - 0x00000010=constrain-rotation - 0x00010000=use-fill-color-harsh - 0x00020000=use-key-color-harsh - 0x00040000=use-parallel - 0x00080000=use-rotation-center-auto - 0x00100000=use-constrain-rotation + 0x0001=:fill-color-harsh + 0x0002=:key-color-harsh + 0x0004=:parallel + 0x0008=:rotation-center-auto + 0x0010=:constrain-rotation end +# shape + flagslist=DFFOPT-SHAPE-FLAGS - 0x00000001=background - 0x00000004=initiator - 0x00000008=lock-shape-type - 0x00000010=prefer-rel-resize - 0x00000020=ole-iconified - 0x00000040=flip-v-override - 0x00000080=flip-h-override - 0x00000100=policy-barcode - 0x00000200=policy-label - 0x00010000=use-background - 0x00040000=use-initiator - 0x00080000=use-lock-shape-type - 0x00100000=use-prefer-rel-resize - 0x00200000=use-ole-iconified - 0x00400000=use-flip-v-override - 0x00800000=use-flip-h-override - 0x01000000=use-policy-barcode - 0x02000000=use-policy-label + 0x0001=:background + 0x0004=:initiator + 0x0008=:lock-shape-type + 0x0010=:prefer-rel-resize + 0x0020=:ole-iconified + 0x0040=:flip-v-override + 0x0080=:flip-h-override + 0x0100=:policy-barcode + 0x0200=:policy-label end +# callout + flagslist=DFFOPT-CALLOUT-FLAGS - 0x00000001=length-specified - 0x00000002=drop-auto - 0x00000004=minus-y - 0x00000008=minus-x - 0x00000010=has-text-border - 0x00000020=has-accent-bar - 0x00000040=is-callout - 0x00010000=use-length-specified - 0x00020000=use-drop-auto - 0x00040000=use-minus-y - 0x00080000=use-minus-x - 0x00100000=use-has-text-border - 0x00200000=use-has-accent-bar - 0x00400000=use-is-callout + 0x0001=:length-specified + 0x0002=:drop-auto + 0x0004=:minus-y + 0x0008=:minus-x + 0x0010=:has-text-border + 0x0020=:has-accent-bar + 0x0040=:is-callout end +# group or shape + flagslist=DFFOPT-GROUP-FLAGS - 0x00000001=print - 0x00000002=hidden - 0x00000004=1d-adjustment - 0x00000008=is-button - 0x00000010=notify-double-click - 0x00000020=behind-doc - 0x00000040=wrap-edited - 0x00000080=script-anchor - 0x00000100=really-hidden - 0x00000200=allow-overlap - 0x00000400=user-drawn - 0x00000800=is-hr - 0x00001000=no-shade-hr - 0x00002000=standard-hr - 0x00004000=is-bullet - 0x00008000=layout-in-cell - 0x00010000=use-print - 0x00020000=use-hidden - 0x00040000=use-1d-adjustment - 0x00080000=use-is-button - 0x00100000=use-notify-double-click - 0x00200000=use-behind-doc - 0x00400000=use-wrap-edited - 0x00800000=use-script-anchor - 0x01000000=use-really-hidden - 0x02000000=use-allow-overlap - 0x04000000=use-user-drawn - 0x08000000=use-is-hr - 0x10000000=use-no-shade-hr - 0x20000000=use-standard-hr - 0x40000000=use-is-bullet - 0x80000000=use-layout-in-cell -end + 0x0001=:print + 0x0002=:hidden + 0x0004=:1d-adjustment + 0x0008=:is-button + 0x0010=:notify-double-click + 0x0020=:behind-doc + 0x0040=:wrap-edited + 0x0080=:script-anchor + 0x0100=:really-hidden + 0x0200=:allow-overlap + 0x0400=:user-drawn + 0x0800=:is-hr + 0x1000=:no-shade-hr + 0x2000=:standard-hr + 0x4000=:is-bullet + 0x8000=:layout-in-cell +end + +# unknown HTML flagslist=DFFOPT-UHTML-FLAGS - 0x00000002=fake-master - 0x00000004=ole-from-html - 0x00020000=use-fake-master - 0x00040000=use-ole-from-html + 0x0002=:fake-master + 0x0004=:ole-from-html end +# diagram + flagslist=DFFOPT-DIAGRAM-FLAGS - 0x00000001=pseudo-inline - 0x00000002=do-layout - 0x00000004=reverse - 0x00000008=do-format - 0x00010000=use-pseudo-inline - 0x00020000=use-do-layout - 0x00040000=use-reverse - 0x00080000=use-do-format + 0x0001=:pseudo-inline + 0x0002=:do-layout + 0x0004=:reverse + 0x0008=:do-format end +# web component + flagslist=DFFOPT-WEBCOMP-FLAGS - 0x00000001=is-web-component - 0x00010000=use-is-web-component + 0x0001=:is-web-component end +# ink data + flagslist=DFFOPT-INK-FLAGS - 0x00000001=render-ink - 0x00000002=render-shape - 0x00000004=hit-test-ink - 0x00000008=ink-annotation - 0x00010000=use-render-ink - 0x00020000=use-render-shape - 0x00040000=use-hit-test-ink - 0x00080000=use-ink-annotation + 0x0001=:render-ink + 0x0002=:render-shape + 0x0004=:hit-test-ink + 0x0008=:ink-annotation end +# signature line + flagslist=DFFOPT-SIGLINE-FLAGS - 0x00000001=is-signature-line - 0x00000002=shoe-sign-instruction - 0x00000004=show-sign-comment - 0x00000008=show-sign-date - 0x00010000=use-is-signature-line - 0x00020000=use-shoe-sign-instruction - 0x00040000=use-show-sign-comment - 0x00080000=use-show-sign-date + 0x0001=:is-signature-line + 0x0002=:show-sign-instruction + 0x0004=:show-sign-comment + 0x0008=:show-sign-date end +# group or shape #2 + # DFFSP ---------------------------------------------------------------------- combilist=DFFSP-RECORD-INST diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index 581bd8fbc898..75d817194458 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -773,6 +773,14 @@ OUString StringHelper::trimSpaces( const OUString& rStr ) return rStr.copy( nBeg, nEnd - nBeg ); } +OUString StringHelper::trimTrailingNul( const OUString& rStr ) +{ + sal_Int32 nLastPos = rStr.getLength() - 1; + if( (nLastPos >= 0) && (rStr[ nLastPos ] == 0) ) + return rStr.copy( 0, nLastPos ); + return rStr; +} + OString StringHelper::convertToUtf8( const OUString& rStr ) { return OUStringToOString( rStr, RTL_TEXTENCODING_UTF8 ); @@ -889,6 +897,25 @@ bool StringHelper::convertStringToBool( const OUString& rData ) return convertStringToInt( nData, rData ) && (nData != 0); } +OUStringPair StringHelper::convertStringToPair( const OUString& rString, sal_Unicode cSep ) +{ + OUStringPair aPair; + if( rString.getLength() > 0 ) + { + sal_Int32 nEqPos = rString.indexOf( cSep ); + if( nEqPos < 0 ) + { + aPair.first = rString; + } + else + { + aPair.first = StringHelper::trimSpaces( rString.copy( 0, nEqPos ) ); + aPair.second = StringHelper::trimSpaces( rString.copy( nEqPos + 1 ) ); + } + } + return aPair; +} + void StringHelper::convertStringToStringList( OUStringVector& orVec, const OUString& rData, bool bIgnoreEmpty ) { orVec.clear(); @@ -1068,25 +1095,11 @@ ConfigItemBase::LineType ConfigItemBase::readConfigLine( } } - LineType eResult = LINETYPE_END; - if( aLine.getLength() > 0 ) - { - sal_Int32 nEqPos = aLine.indexOf( '=' ); - if( nEqPos < 0 ) - { - orKey = aLine; - } - else - { - orKey = StringHelper::trimSpaces( aLine.copy( 0, nEqPos ) ); - orData = StringHelper::trimSpaces( aLine.copy( nEqPos + 1 ) ); - } - - if( (orKey.getLength() > 0) && ((orData.getLength() > 0) || !orKey.equalsAscii( "end" )) ) - eResult = LINETYPE_DATA; - } - - return eResult; + OUStringPair aPair = StringHelper::convertStringToPair( aLine ); + orKey = aPair.first; + orData = aPair.second; + return ((orKey.getLength() > 0) && ((orData.getLength() > 0) || !orKey.equalsAscii( "end" ))) ? + LINETYPE_DATA : LINETYPE_END; } ConfigItemBase::LineType ConfigItemBase::readConfigLine( const ConfigInputStreamRef& rxStrm ) const @@ -1177,6 +1190,15 @@ void NameListBase::exclude( const OUString& rKeys ) // ============================================================================ +void ItemFormatMap::insertFormats( const NameListRef& rxNameList ) +{ + if( Base::isValid( rxNameList ) ) + for( NameListBase::const_iterator aIt = rxNameList->begin(), aEnd = rxNameList->end(); aIt != aEnd; ++aIt ) + (*this)[ aIt->first ].parse( aIt->second ); +} + +// ============================================================================ + ConstList::ConstList( const SharedConfigData& rCfgData ) : NameListBase( rCfgData ), maDefName( OOX_DUMP_ERR_NONAME ), @@ -1284,46 +1306,57 @@ void FlagsList::implProcessConfigItemStr( void FlagsList::implSetName( sal_Int64 nKey, const OUString& rName ) { - insertRawName( nKey, rName ); + if( (nKey != 0) && ((nKey & (nKey - 1)) == 0) ) // only a single bit set? + insertRawName( nKey, rName ); } OUString FlagsList::implGetName( const Config& /*rCfg*/, sal_Int64 nKey ) const { - sal_Int64 nFlags = nKey; - setFlag( nFlags, mnIgnore, false ); - sal_Int64 nFound = 0; + sal_Int64 nFound = mnIgnore; OUStringBuffer aName; // add known flags for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt ) { sal_Int64 nMask = aIt->first; - const OUString& rFlagName = aIt->second; - bool bNegated = (rFlagName.getLength() > 0) && (rFlagName[ 0 ] == '!'); - sal_Int32 nBothSep = bNegated ? rFlagName.indexOf( '!', 1 ) : -1; - bool bFlag = getFlag( nFlags, nMask ); - if( bFlag ) - { - if( !bNegated ) - StringHelper::appendToken( aName, rFlagName ); - else if( nBothSep > 0 ) - StringHelper::appendToken( aName, rFlagName.copy( nBothSep + 1 ) ); - } - else if( bNegated ) + setFlag( nFound, nMask ); + if( !getFlag( mnIgnore, nMask ) ) { - if( nBothSep > 0 ) - StringHelper::appendToken( aName, rFlagName.copy( 1, nBothSep - 1 ) ); - else + const OUString& rFlagName = aIt->second; + bool bOnOff = (rFlagName.getLength() > 0) && (rFlagName[ 0 ] == ':'); + bool bFlag = getFlag( nKey, nMask ); + if( bOnOff ) + { StringHelper::appendToken( aName, rFlagName.copy( 1 ) ); + aName.appendAscii( bFlag ? ":on" : ":off" ); + } + else + { + bool bNegated = (rFlagName.getLength() > 0) && (rFlagName[ 0 ] == '!'); + sal_Int32 nBothSep = bNegated ? rFlagName.indexOf( '!', 1 ) : -1; + if( bFlag ) + { + if( !bNegated ) + StringHelper::appendToken( aName, rFlagName ); + else if( nBothSep > 0 ) + StringHelper::appendToken( aName, rFlagName.copy( nBothSep + 1 ) ); + } + else if( bNegated ) + { + if( nBothSep > 0 ) + StringHelper::appendToken( aName, rFlagName.copy( 1, nBothSep - 1 ) ); + else + StringHelper::appendToken( aName, rFlagName.copy( 1 ) ); + } + } } - setFlag( nFound, nMask ); } // add unknown flags - setFlag( nFlags, nFound, false ); - if( nFlags != 0 ) + setFlag( nKey, nFound, false ); + if( nKey != 0 ) { OUStringBuffer aUnknown( CREATE_OUSTRING( OOX_DUMP_UNKNOWN ) ); aUnknown.append( OOX_DUMP_ITEMSEP ); - StringHelper::appendShortHex( aUnknown, nFlags, true ); + StringHelper::appendShortHex( aUnknown, nKey, true ); StringHelper::enclose( aUnknown, '(', ')' ); StringHelper::appendToken( aName, aUnknown.makeStringAndClear() ); } @@ -1343,6 +1376,11 @@ void FlagsList::implIncludeList( const NameListBase& rList ) // ============================================================================ +bool CombiList::ExtItemFormatKey::operator<( const ExtItemFormatKey& rRight ) const +{ + return (mnKey < rRight.mnKey) || ((mnKey == rRight.mnKey) && (maFilter < rRight.maFilter)); +} + CombiList::CombiList( const SharedConfigData& rCfgData ) : FlagsList( rCfgData ) { @@ -1352,9 +1390,34 @@ void CombiList::implSetName( sal_Int64 nKey, const OUString& rName ) { if( (nKey & (nKey - 1)) != 0 ) // more than a single bit set? { - ExtItemFormat& rItemFmt = maFmtMap[ nKey ]; - OUStringVector aRemain = rItemFmt.parse( rName ); - rItemFmt.mbShiftValue = aRemain.empty() || !aRemain.front().equalsAscii( "noshift" ); + typedef ::std::set< ExtItemFormatKey > ExtItemFormatKeySet; + ::std::set< ExtItemFormatKey > aItemKeys; + ExtItemFormat aItemFmt; + OUStringVector aRemain = aItemFmt.parse( rName ); + for( OUStringVector::iterator aIt = aRemain.begin(), aEnd = aRemain.end(); aIt != aEnd; ++aIt ) + { + OUStringPair aPair = StringHelper::convertStringToPair( *aIt ); + if( aPair.first.equalsAscii( "noshift" ) ) + { + aItemFmt.mbShiftValue = StringHelper::convertStringToBool( aPair.second ); + } + else if( aPair.first.equalsAscii( "filter" ) ) + { + OUStringPair aFilter = StringHelper::convertStringToPair( aPair.second, '~' ); + ExtItemFormatKey aKey( nKey ); + if( (aFilter.first.getLength() > 0) && StringHelper::convertStringToInt( aKey.maFilter.first, aFilter.first ) && + (aFilter.second.getLength() > 0) && StringHelper::convertStringToInt( aKey.maFilter.second, aFilter.second ) ) + { + if( aKey.maFilter.first == 0 ) + aKey.maFilter.second = 0; + aItemKeys.insert( aKey ); + } + } + } + if( aItemKeys.empty() ) + aItemKeys.insert( ExtItemFormatKey( nKey ) ); + for( ExtItemFormatKeySet::iterator aIt = aItemKeys.begin(), aEnd = aItemKeys.end(); aIt != aEnd; ++aIt ) + maFmtMap[ *aIt ] = aItemFmt; } else { @@ -1364,18 +1427,18 @@ void CombiList::implSetName( sal_Int64 nKey, const OUString& rName ) OUString CombiList::implGetName( const Config& rCfg, sal_Int64 nKey ) const { - sal_Int64 nFlags = nKey; sal_Int64 nFound = 0; OUStringBuffer aName; // add known flag fields for( ExtItemFormatMap::const_iterator aIt = maFmtMap.begin(), aEnd = maFmtMap.end(); aIt != aEnd; ++aIt ) { - sal_Int64 nMask = aIt->first; - if( nMask != 0 ) + const ExtItemFormatKey& rMapKey = aIt->first; + sal_Int64 nMask = rMapKey.mnKey; + if( (nMask != 0) && ((nKey & rMapKey.maFilter.first) == rMapKey.maFilter.second) ) { const ExtItemFormat& rItemFmt = aIt->second; - sal_uInt64 nUFlags = static_cast< sal_uInt64 >( nFlags ); + sal_uInt64 nUFlags = static_cast< sal_uInt64 >( nKey ); sal_uInt64 nUMask = static_cast< sal_uInt64 >( nMask ); if( rItemFmt.mbShiftValue ) while( (nUMask & 1) == 0 ) { nUFlags >>= 1; nUMask >>= 1; } @@ -1412,8 +1475,8 @@ OUString CombiList::implGetName( const Config& rCfg, sal_Int64 nKey ) const setFlag( nFound, nMask ); } } - setFlag( nFlags, nFound, false ); - StringHelper::appendToken( aName, FlagsList::implGetName( rCfg, nFlags ) ); + setFlag( nKey, nFound, false ); + StringHelper::appendToken( aName, FlagsList::implGetName( rCfg, nKey ) ); return aName.makeStringAndClear(); } @@ -2601,7 +2664,7 @@ sal_Unicode InputObjectBase::dumpUnicode( const String& rName ) return cChar; } -OUString InputObjectBase::dumpCharArray( const String& rName, sal_Int32 nLen, rtl_TextEncoding eTextEnc ) +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 ); OUString aString; @@ -2612,16 +2675,20 @@ OUString InputObjectBase::dumpCharArray( const String& rName, sal_Int32 nLen, rt aBuffer[ nCharsRead ] = 0; aString = OStringToOUString( OString( &aBuffer.front() ), eTextEnc ); } + if( bHideTrailingNul ) + aString = StringHelper::trimTrailingNul( aString ); writeStringItem( rName( "text" ), aString ); return aString; } -OUString InputObjectBase::dumpUnicodeArray( const String& rName, sal_Int32 nLen ) +OUString InputObjectBase::dumpUnicodeArray( const String& rName, sal_Int32 nLen, bool bHideTrailingNul ) { OUStringBuffer aBuffer; for( sal_Int32 nIndex = 0; !mxStrm->isEof() && (nIndex < nLen); ++nIndex ) aBuffer.append( static_cast< sal_Unicode >( mxStrm->readuInt16() ) ); OUString aString = aBuffer.makeStringAndClear(); + if( bHideTrailingNul ) + aString = StringHelper::trimTrailingNul( aString ); writeStringItem( rName( "text" ), aString ); return aString; } @@ -3033,12 +3100,7 @@ bool RecordObjectBase::implIsValid() const void RecordObjectBase::implDump() { NameListRef xRecNames = getRecNames(); - - typedef ::std::map< sal_Int64, ItemFormat > ItemFormatMap; - ItemFormatMap aSimpleRecs; - if( NameListBase* pSimpleRecs = maSimpleRecs.getNameList( cfg() ).get() ) - for( NameListBase::const_iterator aIt = pSimpleRecs->begin(), aEnd = pSimpleRecs->end(); aIt != aEnd; ++aIt ) - aSimpleRecs[ aIt->first ].parse( aIt->second ); + ItemFormatMap aSimpleRecs( maSimpleRecs.getNameList( cfg() ) ); while( implStartRecord( *mxBaseStrm, mnRecPos, mnRecId, mnRecSize ) ) { diff --git a/oox/source/dump/dumperbase.ini b/oox/source/dump/dumperbase.ini index bf51365642c0..26ab682d0b9e 100644 --- a/oox/source/dump/dumperbase.ini +++ b/oox/source/dump/dumperbase.ini @@ -164,7 +164,7 @@ show-record-position=0 # include = <LISTNAME>[,<LISTNAME>...] # exclude = <bitfield>[,<bitfield>...] # ignore = <bitfield> -# <bitmask> = <constname> | !<constname> | !<constname0>!<constname1> +# <bitmask> = <cname> | !<cname> | :<cname> | !<cname0>!<cname1> # end # # - include (optional): See constlist above. @@ -173,10 +173,14 @@ show-record-position=0 # name and not set in this declaration will be shown as unknown. Default is # to not ignore a bit. # - <bitmask>: The bit to be named. Must be a value with a single bit set. -# - <constname>: sets a name for the bit that will be shown if it is set. -# - !<constname>: sets a name for the bit that will be shown if it is cleared. -# - !<constname0>!<constname1>: sets a name for the cleared bit (constname0), -# and for the set bit (constname1). +# - <cname> - Sets a name for the bit that will be shown if the bit is set. +# Does not show anything if the bit is cleared. +# - !<cname> - Sets a name for the bit that will be shown if the bit is +# cleared. Does not show anything if the bit is set. +# - :<cname> - Sets a name for the bit that will always be shown together +# with the actual state of the bit, appended as ':on' or ':off'. +# - !<cname0>!<cname1> - Sets a name for both the cleared bit (cname0), and +# for the set bit (cname1). # # ---------------------------------------------------------------------------- # @@ -191,8 +195,8 @@ show-record-position=0 # include = <LISTNAME>[,<LISTNAME>...] # exclude = <bitmask>[,<bitmask>...] # ignore = <bitfield> -# <bitmask> = <constname> | !<constname> | !<constname0>!<constname1> -# <bitfield> = <datatype>,<dataformat>,<bitfieldname>[,<LISTNAME>[,noshift]] +# <bitmask> = <cname> | !<cname> | :<cname> | !<cname0>!<cname1> +# <bitfield> = <datatype>,<dataformat>,<bitfieldname>[,<LISTNAME>[,options...]] # end # # - include (optional): See constlist above. @@ -206,7 +210,17 @@ show-record-position=0 # - <bitfieldname>: The name of the embedded bitfield. # - <LISTAME>: Optional name list with names for the values of the embedded # bitfield. -# - noshift: If set, the extracted value is not shifted to the right. +# - options: Additional options for this bitfield: +# - filter = <filterbitfield>~<filtervalue>: If set, the entire bitfield +# will only be written, if the complete data item currently dumped +# contains exactly the value specified in <filtervalue> in the bitfield +# specified in <filterbitfield>. Otherwise, nothing is written. It is +# possible to specify multiple filter rules for this bitfield. In that +# case, the bitfield will be written, if at least one filter rule +# applies for the current data item. +# - noshift = <bool>: If set to 'true', the extracted value will be +# shifted to the right (normalized). If set to 'false', the value will +# be written unshifted. Default is 'true'. # # ---------------------------------------------------------------------------- # @@ -222,6 +236,7 @@ show-record-position=0 unitconverter=CONV-DEC,1 unitconverter=CONV-PERCENT,1,% +unitconverter=CONV-FLOAT-TO-PERC,100,% unitconverter=CONV-DEG,1,° unitconverter=CONV-HMM-TO-CM,/1000,cm unitconverter=CONV-INCH-TO-CM,2.54,cm @@ -229,6 +244,7 @@ unitconverter=CONV-PT-TO-CM,/28.346457,cm unitconverter=CONV-PT1616-TO-CM,/1857713.4,cm unitconverter=CONV-TWIP-TO-CM,/566.92913,cm unitconverter=CONV-TWIP-TO-PT,/20,pt +unitconverter=CONV-EMU-TO-CM,/36000,cm constlist=BOOLEAN 0=FALSE @@ -238,7 +254,7 @@ end combilist=RK-FLAGS 0x00000001=div-100 0x00000002=integer - 0xFFFFFFFC=int32,dec,value + 0xFFFFFFFC=int32,dec,value,,filter=0x2~0x2 end constlist=CHARSET @@ -351,5 +367,12 @@ constlist=CODEPAGES 65001=utf-8 end +multilist=SYSTEMCOLOR + 0x00=scrollbar,desktop,active-title,inactive-title,menu,window-back,window-frame,menu-text + 0x08=window-text,active-title-text,active-border,inactive-border,app-workspace,highlight,highlight-text,button-face + 0x10=button-shadow,disabled-text,button-text,inactive-title-text,button-highlight,button-dark-shadow,button-light-shadow,tooltip-text + 0x18=tooltip-back,,hot-light,active-title-2,inactive-title-2,menu-highlight,menubar +end + # ============================================================================ diff --git a/oox/source/dump/oledumper.cxx b/oox/source/dump/oledumper.cxx index 248e49732af6..a61cfc837ea6 100644 --- a/oox/source/dump/oledumper.cxx +++ b/oox/source/dump/oledumper.cxx @@ -674,15 +674,7 @@ sal_uInt32 OcxPropertyObjectBase::dumpColorProperty( sal_uInt32 nDefault ) { MultiItemsGuard aMultiGuard( out() ); alignInput< sal_uInt32 >(); - sal_uInt32 nColor = dumpHex< sal_uInt32 >( getPropertyName(), "OCX-COLOR" ); - switch( extractValue< sal_uInt8 >( nColor, 24, 8 ) ) - { - case 0x00: writeColorABGRItem( "rgb", extractValue< sal_Int32 >( nColor, 0, 24 ) ); break; - case 0x01: writeDecItem( "palette-index", extractValue< sal_uInt16 >( nColor, 0, 16 ) ); break; - case 0x02: writeColorABGRItem( "rgb", extractValue< sal_Int32 >( nColor, 0, 24 ) ); break; - case 0x80: writeDecItem( "sys-color", extractValue< sal_uInt16 >( nColor, 0, 16 ), "OCX-SYSTEMCOLOR" ); break; - } - return nColor; + return dumpHex< sal_uInt32 >( getPropertyName(), "OCX-COLOR" ); } return nDefault; } diff --git a/oox/source/dump/oledumper.ini b/oox/source/dump/oledumper.ini index fe38d201c329..0032ba7a8d09 100644 --- a/oox/source/dump/oledumper.ini +++ b/oox/source/dump/oledumper.ini @@ -115,8 +115,12 @@ end {0713E8D2-850A-101B-AFC0-4210102A8DA7}=COMCTL.ProgCtrl.1 combilist=OCX-COLOR + 0x0000FFFF=uint32,dec,palette-index,,filter=0xFF000000~0x01000000 + 0x000000FF=uint32,dec,red,,filter=0xFF000000~0x00000000,filter=0xFF000000~0x02000000 + 0x0000FF00=uint32,dec,green,,filter=0xFF000000~0x00000000,filter=0xFF000000~0x02000000 + 0x00FF0000=uint32,dec,blue,,filter=0xFF000000~0x00000000,filter=0xFF000000~0x02000000 + 0x0000FFFF=uint32,dec,system-color,SYSTEMCOLOR,filter=0xFF000000~0x80000000 0xFF000000=uint8,dec,type,OCX-COLORTYPE - 0x00FFFFFF=uint32,hex,value end constlist=OCX-COLORTYPE @@ -126,13 +130,6 @@ constlist=OCX-COLORTYPE 0x80=system-color end -multilist=OCX-SYSTEMCOLOR - 0x00=scrollbar,desktop,active-title,inactive-title,menubar,window-back,window-frame,menu-text - 0x08=window-text,active-title-text,active-border,inactive-border,app-workspace,highlight,highlight-text,button-face - 0x10=button-shadow,disabled-text,button-text,inactive-title-text,button-highlight,button-dark-shadow,button-light-shadow,tooltip-text - 0x18=tooltip-back -end - combilist=OCX-STRINGLEN 0x80000000=!unicode!compressed 0x7FFFFFFF=int32,dec,buffer-size @@ -541,16 +538,6 @@ flagslist=OCX-FORMSITE-FLAGS 0x00040000=container end -combilist=OCX-FORMSITE-CLASSIDCACHE - 0x7FFF=uint16,dec,cache-idx,OCX-FORMSITE-CLASSIDCACHEINDEX - 0x8000=!predefined-class-id!class-table-index -end - -constlist=OCX-FORMSITE-CLASSIDCACHEINDEX - default= - 0x7FFF=invalid -end - constlist=OCX-FORMSITE-CLASSNAMES 7=Forms.Form.1 12=Forms.Image.1 @@ -570,6 +557,17 @@ constlist=OCX-FORMSITE-CLASSNAMES 57=Forms.MultiPage.1 end +constlist=OCX-FORMSITE-CLASSIDCACHEINDEX + include=OCX-FORMSITE-CLASSNAMES + 0x7FFF=invalid +end + +combilist=OCX-FORMSITE-CLASSIDCACHE + 0x7FFF=uint16,dec,cache-idx,OCX-FORMSITE-CLASSIDCACHEINDEX,filter=0x8000~0x0000 + 0x7FFF=uint16,dec,class-table-idx,,filter=0x8000~0x8000 + 0x8000=!predefined-class-id!class-table-index +end + # form design extender ------------------------------------------------------ flagslist=OCX-FORMDESIGNEXT-PROPERTIES |