ooo-build r12964 - in trunk: . patches/dev300



Author: strba
Date: Wed Jun 25 14:13:37 2008
New Revision: 12964
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12964&view=rev

Log:
handle supported WP encrypted documents

Modified:
   trunk/ChangeLog
   trunk/patches/dev300/writerperfect-testing.diff

Modified: trunk/patches/dev300/writerperfect-testing.diff
==============================================================================
--- trunk/patches/dev300/writerperfect-testing.diff	(original)
+++ trunk/patches/dev300/writerperfect-testing.diff	Wed Jun 25 14:13:37 2008
@@ -1,5 +1,5 @@
---- writerperfect//source/filter/DocumentCollector.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/DocumentCollector.cxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/DocumentCollector.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/DocumentCollector.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -39,6 +39,8 @@
  
  #include "DocumentCollector.hxx"
@@ -1524,8 +1524,8 @@
 +	mpCurrentContentElements->push_back(new TagCloseElement("draw:text-box"));
 +}
 +
---- writerperfect//source/filter/DocumentCollector.hxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/DocumentCollector.hxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/DocumentCollector.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/DocumentCollector.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -45,8 +45,9 @@
  #include <stack>
  #include <string.h>
@@ -1697,8 +1697,8 @@
  };
  
  #endif
---- writerperfect//source/filter/DocumentElement.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/DocumentElement.cxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/DocumentElement.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/DocumentElement.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -26,6 +26,7 @@
   */
  
@@ -1745,8 +1745,8 @@
  	WPXPropertyList xBlankAttrList;
          
  	WPXString sTemp;
---- writerperfect//source/filter/DocumentElement.hxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/DocumentElement.hxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/DocumentElement.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/DocumentElement.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -21,36 +21,31 @@
   *
   */
@@ -1834,8 +1834,8 @@
 -
 + 
  #endif
---- writerperfect//source/filter/DocumentHandler.hxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/DocumentHandler.hxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/DocumentHandler.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/DocumentHandler.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -11,10 +11,12 @@
  #pragma warning( pop )
  #endif
@@ -1851,7 +1851,7 @@
  public:
          DocumentHandler(Reference < XDocumentHandler > &xHandler);
 --- writerperfect//source/filter/DocumentHandlerInterface.hxx	1970-01-01 01:00:00.000000000 +0100
-+++ writerperfect//source/filter/DocumentHandlerInterface.hxx	2008-06-24 21:07:12.000000000 +0200
++++ writerperfect//source/filter/DocumentHandlerInterface.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -0,0 +1,45 @@
 +/*
 + * Copyright (C) 2004 William Lachance (wlach interlog com)
@@ -1898,8 +1898,8 @@
 +        virtual void characters(const WPXString &sCharacters) = 0;
 +};
 +#endif
---- writerperfect//source/filter/FontStyle.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/FontStyle.cxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/FontStyle.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/FontStyle.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -29,7 +29,7 @@
  #include "DocumentElement.hxx"
  
@@ -1928,8 +1928,8 @@
 +	TagCloseElement styleClose("style:font-face");
  	styleClose.write(pHandler);
  }
---- writerperfect//source/filter/FontStyle.hxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/FontStyle.hxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/FontStyle.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/FontStyle.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -21,28 +21,23 @@
   *
   */
@@ -1963,7 +1963,7 @@
  
  private:
 --- writerperfect//source/filter/GraphicsStyle.cxx	1970-01-01 01:00:00.000000000 +0100
