[Libreoffice-commits] .: 3 commits - filter/source lotuswordpro/prj lotuswordpro/source lotuswordpro/util
Michael Meeks
mmeeks at kemper.freedesktop.org
Fri Oct 8 11:27:30 PDT 2010
filter/source/config/fragments/fcfg_writer.mk | 2
lotuswordpro/prj/build.lst | 5
lotuswordpro/prj/d.lst | 3
lotuswordpro/source/filter/LotusWordProImportFilter.cxx | 400 +
lotuswordpro/source/filter/LotusWordProImportFilter.cxx.orig | 396 +
lotuswordpro/source/filter/LotusWordProImportFilter.hxx | 90
lotuswordpro/source/filter/bencont.cxx | 716 +++
lotuswordpro/source/filter/benlist.cxx | 121
lotuswordpro/source/filter/benname.cxx | 91
lotuswordpro/source/filter/benobj.cxx | 128
lotuswordpro/source/filter/bento.hxx | 567 ++
lotuswordpro/source/filter/bentoid.hxx | 110
lotuswordpro/source/filter/benval.cxx | 348 +
lotuswordpro/source/filter/explode.cxx | 647 +++
lotuswordpro/source/filter/explode.hxx | 125
lotuswordpro/source/filter/first.hxx | 81
lotuswordpro/source/filter/genericfilter.cxx | 77
lotuswordpro/source/filter/localtime.cxx | 192
lotuswordpro/source/filter/localtime.hxx | 73
lotuswordpro/source/filter/lwp9reader.cxx | 291 +
lotuswordpro/source/filter/lwp9reader.hxx | 89
lotuswordpro/source/filter/lwparrowstyles.hxx | 101
lotuswordpro/source/filter/lwpatomholder.cxx | 108
lotuswordpro/source/filter/lwpatomholder.hxx | 86
lotuswordpro/source/filter/lwpbackgroundoverride.hxx | 91
lotuswordpro/source/filter/lwpbackgroundstuff.cxx | 182
lotuswordpro/source/filter/lwpbackgroundstuff.hxx | 168
lotuswordpro/source/filter/lwpbasetype.cxx | 92
lotuswordpro/source/filter/lwpbasetype.hxx | 117
lotuswordpro/source/filter/lwpbookmarkmgr.cxx | 112
lotuswordpro/source/filter/lwpbookmarkmgr.hxx | 84
lotuswordpro/source/filter/lwpborderstuff.cxx | 255 +
lotuswordpro/source/filter/lwpborderstuff.hxx | 119
lotuswordpro/source/filter/lwpbreaksoverride.cxx | 280 +
lotuswordpro/source/filter/lwpbreaksoverride.hxx | 248 +
lotuswordpro/source/filter/lwpbulletstylemgr.cxx | 590 ++
lotuswordpro/source/filter/lwpbulletstylemgr.hxx | 168
lotuswordpro/source/filter/lwpcelllayout.cxx | 955 ++++
lotuswordpro/source/filter/lwpcelllayout.hxx | 209 +
lotuswordpro/source/filter/lwpchangemgr.cxx | 383 +
lotuswordpro/source/filter/lwpchangemgr.hxx | 95
lotuswordpro/source/filter/lwpcharacterstyle.cxx | 207 +
lotuswordpro/source/filter/lwpcharacterstyle.hxx | 137
lotuswordpro/source/filter/lwpcharborderoverride.cxx | 148
lotuswordpro/source/filter/lwpcharborderoverride.hxx | 195
lotuswordpro/source/filter/lwpcharsetmgr.cxx | 119
lotuswordpro/source/filter/lwpcharsetmgr.hxx | 86
lotuswordpro/source/filter/lwpchartstreamtools.cxx | 359 +
lotuswordpro/source/filter/lwpchartstreamtools.hxx | 149
lotuswordpro/source/filter/lwpchartwrapper.cxx | 93
lotuswordpro/source/filter/lwpchartwrapper.hxx | 79
lotuswordpro/source/filter/lwpcolor.cxx | 149
lotuswordpro/source/filter/lwpcolor.hxx | 130
lotuswordpro/source/filter/lwpcontent.cxx | 153
lotuswordpro/source/filter/lwpcontent.hxx | 158
lotuswordpro/source/filter/lwpdefobj.cxx | 88
lotuswordpro/source/filter/lwpdefobj.hxx | 81
lotuswordpro/source/filter/lwpdefs.hxx | 423 ++
lotuswordpro/source/filter/lwpdivinfo.cxx | 174
lotuswordpro/source/filter/lwpdivinfo.hxx | 166
lotuswordpro/source/filter/lwpdivopts.cxx | 133
lotuswordpro/source/filter/lwpdivopts.hxx | 120
lotuswordpro/source/filter/lwpdllist.cxx | 99
lotuswordpro/source/filter/lwpdllist.hxx | 104
lotuswordpro/source/filter/lwpdlvlist.cxx | 185
lotuswordpro/source/filter/lwpdlvlist.hxx | 205 +
lotuswordpro/source/filter/lwpdoc.cxx | 830 ++++
lotuswordpro/source/filter/lwpdoc.hxx | 248 +
lotuswordpro/source/filter/lwpdocdata.cxx | 395 +
lotuswordpro/source/filter/lwpdocdata.hxx | 191
lotuswordpro/source/filter/lwpdrawobj.cxx | 1551 +++++++
lotuswordpro/source/filter/lwpdrawobj.hxx | 376 +
lotuswordpro/source/filter/lwpdropcapmgr.cxx | 82
lotuswordpro/source/filter/lwpdropcapmgr.hxx | 79
lotuswordpro/source/filter/lwpfilehdr.cxx | 83
lotuswordpro/source/filter/lwpfilehdr.hxx | 89
lotuswordpro/source/filter/lwpfilter.cxx | 593 ++
lotuswordpro/source/filter/lwpfilter.hxx | 184
lotuswordpro/source/filter/lwpfnlayout.cxx | 395 +
lotuswordpro/source/filter/lwpfnlayout.hxx | 195
lotuswordpro/source/filter/lwpfont.cxx | 556 ++
lotuswordpro/source/filter/lwpfont.hxx | 283 +
lotuswordpro/source/filter/lwpfootnote.cxx | 595 ++
lotuswordpro/source/filter/lwpfootnote.hxx | 285 +
lotuswordpro/source/filter/lwpfoundry.cxx | 579 ++
lotuswordpro/source/filter/lwpfoundry.hxx | 326 +
lotuswordpro/source/filter/lwpframelayout.cxx | 1281 ++++++
lotuswordpro/source/filter/lwpframelayout.hxx | 240 +
lotuswordpro/source/filter/lwpfrib.cxx | 463 ++
lotuswordpro/source/filter/lwpfrib.hxx | 139
lotuswordpro/source/filter/lwpfribbreaks.cxx | 165
lotuswordpro/source/filter/lwpfribbreaks.hxx | 104
lotuswordpro/source/filter/lwpfribframe.cxx | 235 +
lotuswordpro/source/filter/lwpfribframe.hxx | 97
lotuswordpro/source/filter/lwpfribheader.hxx | 135
lotuswordpro/source/filter/lwpfribmark.cxx | 1460 +++++++
lotuswordpro/source/filter/lwpfribmark.hxx | 164
lotuswordpro/source/filter/lwpfribptr.cxx | 689 +++
lotuswordpro/source/filter/lwpfribptr.hxx | 100
lotuswordpro/source/filter/lwpfribsection.cxx | 470 ++
lotuswordpro/source/filter/lwpfribsection.hxx | 131
lotuswordpro/source/filter/lwpfribtable.cxx | 173
lotuswordpro/source/filter/lwpfribtable.hxx | 74
lotuswordpro/source/filter/lwpfribtext.cxx | 496 ++
lotuswordpro/source/filter/lwpfribtext.hxx | 230 +
lotuswordpro/source/filter/lwpglobalmgr.cxx | 166
lotuswordpro/source/filter/lwpglobalmgr.hxx | 103
lotuswordpro/source/filter/lwpgrfobj.cxx | 841 ++++
lotuswordpro/source/filter/lwpgrfobj.hxx | 140
lotuswordpro/source/filter/lwpheader.hxx | 84
lotuswordpro/source/filter/lwpholder.cxx | 118
lotuswordpro/source/filter/lwpholder.hxx | 129
lotuswordpro/source/filter/lwphyperlinkmgr.cxx | 82
lotuswordpro/source/filter/lwphyperlinkmgr.hxx | 82
lotuswordpro/source/filter/lwpidxmgr.cxx | 354 +
lotuswordpro/source/filter/lwpidxmgr.hxx | 116
lotuswordpro/source/filter/lwplayout.cxx | 2215 +++++++++++
lotuswordpro/source/filter/lwplayout.hxx | 458 ++
lotuswordpro/source/filter/lwplayoutdef.hxx | 170
lotuswordpro/source/filter/lwplaypiece.cxx | 464 ++
lotuswordpro/source/filter/lwplaypiece.hxx | 392 +
lotuswordpro/source/filter/lwplnopts.cxx | 96
lotuswordpro/source/filter/lwplnopts.hxx | 98
lotuswordpro/source/filter/lwpmargins.hxx | 120
lotuswordpro/source/filter/lwpmarker.cxx | 572 ++
lotuswordpro/source/filter/lwpmarker.hxx | 281 +
lotuswordpro/source/filter/lwpnotes.cxx | 326 +
lotuswordpro/source/filter/lwpnotes.hxx | 161
lotuswordpro/source/filter/lwpnumberingoverride.cxx | 180
lotuswordpro/source/filter/lwpnumberingoverride.hxx | 170
lotuswordpro/source/filter/lwpnumericfmt.cxx | 566 ++
lotuswordpro/source/filter/lwpnumericfmt.hxx | 312 +
lotuswordpro/source/filter/lwpobj.cxx | 120
lotuswordpro/source/filter/lwpobj.hxx | 105
lotuswordpro/source/filter/lwpobjfactory.cxx | 781 +++
lotuswordpro/source/filter/lwpobjfactory.hxx | 140
lotuswordpro/source/filter/lwpobjhdr.cxx | 198
lotuswordpro/source/filter/lwpobjhdr.hxx | 137
lotuswordpro/source/filter/lwpobjid.cxx | 256 +
lotuswordpro/source/filter/lwpobjid.hxx | 159
lotuswordpro/source/filter/lwpobjstrm.cxx | 371 +
lotuswordpro/source/filter/lwpobjstrm.hxx | 127
lotuswordpro/source/filter/lwpobjtags.hxx | 241 +
lotuswordpro/source/filter/lwpoleobject.cxx | 752 +++
lotuswordpro/source/filter/lwpoleobject.hxx | 194
lotuswordpro/source/filter/lwpoverride.cxx | 555 ++
lotuswordpro/source/filter/lwpoverride.hxx | 438 ++
lotuswordpro/source/filter/lwppagehint.cxx | 117
lotuswordpro/source/filter/lwppagehint.hxx | 129
lotuswordpro/source/filter/lwppagelayout.cxx | 1061 +++++
lotuswordpro/source/filter/lwppagelayout.hxx | 169
lotuswordpro/source/filter/lwppara.cxx | 1046 +++++
lotuswordpro/source/filter/lwppara.hxx | 423 ++
lotuswordpro/source/filter/lwppara1.cxx | 730 +++
lotuswordpro/source/filter/lwpparaborderoverride.cxx | 394 +
lotuswordpro/source/filter/lwpparaborderoverride.hxx | 284 +
lotuswordpro/source/filter/lwpparaproperty.cxx | 294 +
lotuswordpro/source/filter/lwpparaproperty.hxx | 319 +
lotuswordpro/source/filter/lwpparastyle.cxx | 795 +++
lotuswordpro/source/filter/lwpparastyle.hxx | 130
lotuswordpro/source/filter/lwppiece.hxx | 202 +
lotuswordpro/source/filter/lwpproplist.cxx | 151
lotuswordpro/source/filter/lwpproplist.hxx | 99
lotuswordpro/source/filter/lwpprtinfo.cxx | 105
lotuswordpro/source/filter/lwpprtinfo.hxx | 92
lotuswordpro/source/filter/lwppttntbl.hxx | 145
lotuswordpro/source/filter/lwpresource.hxx | 65
lotuswordpro/source/filter/lwprowlayout.cxx | 491 ++
lotuswordpro/source/filter/lwprowlayout.hxx | 134
lotuswordpro/source/filter/lwpsdwdrawheader.hxx | 297 +
lotuswordpro/source/filter/lwpsdwfileloader.cxx | 148
lotuswordpro/source/filter/lwpsdwfileloader.hxx | 86
lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx | 410 ++
lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx | 94
lotuswordpro/source/filter/lwpsdwrect.cxx | 230 +
lotuswordpro/source/filter/lwpsdwrect.hxx | 128
lotuswordpro/source/filter/lwpsection.cxx | 155
lotuswordpro/source/filter/lwpsection.hxx | 172
lotuswordpro/source/filter/lwpshadow.hxx | 120
lotuswordpro/source/filter/lwpsilverbullet.cxx | 486 ++
lotuswordpro/source/filter/lwpsilverbullet.hxx | 189
lotuswordpro/source/filter/lwpslvlist.hxx | 89
lotuswordpro/source/filter/lwpsortopt.cxx | 105
lotuswordpro/source/filter/lwpsortopt.hxx | 102
lotuswordpro/source/filter/lwpstory.cxx | 549 ++
lotuswordpro/source/filter/lwpstory.hxx | 201
lotuswordpro/source/filter/lwpstyledef.hxx | 257 +
lotuswordpro/source/filter/lwpsvstream.cxx | 99
lotuswordpro/source/filter/lwpsvstream.hxx | 99
lotuswordpro/source/filter/lwptable.cxx | 275 +
lotuswordpro/source/filter/lwptable.hxx | 236 +
lotuswordpro/source/filter/lwptablelayout.cxx | 1542 +++++++
lotuswordpro/source/filter/lwptablelayout.hxx | 269 +
lotuswordpro/source/filter/lwptaboverride.hxx | 128
lotuswordpro/source/filter/lwptabrack.cxx | 134
lotuswordpro/source/filter/lwptabrack.hxx | 162
lotuswordpro/source/filter/lwptblcell.cxx | 252 +
lotuswordpro/source/filter/lwptblcell.hxx | 494 ++
lotuswordpro/source/filter/lwptblformula.cxx | 803 +++
lotuswordpro/source/filter/lwptblformula.hxx | 223 +
lotuswordpro/source/filter/lwptemp.hxx | 79
lotuswordpro/source/filter/lwptoc.cxx | 456 ++
lotuswordpro/source/filter/lwptoc.hxx | 170
lotuswordpro/source/filter/lwptools.cxx | 920 ++++
lotuswordpro/source/filter/lwptools.hxx | 149
lotuswordpro/source/filter/lwpuidoc.cxx | 139
lotuswordpro/source/filter/lwpuidoc.hxx | 154
lotuswordpro/source/filter/lwpunoheader.hxx | 84
lotuswordpro/source/filter/lwpusewhen.hxx | 176
lotuswordpro/source/filter/lwpusrdicts.cxx | 85
lotuswordpro/source/filter/lwpusrdicts.hxx | 80
lotuswordpro/source/filter/lwpverdocument.cxx | 109
lotuswordpro/source/filter/lwpverdocument.hxx | 84
lotuswordpro/source/filter/lwpvpointer.cxx | 79
lotuswordpro/source/filter/lwpvpointer.hxx | 82
lotuswordpro/source/filter/makefile.mk | 110
lotuswordpro/source/filter/schxmlwrapper.cxx | 488 ++
lotuswordpro/source/filter/schxmlwrapper.hxx | 118
lotuswordpro/source/filter/tocread.cxx | 516 ++
lotuswordpro/source/filter/tocread.hxx | 89
lotuswordpro/source/filter/ut.hxx | 101
lotuswordpro/source/filter/utbenvs.cxx | 288 +
lotuswordpro/source/filter/utlist.cxx | 250 +
lotuswordpro/source/filter/utlist.hxx | 157
lotuswordpro/source/filter/xfilter/ixfattrlist.hxx | 89
lotuswordpro/source/filter/xfilter/ixfcontent.hxx | 101
lotuswordpro/source/filter/xfilter/ixfobject.hxx | 91
lotuswordpro/source/filter/xfilter/ixfproperty.hxx | 76
lotuswordpro/source/filter/xfilter/ixfstream.hxx | 114
lotuswordpro/source/filter/xfilter/ixfstyle.hxx | 113
lotuswordpro/source/filter/xfilter/makefile.mk | 148
lotuswordpro/source/filter/xfilter/xfannotation.hxx | 119
lotuswordpro/source/filter/xfilter/xfarrowstyle.hxx | 130
lotuswordpro/source/filter/xfilter/xfbase64.cxx | 136
lotuswordpro/source/filter/xfilter/xfbase64.hxx | 84
lotuswordpro/source/filter/xfilter/xfbgimage.cxx | 162
lotuswordpro/source/filter/xfilter/xfbgimage.hxx | 154
lotuswordpro/source/filter/xfilter/xfbookmark.hxx | 129
lotuswordpro/source/filter/xfilter/xfbookmarkref.cxx | 107
lotuswordpro/source/filter/xfilter/xfbookmarkref.hxx | 103
lotuswordpro/source/filter/xfilter/xfborders.cxx | 360 +
lotuswordpro/source/filter/xfilter/xfborders.hxx | 195
lotuswordpro/source/filter/xfilter/xfbreaks.hxx | 146
lotuswordpro/source/filter/xfilter/xfcell.cxx | 303 +
lotuswordpro/source/filter/xfilter/xfcell.hxx | 261 +
lotuswordpro/source/filter/xfilter/xfcellstyle.cxx | 308 +
lotuswordpro/source/filter/xfilter/xfcellstyle.hxx | 204 +
lotuswordpro/source/filter/xfilter/xfchange.cxx | 163
lotuswordpro/source/filter/xfilter/xfchange.hxx | 146
lotuswordpro/source/filter/xfilter/xfchartstreamtools.cxx | 117
lotuswordpro/source/filter/xfilter/xfchartstreamtools.hxx | 111
lotuswordpro/source/filter/xfilter/xfchartxmlhandler.cxx | 125
lotuswordpro/source/filter/xfilter/xfchartxmlhandler.hxx | 128
lotuswordpro/source/filter/xfilter/xfcolor.cxx | 92
lotuswordpro/source/filter/xfilter/xfcolor.hxx | 130
lotuswordpro/source/filter/xfilter/xfcolstyle.cxx | 95
lotuswordpro/source/filter/xfilter/xfcolstyle.hxx | 112
lotuswordpro/source/filter/xfilter/xfcolumns.cxx | 213 +
lotuswordpro/source/filter/xfilter/xfcolumns.hxx | 180
lotuswordpro/source/filter/xfilter/xfconditionformat.hxx | 70
lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx | 107
lotuswordpro/source/filter/xfilter/xfconfigmanager.hxx | 110
lotuswordpro/source/filter/xfilter/xfcontent.hxx | 99
lotuswordpro/source/filter/xfilter/xfcontentcontainer.cxx | 218 +
lotuswordpro/source/filter/xfilter/xfcontentcontainer.hxx | 143
lotuswordpro/source/filter/xfilter/xfcrossref.cxx | 105
lotuswordpro/source/filter/xfilter/xfcrossref.hxx | 109
lotuswordpro/source/filter/xfilter/xfdate.cxx | 118
lotuswordpro/source/filter/xfilter/xfdate.hxx | 134
lotuswordpro/source/filter/xfilter/xfdatestyle.cxx | 191
lotuswordpro/source/filter/xfilter/xfdatestyle.hxx | 260 +
lotuswordpro/source/filter/xfilter/xfdefs.hxx | 514 ++
lotuswordpro/source/filter/xfilter/xfdocfield.cxx | 234 +
lotuswordpro/source/filter/xfilter/xfdocfield.hxx | 200
lotuswordpro/source/filter/xfilter/xfdrawareastyle.cxx | 99
lotuswordpro/source/filter/xfilter/xfdrawareastyle.hxx | 145
lotuswordpro/source/filter/xfilter/xfdrawchart.cxx | 96
lotuswordpro/source/filter/xfilter/xfdrawchart.hxx | 97
lotuswordpro/source/filter/xfilter/xfdrawcircle.cxx | 134
lotuswordpro/source/filter/xfilter/xfdrawcircle.hxx | 142
lotuswordpro/source/filter/xfilter/xfdrawellipse.cxx | 118
lotuswordpro/source/filter/xfilter/xfdrawellipse.hxx | 156
lotuswordpro/source/filter/xfilter/xfdrawgroup.hxx | 115
lotuswordpro/source/filter/xfilter/xfdrawline.cxx | 123
lotuswordpro/source/filter/xfilter/xfdrawline.hxx | 111
lotuswordpro/source/filter/xfilter/xfdrawlinestyle.cxx | 123
lotuswordpro/source/filter/xfilter/xfdrawlinestyle.hxx | 217 +
lotuswordpro/source/filter/xfilter/xfdrawobj.cxx | 134
lotuswordpro/source/filter/xfilter/xfdrawobj.hxx | 179
lotuswordpro/source/filter/xfilter/xfdrawpath.cxx | 222 +
lotuswordpro/source/filter/xfilter/xfdrawpath.hxx | 153
lotuswordpro/source/filter/xfilter/xfdrawpolygon.cxx | 101
lotuswordpro/source/filter/xfilter/xfdrawpolygon.hxx | 82
lotuswordpro/source/filter/xfilter/xfdrawpolyline.cxx | 133
lotuswordpro/source/filter/xfilter/xfdrawpolyline.hxx | 99
lotuswordpro/source/filter/xfilter/xfdrawrect.cxx | 83
lotuswordpro/source/filter/xfilter/xfdrawrect.hxx | 115
lotuswordpro/source/filter/xfilter/xfdrawstyle.cxx | 349 +
lotuswordpro/source/filter/xfilter/xfdrawstyle.hxx | 167
lotuswordpro/source/filter/xfilter/xfdropcap.hxx | 152
lotuswordpro/source/filter/xfilter/xfendnote.hxx | 128
lotuswordpro/source/filter/xfilter/xfendnoteconfig.hxx | 82
lotuswordpro/source/filter/xfilter/xfentry.cxx | 108
lotuswordpro/source/filter/xfilter/xfentry.hxx | 162
lotuswordpro/source/filter/xfilter/xffileattrlist.cxx | 82
lotuswordpro/source/filter/xfilter/xffileattrlist.hxx | 89
lotuswordpro/source/filter/xfilter/xffilestream.cxx | 208 +
lotuswordpro/source/filter/xfilter/xffilestream.hxx | 91
lotuswordpro/source/filter/xfilter/xffloatframe.cxx | 91
lotuswordpro/source/filter/xfilter/xffloatframe.hxx | 93
lotuswordpro/source/filter/xfilter/xffont.cxx | 413 ++
lotuswordpro/source/filter/xfilter/xffont.hxx | 508 ++
lotuswordpro/source/filter/xfilter/xffontdecl.cxx | 104
lotuswordpro/source/filter/xfilter/xffontdecl.hxx | 112
lotuswordpro/source/filter/xfilter/xffontfactory.cxx | 102
lotuswordpro/source/filter/xfilter/xffontfactory.hxx | 107
lotuswordpro/source/filter/xfilter/xffontworkstyle.hxx | 156
lotuswordpro/source/filter/xfilter/xffooter.hxx | 89
lotuswordpro/source/filter/xfilter/xffooterstyle.hxx | 126
lotuswordpro/source/filter/xfilter/xffootnote.hxx | 128
lotuswordpro/source/filter/xfilter/xffootnoteconfig.hxx | 269 +
lotuswordpro/source/filter/xfilter/xfframe.cxx | 208 +
lotuswordpro/source/filter/xfilter/xfframe.hxx | 264 +
lotuswordpro/source/filter/xfilter/xfframestyle.cxx | 238 +
lotuswordpro/source/filter/xfilter/xfframestyle.hxx | 251 +
lotuswordpro/source/filter/xfilter/xfframetable.hxx | 90
lotuswordpro/source/filter/xfilter/xfglobal.cxx | 145
lotuswordpro/source/filter/xfilter/xfglobal.hxx | 178
lotuswordpro/source/filter/xfilter/xfheader.hxx | 90
lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx | 192
lotuswordpro/source/filter/xfilter/xfheaderstyle.hxx | 142
lotuswordpro/source/filter/xfilter/xfhyperlink.hxx | 140
lotuswordpro/source/filter/xfilter/xfimage.cxx | 145
lotuswordpro/source/filter/xfilter/xfimage.hxx | 100
lotuswordpro/source/filter/xfilter/xfimagestyle.cxx | 211 +
lotuswordpro/source/filter/xfilter/xfimagestyle.hxx | 164
lotuswordpro/source/filter/xfilter/xfindex.cxx | 449 ++
lotuswordpro/source/filter/xfilter/xfindex.hxx | 282 +
lotuswordpro/source/filter/xfilter/xfinputlist.hxx | 115
lotuswordpro/source/filter/xfilter/xflinebreak.hxx | 84
lotuswordpro/source/filter/xfilter/xflineheight.hxx | 176
lotuswordpro/source/filter/xfilter/xflinenumberconfig.hxx | 211 +
lotuswordpro/source/filter/xfilter/xflist.cxx | 189
lotuswordpro/source/filter/xfilter/xflist.hxx | 162
lotuswordpro/source/filter/xfilter/xflistitem.hxx | 118
lotuswordpro/source/filter/xfilter/xfliststyle.cxx | 341 +
lotuswordpro/source/filter/xfilter/xfliststyle.hxx | 268 +
lotuswordpro/source/filter/xfilter/xfmargins.cxx | 129
lotuswordpro/source/filter/xfilter/xfmargins.hxx | 147
lotuswordpro/source/filter/xfilter/xfmasterpage.cxx | 132
lotuswordpro/source/filter/xfilter/xfmasterpage.hxx | 98
lotuswordpro/source/filter/xfilter/xfnumberstyle.cxx | 388 +
lotuswordpro/source/filter/xfilter/xfnumberstyle.hxx | 197
lotuswordpro/source/filter/xfilter/xfnumfmt.hxx | 153
lotuswordpro/source/filter/xfilter/xfofficemeta.cxx | 150
lotuswordpro/source/filter/xfilter/xfofficemeta.hxx | 97
lotuswordpro/source/filter/xfilter/xfoleobj.cxx | 118
lotuswordpro/source/filter/xfilter/xfoleobj.hxx | 89
lotuswordpro/source/filter/xfilter/xfoutlinestyle.cxx | 131
lotuswordpro/source/filter/xfilter/xfoutlinestyle.hxx | 191
lotuswordpro/source/filter/xfilter/xfpadding.hxx | 210 +
lotuswordpro/source/filter/xfilter/xfpagecount.hxx | 89
lotuswordpro/source/filter/xfilter/xfpagemaster.cxx | 300 +
lotuswordpro/source/filter/xfilter/xfpagemaster.hxx | 168
lotuswordpro/source/filter/xfilter/xfpagenumber.hxx | 101
lotuswordpro/source/filter/xfilter/xfparagraph.cxx | 122
lotuswordpro/source/filter/xfilter/xfparagraph.hxx | 98
lotuswordpro/source/filter/xfilter/xfparastyle.cxx | 527 ++
lotuswordpro/source/filter/xfilter/xfparastyle.hxx | 364 +
lotuswordpro/source/filter/xfilter/xfplaceholder.hxx | 144
lotuswordpro/source/filter/xfilter/xfpoint.hxx | 106
lotuswordpro/source/filter/xfilter/xfpvector.hxx | 100
lotuswordpro/source/filter/xfilter/xfrect.hxx | 140
lotuswordpro/source/filter/xfilter/xfrow.cxx | 185
lotuswordpro/source/filter/xfilter/xfrow.hxx | 142
lotuswordpro/source/filter/xfilter/xfrowstyle.cxx | 128
lotuswordpro/source/filter/xfilter/xfrowstyle.hxx | 126
lotuswordpro/source/filter/xfilter/xfruby.hxx | 113
lotuswordpro/source/filter/xfilter/xfrubystyle.hxx | 143
lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx | 88
lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx | 100
lotuswordpro/source/filter/xfilter/xfsaxstream.cxx | 130
lotuswordpro/source/filter/xfilter/xfsaxstream.hxx | 137
lotuswordpro/source/filter/xfilter/xfsection.cxx | 155
lotuswordpro/source/filter/xfilter/xfsection.hxx | 120
lotuswordpro/source/filter/xfilter/xfsectionstyle.cxx | 156
lotuswordpro/source/filter/xfilter/xfsectionstyle.hxx | 106
lotuswordpro/source/filter/xfilter/xfshadow.cxx | 128
lotuswordpro/source/filter/xfilter/xfshadow.hxx | 157
lotuswordpro/source/filter/xfilter/xfstyle.cxx | 107
lotuswordpro/source/filter/xfilter/xfstyle.hxx | 121
lotuswordpro/source/filter/xfilter/xfstylecont.cxx | 299 +
lotuswordpro/source/filter/xfilter/xfstylecont.hxx | 139
lotuswordpro/source/filter/xfilter/xfstylefamily.hxx | 71
lotuswordpro/source/filter/xfilter/xfstylemanager.cxx | 387 +
lotuswordpro/source/filter/xfilter/xfstylemanager.hxx | 146
lotuswordpro/source/filter/xfilter/xfsubject.hxx | 85
lotuswordpro/source/filter/xfilter/xftable.cxx | 319 +
lotuswordpro/source/filter/xfilter/xftable.hxx | 171
lotuswordpro/source/filter/xfilter/xftablestyle.cxx | 139
lotuswordpro/source/filter/xfilter/xftablestyle.hxx | 155
lotuswordpro/source/filter/xfilter/xftabstop.hxx | 84
lotuswordpro/source/filter/xfilter/xftabstyle.cxx | 102
lotuswordpro/source/filter/xfilter/xftabstyle.hxx | 122
lotuswordpro/source/filter/xfilter/xftextboxstyle.cxx | 102
lotuswordpro/source/filter/xfilter/xftextboxstyle.hxx | 89
lotuswordpro/source/filter/xfilter/xftextcontent.cxx | 125
lotuswordpro/source/filter/xfilter/xftextcontent.hxx | 104
lotuswordpro/source/filter/xfilter/xftextheading.cxx | 108
lotuswordpro/source/filter/xfilter/xftextheading.hxx | 92
lotuswordpro/source/filter/xfilter/xftextspan.cxx | 191
lotuswordpro/source/filter/xfilter/xftextspan.hxx | 102
lotuswordpro/source/filter/xfilter/xftextstyle.cxx | 139
lotuswordpro/source/filter/xfilter/xftextstyle.hxx | 101
lotuswordpro/source/filter/xfilter/xftexttable.cxx | 142
lotuswordpro/source/filter/xfilter/xftexttable.hxx | 87
lotuswordpro/source/filter/xfilter/xftime.cxx | 89
lotuswordpro/source/filter/xfilter/xftime.hxx | 108
lotuswordpro/source/filter/xfilter/xftimestyle.cxx | 152
lotuswordpro/source/filter/xfilter/xftimestyle.hxx | 205 +
lotuswordpro/source/filter/xfilter/xftitle.hxx | 89
lotuswordpro/source/filter/xfilter/xfutil.cxx | 563 ++
lotuswordpro/source/filter/xfilter/xfutil.hxx | 121
lotuswordpro/util/lwpft.map | 8
lotuswordpro/util/makefile.mk | 37
425 files changed, 93445 insertions(+)
New commits:
commit d71476a444156d041eecd848adb3c541224f7bae
Author: Petr Mladek <pmladek at suse.cz>
Date: Fri Oct 8 17:06:15 2010 +0100
Fix filter issues
diff --git a/lotuswordpro/source/filter/lwpborderstuff.cxx b/lotuswordpro/source/filter/lwpborderstuff.cxx
index e6dfa72..9f7acc5 100644
--- a/lotuswordpro/source/filter/lwpborderstuff.cxx
+++ b/lotuswordpro/source/filter/lwpborderstuff.cxx
@@ -182,6 +182,9 @@ sal_uInt16 LwpBorderStuff::GetSideType(sal_uInt16 side)
return m_nBoderGroupIDBottom;
break;
}
+ // FIXME: this is needed to avoid warning: control reaches end of non-void function
+ // a better solution would be to enum value for the parameter side
+ return 0;
}
LwpColor LwpBorderStuff::GetSideColor(sal_uInt16 side)
@@ -201,6 +204,9 @@ LwpColor LwpBorderStuff::GetSideColor(sal_uInt16 side)
return m_aColorBottom;
break;
}
+ // FIXME: this is needed to avoid warning: control reaches end of non-void function
+ // a better solution would be to enum value for the parameter side
+ return LwpColor();
}
float LwpBorderStuff::GetSideWidth(sal_uInt16 side)
@@ -220,6 +226,9 @@ float LwpBorderStuff::GetSideWidth(sal_uInt16 side)
return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nWidthBottom));
break;
}
+ // FIXME: this is needed to avoid warning: control reaches end of non-void function
+ // a better solution would be to enum value for the parameter side
+ return 0;
}
void LwpBorderStuff::operator = (const LwpBorderStuff& rOther)
diff --git a/lotuswordpro/source/filter/lwpmargins.hxx b/lotuswordpro/source/filter/lwpmargins.hxx
index ac804a1..17aba19 100644
--- a/lotuswordpro/source/filter/lwpmargins.hxx
+++ b/lotuswordpro/source/filter/lwpmargins.hxx
@@ -113,5 +113,8 @@ inline double LwpMargins::GetMarginsValue(const sal_uInt8& nWhichSide)
return LwpTools::ConvertFromUnitsToMetric(m_nBottom);
break;
}
+ // FIXME: this is needed to avoid warning: control reaches end of non-void function
+ // a better solution would be to enum value for the parameter side
+ return 0;
}
-#endif
\ No newline at end of file
+#endif
diff --git a/lotuswordpro/source/filter/xfilter/xffontfactory.hxx b/lotuswordpro/source/filter/xfilter/xffontfactory.hxx
index 104888e..72ee9d2 100644
--- a/lotuswordpro/source/filter/xfilter/xffontfactory.hxx
+++ b/lotuswordpro/source/filter/xfilter/xffontfactory.hxx
@@ -80,8 +80,6 @@ public:
~XFFontFactory();
XFFontFactory(const XFFontFactory& other){}
- XFFontFactory operator=(XFFontFactory& other){}
-
public:
/**
* @descr Clear all fonts, this is called when load a file.
diff --git a/lotuswordpro/source/filter/xfilter/xfstylemanager.hxx b/lotuswordpro/source/filter/xfilter/xfstylemanager.hxx
index 2cab89a..bbf1a64 100644
--- a/lotuswordpro/source/filter/xfilter/xfstylemanager.hxx
+++ b/lotuswordpro/source/filter/xfilter/xfstylemanager.hxx
@@ -91,8 +91,6 @@ public:
~XFStyleManager();
XFStyleManager(XFStyleManager& other){}
- XFStyleManager operator=(XFStyleManager& other){}
-
public:
/**
* @descr clear all styles, called before load file.
diff --git a/lotuswordpro/source/filter/xfilter/xfutil.cxx b/lotuswordpro/source/filter/xfilter/xfutil.cxx
index 9755360..7b45a32 100644
--- a/lotuswordpro/source/filter/xfilter/xfutil.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfutil.cxx
@@ -288,7 +288,7 @@ rtl::OUString GetCrossoutName(enumXFCrossout type)
return A2OUSTR("X");
break;
}
-
+ return A2OUSTR("");
}
rtl::OUString GetTransformName(enumXFTransform type)
@@ -425,6 +425,7 @@ rtl::OUString GetFrameXRel(enumXFFrameXRel rel)
return A2OUSTR("frame-start-margin");
break;
}
+ return A2OUSTR("");
}
rtl::OUString GetFrameYPos(enumXFFrameYPos pos)
commit c0fe7ce4048d2d81e8823370a44337936b2e70f7
Author: Fong Lin <pflin at novell.com>
Date: Fri Oct 8 17:04:46 2010 +0100
Port of Lotus Word Pro filter, by Fong Lin and Noel Power
diff --git a/lotuswordpro/prj/build.lst b/lotuswordpro/prj/build.lst
new file mode 100644
index 0000000..64b2b2f
--- /dev/null
+++ b/lotuswordpro/prj/build.lst
@@ -0,0 +1,5 @@
+wp lotuswordpro : sfx2 sot svx comphelper NULL
+wp lotuswordpro usr1 - all lwp_mkout NULL
+wp lotuswordpro\source\filter nmake - all lwp_filter NULL
+wp lotuswordpro\source\filter\xfilter nmake - all lwp_xfilter NULL
+wp lotuswordpro\util nmake - all lwp_util lwp_filter lwp_xfilter NULL
diff --git a/lotuswordpro/prj/d.lst b/lotuswordpro/prj/d.lst
new file mode 100644
index 0000000..48efbc1
--- /dev/null
+++ b/lotuswordpro/prj/d.lst
@@ -0,0 +1,3 @@
+..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\*.so
+..\%__SRC%\bin\*.dll %_DEST%\lib%_EXT%\*.dll
+..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
diff --git a/lotuswordpro/source/filter/LotusWordProImportFilter.cxx b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
new file mode 100644
index 0000000..69e177e
--- /dev/null
+++ b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
@@ -0,0 +1,400 @@
+#include <osl/diagnose.h>
+#include <rtl/tencinfo.h>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <com/sun/star/xml/sax/XParser.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <xmloff/attrlist.hxx>
+
+#include <ucbhelper/content.hxx>
+
+#include <tools/stream.hxx>
+
+#include "LotusWordProImportFilter.hxx"
+
+#include <vector>
+
+#include "lwpfilter.hxx"
+
+using namespace ::rtl;
+using namespace com::sun::star;
+using rtl::OString;
+using rtl::OUStringBuffer;
+using rtl::OUString;
+using com::sun::star::uno::Sequence;
+using com::sun::star::lang::XComponent;
+using com::sun::star::uno::Any;
+using com::sun::star::uno::UNO_QUERY;
+using com::sun::star::uno::XInterface;
+using com::sun::star::uno::Exception;
+using com::sun::star::uno::RuntimeException;
+using com::sun::star::io::XInputStream;
+using com::sun::star::lang::XMultiServiceFactory;
+using com::sun::star::beans::PropertyValue;
+using com::sun::star::document::XFilter;
+using com::sun::star::document::XExtendedFilterDetection;
+using com::sun::star::ucb::XCommandEnvironment;
+
+using com::sun::star::document::XImporter;
+using com::sun::star::xml::sax::XAttributeList;
+using com::sun::star::xml::sax::XDocumentHandler;
+using com::sun::star::xml::sax::XParser;
+
+// W o r d P r o
+static const sal_Int8 header[] = { 0x57, 0x6f, 0x72, 0x64, 0x50, 0x72, 0x6f };
+
+const sal_Int32 MAXCHARS = 65534;
+
+ // Simple xml importer, currently the importer is very very simple
+ // it only extracts pure text from the wordpro file. Absolutely no formating
+ // information is currently imported.
+ // To reflect the current state of this importer the sax events sent
+ // to the document handler are also the simplest possible. In addition to
+ // the the basic attributes set up for the 'office:document' element
+ // all the imported text is inserted into 'text:p' elements.
+ // The parser extracts the pure text and creates simple a simple 'text:p'
+ // element to contain that text. In the event of the text exceeding
+ // MAXCHARS new 'text:p' elements are created as needed
+class SimpleXMLImporter
+{
+private:
+
+ uno::Reference< XDocumentHandler > m_xDocHandler;
+ std::vector< OUString > m_vStringChunks;
+ SvStream& m_InputStream;
+
+ bool CheckValidData( sal_Int8 nChar )
+ {
+ if( ( nChar >= 0x20 && nChar <= 0x7E ) && ( nChar != 0X40 ) )
+ return true;
+ return false;
+ }
+
+ void addAttribute( SvXMLAttributeList* pAttrList, const char* key, const char* val )
+ {
+ pAttrList->AddAttribute( OUString::createFromAscii( key ), OUString::createFromAscii( val ) );
+ }
+
+ void writeTextChunk( const OUString& sChunk )
+ {
+ SvXMLAttributeList *pAttrList = new SvXMLAttributeList();
+ uno::Reference < XAttributeList > xAttrList(pAttrList);
+
+ pAttrList->AddAttribute( OUString(RTL_CONSTASCII_USTRINGPARAM("text:style-name")), OUString(RTL_CONSTASCII_USTRINGPARAM("Standard")));
+
+ m_xDocHandler->startElement( OUString(RTL_CONSTASCII_USTRINGPARAM("text:p")), xAttrList );
+ m_xDocHandler->characters( sChunk );
+ m_xDocHandler->endElement( OUString(RTL_CONSTASCII_USTRINGPARAM("text:p") ) );
+ }
+
+ void writeDocContentPreamble()
+ {
+ SvXMLAttributeList *pDocContentPropList = new SvXMLAttributeList();
+ uno::Reference < XAttributeList > xDocContentList(pDocContentPropList);
+ addAttribute( pDocContentPropList, "xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0");
+ addAttribute( pDocContentPropList, "xmlns:text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:table", "urn:oasis:names:tc:opendocument:xmlns:table:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:draw", "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:fo", "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:xlink", "http://www.w3.org/1999/xlink" );
+ addAttribute( pDocContentPropList, "xmlns:dc", "http://purl.org/dc/elements/1.1/" );
+ addAttribute( pDocContentPropList, "xmlns:meta", "urn:oasis:names:tc:opendocument:xmlns:meta:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:number", "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:svg", "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:chart", "urn:oasis:names:tc:opendocument:xmlns:chart:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:dr3d", "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:math", "http://www.w3.org/1998/Math/MathML" );
+ addAttribute( pDocContentPropList, "xmlns:form", "urn:oasis:names:tc:opendocument:xmlns:form:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:script", "urn:oasis:names:tc:opendocument:xmlns:script:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:ooo", "http://openoffice.org/2004/office" );
+ addAttribute( pDocContentPropList, "xmlns:ooow", "http://openoffice.org/2004/writer" );
+ addAttribute( pDocContentPropList, "xmlns:oooc", "http://openoffice.org/2004/calc" );
+ addAttribute( pDocContentPropList, "xmlns:dom", "http://www.w3.org/2001/xml-events" );
+ addAttribute( pDocContentPropList, "xmlns:xforms", "http://www.w3.org/2002/xforms" );
+ addAttribute( pDocContentPropList, "xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
+ addAttribute( pDocContentPropList, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
+ addAttribute( pDocContentPropList, "office:version", "1.0");
+ m_xDocHandler->startElement(OUString(RTL_CONSTASCII_USTRINGPARAM("office:document-content" ) ), xDocContentList );
+ }
+
+ void parseDoc()
+ {
+ UINT8 nDelim, nDummy, nLen, nData;
+ UINT16 nOpcode;
+ int nCount = 0;
+ OUStringBuffer sBuf( MAXCHARS );
+ sal_Int32 nChars = 0;
+
+ while( !m_InputStream.IsEof())
+ {
+ m_InputStream >> nDelim;
+ if( nDelim == 0x40 )
+ {
+ m_InputStream >> nDummy >> nOpcode;
+ switch( nOpcode )
+ {
+ case 0xC00B: // Dictionary Word
+ m_InputStream >> nLen >> nDummy;
+ while( nLen > 0 && !m_InputStream.IsEof() )
+ {
+ UINT8 nChar;
+ m_InputStream >> nChar;
+ if( CheckValidData( nChar ) )
+ {
+ sBuf.appendAscii( (sal_Char*)(&nChar),1 );
+ if ( ++nChars >= MAXCHARS )
+ {
+ m_vStringChunks.push_back( sBuf.makeStringAndClear() );
+ nChars = 0;
+ }
+ }
+ nLen--;
+ }
+ break;
+
+ case 0x0242: // Non Dictionary word
+ m_InputStream >> nData;
+ if( nData == 0x02 )
+ {
+ m_InputStream >> nLen >> nDummy;
+ while( nLen > 0 && !m_InputStream.IsEof() )
+ {
+ m_InputStream >> nData;
+ if( CheckValidData( nData ) )
+ {
+ sBuf.appendAscii( (sal_Char*)(&nData),1 );
+ if ( ++nChars >= MAXCHARS )
+ {
+ m_vStringChunks.push_back( sBuf.makeStringAndClear() );
+ nChars = 0;
+ }
+ }
+ nLen--;
+ }
+ }
+ break;
+ }
+ }
+ }
+ if ( nChars )
+ m_vStringChunks.push_back( sBuf.makeStringAndClear() );
+ }
+
+ void writeXML()
+ {
+ if ( m_vStringChunks.size() )
+ {
+ m_xDocHandler->startDocument();
+ SvXMLAttributeList *pAttrList = new SvXMLAttributeList();
+ writeDocContentPreamble(); // writes "office:document-content" elem
+ uno::Reference < XAttributeList > xAttrList(pAttrList);
+
+ m_xDocHandler->startElement( OUString(RTL_CONSTASCII_USTRINGPARAM("office:body")), xAttrList );
+
+ // process strings imported
+ std::vector< OUString >::const_iterator it = m_vStringChunks.begin();
+ std::vector< OUString >::const_iterator it_end = m_vStringChunks.end();
+ for ( ; it!=it_end; ++it )
+ writeTextChunk( *it );
+
+ m_xDocHandler->endElement( OUString(RTL_CONSTASCII_USTRINGPARAM("office:body") ) );
+ m_xDocHandler->endElement( OUString(RTL_CONSTASCII_USTRINGPARAM("office:document-content")));
+ m_xDocHandler->endDocument();
+ }
+ }
+public:
+
+ SimpleXMLImporter( const uno::Reference< XDocumentHandler >& xDocHandler, SvStream& rStream ) : m_xDocHandler( xDocHandler ), m_InputStream( rStream ) {}
+
+ void import()
+ {
+ parseDoc();
+ writeXML();
+ }
+};
+
+sal_Bool SAL_CALL LotusWordProImportFilter::importImpl( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+ throw (RuntimeException)
+{
+
+ sal_Int32 nLength = aDescriptor.getLength();
+ const PropertyValue * pValue = aDescriptor.getConstArray();
+ OUString sURL;
+ uno::Reference < XInputStream > xInputStream;
+ for ( sal_Int32 i = 0 ; i < nLength; i++)
+ {
+ if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "InputStream" ) ) )
+ pValue[i].Value >>= xInputStream;
+ else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "URL" ) ) )
+ pValue[i].Value >>= sURL;
+ rtl_TextEncoding encoding = RTL_TEXTENCODING_INFO_ASCII;
+ }
+ if ( !xInputStream.is() )
+ {
+ OSL_ASSERT( 0 );
+ return sal_False;
+ }
+
+ OString sFileName;
+ sFileName = OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII);
+
+ SvFileStream inputStream( sURL, STREAM_READ );
+ if ( inputStream.IsEof() || ( inputStream.GetError() != SVSTREAM_OK ) )
+ return sal_False;
+
+ // An XML import service: what we push sax messages to..
+ OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.XMLImporter" ) );
+
+ uno::Reference< XDocumentHandler > xInternalHandler( mxMSF->createInstance( sXMLImportService ), UNO_QUERY );
+ uno::Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY);
+ xImporter->setTargetDocument(mxDoc);
+/*
+ SimpleXMLImporter xmlImporter( xInternalHandler, inputStream );
+ xmlImporter.import();
+ return sal_True;
+*/
+ return ( ReadWordproFile( &inputStream, xInternalHandler) == 0 );
+
+}
+
+sal_Bool SAL_CALL LotusWordProImportFilter::filter( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+ throw (RuntimeException)
+{
+ return importImpl ( aDescriptor );
+}
+void SAL_CALL LotusWordProImportFilter::cancel( )
+ throw (RuntimeException)
+{
+}
+
+// XImporter
+void SAL_CALL LotusWordProImportFilter::setTargetDocument( const uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
+ throw (::com::sun::star::lang::IllegalArgumentException, RuntimeException)
+{
+ meType = FILTER_IMPORT;
+ mxDoc = xDoc;
+}
+
+// XExtendedFilterDetection
+OUString SAL_CALL LotusWordProImportFilter::detect( com::sun::star::uno::Sequence< PropertyValue >& Descriptor )
+ throw( com::sun::star::uno::RuntimeException )
+{
+
+ OUString sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( "" ) );
+ sal_Int32 nLength = Descriptor.getLength();
+ sal_Int32 location = nLength;
+ OUString sURL;
+ const PropertyValue * pValue = Descriptor.getConstArray();
+ uno::Reference < XInputStream > xInputStream;
+ for ( sal_Int32 i = 0 ; i < nLength; i++)
+ {
+ if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "TypeName" ) ) )
+ location=i;
+ else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "InputStream" ) ) )
+ pValue[i].Value >>= xInputStream;
+ else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "URL" ) ) )
+ pValue[i].Value >>= sURL;
+
+ rtl_TextEncoding encoding = RTL_TEXTENCODING_INFO_ASCII;
+ }
+
+ uno::Reference< com::sun::star::ucb::XCommandEnvironment > xEnv;
+ if (!xInputStream.is())
+ {
+ try
+ {
+ ::ucbhelper::Content aContent(sURL, xEnv);
+ xInputStream = aContent.openStream();
+ }
+ catch ( Exception& )
+ {
+ return ::rtl::OUString();
+ }
+
+ if (!xInputStream.is())
+ return ::rtl::OUString();
+ }
+
+ Sequence< ::sal_Int8 > aData;
+ sal_Int32 nLen = sizeof( header ) / sizeof( header[0] );
+ if ( ( nLen == xInputStream->readBytes( aData, nLen ) ) )
+ if ( memcmp( ( void* )header, (void*) aData.getConstArray(), nLen ) == 0 )
+ sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( "writer_LotusWordPro_Document" ) );
+ return sTypeName;
+}
+
+
+// XInitialization
+void SAL_CALL LotusWordProImportFilter::initialize( const Sequence< Any >& aArguments )
+ throw (Exception, RuntimeException)
+{
+ Sequence < PropertyValue > aAnySeq;
+ sal_Int32 nLength = aArguments.getLength();
+ if ( nLength && ( aArguments[0] >>= aAnySeq ) )
+ {
+ const PropertyValue * pValue = aAnySeq.getConstArray();
+ nLength = aAnySeq.getLength();
+ for ( sal_Int32 i = 0 ; i < nLength; i++)
+ {
+ if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "Type" ) ) )
+ {
+ pValue[i].Value >>= msFilterName;
+ break;
+ }
+ }
+ }
+}
+OUString LotusWordProImportFilter_getImplementationName ()
+ throw (RuntimeException)
+{
+ return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.LotusWordProImportFilter" ) );
+}
+
+#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
+#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
+sal_Bool SAL_CALL LotusWordProImportFilter_supportsService( const OUString& ServiceName )
+ throw (RuntimeException)
+{
+ return (ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME1 ) ) ||
+ ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME2 ) ) );
+}
+Sequence< OUString > SAL_CALL LotusWordProImportFilter_getSupportedServiceNames( )
+ throw (RuntimeException)
+{
+ Sequence < OUString > aRet(2);
+// Sequence < OUString > aRet(1);
+ OUString* pArray = aRet.getArray();
+ pArray[0] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME1 ) );
+ pArray[1] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME2 ) );
+ return aRet;
+}
+#undef SERVICE_NAME2
+#undef SERVICE_NAME1
+
+uno::Reference< XInterface > SAL_CALL LotusWordProImportFilter_createInstance( const uno::Reference< XMultiServiceFactory > & rSMgr)
+ throw( Exception )
+{
+ return (cppu::OWeakObject*) new LotusWordProImportFilter( rSMgr );
+}
+
+// XServiceInfo
+OUString SAL_CALL LotusWordProImportFilter::getImplementationName( )
+ throw (RuntimeException)
+{
+ return LotusWordProImportFilter_getImplementationName();
+}
+sal_Bool SAL_CALL LotusWordProImportFilter::supportsService( const OUString& rServiceName )
+ throw (RuntimeException)
+{
+ return LotusWordProImportFilter_supportsService( rServiceName );
+}
+Sequence< OUString > SAL_CALL LotusWordProImportFilter::getSupportedServiceNames( )
+ throw (RuntimeException)
+{
+ return LotusWordProImportFilter_getSupportedServiceNames();
+}
diff --git a/lotuswordpro/source/filter/LotusWordProImportFilter.cxx.orig b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx.orig
new file mode 100644
index 0000000..481e214
--- /dev/null
+++ b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx.orig
@@ -0,0 +1,396 @@
+#include <osl/diagnose.h>
+#include <rtl/tencinfo.h>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <com/sun/star/xml/sax/XParser.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <xmloff/attrlist.hxx>
+
+#include <ucbhelper/content.hxx>
+
+#include <tools/stream.hxx>
+
+#include "LotusWordProImportFilter.hxx"
+
+#include <vector>
+
+using namespace ::rtl;
+using namespace com::sun::star;
+using rtl::OString;
+using rtl::OUStringBuffer;
+using rtl::OUString;
+using com::sun::star::uno::Sequence;
+using com::sun::star::lang::XComponent;
+using com::sun::star::uno::Any;
+using com::sun::star::uno::UNO_QUERY;
+using com::sun::star::uno::XInterface;
+using com::sun::star::uno::Exception;
+using com::sun::star::uno::RuntimeException;
+using com::sun::star::io::XInputStream;
+using com::sun::star::lang::XMultiServiceFactory;
+using com::sun::star::beans::PropertyValue;
+using com::sun::star::document::XFilter;
+using com::sun::star::document::XExtendedFilterDetection;
+using com::sun::star::ucb::XCommandEnvironment;
+
+using com::sun::star::document::XImporter;
+using com::sun::star::xml::sax::XAttributeList;
+using com::sun::star::xml::sax::XDocumentHandler;
+using com::sun::star::xml::sax::XParser;
+
+// W o r d P r o
+static const sal_Int8 header[] = { 0x57, 0x6f, 0x72, 0x64, 0x50, 0x72, 0x6f };
+
+const sal_Int32 MAXCHARS = 65534;
+
+ // Simple xml importer, currently the importer is very very simple
+ // it only extracts pure text from the wordpro file. Absolutely no formating
+ // information is currently imported.
+ // To reflect the current state of this importer the sax events sent
+ // to the document handler are also the simplest possible. In addition to
+ // the the basic attributes set up for the 'office:document' element
+ // all the imported text is inserted into 'text:p' elements.
+ // The parser extracts the pure text and creates simple a simple 'text:p'
+ // element to contain that text. In the event of the text exceeding
+ // MAXCHARS new 'text:p' elements are created as needed
+class SimpleXMLImporter
+{
+private:
+
+ uno::Reference< XDocumentHandler > m_xDocHandler;
+ std::vector< OUString > m_vStringChunks;
+ SvStream& m_InputStream;
+
+ bool CheckValidData( sal_Int8 nChar )
+ {
+ if( ( nChar >= 0x20 && nChar <= 0x7E ) && ( nChar != 0X40 ) )
+ return true;
+ return false;
+ }
+
+ void addAttribute( SvXMLAttributeList* pAttrList, const char* key, const char* val )
+ {
+ pAttrList->AddAttribute( OUString::createFromAscii( key ), OUString::createFromAscii( val ) );
+ }
+
+ void writeTextChunk( const OUString& sChunk )
+ {
+ SvXMLAttributeList *pAttrList = new SvXMLAttributeList();
+ uno::Reference < XAttributeList > xAttrList(pAttrList);
+
+ pAttrList->AddAttribute( OUString(RTL_CONSTASCII_USTRINGPARAM("text:style-name")), OUString(RTL_CONSTASCII_USTRINGPARAM("Standard")));
+
+ m_xDocHandler->startElement( OUString(RTL_CONSTASCII_USTRINGPARAM("text:p")), xAttrList );
+ m_xDocHandler->characters( sChunk );
+ m_xDocHandler->endElement( OUString(RTL_CONSTASCII_USTRINGPARAM("text:p") ) );
+ }
+
+ void writeDocContentPreamble()
+ {
+ SvXMLAttributeList *pDocContentPropList = new SvXMLAttributeList();
+ uno::Reference < XAttributeList > xDocContentList(pDocContentPropList);
+ addAttribute( pDocContentPropList, "xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0");
+ addAttribute( pDocContentPropList, "xmlns:text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:table", "urn:oasis:names:tc:opendocument:xmlns:table:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:draw", "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:fo", "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:xlink", "http://www.w3.org/1999/xlink" );
+ addAttribute( pDocContentPropList, "xmlns:dc", "http://purl.org/dc/elements/1.1/" );
+ addAttribute( pDocContentPropList, "xmlns:meta", "urn:oasis:names:tc:opendocument:xmlns:meta:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:number", "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:svg", "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:chart", "urn:oasis:names:tc:opendocument:xmlns:chart:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:dr3d", "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:math", "http://www.w3.org/1998/Math/MathML" );
+ addAttribute( pDocContentPropList, "xmlns:form", "urn:oasis:names:tc:opendocument:xmlns:form:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:script", "urn:oasis:names:tc:opendocument:xmlns:script:1.0" );
+ addAttribute( pDocContentPropList, "xmlns:ooo", "http://openoffice.org/2004/office" );
+ addAttribute( pDocContentPropList, "xmlns:ooow", "http://openoffice.org/2004/writer" );
+ addAttribute( pDocContentPropList, "xmlns:oooc", "http://openoffice.org/2004/calc" );
+ addAttribute( pDocContentPropList, "xmlns:dom", "http://www.w3.org/2001/xml-events" );
+ addAttribute( pDocContentPropList, "xmlns:xforms", "http://www.w3.org/2002/xforms" );
+ addAttribute( pDocContentPropList, "xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
+ addAttribute( pDocContentPropList, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
+ addAttribute( pDocContentPropList, "office:version", "1.0");
+ m_xDocHandler->startElement(OUString(RTL_CONSTASCII_USTRINGPARAM("office:document-content" ) ), xDocContentList );
+ }
+
+ void parseDoc()
+ {
+ UINT8 nDelim, nDummy, nLen, nData;
+ UINT16 nOpcode;
+ int nCount = 0;
+ OUStringBuffer sBuf( MAXCHARS );
+ sal_Int32 nChars = 0;
+
+ while( !m_InputStream.IsEof())
+ {
+ m_InputStream >> nDelim;
+ if( nDelim == 0x40 )
+ {
+ m_InputStream >> nDummy >> nOpcode;
+ switch( nOpcode )
+ {
+ case 0xC00B: // Dictionary Word
+ m_InputStream >> nLen >> nDummy;
+ while( nLen > 0 && !m_InputStream.IsEof() )
+ {
+ UINT8 nChar;
+ m_InputStream >> nChar;
+ if( CheckValidData( nChar ) )
+ {
+ sBuf.appendAscii( (sal_Char*)(&nChar),1 );
+ if ( ++nChars >= MAXCHARS )
+ {
+ m_vStringChunks.push_back( sBuf.makeStringAndClear() );
+ nChars = 0;
+ }
+ }
+ nLen--;
+ }
+ break;
+
+ case 0x0242: // Non Dictionary word
+ m_InputStream >> nData;
+ if( nData == 0x02 )
+ {
+ m_InputStream >> nLen >> nDummy;
+ while( nLen > 0 && !m_InputStream.IsEof() )
+ {
+ m_InputStream >> nData;
+ if( CheckValidData( nData ) )
+ {
+ sBuf.appendAscii( (sal_Char*)(&nData),1 );
+ if ( ++nChars >= MAXCHARS )
+ {
+ m_vStringChunks.push_back( sBuf.makeStringAndClear() );
+ nChars = 0;
+ }
+ }
+ nLen--;
+ }
+ }
+ break;
+ }
+ }
+ }
+ if ( nChars )
+ m_vStringChunks.push_back( sBuf.makeStringAndClear() );
+ }
+
+ void writeXML()
+ {
+ if ( m_vStringChunks.size() )
+ {
+ m_xDocHandler->startDocument();
+ SvXMLAttributeList *pAttrList = new SvXMLAttributeList();
+ writeDocContentPreamble(); // writes "office:document-content" elem
+ uno::Reference < XAttributeList > xAttrList(pAttrList);
+
+ m_xDocHandler->startElement( OUString(RTL_CONSTASCII_USTRINGPARAM("office:body")), xAttrList );
+
+ // process strings imported
+ std::vector< OUString >::const_iterator it = m_vStringChunks.begin();
+ std::vector< OUString >::const_iterator it_end = m_vStringChunks.end();
+ for ( ; it!=it_end; ++it )
+ writeTextChunk( *it );
+
+ m_xDocHandler->endElement( OUString(RTL_CONSTASCII_USTRINGPARAM("office:body") ) );
+ m_xDocHandler->endElement( OUString(RTL_CONSTASCII_USTRINGPARAM("office:document-content")));
+ m_xDocHandler->endDocument();
+ }
+ }
+public:
+
+ SimpleXMLImporter( const uno::Reference< XDocumentHandler >& xDocHandler, SvStream& rStream ) : m_xDocHandler( xDocHandler ), m_InputStream( rStream ) {}
+
+ void import()
+ {
+ parseDoc();
+ writeXML();
+ }
+};
+
+sal_Bool SAL_CALL LotusWordProImportFilter::importImpl( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+ throw (RuntimeException)
+{
+
+ sal_Int32 nLength = aDescriptor.getLength();
+ const PropertyValue * pValue = aDescriptor.getConstArray();
+ OUString sURL;
+ uno::Reference < XInputStream > xInputStream;
+ for ( sal_Int32 i = 0 ; i < nLength; i++)
+ {
+ if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "InputStream" ) ) )
+ pValue[i].Value >>= xInputStream;
+ else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "URL" ) ) )
+ pValue[i].Value >>= sURL;
+ rtl_TextEncoding encoding = RTL_TEXTENCODING_INFO_ASCII;
+ }
+ if ( !xInputStream.is() )
+ {
+ OSL_ASSERT( 0 );
+ return sal_False;
+ }
+
+ OString sFileName;
+ sFileName = OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII);
+
+ SvFileStream inputStream( sURL, STREAM_READ );
+ if ( inputStream.IsEof() || ( inputStream.GetError() != SVSTREAM_OK ) )
+ return sal_False;
+
+ // An XML import service: what we push sax messages to..
+ OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.XMLImporter" ) );
+
+ uno::Reference< XDocumentHandler > xInternalHandler( mxMSF->createInstance( sXMLImportService ), UNO_QUERY );
+ uno::Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY);
+ xImporter->setTargetDocument(mxDoc);
+
+ SimpleXMLImporter xmlImporter( xInternalHandler, inputStream );
+ xmlImporter.import();
+
+ return sal_True;
+}
+
+sal_Bool SAL_CALL LotusWordProImportFilter::filter( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+ throw (RuntimeException)
+{
+ return importImpl ( aDescriptor );
+}
+void SAL_CALL LotusWordProImportFilter::cancel( )
+ throw (RuntimeException)
+{
+}
+
+// XImporter
+void SAL_CALL LotusWordProImportFilter::setTargetDocument( const uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
+ throw (::com::sun::star::lang::IllegalArgumentException, RuntimeException)
+{
+ meType = FILTER_IMPORT;
+ mxDoc = xDoc;
+}
+
+// XExtendedFilterDetection
+OUString SAL_CALL LotusWordProImportFilter::detect( com::sun::star::uno::Sequence< PropertyValue >& Descriptor )
+ throw( com::sun::star::uno::RuntimeException )
+{
+
+ OUString sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( "" ) );
+ sal_Int32 nLength = Descriptor.getLength();
+ sal_Int32 location = nLength;
+ OUString sURL;
+ const PropertyValue * pValue = Descriptor.getConstArray();
+ uno::Reference < XInputStream > xInputStream;
+ for ( sal_Int32 i = 0 ; i < nLength; i++)
+ {
+ if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "TypeName" ) ) )
+ location=i;
+ else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "InputStream" ) ) )
+ pValue[i].Value >>= xInputStream;
+ else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "URL" ) ) )
+ pValue[i].Value >>= sURL;
+
+ rtl_TextEncoding encoding = RTL_TEXTENCODING_INFO_ASCII;
+ }
+
+ uno::Reference< com::sun::star::ucb::XCommandEnvironment > xEnv;
+ if (!xInputStream.is())
+ {
+ try
+ {
+ ::ucbhelper::Content aContent(sURL, xEnv);
+ xInputStream = aContent.openStream();
+ }
+ catch ( Exception& )
+ {
+ return ::rtl::OUString();
+ }
+
+ if (!xInputStream.is())
+ return ::rtl::OUString();
+ }
+
+ Sequence< ::sal_Int8 > aData;
+ sal_Int32 nLen = sizeof( header ) / sizeof( header[0] );
+ if ( ( nLen == xInputStream->readBytes( aData, nLen ) ) )
+ if ( memcmp( ( void* )header, (void*) aData.getConstArray(), nLen ) == 0 )
+ sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( "writer_LotusWordPro_Document" ) );
+ return sTypeName;
+}
+
+
+// XInitialization
+void SAL_CALL LotusWordProImportFilter::initialize( const Sequence< Any >& aArguments )
+ throw (Exception, RuntimeException)
+{
+ Sequence < PropertyValue > aAnySeq;
+ sal_Int32 nLength = aArguments.getLength();
+ if ( nLength && ( aArguments[0] >>= aAnySeq ) )
+ {
+ const PropertyValue * pValue = aAnySeq.getConstArray();
+ nLength = aAnySeq.getLength();
+ for ( sal_Int32 i = 0 ; i < nLength; i++)
+ {
+ if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "Type" ) ) )
+ {
+ pValue[i].Value >>= msFilterName;
+ break;
+ }
+ }
+ }
+}
+OUString LotusWordProImportFilter_getImplementationName ()
+ throw (RuntimeException)
+{
+ return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.LotusWordProImportFilter" ) );
+}
+
+#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
+#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
+sal_Bool SAL_CALL LotusWordProImportFilter_supportsService( const OUString& ServiceName )
+ throw (RuntimeException)
+{
+ return (ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME1 ) ) ||
+ ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME2 ) ) );
+}
+Sequence< OUString > SAL_CALL LotusWordProImportFilter_getSupportedServiceNames( )
+ throw (RuntimeException)
+{
+ Sequence < OUString > aRet(2);
+// Sequence < OUString > aRet(1);
+ OUString* pArray = aRet.getArray();
+ pArray[0] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME1 ) );
+ pArray[1] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME2 ) );
+ return aRet;
+}
+#undef SERVICE_NAME2
+#undef SERVICE_NAME1
+
+uno::Reference< XInterface > SAL_CALL LotusWordProImportFilter_createInstance( const uno::Reference< XMultiServiceFactory > & rSMgr)
+ throw( Exception )
+{
+ return (cppu::OWeakObject*) new LotusWordProImportFilter( rSMgr );
+}
+
+// XServiceInfo
+OUString SAL_CALL LotusWordProImportFilter::getImplementationName( )
+ throw (RuntimeException)
+{
+ return LotusWordProImportFilter_getImplementationName();
+}
+sal_Bool SAL_CALL LotusWordProImportFilter::supportsService( const OUString& rServiceName )
+ throw (RuntimeException)
+{
+ return LotusWordProImportFilter_supportsService( rServiceName );
+}
+Sequence< OUString > SAL_CALL LotusWordProImportFilter::getSupportedServiceNames( )
+ throw (RuntimeException)
+{
+ return LotusWordProImportFilter_getSupportedServiceNames();
+}
diff --git a/lotuswordpro/source/filter/LotusWordProImportFilter.hxx b/lotuswordpro/source/filter/LotusWordProImportFilter.hxx
new file mode 100644
index 0000000..93f700a
--- /dev/null
+++ b/lotuswordpro/source/filter/LotusWordProImportFilter.hxx
@@ -0,0 +1,90 @@
+#ifndef _WORDPERFECTIMPORTFILTER_HXX
+#define _WORDPERFECTIMPORTFILTER_HXX
+
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
+#include <com/sun/star/document/XExtendedFilterDetection.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <cppuhelper/implbase5.hxx>
+#include <rtl/ustrbuf.hxx>
+
+enum FilterType
+{
+ FILTER_IMPORT,
+ FILTER_EXPORT
+};
+/* This component will be instantiated for both import or export. Whether it calls
+ * setSourceDocument or setTargetDocument determines which Impl function the filter
+ * member calls */
+class LotusWordProImportFilter : public cppu::WeakImplHelper5
+<
+ com::sun::star::document::XFilter,
+ com::sun::star::document::XImporter,
+ com::sun::star::document::XExtendedFilterDetection,
+ com::sun::star::lang::XInitialization,
+ com::sun::star::lang::XServiceInfo
+>
+{
+private:
+
+protected:
+ // oo.org declares
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc;
+ ::rtl::OUString msFilterName;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler;
+
+ FilterType meType;
+
+ sal_Bool SAL_CALL importImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+ throw (::com::sun::star::uno::RuntimeException);
+
+public:
+ LotusWordProImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF)
+ : mxMSF( rxMSF ) {}
+ virtual ~LotusWordProImportFilter() {}
+
+ // XFilter
+ virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL cancel( )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // XImporter
+ virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ //XExtendedFilterDetection
+ virtual ::rtl::OUString SAL_CALL detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& Descriptor )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
+ throw (::com::sun::star::uno::RuntimeException);
+
+};
+
+::rtl::OUString LotusWordProImportFilter_getImplementationName()
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+sal_Bool SAL_CALL LotusWordProImportFilter_supportsService( const ::rtl::OUString& ServiceName )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL LotusWordProImportFilter_getSupportedServiceNames( )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+SAL_CALL LotusWordProImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr)
+ throw ( ::com::sun::star::uno::Exception );
+
+#endif
diff --git a/lotuswordpro/source/filter/bencont.cxx b/lotuswordpro/source/filter/bencont.cxx
new file mode 100644
index 0000000..895367f
--- /dev/null
+++ b/lotuswordpro/source/filter/bencont.cxx
@@ -0,0 +1,716 @@
+/*************************************************************************
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: IBM Corporation
+ *
+ * Copyright: 2008 by IBM Corporation
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "first.hxx"
+#include "assert.h"
+#include <stdio.h>
+#include <sot/storinfo.hxx>
+namespace OpenStormBento
+{
+
+// String definitions
+const char gsBenMagicBytes[] = BEN_MAGIC_BYTES;
+
+/**
+* New bento container from file stream
+* @param pointer to length of bento file
+* @param pointer to pointer of Bento Container object
+* @return error code
+*/
+ULONG BenOpenContainer(LwpSvStream * pStream, pLtcBenContainer * ppContainer)
+{
+ BenError Err;
+
+ *ppContainer = NULL;
+
+ if (NULL == pStream)
+ {
+ return BenErr_ContainerWithNoObjects;
+ }
+
+ pLtcBenContainer pContainer = new LtcBenContainer(pStream);
+ if ((Err = pContainer->Open()) != BenErr_OK) // delete two inputs
+ {
+ delete pContainer;
+ return BenErr_InvalidTOC;
+ }
+
+ *ppContainer = pContainer;
+ return BenErr_OK;
+}
+BenError
+LtcBenContainer::Close()
+{
+ return BenErr_OK;
+}
+
+LtcBenContainer::~LtcBenContainer()
+{
+ Close();
+}
+
+BenError
+LtcBenContainer::Open() // delete two inputs
+{
+ BenError Err;
+ CBenTOCReader TOCReader(this);
+ if ((Err = TOCReader.ReadLabelAndTOC()) != BenErr_OK)
+ {
+ return Err;
+ }
+ return BenErr_OK;
+}
+
+void
+LtcBenContainer::Release()
+{
+ delete this;
+}
+
+BenError
+LtcBenContainer::RegisterPropertyName(const char * sPropertyName,
+ pCBenPropertyName * ppPropertyName)
+{
+ pCBenNamedObjectListElmt pPrevNamedObjectListElmt;
+ pCBenNamedObject pNamedObject = FindNamedObject(&cNamedObjects,
+ sPropertyName, &pPrevNamedObjectListElmt);
+
+ if (pNamedObject != NULL)
+ {
+ if (! pNamedObject->IsPropertyName())
+ return BenErr_NameConflict;
+ else *ppPropertyName = (pCBenPropertyName) pNamedObject;
+ }
+ else
+ {
+ pCBenIDListElmt pPrevObject;
+ if (FindID(&cObjects, cNextAvailObjectID, &pPrevObject) != NULL)
+ return BenErr_DuplicateObjectID;
+
+ *ppPropertyName = new CBenPropertyName(this, cNextAvailObjectID,
+ (pCBenObject) pPrevObject, sPropertyName, pPrevNamedObjectListElmt);
+ ++cNextAvailObjectID;
+ }
+
+ return BenErr_OK;
+}
+
+BenError
+LtcBenContainer::RegisterTypeName(const char * sTypeName,
+ pCBenTypeName * ppTypeName)
+{
+ pCBenNamedObjectListElmt pPrevNamedObjectListElmt;
+ pCBenNamedObject pNamedObject = FindNamedObject(&cNamedObjects, sTypeName,
+ &pPrevNamedObjectListElmt);
+
+ if (pNamedObject != NULL)
+ {
+ if (! pNamedObject->IsTypeName())
+ return BenErr_NameConflict;
+ else *ppTypeName = (pCBenTypeName) pNamedObject;
+ }
+ else
+ {
+ pCBenIDListElmt pPrevObject;
+ if (FindID(&cObjects, cNextAvailObjectID, &pPrevObject) != NULL)
+ return BenErr_DuplicateObjectID;
+
+ *ppTypeName = new CBenTypeName(this, cNextAvailObjectID,
+ (pCBenObject) pPrevObject, sTypeName, pPrevNamedObjectListElmt);
+ ++cNextAvailObjectID;
+ }
+
+ return BenErr_OK;
+}
+
+BenError
+LtcBenContainer::NewObject(pCBenObject * ppBenObject)
+{
+ pCBenIDListElmt pPrev;
+ if (FindID(&cObjects, cNextAvailObjectID, &pPrev) != NULL)
+ return BenErr_DuplicateObjectID;
+
+ *ppBenObject = new CBenObject(this, cNextAvailObjectID, pPrev);
+
+ ++cNextAvailObjectID;
+ return BenErr_OK;
+}
+
+pCBenObject
+LtcBenContainer::GetNextObject(pCBenObject pCurrObject)
+{
+ return (pCBenObject) cObjects.GetNextOrNULL(pCurrObject);
+}
+
+pCBenObject
+LtcBenContainer::FindNextObjectWithProperty(pCBenObject pCurrObject,
+ BenObjectID PropertyID)
+{
+ while ((pCurrObject = GetNextObject(pCurrObject)) != NULL)
+ if (pCurrObject->UseProperty(PropertyID) != NULL)
+ return pCurrObject;
+
+ return NULL;
+}
+
+pCBenObject
+LtcBenContainer::FindObject(BenObjectID ObjectID)
+{
+ return (pCBenObject) FindID(&cObjects, ObjectID, NULL);
+}
+
+/**
+* Construction
+* @param Bento file stream pointer
+* @return
+*/
+LtcBenContainer::LtcBenContainer(LwpSvStream * pStream)
+{
+ cpStream = pStream;
+ pStream->Seek(STREAM_SEEK_TO_END);
+ m_ulLength = pStream->Tell();
+ pStream->Seek(STREAM_SEEK_TO_BEGIN);
+}
+
+/**
+* Read buffer fro bento file with specified buffer
+* @date 07/05/2004
+* @param buffer pointer
+* @param buffer size
+* @param number of bytes read
+* @return BenError
+*/
+BenError LtcBenContainer::Read(BenDataPtr pBuffer, unsigned long MaxSize,
+ unsigned long * pAmtRead)
+{
+ *pAmtRead = cpStream->Read(pBuffer, MaxSize);
+ return BenErr_OK;
+}
+/**
+* Read buffer from bento file with specified size
+* @date 07/05/2004
+* @param buffer pointer
+* @param number of bytes to be read
+* @return BenError
+*/
+BenError LtcBenContainer::ReadKnownSize(BenDataPtr pBuffer, unsigned long Amt)
+{
+ ULONG ulLength;
+ ulLength = cpStream->Read(pBuffer, Amt);
+ if(ulLength == Amt)
+ {
+ return BenErr_OK;
+ }
+ return BenErr_ReadPastEndOfContainer;
+}
+/**
+* Seek to position from the beginning of the bento file
+* @date 07/05/2004
+* @param position in container file from beginning
+* @return BenError
+*/
+BenError LtcBenContainer::SeekToPosition(BenContainerPos Pos)
+{
+ cpStream->Seek(Pos);
+ return BenErr_OK;
+}
+/**
+* Seek to position compare to end of bento file
+* @date 07/05/2004
+* @param position in container file from end
+* @return BenError
+*/
+BenError LtcBenContainer::SeekFromEnd(long Offset)
+{
+ cpStream->Seek(STREAM_SEEK_TO_END);
+ cpStream->SeekRel(Offset);
+
+ return BenErr_OK;
+}
+/**
+* Get position in the bento file
+* @date 07/05/2004
+* @param pointer of current position in container file from end
+* @return BenError
+*/
+BenError LtcBenContainer::GetPosition(BenContainerPos * pPosition)
+{
+ *pPosition = cpStream->Tell();
+ return BenErr_OK;
+}
+/**
+* Find the next value stream with property name
+* @date 07/05/2004
+* @param string of property name
+* @param current value stream pointer with the property name
+* @return next value stream pointer with the property names
+*/
+LtcUtBenValueStream * LtcBenContainer::FindNextValueStreamWithPropertyName(const char * sPropertyName, LtcUtBenValueStream * pCurrentValueStream)
+{
+ CBenPropertyName * pPropertyName;
+ RegisterPropertyName(sPropertyName, &pPropertyName); // Get property name object
+
+ if (NULL == pPropertyName)
+ return NULL; // Property not exist
+
+ // Get current object
+ CBenObject * pObj = NULL;
+ if (pCurrentValueStream != NULL)
+ {
+ pObj = pCurrentValueStream->GetValue()->GetProperty()->GetBenObject();
+ }
+
+
+ pObj =FindNextObjectWithProperty(pObj, pPropertyName->GetID()); // Get next object with same property name
+ if (NULL == pObj)
+ return NULL;
+
+ CBenValue * pValue;
+ LtcUtBenValueStream * pValueStream;
+
+ pValue = pObj->UseValue(pPropertyName->GetID());
+
+ pValueStream = new LtcUtBenValueStream(pValue);
+
+ return pValueStream;
+}
+
+/**
+* Find the unique value stream with property name
+* @date 07/05/2004
+* @param string of property name
+* @return the only value stream pointer with the property names
+*/
+LtcUtBenValueStream * LtcBenContainer::FindValueStreamWithPropertyName(const char * sPropertyName)
+{
+ return FindNextValueStreamWithPropertyName(sPropertyName, NULL);
+}
+/**
+* Find the unique value stream with property name and Object ID
+* @date 10/24/2005
+* @param object ID
+* @param string of property name
+* @return the only value stream pointer with the property names
+*/
+LtcUtBenValueStream * LtcBenContainer::FindObjectValueStreamWithObjectIDAndProperty(BenObjectID ObjectID, const char * sPropertyName)
+{
+ CBenPropertyName * pPropertyName;
+ RegisterPropertyName(sPropertyName, &pPropertyName); // Get property name object
+ if (NULL == pPropertyName)
+ return NULL; // Property not exist
+ // Get current object
+ CBenObject * pObj = NULL;
+ pObj = FindObject(ObjectID); // Get object with object ID
+ if (NULL == pObj)
+ return NULL;
+ CBenValue * pValue;
+ LtcUtBenValueStream * pValueStream;
+ pValue = pObj->UseValue(pPropertyName->GetID());
+ pValueStream = new LtcUtBenValueStream(pValue);
+ return pValueStream;
+}
+/**
+* <description>
+* @date 07/05/2004
+* @param pointer to length of bento file
+* @return BenError
+*/
+BenError LtcBenContainer::GetSize(ULONG * pLength)
+{
+ *pLength = m_ulLength;
+ return BenErr_OK;
+}
+
+sal_uInt32 GetSvStreamSize(SvStream * pStream)
+{
+ sal_uInt32 nCurPos = pStream->Tell();
+ pStream->Seek(STREAM_SEEK_TO_END);
+ sal_uInt32 ulLength = pStream->Tell();
+ pStream->Seek(nCurPos);
+
+ return ulLength;
+}
+/**
+* Find hazily according to part of property name
+* @date 01/31/2005
+* @param
+* @return the value stream pointers vector with the property names
+*/
+BenError LtcBenContainer::CreateGraphicStreams(std::vector<SvStream *> * pStreamVector)
+{
+ /* traverse all named objects to find all the graphic property names */
+ CBenObject * pObj= NULL;
+ char *pName;
+ std::vector<std::string> aGrPropertyVector ;
+ while(pObj = GetNextObject(pObj) )
+ {
+ if(pObj->IsNamedObject())
+ {
+ CBenNamedObject * pNamedObj = static_cast<CBenNamedObject *>(pObj);
+ if(!pNamedObj->IsPropertyName())
+ continue;
+
+ // Gr2E,41FDD458-S
+ // Gr2E,41FDD458-D
+ pName = const_cast<char *>(pNamedObj->GetName());
+ if ( (pName[0] == 'G')
+ && (pName[1] == 'r')
+ &&( (pName[14] == 'D') || (pName[14] == 'S') ) )
+ {
+ aGrPropertyVector.push_back(std::string(pName));
+ }
+ }
+ }
+
+ /* traverse the found properties and construct the stream vectors */
+ std::vector<std::string>::iterator itor;
+ for (itor = aGrPropertyVector.begin(); itor != aGrPropertyVector.end(); itor ++)
+ {
+ // get property names with suffix of S&D
+ char sSName[32], sDName[32];
+ strcpy(sSName, itor->c_str());
+ strcpy(sDName, itor->c_str());
+ sSName[14] = 'S';
+ sDName[14] = 'D';
+
+ // erase strings in vector
+ std::vector<std::string>::iterator itorSearch;
+ for (itorSearch = aGrPropertyVector.begin(); itorSearch != aGrPropertyVector.end(); itorSearch ++)
+ {
+ if( (*itorSearch == sSName) || (*itorSearch == sDName) )
+ {
+ std::vector<std::string>::iterator itorDel = itorSearch;
+ aGrPropertyVector.erase(itorDel);
+ }
+ }
+
+ // get S&D's stream and merge them together
+ {
+ SvStream *pD = NULL, *pS = NULL;
+
+ pS = FindValueStreamWithPropertyName(sSName);
+ assert(pS != NULL);
+ pD = FindValueStreamWithPropertyName(sDName);
+ assert(pD != NULL);
+
+ sal_uInt32 nDLen = GetSvStreamSize(pD);
+ sal_uInt32 nLen = GetSvStreamSize(pS) + nDLen;
+ assert(nLen > 0);
+ char * pBuf = new char[nLen];
+ assert(pBuf != NULL);
+ char * pPointer = pBuf;
+ pD->Read(pPointer, nDLen);
+ pPointer += nDLen;
+ pS->Read(pPointer, nLen - nDLen);
+
+ delete pS;
+ delete pD;
+
+ SvMemoryStream * pStream = new SvMemoryStream(pBuf, nLen, STREAM_READ);
+ assert(pStream != NULL);
+
+ pStreamVector->push_back(pStream);
+ }
+ }
+
+ aGrPropertyVector.clear();
+ return BenErr_OK;
+}
+
+/**
+* Find hazily according to object ID
+* @date 01/31/2005
+* @param pObjectname - format as "GrXX,XXXXXXXX" wherein XX is high part of object ID, and XXXXXXXX is low part
+* @return the value stream pointers with the property names
+*/
+BenError LtcBenContainer::CreateGraphicStream(SvStream * &pStream, const char *pObjectName)
+{
+ if (!pObjectName)
+ {
+ pStream = NULL;
+ return BenErr_NamedObjectError;
+ }
+ // construct the string of property name
+ char sSName[64]="";
+ char sDName[64]="";
+
+ sprintf(sSName, "%s-S", pObjectName);
+ sprintf(sDName, "%s-D", pObjectName);
+
+ /* traverse the found properties and construct the stream vectors */
+ SvMemoryStream * pMemStream = NULL;
+ // get S&D's stream and merge them together
+ SvStream *pD = NULL, *pS = NULL;
+
+ pS = FindValueStreamWithPropertyName(sSName);
+ pD = FindValueStreamWithPropertyName(sDName);
+
+
+ sal_uInt32 nDLen = 0;
+ if(pD)
+ {
+ nDLen = GetSvStreamSize(pD);
+ }
+ sal_uInt32 nLen = nDLen;
+ if(pS)
+ {
+ nLen += GetSvStreamSize(pS) ;
+ }
+
+ assert(nLen > 0);
+ char * pBuf = new char[nLen];
+ assert(pBuf != NULL);
+ char * pPointer = pBuf;
+ if(pD)
+ {
+ pD->Read(pPointer, nDLen);
+ delete pD;
+ }
+ pPointer += nDLen;
+ if(pS)
+ {
+ pS->Read(pPointer, nLen - nDLen);
+ delete pS;
+ }
+
+ pMemStream = new SvMemoryStream(pBuf, nLen, STREAM_READ);
+ assert(pMemStream != NULL);
+
+ pStream = pMemStream;
+ return BenErr_OK;
+}
+/**
+* Find ole object stream according to object name
+* @date 10/24/2005
+* @param
+* @return the value ole storage stream pointers
+*/
+#include <tools/globname.hxx>
+SotStorageStreamRef LtcBenContainer::ConvertAswStorageToOLE2Stream(const char * sObjectName)
+{
+ SotStorageStreamRef xOleObjStm;
+
+ SvStream* pOleStorageStream = NULL;
+ //Get Ole Storage stream
+ AswEntry aEntry;
+ pOleStorageStream = FindOLEStorageStreamWithObjectName(sObjectName, aEntry);
+
+ if( !pOleStorageStream )
+ return xOleObjStm;
+ //Find it, create Ole stream
+ //xOleObjStm = new SotStorageStream(String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Ole-Object" ) ));
+ xOleObjStm = new SotStorageStream(String());
+ if( xOleObjStm->GetError() )
+ return xOleObjStm;
+ xOleObjStm->SetBufferSize( 0xff00 );
+
+ SotStorageRef xOleObjStor = new SotStorage( *xOleObjStm );
+ if( xOleObjStor->GetError() )
+ return xOleObjStm;
+ //Set class id
+ ClsId aClsId = aEntry.GetClassId();
+ SvGlobalName aGName( aClsId.n1, aClsId.n2, aClsId.n3, aClsId.n4,
+ aClsId.n5, aClsId.n6,aClsId.n7,aClsId.n8,
+ aClsId.n9,aClsId.n10,aClsId.n11);
+ xOleObjStor->SetClass( aGName, 0, String());
+
+ xOleObjStor->SetVersion( SOFFICE_FILEFORMAT_60 );
+ std::string aOleStreamName("OleStream");
+ sal_uInt32 nDLen = 0;
+ nDLen = GetSvStreamSize(pOleStorageStream);
+ for(sal_uInt32 nIndex = 0; nIndex < nDLen / ASWENTRY_SIZE; nIndex ++)
+ {
+ AswEntry aOleEntry;
+ ReadAswEntry(pOleStorageStream, aOleEntry);
+ if(aOleEntry.GetType()== BEN_STGTY_STREAM)
+ {
+ SvStream* pOleStream = FindObjectValueStreamWithObjectIDAndProperty(aOleEntry.GetObjectID(), aOleStreamName.c_str());
+ if(pOleStream)
+ {
+ String strName;
+ aOleEntry.GetName(strName);
+ SotStorageStreamRef xStm = xOleObjStor->OpenSotStream( strName );
+ if( xStm->GetError() )
+ break;
+ xStm->SetBufferSize( 8192 );
+ (*pOleStream) >> (*xStm);
+ xStm->Commit();
+ delete pOleStream;
+ pOleStream = NULL;
+ }
+ }
+ }
+ xOleObjStor->Commit();
+ xOleObjStm->Commit();
+
+ return xOleObjStm;
+}
+/**
+* Find ole object storage stream data according to object name
+* @date 10/24/2005
+* @param
+* @return the value ole storage stream data pointers
+*/
+LtcUtBenValueStream* LtcBenContainer::FindOLEStorageStreamWithObjectName(const char * sObjectName, AswEntry& rEntry)
+{
+ if (!sObjectName)
+ return NULL;
+
+ //Find OleRootStorage stream
+ std::string aRootStroageName("OleRootStorage");
+ std::string aOleStroageName("OleStorage");
+ LtcUtBenValueStream* pRootStream = NULL;
+ pRootStream = FindValueStreamWithPropertyName(aRootStroageName.c_str());
+ if(!pRootStream)
+ return NULL;
+ //Read root storage data and find the ole storage object id according to the object name
+ sal_uInt32 nDLen = 0;
+ nDLen = GetSvStreamSize(pRootStream);
+ for(sal_uInt32 nIndex = 0; nIndex < nDLen / ASWENTRY_SIZE; nIndex ++)
+ {
+ //Get entry
+ ReadAswEntry(pRootStream, rEntry);
+ String sObjName;
+ rEntry.GetName(sObjName);
+ if(sObjName.EqualsAscii(sObjectName))
+ {
+ //Find it
+ delete pRootStream;
+ return FindObjectValueStreamWithObjectIDAndProperty(rEntry.GetObjectID(), aOleStroageName.c_str());
+ }
+ }
+
+ // Not find
+ if(pRootStream)
+ {
+ delete pRootStream;
+ }
+
+ return NULL;
+}
+void LtcBenContainer::ReadAswEntry(SvStream * pStream, AswEntry & rEntry)
+{
+ char* pBuf = new char[ASWENTRY_SIZE];
+ pStream->Read(pBuf, ASWENTRY_SIZE);
+ rEntry.Load(pBuf);
+ delete[] pBuf;
+}
+////////////////////////////////////////////////////////////////////
+//classs AswEntry
+AswEntry::AswEntry()
+{
+ Init();
+}
+void AswEntry::Init()
+{
+ memset( this, 0, sizeof (AswEntry));
+}
+void AswEntry::SetName( const String& rName )
+{
+ int i;
+ for( i = 0; i < rName.Len() && i < 68; i++ )
+ nName[ i ] = rName.GetChar( i );
+ while( i < 68 )
+ nName[ i++ ] = 0;
+}
+void AswEntry::GetName(String & rName) const
+{
+ rName = nName;
+}
+void AswEntry::Store( void* pTo )
+{
+ SvMemoryStream r( (sal_Char *)pTo, ASWENTRY_SIZE, STREAM_WRITE );
+ for( short i = 0; i < 68; i++ )
+ r << nName[ i ]; // 00 name as WCHAR
+ r<< nMtime[ 0 ] // 42 entry type
+ << nMtime[ 1 ] // 43 0 or 1 (tree balance?)
+ << nCtime[ 0 ] // 44 left node entry
+ << nCtime[ 1 ] // 48 right node entry
+ << nAtime[ 0 ] // 44 left node entry
+ << nAtime[ 1 ]; // 48 right node entry
+ r.Write(&aClsId ,16); // 50 class ID (optional)
+ r<< nStatebits // 60 state flags(?)
+ << nType
+ << nObjectIDRef // 64 modification time
+ << nMversion // 6C creation and access time
+ << nLversion // 6C creation and access time
+ << nReserved[ 0 ] // 74 starting block (either direct or translated)
+ << nReserved[ 1 ]; // 78 file size
+}
+void AswEntry::Load( const void* pFrom )
+{
+ SvMemoryStream r( (sal_Char *)pFrom, ASWENTRY_SIZE, STREAM_WRITE );
+ for( short i = 0; i < 68; i++ )
+ r >> nName[ i ]; // 00 name as WCHAR
+ r>> nMtime[ 0 ] // 42 entry type
+ >> nMtime[ 1 ] // 43 0 or 1 (tree balance?)
+ >> nCtime[ 0 ] // 44 left node entry
+ >> nCtime[ 1 ] // 48 right node entry
+ >> nAtime[ 0 ] // 44 left node entry
+ >> nAtime[ 1 ]; // 48 right node entry
+ r.Read(&aClsId,16); // 50 class ID (optional)
+ r>> nStatebits // 60 state flags(?)
+ >> nType
+ >> nObjectIDRef // 64 modification time
+ >> nMversion // 6C creation and access time
+ >> nLversion // 6C creation and access time
+ >> nReserved[ 0 ] // 74 starting block (either direct or translated)
+ >> nReserved[ 1 ]; // 78 file size
+}
+void AswEntry::SetClassId( const ClsId& r )
+{
+ memcpy( &aClsId, &r, sizeof( ClsId ) );
+}
+///////////////////////////////////////////////////////////////////
+}// end namespace OpenStormBento
diff --git a/lotuswordpro/source/filter/benlist.cxx b/lotuswordpro/source/filter/benlist.cxx
new file mode 100644
index 0000000..48269ba
--- /dev/null
+++ b/lotuswordpro/source/filter/benlist.cxx
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: IBM Corporation
+ *
+ * Copyright: 2008 by IBM Corporation
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "first.hxx"
+namespace OpenStormBento
+{
+
+pCBenNamedObject
+FindNamedObject(pCUtList pList, const char * sName,
+ pCBenNamedObjectListElmt * ppPrev)
+{
+ pCUtListElmt pTerminating = pList->GetTerminating();
+ for (pCUtListElmt pCurr = pList->GetLast(); pCurr != pTerminating;
+ pCurr = pCurr->GetPrev())
+ {
+ pCBenNamedObjectListElmt pCurrNamedObjectListElmt =
+ (pCBenNamedObjectListElmt) pCurr;
+
+
+ //Old code
+// int Comp = strcmp(sName, pCurrNamedObjectListElmt->GetNamedObject()->
+// GetName());
+ int Comp = strcmp(sName, pCurrNamedObjectListElmt->GetNamedObject()->
+ GetNameCStr());
+
+
+ if (Comp == 0)
+ return pCurrNamedObjectListElmt->GetNamedObject();
+ else if (Comp < 0)
+ continue;
+ else
+ {
+ if (ppPrev != NULL)
+ *ppPrev = pCurrNamedObjectListElmt;
+ return NULL;
+ }
+ }
+
+ if (ppPrev != NULL)
+ *ppPrev = (pCBenNamedObjectListElmt) pTerminating;
+ return NULL;
+}
+
+// Assume list is of BenIDListElmt list elements, sorted by ID
+pCBenIDListElmt
+FindID(pCUtList pList, BenObjectID ObjectID, pCBenIDListElmt * ppPrev)
+{
+ pCUtListElmt pTerminating = pList->GetTerminating();
+ for (pCUtListElmt pCurr = pList->GetLast(); pCurr != pTerminating;
+ pCurr = pCurr->GetPrev())
+ {
+ pCBenIDListElmt pCurrIDListElmt = (pCBenIDListElmt) pCurr;
+
+ if (ObjectID == pCurrIDListElmt->GetID())
+ return pCurrIDListElmt;
+ else if (ObjectID < pCurrIDListElmt->GetID())
+ continue;
+ else
+ {
+ if (ppPrev != NULL)
+ *ppPrev = pCurrIDListElmt;
+ return NULL;
+ }
+ }
+
+ if (ppPrev != NULL)
+ *ppPrev = (pCBenIDListElmt) pTerminating;
+ return NULL;
+}
+} //end namespace OpenStormBento
diff --git a/lotuswordpro/source/filter/benname.cxx b/lotuswordpro/source/filter/benname.cxx
new file mode 100644
index 0000000..ea5e584
--- /dev/null
+++ b/lotuswordpro/source/filter/benname.cxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: IBM Corporation
+ *
+ * Copyright: 2008 by IBM Corporation
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "first.hxx"
+namespace OpenStormBento
+{
+#if 0
+CBenNamedObject::CBenNamedObject(pLtcBenContainer pContainer,
+ BenObjectID ObjectID, pCBenObject pPrevObject, const char * sName,
+ pCBenNamedObjectListElmt pPrevNamedObjectListElmt) :
+ CBenObject(pContainer, ObjectID, pPrevObject), csName(sName),
+ cNameListElmt(this, pPrevNamedObjectListElmt)
+{
+}
+#endif
+ // changed by to remove warning 2004-06-24
+CBenNamedObject::CBenNamedObject(pLtcBenContainer pContainer,
+ BenObjectID ObjectID, pCBenObject pPrevObject, const char * sName,
+ pCBenNamedObjectListElmt pPrevNamedObjectListElmt) :
+ CBenObject(pContainer, ObjectID, pPrevObject), csName(sName),
+ cNameListElmt( pPrevNamedObjectListElmt)
+{
+ cNameListElmt.SetNamedObject(this);
+}
+
+UtBool CBenNamedObject::IsNamedObject()
+{ return UT_TRUE; }
+
+UtBool CBenNamedObject::IsPropertyName()
+{ return UT_FALSE; }
+
+UtBool CBenNamedObject::IsTypeName()
+{ return UT_FALSE; }
+
+UtBool CBenPropertyName::IsPropertyName()
+{ return UT_TRUE; }
+
+UtBool CBenTypeName::IsTypeName()
+{ return UT_TRUE; }
+} // end namespace OpenStormBento
diff --git a/lotuswordpro/source/filter/benobj.cxx b/lotuswordpro/source/filter/benobj.cxx
new file mode 100644
index 0000000..7ade154
--- /dev/null
+++ b/lotuswordpro/source/filter/benobj.cxx
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: IBM Corporation
+ *
+ * Copyright: 2008 by IBM Corporation
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "first.hxx"
+namespace OpenStormBento
+{
+
+UtBool
+CBenObject::IsNamedObject()
+{
+ return UT_FALSE;
+}
+
+pCBenProperty
+CBenObject::GetNextProperty(pCBenProperty pCurrProperty)
+{
+ return (pCBenProperty) cProperties.GetNextOrNULL(pCurrProperty);
+}
+
+pCBenProperty
+CBenObject::UseProperty(BenObjectID PropertyID)
+{
+ pCBenIDListElmt pPrev;
+ return (pCBenProperty) FindID(&cProperties, PropertyID, &pPrev);
+}
+
+void
+CBenObject::DeleteProperty(pCBenProperty pProperty)
+{
+ delete pProperty;
+}
+
+pCBenValue
+CBenObject::UseValue(BenObjectID PropertyID)
+{
+ pCBenProperty pProperty = UseProperty(PropertyID);
+ if (pProperty == NULL)
+ return NULL;
+ return pProperty->UseValue();
+}
+
+pCBenValue
+CBenObject::UseValueWithPropertyName(const char * sPropertyName)
+{
+ pCBenPropertyName pPropertyName;
+ if (GetContainer()->RegisterPropertyName(sPropertyName, &pPropertyName)
+ != BenErr_OK)
+ return NULL;
+
+ return UseValue(pPropertyName->GetID());
+}
+
+pCBenValue
+CBenObject::UseSingleValue()
+{
+ if (cProperties.IsEmpty() || cProperties.ContainsAtLeastTwoItems())
+ return NULL;
+ pCBenProperty pProperty = (pCBenProperty) cProperties.GetFirst();
+ return pProperty->UseValue();
+}
+
+BenError
+CBenObject::NewValue(BenObjectID PropertyID, BenObjectID TypeID, pCBenValue *
+ ppValue)
+{
+ pCBenIDListElmt pPrevProperty;
+ pCBenProperty pProperty = (pCBenProperty) FindID(&cProperties,
+ PropertyID, &pPrevProperty);
+ if (pProperty != NULL)
+ return BenErr_PropertyAlreadyExists;
+
+ pProperty = new CBenProperty(this, PropertyID, TypeID, pPrevProperty);
+ *ppValue = pProperty->UseValue();
+
+ return BenErr_OK;
+}
+}// end namespace OpenStormBento
diff --git a/lotuswordpro/source/filter/bento.hxx b/lotuswordpro/source/filter/bento.hxx
new file mode 100644
index 0000000..f0e235f
--- /dev/null
+++ b/lotuswordpro/source/filter/bento.hxx
@@ -0,0 +1,567 @@
+/*************************************************************************
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: IBM Corporation
+ *
+ * Copyright: 2008 by IBM Corporation
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef BENTO_H
+#define BENTO_H
+
+#include <string>
+#include <vector>
+#include "lwpsvstream.hxx"
+
+#define BEN_CC __stdcall
+#ifdef COMP_BENTO
+#define BEN_EXPORT __declspec(dllexport)
+#else
+#define BEN_EXPORT
+#endif
+
+using namespace std;
+
+#include "ut.hxx"
+#include "utlist.hxx"
+// removed for WordPro filter, 2005-01-27
+//#include <scerrors.hxx> // error code defined for SC
+//#include <filter.hxx> // error code defined for SC filters
+#include <tools/stream.hxx> // SvStream definition
+#include <sot/storage.hxx> // SotStorageStream definition, add by 10/24/2005
+
+namespace OpenStormBento
+{
+
+#define BEN_CURR_MAJOR_VERSION 2
+#define BEN_CURR_MINOR_VERSION 0
+#define BEN_MAGIC_BYTES_SIZE 8
+#define BEN_LABEL_SIZE 24
+
+#define BEN_MAGIC_BYTES "\xA4""CM""\xA5""Hdr""\xD7"
+//For Ole2DirectoryStruct, Add by 10/24/2005
+#define BEN_STGTY_STORAGE 1
+#define BEN_STGTY_STREAM 2
+#define ASWENTRY_SIZE 204
+struct ClsId
+{
+ INT32 n1;
+ INT16 n2, n3;
+ UINT8 n4, n5, n6, n7, n8, n9, n10, n11;
+};
+class AswEntry //total length: 204
+{
+ UINT16 nName[ 68 ]; //Name of IStorage or IStream referenced by this entry, length = 136
+ INT32 nMtime[ 2 ];
+ INT32 nCtime[ 2 ];
+ INT32 nAtime[ 2 ];
+ ClsId aClsId; //CLSID from OLE 2 IStorage::SetClass call
+ UINT32 nStatebits; //State bits from OLE 2 IStorage::SetStateBits call
+ UINT32 nType; // STGTY_STORAGE: 1 or STGTY_STREAM:2,
+ UINT32 nObjectIDRef; //Persistent Bento reference to Bento object for this IStorage or IStream
+ UINT32 nMversion;
+ UINT32 nLversion;
+ UINT32 nReserved[2]; //skip 16 char
+public:
+ AswEntry();
+ void Init(); // initialize the data
+ void SetName( const String& ); // store a name (ASCII, up to 32 chars)
+ void GetName( String& rName ) const;
+ void Load( const void* );
+ void Store( void* );
+ UINT32 GetType() const { return nType; }
+ void SetType( UINT32 t ) { nType = t;}
+ const ClsId& GetClassId() const { return aClsId;}
+ void SetClassId( const ClsId& );
+ void SetObjectID(UINT32 id) { nObjectIDRef = id;}
+ UINT32 GetObjectID() const { return nObjectIDRef;}
+};
+//End by
+
+enum BenError
+{
+ BenErr_OK = 0,
+ BenErr_NameConflict = 1,
+ BenErr_DuplicateObjectID = 2,
+ BenErr_UnknownBentoFormatVersion = 3,
+ BenErr_NamedObjectError = 4,
+ BenErr_NamedObjectIllegalValue = 5,
+ BenErr_InvalidTOC = 6,
+ BenErr_64BitOffsetNotSupported = 7,
+ BenErr_ReadPastEndOfTOC = 8,
+ BenErr_ContainerWithNoObjects = 9,
+ BenErr_ObjectWithNoProperties = 10,
+ BenErr_PropertyWithNoValues = 11,
+ BenErr_IllegalInMemoryTOC = 12,
+ BenErr_PropertyAlreadyExists = 13,
+ BenErr_UnexpectedEndOfFile = 14,
+ BenErr_InvalidWriteOffset = 15,
+ BenErr_InvalidImmediateWrite = 16,
+ BenErr_TOCSeedError = 17,
+ BenErr_ReadPastEndOfContainer = 18,
+ BenErr_DuplicateName = 19,
+ BenErr_BadReferencedList = 20,
+ BenErr_IllegalContinuedImmediate = 21,
+ BenErr_NotBentoContainer = 22,
+ BenErr_PropertyWithMoreThanOneValue = 23
+
+ // IMPORTANT - UtStream errors (UtErr_....) are also valid Bento
+ // errors. They have codes of 100 and higher. When, say, a Bento
+ // container open fails due to an access violation (somebody else, say,
+ // has it open exclusive), will get a UtErr code. If define own
+ // subclass of UtStream (custom handler), can define own error codes--
+ // those should start at 200
+};
+/*
+ * These two functions are useless in SODC
+ *
+inline UtError BenToUtError(BenError Err)
+{
+ if (Err == 0 || Err >= 100)
+ return (UtError) Err;
+ else return UtErr_Fail;
+}
+
+inline BenError UtToBenError(UtError Err)
+{ UT_ASSERT(Err == 0 || Err >= 100); return (BenError) Err; }
+enum BenSeekMode {
+ BenSeek_FromStart = 1,
+ BenSeek_FromCurr = 2,
+ BenSeek_FromEnd = 3
+};
+*/
+
+UtDefClassP(LtcBenContainer);
+UtDefClassP(CBenIDListElmt);
+UtDefClassP(CBenObject);
+UtDefClassP(CBenProperty);
+UtDefClassP(CBenReference);
+UtDefClassP(CBenValue);
+UtDefClassP(CBenValueSegment);
+UtDefClassP(CBenNamedObjectListElmt);
+UtDefClassP(CBenNamedObject);
+UtDefClassP(CBenPropertyName);
+UtDefClassP(CBenTypeName);
+
+typedef unsigned char BenByte;
+typedef unsigned short BenWord;
+typedef unsigned long BenDWord;
+typedef void * BenDataPtr;
+typedef const void * BenConstDataPtr;
+
+typedef unsigned long BenContainerPos;
+typedef unsigned long BenObjectID;
+typedef unsigned long BenGeneration;
+
+ULONG BenOpenContainer(LwpSvStream * pStream, pLtcBenContainer * ppContainer);
+
+class CBenIDListElmt : public CUtListElmt
+{
+public: // Internal methods
+ CBenIDListElmt(BenObjectID ID, pCBenIDListElmt pPrev) : CUtListElmt(pPrev)
+ { cID = ID; }
+ CBenIDListElmt(BenObjectID ID) { cID = ID; }
+ BenObjectID GetID() { return cID; }
+
+private: // Data
+ BenObjectID cID;
+};
+
+class CBenNamedObjectListElmt : public CUtListElmt
+{
+public: // Methods
+ // added by to remove warning 2004-06-24
+ CBenNamedObjectListElmt(pCBenNamedObjectListElmt pPrev) : CUtListElmt(pPrev)
+ { cpNamedObject = NULL; }
+ void SetNamedObject(pCBenNamedObject pObj)
+ {
+ cpNamedObject = pObj;
+ }
+
+ CBenNamedObjectListElmt(pCBenNamedObject pNamedObject,
+ pCBenNamedObjectListElmt pPrev) : CUtListElmt(pPrev)
+ { cpNamedObject = pNamedObject; }
+ pCBenNamedObject GetNamedObject() { return cpNamedObject; }
+
+private: // Data
+ pCBenNamedObject cpNamedObject;
+};
+
+class LtcUtBenValueStream : public SvStream
+{
+public:
+ LtcUtBenValueStream(pCBenValue pValue);
+ ~LtcUtBenValueStream();
+
+public: // Overridden methods
+#if 0 // Deleted by 2004-06-16
+ UtError Open(UtBool /* OpenNew */, UtStrmOpenFlags /* Flags */);
+ UtError Close();
+ UtError Seek(long Offset, UtSeekMode Mode);
+ UtError GetPosition(unsigned long * pPosition);
+ UtError GetSize(unsigned long * pSize);
+ UtError Read(UtStrmDataPtr pBuffer, unsigned long MaxSize,
+ unsigned long * pAmtRead);
+ UtError Write(UtConstStrmDataPtr pBuffer, unsigned long Size,
+ unsigned long * pAmtWritten);
+ UtError Flush();
+#endif
+
+ /* added by */
+ CBenValue * GetValue(){ return cpValue; };
+ ULONG GetSize() { return m_ulValueLength; };
+protected: // Overridden methods
+
+ virtual ULONG GetData( void* pData, ULONG nSize );
+ virtual ULONG PutData( const void* pData, ULONG nSize );
+ virtual ULONG SeekPos( ULONG nPos );
+ virtual void SetSize( ULONG nSize );
+ virtual void FlushData();
+
+#if 0// Deleted by 2004-06-16
+ UtError TruncateSize(unsigned long Size);
+#endif
+private: // Data
+ pCBenValue cpValue;
+ unsigned long cCurrentPosition;
+
+ ULONG m_ulValueLength; // Added by , sum of length of all sub-valuesegments
+// void GetAmountLeft(ULONG * pAmtLeft); useless in SODC
+};
+
+class LtcBenContainer
+{
+public:
+ BenError Open();
+ void Release(); // Deletes container object--last call
+ BenError Close();
+ BenError RegisterTypeName(const char * sTypeName,
+ pCBenTypeName * ppTypeName);
+ BenError RegisterPropertyName(const char * sPropertyName,
+ pCBenPropertyName * ppPropertyName);
+ // Pass NULL to begin iteration. Done when returns NULL.
+ // Objects are returned in order of increasing ID
+ pCBenObject GetNextObject(pCBenObject pCurrObject);
+ pCBenObject FindObject(BenObjectID ObjectID);
+ pCBenObject FindNextObjectWithProperty(pCBenObject pCurrObject,
+ BenObjectID PropertyID);
+ BenError BEN_EXPORT NewObject(pCBenObject * ppBenObject);
+
+public: // Internal methods
+ LtcBenContainer(LwpSvStream * pStream);
+ ~LtcBenContainer();
+
+ BenError Read(BenDataPtr pBuffer, unsigned long MaxSize,
+ unsigned long * pAmtRead);
+ BenError ReadKnownSize(BenDataPtr pBuffer, unsigned long Amt);
+ BenError SeekToPosition(BenContainerPos Pos);
+ BenError SeekFromEnd(long Offset);
+
+ BenError GetPosition(BenContainerPos * pPosition);
+
+ BenObjectID GetNextAvailObjectID() { return cNextAvailObjectID; }
+ void SetNextAvailObjectID(BenObjectID ID) { cNextAvailObjectID = ID; }
+ pCUtList GetObjects() { return &cObjects; }
+ pCUtList GetNamedObjects() { return &cNamedObjects; }
+
+ // Added by 2004-06-10
+ LtcUtBenValueStream * FindNextValueStreamWithPropertyName(const char * sPropertyName, LtcUtBenValueStream * pCurrentValueStream);
+ LtcUtBenValueStream * FindValueStreamWithPropertyName(const char * sPropertyName);
+ LtcUtBenValueStream * FindObjectValueStreamWithObjectIDAndProperty(BenObjectID ObjectID, const char * sPropertyName);
+ BenError CreateGraphicStreams(std::vector<SvStream *> * pStreamVector) ;
+ BenError CreateGraphicStream(SvStream * &pStream, const char *pObjectName);
+ //Add by 10/24/2005
+ SotStorageStreamRef ConvertAswStorageToOLE2Stream(const char * sObjectName);
+ LtcUtBenValueStream * FindOLEStorageStreamWithObjectName(const char * sObjectName, AswEntry& rDirStruct);
+ void ReadAswEntry(SvStream * pStream, AswEntry& rEntry);
+
+ BenError GetSize(ULONG * pLength);
+ LwpSvStream * GetStream()
+ {
+ return cpStream;
+ };
+private: // Data
+ CUtOwningList cObjects;
+ CUtList cNamedObjects;
+ LwpSvStream * cpStream;
+ ULONG m_ulLength; // Added for TOCRead.cpp
+ BenObjectID cNextAvailObjectID; // for new object
+};
+
+class CBenObject : public CBenIDListElmt
+{
+public:
+ pCBenProperty GetNextProperty(pCBenProperty pCurrProperty);
+ pCBenProperty UseProperty(BenObjectID PropertyID);
+ void DeleteProperty(pCBenProperty pProperty);
+ pCBenValue UseValue(BenObjectID PropertyID);
+ pCBenValue UseSingleValue();
+ // Inefficient to use this method if will use property multiple times--
+ // instead register property and call UseProperty with property ID
+ pCBenValue UseValueWithPropertyName(const char * sPropertyName);
+ virtual UtBool IsNamedObject();
+ pLtcBenContainer GetContainer() { return cpContainer; }
+ BenObjectID GetObjectID() { return GetID(); }
+ BenError BEN_EXPORT NewValue(BenObjectID PropertyID, BenObjectID TypeID,
+ pCBenValue * ppValue);
+public: // Internal methods
+ CBenObject(pLtcBenContainer pContainer, BenObjectID ObjectID,
+ pCBenIDListElmt pPrev) : CBenIDListElmt(ObjectID, pPrev)
+ { cpContainer = pContainer; }
+ pCUtList GetProperties() { return &cProperties; }
+
+private: // Data
+ pLtcBenContainer cpContainer;
+ CUtOwningList cProperties;
+};
+
+class CBenValue : public CBenIDListElmt
+{
+public:
+ unsigned long GetValueSize();
+ BenError ReadValueData(BenDataPtr pBuffer,
+ unsigned long Offset, unsigned long MaxSize, unsigned long * pAmtRead);
+ BenError ReadValueDataKnownSize(BenDataPtr pBuffer,
+ unsigned long Offset, unsigned long Amt);
+
+ BenError BEN_EXPORT WriteValueData(BenConstDataPtr pBuffer,
+ unsigned long Offset, unsigned long Size);
+ BenError BEN_EXPORT WriteValueData(BenConstDataPtr pBuffer,
+ unsigned long Offset, unsigned long Size, unsigned long * pAmtWritten);
+ BenError BEN_EXPORT WriteImmediateValueData(BenConstDataPtr pBuffer,
+ unsigned short Size);
+ BenError BEN_EXPORT TruncateValueSize(unsigned long NewSize);
+ BenError BEN_EXPORT NewReference(BenObjectID ReferencedObjectID,
+ pCBenReference pReference);
+ BenObjectID BEN_EXPORT GetReferencedObject(pCBenReference pReference);
+
+
+ pCBenProperty BEN_EXPORT GetProperty() { return cpProperty; }
+
+public: // Internal methods
+ // added by to remove WARNING 2004-06-24
+ CBenValue(BenObjectID TypeID):CBenIDListElmt(TypeID)
+ {
+ cpProperty = NULL;
+ cpReferencedList = NULL;
+ }
+
+ void SetProperty(pCBenProperty pProperty)
+ {
+ cpProperty = pProperty;
+ }
+
+ CBenValue(pCBenProperty pProperty, BenObjectID TypeID) :
+ CBenIDListElmt(TypeID)
+ {
+ cpProperty = pProperty;
+ cpReferencedList = NULL;
+ }
+ BenObjectID GetTypeNameID() { return GetID(); }
+ inline pCBenValueSegment GetNextValueSegment(pCBenValueSegment
+ pCurrValueSegment);
+ inline pLtcBenContainer GetContainer();
+ pCUtList GetValueSegments() { return &cValueSegments; }
+ BenObjectID GetReferencedListID();
+ // Currently, no generation support
+ BenGeneration GetGeneration() { return 1; }
+
+private: // Data
+ pCBenProperty cpProperty;
+ CUtOwningList cValueSegments;
+ pCBenValue cpReferencedList;
+ unsigned long cReferencedObjectsSize;
+};
+
+class CBenProperty : public CBenIDListElmt
+{
+public:
+ // In the Apple Bento, a property can have multiple values, each of a
+ // different type. But we never use it that way, so in this code a
+ // property has exactly one value
+
+ pCBenValue UseValue() { return &cValue; }
+ pCBenObject GetBenObject() { return cpObject; }
+ pLtcBenContainer GetContainer() { return GetBenObject()->GetContainer(); }
+
+public: // Internal methods
+#if 0
+ CBenProperty(pCBenObject pObject, BenObjectID PropertyID,
+ BenObjectID TypeID, pCBenIDListElmt pPrevProperty) :
+ CBenIDListElmt(PropertyID, pPrevProperty), cValue(this, TypeID)
+ { cpObject = pObject; }
+#endif
+ // changed by to remove WARNING here 2004-06-24
+ CBenProperty(pCBenObject pObject, BenObjectID PropertyID,
+ BenObjectID TypeID, pCBenIDListElmt pPrevProperty) :
+ CBenIDListElmt(PropertyID, pPrevProperty), cValue(TypeID)
+ {
+ cpObject = pObject;
+ cValue.SetProperty(this);
+ }
+
+BenObjectID GetPropertyNameID() { return GetID(); }
+
+private: // Data
+ pCBenObject cpObject;
+ CBenValue cValue;
+};
+
+// In our implementation, reference is always just the object ID for the
+// object referenced (but you shouldn't assume that)
+#define BEN_REFERENCE_SIZE 4
+
+class CBenReference
+{
+public: // Methods
+ BenByte * GetData() { return cData; }
+
+private: // Data
+ BenByte cData[BEN_REFERENCE_SIZE];
+};
+
+class CBenValueSegment : public CUtListElmt
+{
+public: // Internal methods
+ CBenValueSegment(pCBenValue pValue, BenContainerPos Pos,
+ unsigned long Size) : CUtListElmt(pValue->GetValueSegments())
+ { cpValue = pValue; cImmediate = UT_FALSE; cPos = Pos;
+ cSize = Size; }
+ CBenValueSegment(pCBenValue pValue, BenConstDataPtr pImmData,
+ unsigned short Size) : CUtListElmt(pValue->GetValueSegments())
+ { cpValue = pValue; cImmediate = UT_TRUE;
+ UtHugeMemcpy(cImmData, pImmData, Size); cSize = Size; }
+ CBenValueSegment(BenContainerPos Pos, unsigned long Size)
+ { cpValue = NULL; cImmediate = UT_FALSE; cPos = Pos;
+ cSize = Size; }
+ CBenValueSegment(BenConstDataPtr pImmData, unsigned short Size)
+ { cpValue = NULL; cImmediate = UT_TRUE;
+ UtHugeMemcpy(cImmData, pImmData, Size); cSize = Size; }
+ UtBool IsLast()
+ {
+ return cpValue == NULL || cpValue->GetValueSegments()->GetLast() ==
+ this;
+ }
+ UtBool IsImmediate() { return cImmediate; }
+ BenContainerPos GetPosition() { return cPos; }
+ unsigned long GetSize() { return cSize; }
+ void SetSize(unsigned long Size) { cSize = Size; }
+ BenByte * GetImmediateData() { return cImmData; }
+
+private: // Data
+ pCBenValue cpValue;
+ UtBool cImmediate;
+ union
+ {
+ BenContainerPos cPos;
+ BenByte cImmData[4];
+ };
+ unsigned long cSize;
+};
+
+inline pCBenValueSegment CBenValue::GetNextValueSegment(pCBenValueSegment
+ pCurrValueSegment)
+{ return (pCBenValueSegment) cValueSegments.GetNextOrNULL(pCurrValueSegment); }
+
+inline pLtcBenContainer CBenValue::GetContainer()
+{ return GetProperty()->GetContainer(); }
+
+class CBenNamedObject : public CBenObject
+{
+public: // Methods
+ virtual UtBool IsNamedObject();
+ virtual UtBool IsPropertyName();
+ virtual UtBool IsTypeName();
+
+public: // Internal methods
+ CBenNamedObject(pLtcBenContainer pContainer, BenObjectID ObjectID,
+ pCBenObject pPrevObject, const char * sName,
+ pCBenNamedObjectListElmt pPrevNamedObjectListElmt);
+ const char * GetName() { return csName.data(); }
+
+
+ const char * GetNameCStr() { return csName.c_str(); }
+
+
+ void SetPosition(BenContainerPos Pos) { cPos = Pos; }
+ BenContainerPos GetPosition(void) { return cPos; }
+ size_t GetLength(void) { return csName.length()+ 1; }
+ pCBenNamedObjectListElmt GetNameListElmt() { return &cNameListElmt; }
+
+private: // Data
+ string csName;
+ CBenNamedObjectListElmt cNameListElmt;
+ BenContainerPos cPos;
+};
+
+class CBenPropertyName : public CBenNamedObject
+{
+public: // Internal methods
+ CBenPropertyName(pLtcBenContainer pContainer, BenObjectID ObjectID,
+ pCBenObject pPrevObject, const char * sName,
+ pCBenNamedObjectListElmt pPrevNamedObjectListElmt) :
+ CBenNamedObject(pContainer, ObjectID, pPrevObject, sName,
+ pPrevNamedObjectListElmt) { ; }
+ virtual UtBool IsPropertyName();
+};
+
+class CBenTypeName : public CBenNamedObject
+{
+public: // Internal methods
+ CBenTypeName(pLtcBenContainer pContainer, BenObjectID ObjectID,
+ pCBenObject pPrevObject, const char * sName,
+ pCBenNamedObjectListElmt pPrevNamedObjectListElmt) :
+ CBenNamedObject(pContainer, ObjectID, pPrevObject, sName,
+ pPrevNamedObjectListElmt) { ; }
+ virtual UtBool IsTypeName();
+};
+
+
+} // end namespace OpenStormBento
+#endif
diff --git a/lotuswordpro/source/filter/bentoid.hxx b/lotuswordpro/source/filter/bentoid.hxx
new file mode 100644
index 0000000..4323faa
--- /dev/null
+++ b/lotuswordpro/source/filter/bentoid.hxx
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list