[Libreoffice-commits] .: 2 commits - filter/source
Peter Jentsch
pjentsch at kemper.freedesktop.org
Tue Oct 18 13:23:29 PDT 2011
filter/source/xsltdialog/typedetectionexport.cxx | 1 +
filter/source/xsltdialog/typedetectionimport.cxx | 1 +
filter/source/xsltdialog/xmlfiltercommon.hxx | 1 +
filter/source/xsltdialog/xmlfilterhelpids.hrc | 1 +
filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 9 +++++++--
filter/source/xsltdialog/xmlfiltertabpagexslt.cxx | 7 +++++++
filter/source/xsltdialog/xmlfiltertabpagexslt.hrc | 2 ++
filter/source/xsltdialog/xmlfiltertabpagexslt.hxx | 3 +++
filter/source/xsltdialog/xmlfiltertabpagexslt.src | 18 ++++++++++++++++++
9 files changed, 41 insertions(+), 2 deletions(-)
New commits:
commit 11fbde8fed1a866c4ec9565d56f5f5034631d8b2
Author: Peter Jentsch <pjotr at guineapics.de>
Date: Tue Oct 18 21:59:49 2011 +0200
support editing, importing, exporting the xslt transformer service setting
starting with LO 3.4 we default to using libxslt for xslt transformations
in filters. the saxon/j based services is still available and can be
explicitly requested by filters using the 2nd userdata entry in the filter
configuration. There wasn't any place to edit this 2nd userdata entry,
and it wasn't exported or imported with the custom filter packages.
diff --git a/filter/source/xsltdialog/typedetectionexport.cxx b/filter/source/xsltdialog/typedetectionexport.cxx
index fb925b2..b607883 100644
--- a/filter/source/xsltdialog/typedetectionexport.cxx
+++ b/filter/source/xsltdialog/typedetectionexport.cxx
@@ -194,6 +194,7 @@ void TypeDetectionExporter::doExport( Reference< XOutputStream > xOS, const XML
sValue += sComma;
sValue += sXSLTFilterService;
sValue += sDelim;
+ sValue += pFilter->maXSLTTransformerImpl;
sValue += sDelim;
const application_info_impl* pAppInfo = getApplicationInfo( pFilter->maExportService );
diff --git a/filter/source/xsltdialog/xmlfilterhelpids.hrc b/filter/source/xsltdialog/xmlfilterhelpids.hrc
index cced060..8e6a34f 100644
--- a/filter/source/xsltdialog/xmlfilterhelpids.hrc
+++ b/filter/source/xsltdialog/xmlfilterhelpids.hrc
@@ -50,6 +50,7 @@
#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_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 c5ebd3b..abb3051 100644
--- a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx
+++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx
@@ -68,6 +68,9 @@ XMLFilterTabPageXSLT::XMLFilterTabPageXSLT( Window* pParent, ResMgr& rResMgr, co
maEDImportTemplate( this, ResId( ED_XML_IMPORT_TEMPLATE, rResMgr ), INET_PROT_FILE ),
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 ) ),
+
sHTTPSchema( RTL_CONSTASCII_USTRINGPARAM( "http://" ) ),
sSHTTPSchema( RTL_CONSTASCII_USTRINGPARAM( "shttp://" ) ),
sFILESchema( RTL_CONSTASCII_USTRINGPARAM( "file://" ) ),
@@ -96,6 +99,7 @@ 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 );
}
XMLFilterTabPageXSLT::~XMLFilterTabPageXSLT()
@@ -111,6 +115,7 @@ bool XMLFilterTabPageXSLT::FillInfo( filter_info_impl* pInfo )
pInfo->maExportXSLT = GetURL( maEDExportXSLT );
pInfo->maImportXSLT = GetURL( maEDImportXSLT );
pInfo->maImportTemplate = GetURL( maEDImportTemplate );
+ pInfo->maXSLTTransformerImpl = maEDTransformationService.GetText();
}
return true;
@@ -126,6 +131,8 @@ void XMLFilterTabPageXSLT::SetInfo(const filter_info_impl* pInfo)
SetURL( maEDExportXSLT, pInfo->maExportXSLT );
SetURL( maEDImportXSLT, pInfo->maImportXSLT );
SetURL( maEDImportTemplate, pInfo->maImportTemplate );
+
+ maEDTransformationService.SetText( pInfo->maXSLTTransformerImpl );
}
}
diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.hrc b/filter/source/xsltdialog/xmlfiltertabpagexslt.hrc
index e5b768d..48fc571 100644
--- a/filter/source/xsltdialog/xmlfiltertabpagexslt.hrc
+++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.hrc
@@ -44,5 +44,7 @@
#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
#endif
diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx b/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx
index 7c1ce5c..64742f5 100644
--- a/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx
+++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx
@@ -69,6 +69,9 @@ public:
SvtURLBox maEDImportTemplate;
PushButton maPBImportTemplate;
+ FixedText maFTTransformationService;
+ Edit maEDTransformationService;
+
private:
void SetURL( SvtURLBox& rURLBox, const rtl::OUString& rURL );
rtl::OUString GetURL( SvtURLBox& rURLBox );
diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.src b/filter/source/xsltdialog/xmlfiltertabpagexslt.src
index 43a5bb1..e861112 100644
--- a/filter/source/xsltdialog/xmlfiltertabpagexslt.src
+++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.src
@@ -172,5 +172,23 @@ TabPage RID_XML_FILTER_TABPAGE_XSLT
HelpId = HID_XML_FILTER_IMPORT_TEMPLATE_BROWSE;
Text [ en-US ] = "Browse...";
};
+
+ // XSLT transformation service --------------------------------------------------------
+
+ FixedText FT_XML_TRANSFORM_SERVICE
+ {
+ Pos = MAP_APPFONT ( FIRST_ROW_X , FIRST_ROW_Y + 5 * ROW_HEIGHT + 5 * SPACING + FIXED_TEXT_OFFSET + EDIT_OFFSET ) ;
+ Size = MAP_APPFONT ( FIRST_ROW_WIDTH , 8 ) ;
+ Text [ en-US ] = "XSLT Tranformation Service";
+ };
+
+ Edit ED_XML_TRANSFORM_SERVICE
+ {
+ 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;
+ };
+
};
commit 960f4bdd71c9de19059279d61abb142ddfdac0ce
Author: Peter Jentsch <pjotr at guineapics.de>
Date: Fri Oct 14 22:12:29 2011 +0200
initial support for user defined xslt service impl in filter jar
Supports importing the 2nd userdata parameter for xslt filter
definitions from manually edited custom XML filter settings.
UI currently not available.
diff --git a/filter/source/xsltdialog/typedetectionimport.cxx b/filter/source/xsltdialog/typedetectionimport.cxx
index 9133f9b..07dd079 100644
--- a/filter/source/xsltdialog/typedetectionimport.cxx
+++ b/filter/source/xsltdialog/typedetectionimport.cxx
@@ -183,6 +183,7 @@ filter_info_impl* TypeDetectionImporter::createFilterForNode( Node * pNode )
OUString aAdapterService( getSubdata( 0, aDelim, aFilterUserData ) );
//Import/ExportService
+ pFilter->maXSLTTransformerImpl = getSubdata( 1, aDelim, aFilterUserData );
pFilter->maImportService = getSubdata( 2, aDelim, aFilterUserData );
pFilter->maExportService = getSubdata( 3, aDelim, aFilterUserData );
pFilter->maImportXSLT = getSubdata( 4, aDelim, aFilterUserData );
diff --git a/filter/source/xsltdialog/xmlfiltercommon.hxx b/filter/source/xsltdialog/xmlfiltercommon.hxx
index 6ff2809..c1da769 100644
--- a/filter/source/xsltdialog/xmlfiltercommon.hxx
+++ b/filter/source/xsltdialog/xmlfiltercommon.hxx
@@ -70,6 +70,7 @@ public:
rtl::OUString maDocType;
rtl::OUString maImportService;
rtl::OUString maExportService;
+ rtl::OUString maXSLTTransformerImpl;
sal_Int32 maFlags;
sal_Int32 maFileFormatVersion;
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index 2ba8392..c11a455 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -1167,6 +1167,7 @@ void XMLFilterSettingsDialog::initFilterList()
continue;
// get filter information from userdata
+ pTempFilter->maXSLTTransformerImpl = aUserData[1];
pTempFilter->maImportService = aUserData[2];
pTempFilter->maExportService = aUserData[3];
pTempFilter->maImportXSLT = aUserData[4];
@@ -1645,7 +1646,8 @@ filter_info_impl::filter_info_impl( const filter_info_impl& rInfo ) :
maFlags( rInfo.maFlags ),
maFileFormatVersion( rInfo.maFileFormatVersion ),
mnDocumentIconID( rInfo.mnDocumentIconID ),
- mbReadonly( rInfo.mbReadonly )
+ mbReadonly( rInfo.mbReadonly ),
+ maXSLTTransformerImpl( rInfo.maXSLTTransformerImpl )
{
}
@@ -1668,7 +1670,9 @@ int filter_info_impl::operator==( const filter_info_impl& r ) const
maImportService != r.maImportService ||
maImportTemplate != r.maImportTemplate ||
maFlags != r.maFlags ||
- maFileFormatVersion != r.maFileFormatVersion )
+ maFileFormatVersion != r.maFileFormatVersion ||
+ maXSLTTransformerImpl != r.maXSLTTransformerImpl
+ )
return false;
return true;
@@ -1689,6 +1693,7 @@ Sequence< OUString > filter_info_impl::getFilterUserData() const
aUserData[3] = pInfo->maXMLExporter;
}
*/
+ aUserData[1] = maXSLTTransformerImpl;
aUserData[2] = maImportService;
aUserData[3] = maExportService;
aUserData[4] = maImportXSLT;
More information about the Libreoffice-commits
mailing list