-+++ writerperfect//source/filter/GraphicsStyle.cxx	2008-06-24 21:07:12.000000000 +0200
++++ writerperfect//source/filter/GraphicsStyle.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -0,0 +1,40 @@
 +/* GraphicsStyle:
 + *
@@ -2006,7 +2006,7 @@
 +{        
 +}
 --- writerperfect//source/filter/GraphicsStyle.hxx	1970-01-01 01:00:00.000000000 +0100
-+++ writerperfect//source/filter/GraphicsStyle.hxx	2008-06-24 21:07:12.000000000 +0200
++++ writerperfect//source/filter/GraphicsStyle.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -0,0 +1,40 @@
 +/* GraphicsStyle:
 + *
@@ -2049,7 +2049,7 @@
 +};
 +#endif
 --- writerperfect//source/filter/InternalHandler.cxx	1970-01-01 01:00:00.000000000 +0100
-+++ writerperfect//source/filter/InternalHandler.cxx	2008-06-24 21:07:12.000000000 +0200
++++ writerperfect//source/filter/InternalHandler.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -0,0 +1,54 @@
 +/*
 + * Copyright (C) 2007 Fridrich Strba  strba bluewin ch)
@@ -2106,7 +2106,7 @@
 +	mpElements->push_back(new CharDataElement(sCharacters.cstr()));
 +}
 --- writerperfect//source/filter/InternalHandler.hxx	1970-01-01 01:00:00.000000000 +0100
-+++ writerperfect//source/filter/InternalHandler.hxx	2008-06-24 21:07:12.000000000 +0200
++++ writerperfect//source/filter/InternalHandler.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -0,0 +1,46 @@
 +/*
 + * Copyright (C) 2007 Fridrich Strba  strba bluewin ch)
@@ -2154,8 +2154,8 @@
 +	std::vector<DocumentElement *> *mpElements;
 +};
 +#endif
---- writerperfect//source/filter/ListStyle.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/ListStyle.cxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/ListStyle.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/ListStyle.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -29,7 +29,7 @@
  #include "DocumentElement.hxx"
  
@@ -2285,8 +2285,8 @@
  {
  	TagOpenElement listStyleOpenElement("text:list-style");
  	listStyleOpenElement.addAttribute("style:name", getName());
---- writerperfect//source/filter/ListStyle.hxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/ListStyle.hxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/ListStyle.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/ListStyle.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -21,23 +21,18 @@
   *
   */
@@ -2348,8 +2348,8 @@
  	const int getListID() { return miListID; }
  	const bool isListLevelDefined(int iLevel) const;
  
---- writerperfect//source/filter/makefile.mk	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/makefile.mk	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/makefile.mk	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/makefile.mk	2008-06-25 12:39:46.000000000 +0200
 @@ -10,6 +10,10 @@
  INCPRE+=$(LIBWPD_CFLAGS)
  .ENDIF
@@ -2389,7 +2389,7 @@
  
  .INCLUDE :  target.mk
 --- writerperfect//source/filter/OdgExporter.cxx	1970-01-01 01:00:00.000000000 +0100
-+++ writerperfect//source/filter/OdgExporter.cxx	2008-06-24 21:07:12.000000000 +0200
++++ writerperfect//source/filter/OdgExporter.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -0,0 +1,615 @@
 +/* libwpg
 + * Copyright (C) 2006 Ariya Hidayat (ariya kde org)
@@ -3007,7 +3007,7 @@
 +	return WPXString(stringValue.c_str());
 +}
 --- writerperfect//source/filter/OdgExporter.hxx	1970-01-01 01:00:00.000000000 +0100
-+++ writerperfect//source/filter/OdgExporter.hxx	2008-06-24 21:07:12.000000000 +0200
++++ writerperfect//source/filter/OdgExporter.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -0,0 +1,85 @@
 +/* libwpg
 + * Copyright (C) 2006 Ariya Hidayat (ariya kde org)
@@ -3094,8 +3094,8 @@
 +};
 +
 +#endif // __ODGEXPORTER_HXX__
---- writerperfect//source/filter/PageSpan.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/PageSpan.cxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/PageSpan.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/PageSpan.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -87,39 +87,38 @@
          return 0; // should never happen
  }
@@ -3235,8 +3235,8 @@
 -	headerFooterClose.write(pHandler);
  }
 -
---- writerperfect//source/filter/PageSpan.hxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/PageSpan.hxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/PageSpan.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/PageSpan.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -26,25 +26,20 @@
   */
  #ifndef _PAGESPAN_H
@@ -3276,8 +3276,8 @@
  private:
          WPXPropertyList mxPropList;
  	std::vector<DocumentElement *> * mpHeaderContent;
