Issue 915 - On loading some older .sdw and .smf files some properties corrupt
Summary: On loading some older .sdw and .smf files some properties corrupt
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: 627
Hardware: PC Windows 2000
: P3 Trivial (vote)
Target Milestone: ---
Assignee: Mathias_Bauer
QA Contact: issues@www
URL:
Keywords:
Depends on:
Blocks: 906
  Show dependency tree
 
Reported: 2001-05-18 09:58 UTC by caolanm
Modified: 2003-12-06 14:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2001-05-18 09:58:29 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
Comment 1 jp 2001-05-28 13:43:48 UTC
I think, the import of DocInfo happend in the SFX. 
Comment 2 caolanm 2001-06-22 13:20:06 UTC
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.

Comment 3 Mathias_Bauer 2001-07-12 15:29:06 UTC
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.
Comment 4 caolanm 2001-08-28 17:37:05 UTC
closed