ooo-build r15433 - in trunk: . patches/dev300 patches/vba
- From: noelpwer svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r15433 - in trunk: . patches/dev300 patches/vba
- Date: Mon, 2 Mar 2009 16:42:22 +0000 (UTC)
Author: noelpwer
Date: Mon Mar 2 16:42:22 2009
New Revision: 15433
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15433&view=rev
Log:
2009-02-28 Noel Power <noel power novell com>
* patches/dev300/apply: fix reading of autotext ( sub document fib
not identified correctly ) and also make ole object word properly as
autotext items, i#99786 & i#99790
* patches/vba/vba-autotext-ole-read-fix.diff:
Added:
trunk/patches/vba/vba-autotext-ole-read-fix.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Mon Mar 2 16:42:22 2009
@@ -1839,6 +1839,7 @@
vba-fix-copysheet-toend.diff, n#478187
vba-improve-toolbarapi-macro-search.diff
vba-templateobject.diff
+vba-autotext-ole-read-fix.diff, i#99786, i#99790
[ VBAUntested ]
SectionOwner => noelpwer
vba-basic-null.diff i#85349, jjiao
Added: trunk/patches/vba/vba-autotext-ole-read-fix.diff
==============================================================================
--- (empty file)
+++ trunk/patches/vba/vba-autotext-ole-read-fix.diff Mon Mar 2 16:42:22 2009
@@ -0,0 +1,138 @@
+diff --git sw/source/core/swg/SwXMLTextBlocks1.cxx sw/source/core/swg/SwXMLTextBlocks1.cxx
+index 14a0497..41e468f 100644
+--- sw/source/core/swg/SwXMLTextBlocks1.cxx
++++ sw/source/core/swg/SwXMLTextBlocks1.cxx
+@@ -40,6 +40,7 @@
+ #include <com/sun/star/xml/sax/InputSource.hpp>
+ #include <com/sun/star/io/XActiveDataSource.hpp>
+ #include <com/sun/star/xml/sax/XParser.hpp>
++#include <com/sun/star/document/XStorageBasedDocument.hpp>
+ #include <doc.hxx>
+ #ifndef _DOCSH_HXX
+ #include <docsh.hxx>
+@@ -81,6 +82,21 @@ ULONG SwXMLTextBlocks::GetDoc( USHORT nIdx )
+ ReadXML->SetBlockMode( sal_True );
+ aReader.Read( *ReadXML );
+ ReadXML->SetBlockMode( sal_False );
++ // Ole objects fails to display when inserted into document
++ // because the ObjectReplacement folder ( and contents are missing )
++ rtl::OUString sObjReplacements( RTL_CONSTASCII_USTRINGPARAM( "ObjectReplacements" ) );
++ if ( xRoot->hasByName( sObjReplacements ) )
++ {
++ uno::Reference< document::XStorageBasedDocument > xDocStor( pDoc->GetDocShell()->GetModel(), uno::UNO_QUERY_THROW );
++ uno::Reference< embed::XStorage > xStr( xDocStor->getDocumentStorage() );
++ if ( xStr.is() )
++ {
++ xRoot->copyElementTo( sObjReplacements, xStr, sObjReplacements );
++ uno::Reference< embed::XTransactedObject > xTrans( xStr, uno::UNO_QUERY );
++ if ( xTrans.is() )
++ xTrans->commit();
++ }
++ }
+ }
+ catch( uno::Exception& )
+ {
+diff --git sw/source/filter/ww8/ww8glsy.cxx sw/source/filter/ww8/ww8glsy.cxx
+index 77c6383..3585c30 100644
+--- sw/source/filter/ww8/ww8glsy.cxx
++++ sw/source/filter/ww8/ww8glsy.cxx
+@@ -258,92 +258,20 @@ bool WW8Glossary::Load( SwTextBlocks &rBlocks, bool bSaveRelFile )
+
+ bool WW8GlossaryFib::IsGlossaryFib()
+ {
+- if (!nFibError)
+- {
+- INT16 nFibMin;
+- INT16 nFibMax;
+- switch(nVersion)
+- {
+- case 6:
+- nFibMin = 0x0065; // von 101 WinWord 6.0
+- // 102 "
+- // und 103 WinWord 6.0 fuer Macintosh
+- // 104 "
+- nFibMax = 0x0069; // bis 105 WinWord 95
+- break;
+- case 7:
+- nFibMin = 0x0069; // von 105 WinWord 95
+- nFibMax = 0x0069; // bis 105 WinWord 95
+- break;
+- case 8:
+- nFibMin = 0x006A; // von 106 WinWord 97
+- nFibMax = 0x00c2; // bis 194 WinWord 2000
+- break;
+- default:
+- nFibMin = 0; // Programm-Fehler!
+- nFibMax = 0;
+- nFib = nFibBack = 1;
+- break;
+- }
+- if ( (nFibBack < nFibMin) || (nFibBack > nFibMax) )
+- nFibError = ERR_SWG_READ_ERROR; // Error melden
+- }
+- return !nFibError;
++ // fGlsy will indicate whether this has AutoText or not
++ return fGlsy;
+ }
+
+ UINT32 WW8GlossaryFib::FindGlossaryFibOffset(SvStream &rTableStrm,
+ SvStream &rStrm, const WW8Fib &rFib)
+ {
+- WW8PLCF aPlc( &rTableStrm, rFib.fcPlcfsed, rFib.lcbPlcfsed, 12 );
+- WW8_CP start,ende;
+- void *pData;
+- aPlc.Get(start,ende,pData);
+- UINT32 nPo = SVBT32ToUInt32((BYTE *)pData+2);
+- //*pOut << hex << "Offset of last SEPX is " << nPo << endl;
+-
+- UINT16 nLen;
+- if (nPo != 0xFFFFFFFF)
+- {
+- rStrm.Seek(nPo);
+- rStrm >> nLen;
+- }
+- else
+- {
+- nPo=0;
+- nLen=0;
+- }
+-
+-// *pOut << hex << "Ends at " << nPo+len << endl;
+- nPo+=nLen;
+- UINT32 nEndLastPage;
+- if (nPo%512)
++ UINT32 nGlossaryFibOffset = 0;
++ if ( rFib.fDot ) // its a template
+ {
+- nEndLastPage = (nPo)/512;
+- nEndLastPage = (nEndLastPage+1)*512;
++ if ( rFib.pnNext )
++ nGlossaryFibOffset = ( rFib.pnNext * 512 );
+ }
+- else
+- nEndLastPage = nPo;
+-
+- //*pOut << hex << "SECOND FIB SHOULD BE FOUND at " << k << endl;
+-
+- WW8PLCF xcPLCF( &rTableStrm, rFib.fcPlcfbteChpx,
+- rFib.lcbPlcfbteChpx, (8 > rFib.nVersion) ? 2 : 4);
+-
+- xcPLCF.Get(start,ende,pData);
+-
+- nPo = SVBT32ToUInt32((BYTE *)pData);
+- //*pOut << hex << "Offset of last CHPX is " << (nPo+1) *512<< endl;
+- if (((nPo+1)*512) > nEndLastPage) nEndLastPage = (nPo+1)*512;
+-
+- WW8PLCF xpPLCF( &rTableStrm, rFib.fcPlcfbtePapx,
+- rFib.lcbPlcfbtePapx, (8 > rFib.nVersion) ? 2 : 4);
+- xpPLCF.Get(start,ende,pData);
+- nPo = SVBT32ToUInt32((BYTE *)pData);
+- //*pOut << hex << "Offset of last PAPX is " << nPo *512 << endl;
+- if (((nPo+1)*512) > nEndLastPage) nEndLastPage = (nPo+1)*512;
+-
+- //*pOut << hex << "SECOND FIB SHOULD BE FOUND at " << nEndLastPage << endl;
+- return nEndLastPage;
++ return nGlossaryFibOffset;
+ }
+
+ /* vi:set tabstop=4 shiftwidth=4 expandtab: */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]