---- writerperfect//source/filter/SectionStyle.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/SectionStyle.cxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/SectionStyle.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/SectionStyle.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -33,7 +33,7 @@
  
  #ifdef _MSC_VER
@@ -3324,8 +3324,8 @@
  
  	pHandler->endElement("style:style");
  }
---- writerperfect//source/filter/SectionStyle.hxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/SectionStyle.hxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/SectionStyle.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/SectionStyle.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -21,19 +21,13 @@
   *
   */
@@ -3360,8 +3360,8 @@
  	WPXPropertyListVector mColumns;
  };
  #endif
---- writerperfect//source/filter/Style.hxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/Style.hxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/Style.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/Style.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -21,19 +21,13 @@
   *
   */
@@ -3392,8 +3392,8 @@
  	const WPXString &getName() const { return msName; }
  
   private:
---- writerperfect//source/filter/TableStyle.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/TableStyle.cxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/TableStyle.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/TableStyle.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -27,7 +27,6 @@
   * Corel Corporation or Corel Corporation Limited."
   */
@@ -3510,8 +3510,8 @@
  
  		pHandler->endElement("style:style");
  
---- writerperfect//source/filter/TableStyle.hxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/TableStyle.hxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/TableStyle.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/TableStyle.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -22,57 +22,53 @@
   *
   */
@@ -3582,8 +3582,8 @@
  	WPXPropertyListVector mColumns;
  	std::vector<TableCellStyle *> mTableCellStyles;
  	std::vector<TableRowStyle *> mTableRowStyles;
---- writerperfect//source/filter/TextRunStyle.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/TextRunStyle.cxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/TextRunStyle.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/TextRunStyle.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -50,91 +50,95 @@
  	delete mpPropList;
  }
@@ -3761,8 +3761,8 @@
 +	pHandler->endElement("style:text-properties");
  	pHandler->endElement("style:style");
  }
---- writerperfect//source/filter/TextRunStyle.hxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/TextRunStyle.hxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/TextRunStyle.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/TextRunStyle.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -29,26 +29,19 @@
  
  #ifndef _TEXTRUNSTYLE_H
@@ -3800,16 +3800,16 @@
  
  private:
          WPXPropertyList mPropList;
---- writerperfect//source/filter/WriterProperties.hxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/filter/WriterProperties.hxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/filter/WriterProperties.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/filter/WriterProperties.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -32,5 +32,4 @@
  #define IMP_DEFAULT_FONT_NAME "Times New Roman"
  #define IMP_DEFAULT_FONT_SIZE 12.0f
  #define IMP_DEFAULT_FONT_PITCH "variable"
 -#define IMP_DEFAULT_FONT_COLOR (new RGBSColor(0x00,0x00,0x00,0x64))
  #endif
---- writerperfect//source/stream/WPXSvStream.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/stream/WPXSvStream.cxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/stream/WPXSvStream.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/stream/WPXSvStream.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -9,7 +9,7 @@
  using namespace ::com::sun::star::io;
  
@@ -3846,8 +3846,8 @@
 -{
 -	return getDocumentOLEStream( "PerfectOffice_MAIN" );
 -}
---- writerperfect//source/stream/WPXSvStream.h	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/stream/WPXSvStream.h	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/stream/WPXSvStream.h	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/stream/WPXSvStream.h	2008-06-25 12:39:46.000000000 +0200
 @@ -12,13 +12,12 @@
  #if defined _MSC_VER
  #pragma warning( push, 1 )
@@ -3876,8 +3876,8 @@
  	virtual int seek(long offset, WPX_SEEK_TYPE seekType);
  	virtual long tell();
  	virtual bool atEOS();
---- writerperfect//source/wpdimp/makefile.mk	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/wpdimp/makefile.mk	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/wpdimp/makefile.mk	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/wpdimp/makefile.mk	2008-06-25 12:39:46.000000000 +0200
 @@ -10,6 +10,10 @@
  INCPRE+=$(LIBWPD_CFLAGS)
  .ENDIF
@@ -3889,18 +3889,21 @@
  .IF "$(SYSTEM_LIBWPS)" == "YES"
  INCPRE+=$(LIBWPS_CFLAGS)
  .ENDIF
