filter/source/xsltdialog/xmlfilterhelpids.hrc | 3 +- filter/source/xsltdialog/xmlfiltersettingsdialog.hrc | 2 - filter/source/xsltdialog/xmlfiltersettingsdialog.src | 8 +++--- filter/source/xsltdialog/xmlfiltertabpagexslt.cxx | 23 ++++++++++++++---- filter/source/xsltdialog/xmlfiltertabpagexslt.hrc | 5 ++- filter/source/xsltdialog/xmlfiltertabpagexslt.hxx | 4 ++- filter/source/xsltdialog/xmlfiltertabpagexslt.src | 14 ++++++++--- filter/source/xsltdialog/xmlfiltertestdialog.cxx | 24 ++++++++++++------- filter/source/xsltdialog/xmlfiltertestdialog.hxx | 1 filter/source/xsltfilter/LibXSLTTransformer.cxx | 1 10 files changed, 59 insertions(+), 26 deletions(-)
New commits: commit bf2857d88af137ba15939d81970be92b0310c915 Author: Peter Jentsch <pj...@guineapics.de> Date: Sun Nov 13 23:09:23 2011 +0100 open xml filter test result in default xml editor first commit to remove the broken xml filter source view and validation service. The validation service is currently broken in that it doesn't allow to refer to or define an xml catalog or alternative validation methods. All of this is included in current xml development tools elsewhere, so we don't need to duplicate that in LO. diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx index 33b6b28..aaf274f 100644 --- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx @@ -43,6 +43,9 @@ #include <com/sun/star/document/XExporter.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> +#include "com/sun/star/system/XSystemShellExecute.hpp" +#include "com/sun/star/system/SystemShellExecuteFlags.hpp" + #include "com/sun/star/ui/dialogs/TemplateDescription.hpp" #include <vcl/svapp.hxx> #include <osl/mutex.hxx> @@ -50,12 +53,12 @@ #include <osl/file.hxx> #include <unotools/tempfile.hxx> #include <tools/urlobj.hxx> +#include <comphelper/processfactory.hxx> #include "xmlfilterdialogstrings.hrc" #include "xmlfiltersettingsdialog.hxx" #include "xmlfiltertestdialog.hxx" #include "xmlfiltertestdialog.hrc" -#include "xmlfileview.hxx" using namespace utl; @@ -164,7 +167,6 @@ XMLFilterTestDialog::XMLFilterTestDialog( Window* pParent, ResMgr& rResMgr, cons maFTNameOfRecentFile( this, ResId( FT_NAME_OF_RECENT_FILE, rResMgr ) ), maPBClose( this, ResId( PB_CLOSE, rResMgr ) ), maPBHelp( this, ResId( PB_HELP, rResMgr ) ), - mpSourceDLG( NULL ), mpFilterInfo( NULL ), sDTDPath( RTL_CONSTASCII_USTRINGPARAM( "$(inst)/share/dtd/officedocument/1_0/office.dtd" ) ) { @@ -209,7 +211,6 @@ XMLFilterTestDialog::~XMLFilterTestDialog() OSL_FAIL( "XMLFilterTestDialog::~XMLFilterTestDialog exception catched!" ); } - delete mpSourceDLG; delete mpFilterInfo; } @@ -469,7 +470,9 @@ void XMLFilterTestDialog::doExport( Reference< XComponent > xComp ) Reference< XStorable > xStorable( xComp, UNO_QUERY ); if( xStorable.is() ) { - utl::TempFile aTempFile; + String leadingChars; + String ext(RTL_CONSTASCII_USTRINGPARAM(".xml")); + utl::TempFile aTempFile(leadingChars, &ext); OUString aTempFileURL( aTempFile.GetURL() ); const application_info_impl* pAppInfo = getApplicationInfo( mpFilterInfo->maExportService ); @@ -564,10 +567,13 @@ void XMLFilterTestDialog::doExport( Reference< XComponent > xComp ) void XMLFilterTestDialog::displayXMLFile( const OUString& rURL ) { - if( NULL == mpSourceDLG ) - mpSourceDLG = new XMLSourceFileDialog( NULL, mrResMgr, mxMSF ); + ::com::sun::star::uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute(comphelper::getProcessServiceFactory()->createInstance(DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute") ), com::sun::star::uno::UNO_QUERY_THROW ); + xSystemShellExecute->execute( rURL, rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS ); - mpSourceDLG->ShowWindow( rURL, mpFilterInfo); +// if( NULL == mpSourceDLG ) +// mpSourceDLG = new XMLSourceFileDialog( NULL, mrResMgr, mxMSF ); +// +// mpSourceDLG->ShowWindow( rURL, mpFilterInfo); } void XMLFilterTestDialog::onImportBrowse() @@ -644,7 +650,9 @@ void XMLFilterTestDialog::import( const OUString& rURL ) if( maCBXDisplaySource.IsChecked() ) { - TempFile aTempFile; + String lead; + String ext(RTL_CONSTASCII_USTRINGPARAM(".xml")); + TempFile aTempFile(lead, &ext); OUString aTempFileURL( aTempFile.GetURL() ); Reference< XImportFilter > xImporter( mxMSF->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.documentconversion.XSLTFilter" )) ), UNO_QUERY ); diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.hxx b/filter/source/xsltdialog/xmlfiltertestdialog.hxx index b83cd9d..04457b9 100644 --- a/filter/source/xsltdialog/xmlfiltertestdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltertestdialog.hxx @@ -95,7 +95,6 @@ private: PushButton maPBClose; HelpButton maPBHelp; - XMLSourceFileDialog* mpSourceDLG; filter_info_impl* mpFilterInfo; String maDialogTitle; commit 80b8744a97502c10b87c2f869c6672f43495be12 Author: Peter Jentsch <pj...@guineapics.de> Date: Sat Nov 5 21:41:42 2011 +0100 fix threading problem in LibXSLTTransformer.cxx need to wait for reader thread to terminate before deleting it. diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx index 72c31c1..599b80c 100644 --- a/filter/source/xsltfilter/LibXSLTTransformer.cxx +++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx @@ -485,6 +485,7 @@ namespace XSLT LibXSLTTransformer::terminate() throw (RuntimeException) { m_Reader->terminate(); + m_Reader->join(); delete(m_Reader); m_parameters.clear(); } commit 027a8d56baf135c20c63aa0944c125374cac3a57 Author: Peter Jentsch <pj...@guineapics.de> Date: Wed Nov 2 23:33:11 2011 +0100 use radiobuttons to select builtin/saxon xslt transformation diff --git a/filter/source/xsltdialog/xmlfilterhelpids.hrc b/filter/source/xsltdialog/xmlfilterhelpids.hrc index 8e6a34f..558a274 100644 --- a/filter/source/xsltdialog/xmlfilterhelpids.hrc +++ b/filter/source/xsltdialog/xmlfilterhelpids.hrc @@ -50,7 +50,8 @@ #define HID_XML_FILTER_DOCTYPE "FILTER_HID_XML_FILTER_DOCTYPE" #define HID_XML_FILTER_DTD "FILTER_HID_XML_FILTER_DTD" #define HID_XML_FILTER_DTD_BROWSE "FILTER_HID_XML_FILTER_DTD_BROWSE" -#define HID_XML_FILTER_TRANSFORM_SERVICE "FILTER_HID_XML_FILTER_TRANSFORM_SERVICE" +#define HID_XML_FILTER_TRANSFORM_SERVICE_SAXON_J "FILTER_HID_XML_FILTER_TRANSFORM_SERVICE_SAXON_J" +#define HID_XML_FILTER_TRANSFORM_SERVICE_LIBXSLT "FILTER_HID_XML_FILTER_TRANSFORM_SERVICE_LIBXSLT" #define HID_XML_FILTER_EXPORT_XSLT "FILTER_HID_XML_FILTER_EXPORT_XSLT" #define HID_XML_FILTER_EXPORT_XSLT_BROWSE "FILTER_HID_XML_FILTER_EXPORT_XSLT_BROWSE" #define HID_XML_FILTER_IMPORT_XSLT "FILTER_HID_XML_FILTER_IMPORT_XSLT" diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx index 9399fd2..30442a3 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx +++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx @@ -67,7 +67,8 @@ XMLFilterTabPageXSLT::XMLFilterTabPageXSLT( Window* pParent, ResMgr& rResMgr, co maPBImportTemplate( this, ResId( PB_XML_IMPORT_TEMPLATE_BROWSE, rResMgr ) ), maFTTransformationService( this, ResId (FT_XML_TRANSFORM_SERVICE, rResMgr ) ), - maEDTransformationService( this, ResId (ED_XML_TRANSFORM_SERVICE, rResMgr ) ), + maRBTransformationServiceLibXSLT( this, ResId (RB_XML_TRANSFORM_SERVICE_LIBXSLT, rResMgr ) ), + maRBTransformationServiceSaxonJ( this, ResId (RB_XML_TRANSFORM_SERVICE_SAXON_J, rResMgr ) ), sHTTPSchema( RTL_CONSTASCII_USTRINGPARAM( "http://" ) ), sSHTTPSchema( RTL_CONSTASCII_USTRINGPARAM( "shttp://" ) ), @@ -97,7 +98,8 @@ XMLFilterTabPageXSLT::XMLFilterTabPageXSLT( Window* pParent, ResMgr& rResMgr, co maEDExportXSLT.SetHelpId( HID_XML_FILTER_EXPORT_XSLT ); maEDImportXSLT.SetHelpId( HID_XML_FILTER_IMPORT_XSLT ); maEDImportTemplate.SetHelpId( HID_XML_FILTER_IMPORT_TEMPLATE ); - maEDTransformationService.SetHelpId( HID_XML_FILTER_TRANSFORM_SERVICE ); + maRBTransformationServiceLibXSLT.SetHelpId( HID_XML_FILTER_TRANSFORM_SERVICE_LIBXSLT ); + maRBTransformationServiceSaxonJ.SetHelpId( HID_XML_FILTER_TRANSFORM_SERVICE_SAXON_J ); } XMLFilterTabPageXSLT::~XMLFilterTabPageXSLT() @@ -113,7 +115,10 @@ bool XMLFilterTabPageXSLT::FillInfo( filter_info_impl* pInfo ) pInfo->maExportXSLT = GetURL( maEDExportXSLT ); pInfo->maImportXSLT = GetURL( maEDImportXSLT ); pInfo->maImportTemplate = GetURL( maEDImportTemplate ); - pInfo->maXSLTTransformerImpl = maEDTransformationService.GetText(); + pInfo->maXSLTTransformerImpl + = maRBTransformationServiceSaxonJ.IsChecked() ? OUString( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.JAXTHelper" )) + : OUString(RTL_CONSTASCII_USTRINGPARAM( "" )); } return true; @@ -129,8 +134,12 @@ void XMLFilterTabPageXSLT::SetInfo(const filter_info_impl* pInfo) SetURL( maEDExportXSLT, pInfo->maExportXSLT ); SetURL( maEDImportXSLT, pInfo->maImportXSLT ); SetURL( maEDImportTemplate, pInfo->maImportTemplate ); - - maEDTransformationService.SetText( pInfo->maXSLTTransformerImpl ); + if (pInfo->maXSLTTransformerImpl.equals(OUString( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.JAXTHelper" )))) { + maRBTransformationServiceSaxonJ.Check(); + } else { + maRBTransformationServiceLibXSLT.Check(); + } } } @@ -188,6 +197,10 @@ OUString XMLFilterTabPageXSLT::GetURL( SvtURLBox& rURLBox ) return aURL; } +IMPL_LINK ( XMLFilterTabPageXSLT, ToggleXSLTImplHdl, void *, EMPTYARG) { + return (0L); +} + IMPL_LINK ( XMLFilterTabPageXSLT, ClickBrowseHdl_Impl, PushButton *, pButton ) { SvtURLBox* pURLBox; diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.hrc b/filter/source/xsltdialog/xmlfiltertabpagexslt.hrc index 48fc571..12a9d46 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagexslt.hrc +++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.hrc @@ -44,7 +44,8 @@ #define FT_XML_IMPORT_TEMPLATE 12 #define ED_XML_IMPORT_TEMPLATE 13 #define PB_XML_IMPORT_TEMPLATE_BROWSE 14 -#define FT_XML_TRANSFORM_SERVICE 15 -#define ED_XML_TRANSFORM_SERVICE 16 +#define FT_XML_TRANSFORM_SERVICE 15 +#define RB_XML_TRANSFORM_SERVICE_LIBXSLT 16 +#define RB_XML_TRANSFORM_SERVICE_SAXON_J 17 #endif diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx b/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx index 64742f5..a5bae97 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx +++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx @@ -49,6 +49,7 @@ public: void SetInfo(const filter_info_impl* pInfo); DECL_LINK( ClickBrowseHdl_Impl, PushButton * ); + DECL_LINK( ToggleXSLTImplHdl, void* ); FixedText maFTDocType; Edit maEDDocType; @@ -70,7 +71,8 @@ public: PushButton maPBImportTemplate; FixedText maFTTransformationService; - Edit maEDTransformationService; + RadioButton maRBTransformationServiceLibXSLT; + RadioButton maRBTransformationServiceSaxonJ; private: void SetURL( SvtURLBox& rURLBox, const rtl::OUString& rURL ); diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.src b/filter/source/xsltdialog/xmlfiltertabpagexslt.src index d82bb30..2d0391c 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagexslt.src +++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.src @@ -182,12 +182,20 @@ TabPage RID_XML_FILTER_TABPAGE_XSLT Text [ en-US ] = "XSLT Transformation Service"; }; - Edit ED_XML_TRANSFORM_SERVICE + RadioButton RB_XML_TRANSFORM_SERVICE_LIBXSLT { + HelpID = HID_XML_FILTER_TRANSFORM_SERVICE_LIBXSLT; Pos = MAP_APPFONT ( SECOND_ROW_X , SECOND_ROW_Y + 5 * ROW_HEIGHT + 5 * SPACING + EDIT_OFFSET ) ; Size = MAP_APPFONT ( SECOND_ROW_WIDTH - SPACING - BROWSE_WIDTH, 12 ) ; - HelpId = HID_XML_FILTER_TRANSFORM_SERVICE; - Border = TRUE; + Text[ en-US ] = "~Builtin (LibXSLT)"; + }; + + RadioButton RB_XML_TRANSFORM_SERVICE_SAXON_J + { + HelpID = HID_XML_FILTER_TRANSFORM_SERVICE_SAXON_J; + Pos = MAP_APPFONT ( SECOND_ROW_X , SECOND_ROW_Y + 6 * ROW_HEIGHT + 6 * SPACING + EDIT_OFFSET ) ; + Size = MAP_APPFONT ( SECOND_ROW_WIDTH - SPACING - BROWSE_WIDTH, 12 ) ; + Text[ en-US ] = "~Saxon/J"; }; }; commit dee1e460e19a511296c8d3e5288f25042c458844 Author: Peter Jentsch <pj...@guineapics.de> Date: Wed Oct 19 00:49:41 2011 +0200 fixed warning about global resource in xmlfilterdialog.src diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hrc b/filter/source/xsltdialog/xmlfiltersettingsdialog.hrc index 7f12904..c1b2597 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hrc +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hrc @@ -39,5 +39,5 @@ #define PB_XML_FILTER_OPEN 7 #define BTN_XML_FILTER_HELP 8 #define PB_XML_FILTER_CLOSE 9 -#define STR_XML_FILTER_LISTBOX 1000 +#define STR_XML_FILTER_LISTBOX 10 #endif diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.src b/filter/source/xsltdialog/xmlfiltersettingsdialog.src index deb15d1..97e233f 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.src +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.src @@ -124,11 +124,11 @@ WorkWindow DLG_XML_FILTER_SETTINGS_DIALOG Text [ en-US ] = "~Close"; }; -}; + String STR_XML_FILTER_LISTBOX + { + Text [ en-US ] = "XML Filter List"; + }; -String STR_XML_FILTER_LISTBOX -{ - Text [ en-US ] = "XML Filter List"; }; _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits