Apache OpenOffice (AOO) Bugzilla – Issue 915
On loading some older .sdw and .smf files some properties corrupt
Last modified: 2003-12-06 14:52:32 UTC
SRC631b2 wntmsci7 Loading older sdw and swf documents from 5.2 samples sometimes creates bad properties in "Internet" tab and occasional crash using "User Defined" tab of property dialog, causing further problems in saving to xml e.g. \share\samples\english\texts\Games.sdw Junk in Internet e.g. \share\samples\english\formulas\LawOfErrorPropogation.swf Junk in Internet e.g. \share\samples\english\texts\JobAd.sdw Crash in User Defined e.g. \share\samples\english\texts\LostDogNotive.sdw Crash in User Defined Because there is occasionally junk in the property dialog then when saving into an xml file format's meta.xml stream there may be invalid characters being saved into the xml stream and the xml filter throws an exception, e.g. in LawOfErrorPropogation.smf there is junk in Internet, save as xml and get exception in xmloff because of bad characters being saved to meta.xml, clear out the dialog and save again, all is now well. Either the properties aren't being set empty by the existing file filters when loading older format documents, or the properties aren't being initialized correctly by something else. I don't know if this is a known issue ?, or what component is responsible for these properties, sfx2 ?, as it happens with two seperate file formats, its likely some shared property handlers ? Checking with version 618 with the Games.sdw example gives me an "Invalid URL" dialog on chosing properties, so it is likely an old problem, the failure of some math examples to save as sxm follows from this (i.e. this problem blocks issue 906), the 618 stack trace follows. TL618MI! DbgFunc(unsigned short,void *) + 325 bytes VCL618MI! DbgPrintMsgBox(char const *) + 422 bytes TL618MI! DbgOut(char const *,unsigned short,char const *,unsigned short) + 830 bytes SFX618MI! SfxContentHelper::GetSize(class String const &) + 386 bytes SFX618MI! SfxDocumentPage::Reset(class SfxItemSet const &) + 1834 bytes SFX618MI! SfxTabDialog::ActivatePageHdl(class TabControl *) + 798 bytes SFX618MI! SfxTabDialog::Start_Impl(void) + 280 bytes SFX618MI! SfxTabDialog::Execute(void) + 43 bytes SFX618MI! SfxObjectShell::DocInfoDlg_Impl(class SfxDocumentInfo &) + 2000 bytes SFX618MI! SfxObjectShell::ExecFile_Impl(class SfxRequest &) + 5886 bytes SFX618MI! SfxStubSfxObjectShellExecFile_Impl(class SfxShell *,class SfxRequest &) + 15 bytes SFX618MI! SfxDispatcher::Call_Impl(class SfxShell &,class SfxSlot const &,class SfxRequest &,unsigned char) + 386 bytes SFX618MI! SfxDispatcher::_Execute(class SfxShell &,class SfxSlot const &,class SfxRequest &,unsigned short) + 806 bytes SFX618MI! SfxBindings::Execute_Impl(unsigned short,class SfxPoolItem const * *,unsigned short,unsigned short,class SfxPoolItem const * *) + 3345 bytes SFX618MI! SfxBindings::Execute(unsigned short,class SfxPoolItem const * *,unsigned short,unsigned short,class SfxPoolItem const * *) + 166 bytes SFX618MI! SfxVirtualMenu::Select(class Menu *) + 399 bytes SFX618MI! SfxVirtualMenu::LinkStubSelect(void *,void *) + 15 bytes VCL618MI! Menu::Select(void) + 43 bytes
I think, the import of DocInfo happend in the SFX.
Place a breakpoint in sfx2/source/doc/docinf.cxx in BOOL SfxDocumentInfo::Load( SvStream& rStream ) at the expression rStream >> nReloadSecs; in the context of the below snippit if( aHeader.nVersion > 5 ) { rStream >> bReloadEnabled; rStream.ReadByteString( aReloadURL ); rStream >> nReloadSecs; rStream.ReadByteString( aDefaultTarget ); } Load the sample .smf file LawOfErrorPropogation.smf nReloadSec gets filled with 0x77777777 and then aDefaultTarget gets filled with whatever junk is inside the summary stream at the current point. On exporting to xml (save as Math 6.0) in xmloff/source/meta/xmlmetae.xml sax is called to export this string, sax will then throw an exception on seeing an incorrect character, which throws all the way back to the .sxm export and so export fails. In File->Properties->Internet you can see the incorrect imported values. In many of the. smf examples the SfxDocumentInfo stream is only as long as it needs to be to store its properties. In the LawOfErrorPropogation.smf its much longer and filled with 0x77, which causes all the trouble, so it doesn't look like a test for version 5 in the header is good enough on its own to use as a basis of importing the internet properties. If impossible to fix in sfx import, it might be feasable to get xmloff to wrap the export of the broken properties in a try catch block and silently ignore ones that fail as a hackaround.
The problem is that the old documents are trashed. We can't offer a "real" bugfix, but we added some heuristic investigations that should help in most cases. If a URL is longer than 1024 bytes and if doesn't have a valid protocol we know, we treat the whole internet settings as "garbage" and wipe them out. This will be fixed in all builds >=638.
closed