---- writerperfect//source/wpdimp/WordPerfectCollector.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/wpdimp/WordPerfectCollector.cxx	2008-06-24 21:07:12.000000000 +0200
-@@ -35,7 +35,7 @@
+--- writerperfect//source/wpdimp/WordPerfectCollector.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/wpdimp/WordPerfectCollector.cxx	2008-06-25 15:25:06.000000000 +0200
+@@ -35,8 +35,9 @@
  #pragma warning( pop )
  #endif
  
 -WordPerfectCollector::WordPerfectCollector(WPSInputStream *pInput, DocumentHandler *pHandler) :
-+WordPerfectCollector::WordPerfectCollector(WPXInputStream *pInput, DocumentHandlerInterface *pHandler) :
- 	DocumentCollector(pInput, pHandler)
+-	DocumentCollector(pInput, pHandler)
++WordPerfectCollector::WordPerfectCollector(WPXInputStream *pInput, DocumentHandlerInterface *pHandler, const rtl::OString& password) :
++	DocumentCollector(pInput, pHandler),
++	maUtf8Password(password)
  {
  }
-@@ -44,9 +44,9 @@
+ 
+@@ -44,9 +45,13 @@
  {
  }
  
@@ -3908,55 +3911,109 @@
 +bool WordPerfectCollector::parseSourceDocument(WPXInputStream &input)
  {
 -        WPDResult result = WPDocument::parse(&input, static_cast<WPXHLListenerImpl *>(this));
-+        WPDResult result = WPDocument::parse(&input, static_cast<WPXDocumentInterface *>(this), NULL);
++        WPDResult result;
++		if (maUtf8Password.getLength())
++			result = WPDocument::parse(&input, static_cast<WPXDocumentInterface *>(this), maUtf8Password.getStr());
++		else
++			result = WPDocument::parse(&input, static_cast<WPXDocumentInterface *>(this), NULL);
          if (result != WPD_OK)
                  return false;
  
---- writerperfect//source/wpdimp/WordPerfectCollector.hxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/wpdimp/WordPerfectCollector.hxx	2008-06-24 21:07:12.000000000 +0200
-@@ -30,12 +30,13 @@
+--- writerperfect//source/wpdimp/WordPerfectCollector.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/wpdimp/WordPerfectCollector.hxx	2008-06-25 15:27:05.000000000 +0200
+@@ -30,12 +30,16 @@
  #define _WORDPERFECTCOLLECTOR_HXX
  
  #include "filter/DocumentCollector.hxx"
 +#include "filter/DocumentHandlerInterface.hxx"
++#include <rtl/ustring.hxx>
  
  class WordPerfectCollector : public DocumentCollector
  {
  public:
 -	WordPerfectCollector(WPSInputStream *pInput, DocumentHandler *pHandler);
-+	WordPerfectCollector(WPXInputStream *pInput, DocumentHandlerInterface *pHandler);
++	WordPerfectCollector(WPXInputStream *pInput, DocumentHandlerInterface *pHandler, const rtl::OString& password);
  	virtual ~WordPerfectCollector();
 -	bool parseSourceDocument(WPSInputStream &pInput);
 +	bool parseSourceDocument(WPXInputStream &pInput);
++private:
++	rtl::OString maUtf8Password;
  };
  #endif
---- writerperfect//source/wpdimp/WordPerfectImportFilter.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/wpdimp/WordPerfectImportFilter.cxx	2008-06-24 21:14:26.000000000 +0200
-@@ -50,6 +50,7 @@
+--- writerperfect//source/wpdimp/WordPerfectImportFilter.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/wpdimp/WordPerfectImportFilter.cxx	2008-06-25 15:33:32.000000000 +0200
+@@ -29,27 +29,20 @@
+  */
+ 
+ #include <osl/diagnose.h>
+-#ifndef _RTL_TENCINFO_H_
+ #include <rtl/tencinfo.h>
+-#endif
+ #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/InputSource.hpp>
+ #include <com/sun/star/xml/sax/XParser.hpp>
+-
+-#ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_HPP
++#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+ #include <com/sun/star/ucb/XCommandEnvironment.hpp>
+-#endif
+ 
+-#ifndef _ATTRLIST_HPP_
+ #include <xmloff/attrlist.hxx>
+-#endif
+-#ifndef _XMLKYWD_HPP
  #include <xmloff/xmlkywd.hxx>
- #endif
+-#endif
  #include <ucbhelper/content.hxx>
 +#include <sfx2/passwd.hxx>
  
  #include "filter/FilterInternal.hxx"
  #include "filter/DocumentHandler.hxx"
-@@ -98,7 +99,13 @@
+@@ -98,7 +91,6 @@
  	throw (RuntimeException)
  {
  	WRITER_DEBUG_MSG(("WordPerfectImportFilter::importImpl: Got here!\n"));
 -
-+	String aPasswd;
-+	{
-+			SfxPasswordDialog* pPasswdDlg =
-+					new SfxPasswordDialog( 0 );
-+				if(pPasswdDlg->Execute())
-+					aPasswd = pPasswdDlg->GetPassword();
-+	}
  	sal_Int32 nLength = aDescriptor.getLength();
  	const PropertyValue * pValue = aDescriptor.getConstArray();
  	OUString sURL;
-@@ -119,7 +126,7 @@
- 	sFileName = OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII);
+@@ -115,24 +107,48 @@
+ 	    OSL_ASSERT( 0 );
+ 	    return sal_False;
+ 	}
+-	OString sFileName;
+-	sFileName = OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII);
++
++	WPXSvInputStream input( xInputStream );
++
++	OString aUtf8Passwd;
++
++	WPDConfidence confidence = WPDocument::isFileFormatSupported(&input);
++
++	if (WPD_CONFIDENCE_SUPPORTED_ENCRYPTION == confidence)
++	{
++		int unsuccessfulAttempts = 0;
++		while (true )
++		{
++			SfxPasswordDialog* pPasswdDlg =
++				new SfxPasswordDialog( 0 );
++			pPasswdDlg->SetMinLen(0);
++			if(!pPasswdDlg->Execute())
++				return sal_False;
++			String aPasswd = pPasswdDlg->GetPassword();
++			OUString aUniPasswd(aPasswd.GetBuffer() /*, aPasswd.Len(), RTL_TEXTENCODING_UCS2 */);
++			aUtf8Passwd = OUStringToOString(aUniPasswd, RTL_TEXTENCODING_UTF8);
++			if (WPD_PASSWORD_MATCH_OK == WPDocument::verifyPassword(&input, aUtf8Passwd.getStr()))
++				break;
++			else
++				unsuccessfulAttempts++;
++			if (unsuccessfulAttempts == 3) // timeout after 3 password atempts
++				return sal_False;
++		}
++	}
  
  	// An XML import service: what we push sax messages to..
 -	OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.XMLImporter" ) );
@@ -3964,17 +4021,264 @@
  	uno::Reference < XDocumentHandler > xInternalHandler( mxMSF->createInstance( sXMLImportService ), UNO_QUERY );
  
  	// The XImporter sets up an empty target document for XDocumentHandler to write to.. 
-@@ -204,7 +211,7 @@
+ 	uno::Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY);
+ 	xImporter->setTargetDocument(mxDoc);
+ 
+-        // OO Document Handler: abstract class to handle document SAX messages, concrete implementation here
+-        // writes to in-memory target doc
+-        DocumentHandler xHandler(xInternalHandler);
+-
+-	WPXSvInputStream input( xInputStream );
++	// OO Document Handler: abstract class to handle document SAX messages, concrete implementation here
++	// writes to in-memory target doc
++	DocumentHandler xHandler(xInternalHandler);
+ 
+-	WordPerfectCollector collector(&input, &xHandler);
++	WordPerfectCollector collector(&input, &xHandler, aUtf8Passwd);
+ 	collector.filter();
+ 
+ 	return true;
+@@ -204,9 +220,9 @@
  	if (input.atEOS())
          return ::rtl::OUString();
  
 -	confidence = WPDocument::isFileFormatSupported(&input, false);
 +	confidence = WPDocument::isFileFormatSupported(&input);
  
- 	if (confidence == WPD_CONFIDENCE_EXCELLENT)
+-	if (confidence == WPD_CONFIDENCE_EXCELLENT)
++	if (confidence == WPD_CONFIDENCE_EXCELLENT || confidence == WPD_CONFIDENCE_SUPPORTED_ENCRYPTION)
  		sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( "writer_WordPerfect_Document" ) );
---- writerperfect//source/wpgimp/makefile.mk	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/wpgimp/makefile.mk	2008-06-24 21:07:12.000000000 +0200
+ 
+     if (sTypeName.getLength())
+@@ -294,3 +310,93 @@
+ {
+     return WordPerfectImportFilter_getSupportedServiceNames();
+ }
++
++
++WordPerfectImportFilterDialog::WordPerfectImportFilterDialog(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory > &r ) :
++    mxMSF( r ) {}
++
++WordPerfectImportFilterDialog::~WordPerfectImportFilterDialog()
++{
++}
++
++void SAL_CALL WordPerfectImportFilterDialog::setTitle( const ::rtl::OUString& )
++            throw (::com::sun::star::uno::RuntimeException)
++{
++}
++
++sal_Int16 SAL_CALL WordPerfectImportFilterDialog::execute()
++            throw (::com::sun::star::uno::RuntimeException)
++{
++	printf("Here we are my dear\n");
++	String aPasswd;
++	{
++			SfxPasswordDialog* pPasswdDlg =
++					new SfxPasswordDialog( 0 );
++				if(pPasswdDlg->Execute())
++					aPasswd = pPasswdDlg->GetPassword();
++	}
++    if (true)
++		return com::sun::star::ui::dialogs::ExecutableDialogResults::OK;
++	else
++		return com::sun::star::ui::dialogs::ExecutableDialogResults::CANCEL;
++}
++
++uno::Sequence<beans::PropertyValue> SAL_CALL WordPerfectImportFilterDialog::getPropertyValues() throw(uno::RuntimeException)
++{
++	return uno::Sequence<beans::PropertyValue>();
++}
++
++void SAL_CALL WordPerfectImportFilterDialog::setPropertyValues( const uno::Sequence<beans::PropertyValue>& )
++					throw(beans::UnknownPropertyException, beans::PropertyVetoException,
++							lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
++{
++}
++
++
++// XServiceInfo
++OUString SAL_CALL WordPerfectImportFilterDialog::getImplementationName(  )
++    throw (RuntimeException)
++{
++    return WordPerfectImportFilterDialog_getImplementationName();
++}
++
++sal_Bool SAL_CALL WordPerfectImportFilterDialog::supportsService( const OUString& rServiceName )
++    throw (RuntimeException)
++{
++    return WordPerfectImportFilterDialog_supportsService( rServiceName );
++}
++
++Sequence< OUString > SAL_CALL WordPerfectImportFilterDialog::getSupportedServiceNames(  )
++    throw (RuntimeException)
++{
++    return WordPerfectImportFilterDialog_getSupportedServiceNames();
++}
++
++OUString WordPerfectImportFilterDialog_getImplementationName ()
++    throw (RuntimeException)
++{
++    return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.WordPerfectImportFilterDialog" ) );
++}
++
++#define SERVICE_NAME "com.sun.star.ui.dialogs.FilterOptionsDialog"
++sal_Bool SAL_CALL WordPerfectImportFilterDialog_supportsService( const OUString& ServiceName )
++    throw (RuntimeException)
++{
++    return ( ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ) ) );
++}
++
++Sequence< OUString > SAL_CALL WordPerfectImportFilterDialog_getSupportedServiceNames(  )
++    throw (RuntimeException)
++{
++    Sequence < OUString > aRet(1);
++    OUString* pArray = aRet.getArray();
++    pArray[0] =  OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
++    return aRet;
++}
++#undef SERVICE_NAME
++
++uno::Reference< XInterface > SAL_CALL WordPerfectImportFilterDialog_createInstance( const uno::Reference< XMultiServiceFactory > & rSMgr)
++    throw( Exception )
++{
++    return (cppu::OWeakObject*) new WordPerfectImportFilterDialog( rSMgr );
++}
+--- writerperfect//source/wpdimp/WordPerfectImportFilter.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/wpdimp/WordPerfectImportFilter.hxx	2008-06-25 14:19:14.000000000 +0200
+@@ -32,9 +32,12 @@
+ #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/beans/XPropertyAccess.hpp>
++#include <com/sun/star/ui/dialogs/XExecutableDialog.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/implbase3.hxx>
+ #include <cppuhelper/implbase5.hxx>
+ 
+ enum FilterType 
+@@ -112,4 +115,58 @@
+ SAL_CALL WordPerfectImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr)
+ 	throw ( ::com::sun::star::uno::Exception );
+ 
++
++class WordPerfectImportFilterDialog : public cppu::WeakImplHelper3 <
++		com::sun::star::ui::dialogs::XExecutableDialog,
++		com::sun::star::lang::XServiceInfo,
++		com::sun::star::beans::XPropertyAccess
++>
++{
++    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
++
++    ~WordPerfectImportFilterDialog();
++
++	// XExecutableDialog
++       virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle )
++            throw (::com::sun::star::uno::RuntimeException);
++       virtual sal_Int16 SAL_CALL execute()
++            throw (::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);
++
++	// XPropertyAccess
++		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
++							SAL_CALL getPropertyValues() throw (::com::sun::star::uno::RuntimeException);
++		virtual void SAL_CALL	setPropertyValues( const ::com::sun::star::uno::Sequence<
++									::com::sun::star::beans::PropertyValue >& aProps )
++								throw (::com::sun::star::beans::UnknownPropertyException,
++										::com::sun::star::beans::PropertyVetoException,
++										::com::sun::star::lang::IllegalArgumentException,
++										::com::sun::star::lang::WrappedTargetException,
++										::com::sun::star::uno::RuntimeException);
++
++public:
++	WordPerfectImportFilterDialog(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory > &r );
++
++};
++
++::rtl::OUString WordPerfectImportFilterDialog_getImplementationName()
++    throw ( ::com::sun::star::uno::RuntimeException );
++
++sal_Bool SAL_CALL WordPerfectImportFilterDialog_supportsService( const ::rtl::OUString& ServiceName )
++    throw ( ::com::sun::star::uno::RuntimeException );
++
++::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL WordPerfectImportFilterDialog_getSupportedServiceNames(  )
++    throw ( ::com::sun::star::uno::RuntimeException );
++
++::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
++SAL_CALL WordPerfectImportFilterDialog_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr)
++    throw ( ::com::sun::star::uno::Exception );
++
+ #endif
+--- writerperfect//source/wpdimp/wpft_genericfilter.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/wpdimp/wpft_genericfilter.cxx	2008-06-25 15:38:47.000000000 +0200
+@@ -55,14 +55,22 @@
+ 		{
+             sal_Int32 nPos = 0;
+             Reference< XRegistryKey > xNewKey(
+-				reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( WordPerfectImportFilter_getImplementationName() ) ); 
++				reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( WordPerfectImportFilter_getImplementationName() ) );
+             xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
+-			
++
+ 			const Sequence< OUString > & rSNL = WordPerfectImportFilter_getSupportedServiceNames();
+ 			const OUString * pArray = rSNL.getConstArray();
+ 			for ( nPos = rSNL.getLength(); nPos--; )
+ 				xNewKey->createKey( pArray[nPos] );
++#if 0
++			xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( WordPerfectImportFilterDialog_getImplementationName() );
++            xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
+ 
++			const Sequence< OUString > & rSNL2 = WordPerfectImportFilterDialog_getSupportedServiceNames();
++			pArray = rSNL2.getConstArray();
++			for ( nPos = rSNL2.getLength(); nPos--; )
++				xNewKey->createKey( pArray[nPos] );
++#endif
+ 			return sal_True;
+ 		}
+ 		catch (InvalidRegistryException &)
+@@ -85,14 +93,29 @@
+ 			reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
+ 			OUString::createFromAscii( pImplName ),
+ 			WordPerfectImportFilter_createInstance, WordPerfectImportFilter_getSupportedServiceNames() ) );
+-		
++
++		if (xFactory.is())
++		{
++			xFactory->acquire();
++			pRet = xFactory.get();
++		}
++	}
++#if 0
++	else if ( pServiceManager && implName.equals(WordPerfectImportFilterDialog_getImplementationName()) )
++	{
++		Reference< XSingleServiceFactory > xFactory( createSingleFactory(
++			reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
++			OUString::createFromAscii( pImplName ),
++			WordPerfectImportFilterDialog_createInstance, WordPerfectImportFilterDialog_getSupportedServiceNames() ) );
++
+ 		if (xFactory.is())
+ 		{
+ 			xFactory->acquire();
+ 			pRet = xFactory.get();
+ 		}
+ 	}
+-	
++#endif
++
+ 	return pRet;
+ }
+ }
+--- writerperfect//source/wpgimp/makefile.mk	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/wpgimp/makefile.mk	2008-06-25 12:39:46.000000000 +0200
 @@ -12,12 +12,6 @@
  INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/libwpd
  .ENDIF
@@ -3996,8 +4300,8 @@
      $(SLO)$/WPGImportFilter.obj \
  	$(SLO)$/wpgimport_genericfilter.obj		
  
---- writerperfect//source/wpgimp/WPGImportFilter.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/wpgimp/WPGImportFilter.cxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/wpgimp/WPGImportFilter.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/wpgimp/WPGImportFilter.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -75,7 +75,7 @@
  #endif
  
@@ -4041,8 +4345,8 @@
  	if (libwpg::WPGraphics::isSupported(input))
  		sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( "draw_WordPerfect_Graphics" ) );
  
---- writerperfect//source/wpsimp/MSWorksCollector.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/wpsimp/MSWorksCollector.cxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/wpsimp/MSWorksCollector.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/wpsimp/MSWorksCollector.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -29,7 +29,7 @@
  #include "MSWorksCollector.hxx"
  #include <libwps/WPSDocument.h>
@@ -4064,8 +4368,8 @@
          if (result != WPS_OK)
                  return false;
  
---- writerperfect//source/wpsimp/MSWorksCollector.hxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/wpsimp/MSWorksCollector.hxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/wpsimp/MSWorksCollector.hxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/wpsimp/MSWorksCollector.hxx	2008-06-25 12:39:46.000000000 +0200
 @@ -30,12 +30,13 @@
  #define _MSWORKSCOLLECTOR_HXX
  
@@ -4082,8 +4386,8 @@
 +	bool parseSourceDocument(WPXInputStream &input);
  };
  #endif
---- writerperfect//source/wpsimp/MSWorksImportFilter.cxx	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//source/wpsimp/MSWorksImportFilter.cxx	2008-06-24 21:07:12.000000000 +0200
+--- writerperfect//source/wpsimp/MSWorksImportFilter.cxx	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//source/wpsimp/MSWorksImportFilter.cxx	2008-06-25 12:39:46.000000000 +0200
 @@ -127,7 +127,7 @@
  	sFileName = OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII);
  	
@@ -4102,9 +4406,8 @@
  
  	if ((confidence == WPS_CONFIDENCE_EXCELLENT) || (confidence == WPS_CONFIDENCE_GOOD))
  		sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( "writer_MS_Works_Document" ) );
-Files writerperfect//unxlngi6.pro/lib/libwpftli.so and writerperfect//unxlngi6.pro/lib/libwpftli.so differ
---- writerperfect//util/makefile.mk	2008-06-24 21:05:26.000000000 +0200
-+++ writerperfect//util/makefile.mk	2008-06-24 21:40:23.000000000 +0200
+--- writerperfect//util/makefile.mk	2008-06-25 12:39:35.000000000 +0200
++++ writerperfect//util/makefile.mk	2008-06-25 12:39:46.000000000 +0200
 @@ -44,6 +44,8 @@
  	$(SOTLIB) \
  	$(SO2LIB) \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]