diff options
234 files changed, 2674 insertions, 7378 deletions
diff --git a/filter/inc/filter.hrc b/filter/inc/filter.hrc index 4bea3330f617..2bbf94ed50c7 100644 --- a/filter/inc/filter.hrc +++ b/filter/inc/filter.hrc @@ -55,12 +55,11 @@ // warning, next range is RID_FILTER_START + 100 ! -#define HID_FILTER_XSLT_START (HID_FILTER_START + 0) // see source/xsltdialog/xmlfilterhelpids.hrc for range -#define HID_FILTER_XSLT_END (HID_FILTER_START + 99) -#define HID_FILTER_PDF_OPTIONS (HID_FILTER_START + 100) -#define HID_FILTER_PDF_INITIAL_VIEW (HID_FILTER_START + 101) -#define HID_FILTER_PDF_USER_INTERFACE (HID_FILTER_START + 102) -#define HID_FILTER_PDF_SECURITY (HID_FILTER_START + 103) -#define HID_FILTER_PDF_LINKS (HID_FILTER_START + 104) +#define HID_FILTER_PDF_OPTIONS "HID_FILTER_PDF_OPTIONS" +#define HID_FILTER_PDF_INITIAL_VIEW "HID_FILTER_PDF_INITIAL_VIEW" +#define HID_FILTER_PDF_USER_INTERFACE "HID_FILTER_PDF_USER_INTERFACE" +#define HID_FILTER_PDF_SECURITY "HID_FILTER_PDF_SECURITY" +#define HID_FILTER_PDF_LINKS "HID_FILTER_PDF_LINKS" + #endif diff --git a/filter/prj/build.lst b/filter/prj/build.lst index bed99e401b7f..065b4313c57b 100644 --- a/filter/prj/build.lst +++ b/filter/prj/build.lst @@ -42,3 +42,6 @@ fl filter\source\config\cache nmake - all fl_config fl filter\source\config\fragments\types nmake - all fl_fcfg_fragments_types fl_inc NULL fl filter\source\config\fragments\filters nmake - all fl_fcfg_fragments_filters fl_inc NULL fl filter\source\config\fragments nmake - all fl_fcfg_fragments fl_fcfg_fragments_filters fl_inc NULL + +# took very long +# fl filter\qa\complex\filter\misc nmake - all fl_qa_complex NULL diff --git a/filter/prj/d.lst b/filter/prj/d.lst index e8fdae8a1c58..037bef1a3765 100644 --- a/filter/prj/d.lst +++ b/filter/prj/d.lst @@ -49,9 +49,21 @@ mkdir: %_DEST%\bin%_EXT%\pdfimport ..\%__SRC%\bin\pdfunzip.* %_DEST%\bin%_EXT%\pdfunzip.* ..\%__SRC%\misc\filters\modulepacks\fcfg_*.xcu %_DEST%\xml%_EXT%\registry\spool\fcfg_*.xcu ..\%COMMON_OUTDIR%\bin\fcfg_langpack_*.zip %_DEST%\pck%_EXT%\fcfg_langpack_*.zip +..\%__SRC%\misc\t602filter.component %_DEST%\xml%_EXT%\t602filter.component mkdir: %_DEST%\inc%_EXT%\filter mkdir: %_DEST%\inc%_EXT%\filter\msfilter ..\inc\filter\msfilter\*.hxx %_DEST%\inc%_EXT%\filter\msfilter\*.hxx ..\inc\filter\msfilter\*.h %_DEST%\inc%_EXT%\filter\msfilter\*.h +..\%__SRC%\misc\XSLTFilter.jar.component %_DEST%\xml%_EXT%\XSLTFilter.jar.component +..\%__SRC%\misc\XSLTValidate.component %_DEST%\xml%_EXT%\XSLTValidate.component +..\%__SRC%\misc\filterconfig1.component %_DEST%\xml%_EXT%\filterconfig1.component +..\%__SRC%\misc\flash.component %_DEST%\xml%_EXT%\flash.component +..\%__SRC%\misc\pdffilter.component %_DEST%\xml%_EXT%\pdffilter.component +..\%__SRC%\misc\placeware.component %_DEST%\xml%_EXT%\placeware.component +..\%__SRC%\misc\svgfilter.component %_DEST%\xml%_EXT%\svgfilter.component +..\%__SRC%\misc\xmlfa.component %_DEST%\xml%_EXT%\xmlfa.component +..\%__SRC%\misc\xmlfd.component %_DEST%\xml%_EXT%\xmlfd.component +..\%__SRC%\misc\xsltdlg.component %_DEST%\xml%_EXT%\xsltdlg.component +..\%__SRC%\misc\xsltfilter.component %_DEST%\xml%_EXT%\xsltfilter.component diff --git a/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java b/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java index e32b81caa85b..a269afec836d 100644 --- a/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java +++ b/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java @@ -24,7 +24,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - package complex.filter.misc; import com.sun.star.beans.PropertyValue; @@ -39,10 +38,18 @@ import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; import com.sun.star.util.XFlushable; -import complexlib.ComplexTestCase; -import util.utils; - - +// import complexlib.ComplexTestCase; +// import util.utils; + +// ---------- junit imports ----------------- +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; +// ------------------------------------------ /** * This complex test checks the functionality of the properties "Finalized" and "Mandatory" of @@ -74,7 +81,8 @@ import util.utils; * <CODE>Mandatory=true</CODE> * <CODE>Mandatory=false</CODE> */ -public class FinalizedMandatoryTest extends ComplexTestCase { +public class FinalizedMandatoryTest +{ static XMultiServiceFactory xMSF; @@ -82,21 +90,21 @@ public class FinalizedMandatoryTest extends ComplexTestCase { * A function to tell the framework, which test functions are available. * @return All test methods. */ - public String[] getTestMethodNames() { - return new String[]{"checkReadonlySupportFilterFactory", - "checkReadonlySupportTypeDetection"}; - } - +// public String[] getTestMethodNames() { +// return new String[]{"checkReadonlySupportFilterFactory", +// "checkReadonlySupportTypeDetection"}; +// } /** Create the environment for following tests. * Use either a component loader from desktop or * from frame * @throws Exception Exception */ - public void before() throws Exception { + @Before public void before() throws Exception + { // create TypeDetection - xMSF = (XMultiServiceFactory)param.getMSF(); - assure("Could not get XMultiServiceFactory", xMSF != null); + xMSF = getMSF(); + assertNotNull("Could not get XMultiServiceFactory", xMSF); } @@ -106,14 +114,16 @@ public class FinalizedMandatoryTest extends ComplexTestCase { * @throws Exception was thrown if creataion failes * @return <CODE>XInterface</CODE> of service */ - public XInterface getTestObject(String serviceName) throws Exception{ + private XInterface getTestObject(String serviceName) throws Exception + { Object oInterface = xMSF.createInstance(serviceName); - if (oInterface == null) { - failed("Service wasn't created") ; - throw new Exception("could not create service '"+serviceName+"'"); - } + assertNotNull("Service wan't created", oInterface); +// if (oInterface == null) { +// failed("Service wasn't created") ; +// throw new Exception("could not create service '"+serviceName+"'"); +// } return (XInterface) oInterface; } @@ -121,7 +131,8 @@ public class FinalizedMandatoryTest extends ComplexTestCase { * call the function <CODE>checkReadonlySupport</CODE> to test <CODE>com.sun.star.document.FilterFactory</CODE> * @see com.sun.star.document.FilterFactory */ - public void checkReadonlySupportFilterFactory(){ + @Test public void checkReadonlySupportFilterFactory() + { checkReadonlySupport("com.sun.star.document.FilterFactory"); } @@ -129,26 +140,30 @@ public class FinalizedMandatoryTest extends ComplexTestCase { * call the function <CODE>checkReadonlySupport</CODE> to test <CODE>com.sun.star.document.TypeDetection</CODE> * @see com.sun.star.document.TypeDetection */ - public void checkReadonlySupportTypeDetection(){ + @Test public void checkReadonlySupportTypeDetection() + { checkReadonlySupport("com.sun.star.document.TypeDetection"); } - /** * test the given service <CODE>serviceName</CODE>. * For every filter a new instace was created and the tests started. * @param serviceName the name of the service to test */ - private void checkReadonlySupport(String serviceName){ - log.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); - log.println("testing service '" + serviceName + "'"); + private void checkReadonlySupport(String serviceName) + { + System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); + System.out.println("testing service '" + serviceName + "'"); XInterface oObj = null; - try{ + try + { oObj = getTestObject(serviceName); - log.println("ImplName: "+utils.getImplName(oObj)); - } catch (java.lang.Exception e){ - failed("could not get test object"); + System.out.println("ImplName: " + util.utils.getImplName(oObj)); + } + catch (java.lang.Exception e) + { + fail("could not get test object"); } boolean mandantoryTrue = false; @@ -157,19 +172,21 @@ public class FinalizedMandatoryTest extends ComplexTestCase { boolean finalizedFalse = false; - XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface - (XNameAccess.class, oObj); + XNameAccess xNA = UnoRuntime.queryInterface(XNameAccess.class, oObj); String[] filterNames = xNA.getElementNames(); // XNameContainer; XNameReplace String filterName = filterNames[0]; - Object[] instance = null;; - for (int i = 0; i < filterNames.length; i++) { - log.println("------------------------------------------------"); - try{ + Object[] instance = null; + + for (int i = 0; i < filterNames.length; i++) + { + System.out.println("------------------------------------------------"); + try + { PropertyValue instanceProp = new PropertyValue(); filterName = filterNames[i]; - log.println(filterName); + System.out.println(filterName); // testobject must new created for every test. // We change in a loop the container and try to flush this changes. @@ -177,16 +194,19 @@ public class FinalizedMandatoryTest extends ComplexTestCase { // similar to a document which could not be saved beacuse of invalid // contend. While you don't remove the invalid conted you will never // be able to save the document. Same here. - try{ + try + { oObj = getTestObject(serviceName); - } catch (java.lang.Exception e){ - failed("could not get test object", CONTINUE); + } + catch (java.lang.Exception e) + { + fail("could not get test object"); } - xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oObj); - XNameContainer xNC = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, oObj); - XNameReplace xNR = (XNameReplace) UnoRuntime.queryInterface(XNameReplace.class, oObj); - XFlushable xFlush = (XFlushable) UnoRuntime.queryInterface(XFlushable.class, oObj); + xNA = UnoRuntime.queryInterface(XNameAccess.class, oObj); + XNameContainer xNC = UnoRuntime.queryInterface(XNameContainer.class, oObj); + XNameReplace xNR = UnoRuntime.queryInterface(XNameReplace.class, oObj); + XFlushable xFlush = UnoRuntime.queryInterface(XFlushable.class, oObj); instance = (Object[]) xNA.getByName(filterName); PropertyValue[] props = (PropertyValue[]) instance; @@ -204,59 +224,75 @@ public class FinalizedMandatoryTest extends ComplexTestCase { finalizedFalse |= !isFinalized; //change the filter - setPropertyValueValue((PropertyValue[])instance, "UIName", "dummy"); + setPropertyValueValue((PropertyValue[]) instance, "UIName", "dummy"); // 1a.) try to change the filter in the container - try{ + try + { xNR.replaceByName(filterName, instance); - }catch (IllegalArgumentException e){ - failed("could not replace filter properties ('" + filterName + "')", CONTINUE); + } + catch (IllegalArgumentException e) + { + fail("could not replace filter properties ('" + filterName + "')"); } // 1b.) try to wirte the changed filter to the configuration. // This must result in a exception if the filter is finalized. boolean flushError = false; - try{ + try + { xFlush.flush(); - } catch (WrappedTargetRuntimeException e){ + } + catch (WrappedTargetRuntimeException e) + { flushError = true; - assure("Unexpected exception wihle flushing changed filter '"+ filterName + "'", isFinalized,CONTINUE); + assertTrue("Unexpected exception wihle flushing changed filter '" + filterName + "'", isFinalized); } - assure("Expected exception was not thorwn while flushing changed filter '"+ filterName + "' Finalized:" + isFinalized, - !(flushError ^ isFinalized), CONTINUE); + assertTrue("Expected exception was not thorwn while flushing changed filter '" + filterName + "' Finalized:" + isFinalized, + !(flushError ^ isFinalized)); // 2a.) try to remove the filter from the container - try{ + try + { xNC.removeByName(filterName); - }catch (NoSuchElementException e){ - failed("could not remove filter from container ('" + filterName + "')", CONTINUE); + } + catch (NoSuchElementException e) + { + fail("could not remove filter from container ('" + filterName + "')"); } // 1b.) try to wirte the changed filter to the configuration. // This must result in a exception if the filter is mandatory flushError = false; - try{ + try + { xFlush.flush(); - } catch (WrappedTargetRuntimeException e){ + } + catch (WrappedTargetRuntimeException e) + { flushError = true; - assure("Unexpected exception wihle flushing removed filter '"+ filterName + "'", isMandatory,CONTINUE); + assertTrue("Unexpected exception wihle flushing removed filter '" + filterName + "'", isMandatory); } - assure("Expected exception was not thorwn while flushing removed filter '"+ filterName + "' Mandatory:" + isMandatory, - !(flushError ^ isMandatory), CONTINUE); + assertTrue("Expected exception was not thorwn while flushing removed filter '" + filterName + "' Mandatory:" + isMandatory, + !(flushError ^ isMandatory)); - } catch (NoSuchElementException e){ - failed("Couldn't get elements from object", true); - } catch (WrappedTargetException e){ - failed("Couldn't get elements from object", true); + } + catch (NoSuchElementException e) + { + fail("Couldn't get elements from object"); + } + catch (WrappedTargetException e) + { + fail("Couldn't get elements from object"); } } String preMsg = "Could not find filter with state "; String postMsg = " Please check if such filter is installed!"; - assure(preMsg + "'Mandatory=true'" + postMsg ,mandantoryTrue, CONTINUE); - assure(preMsg + "'Mandatory=false'" + postMsg ,mandantoryFalse, CONTINUE); - assure(preMsg + "'Finalized=true'" + postMsg ,finalizedTrue, CONTINUE); - assure(preMsg + "'Finalized=false'" + postMsg ,finalizedFalse, CONTINUE); + assertTrue(preMsg + "'Mandatory=true'" + postMsg, mandantoryTrue); + assertTrue(preMsg + "'Mandatory=false'" + postMsg, mandantoryFalse); + assertTrue(preMsg + "'Finalized=true'" + postMsg, finalizedTrue); + assertTrue(preMsg + "'Finalized=false'" + postMsg, finalizedFalse); } /** @@ -265,13 +301,18 @@ public class FinalizedMandatoryTest extends ComplexTestCase { * @see com.sun.star.beans.PropertyValue * @param props Sequenze of PropertyValue */ - protected void printPropertyValues(PropertyValue[] props) { + protected void printPropertyValues(PropertyValue[] props) + { int i = 0; - while (i < props.length ) { - log.println(props[i].Name + ":" + props[i].Value.toString()); + while (i < props.length) + { + System.out.println(props[i].Name + ":" + props[i].Value.toString()); i++; } - if (i < props.length) log.println(props[i].Name + ":" + props[i].Value.toString()); + if (i < props.length) + { + System.out.println(props[i].Name + ":" + props[i].Value.toString()); + } } /** @@ -280,9 +321,11 @@ public class FinalizedMandatoryTest extends ComplexTestCase { * @param pName the name of the property the value shoud be returned * @return the value of the property */ - protected Object getPropertyValueValue(PropertyValue[] props, String pName) { + protected Object getPropertyValueValue(PropertyValue[] props, String pName) + { int i = 0; - while (i < props.length && !props[i].Name.equals(pName)) { + while (i < props.length && !props[i].Name.equals(pName)) + { i++; } return i < props.length ? props[i].Value : null; @@ -294,14 +337,36 @@ public class FinalizedMandatoryTest extends ComplexTestCase { * @param pName name of the property which should be changed * @param pValue the value the property should be assigned */ - protected void setPropertyValueValue(PropertyValue[] props, String pName, Object pValue) { + protected void setPropertyValueValue(PropertyValue[] props, String pName, Object pValue) + { int i = 0; - while (i < props.length && !props[i].Name.equals(pName)) { + while (i < props.length && !props[i].Name.equals(pName)) + { i++; } props[i].Value = pValue; } + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + // setup and close connections + @BeforeClass + public static void setUpConnection() throws Exception + { + System.out.println("setUpConnection()"); + connection.setUp(); + } + @AfterClass + public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + private static final OfficeConnection connection = new OfficeConnection(); } diff --git a/filter/qa/complex/filter/misc/TypeDetection6FileFormat.java b/filter/qa/complex/filter/misc/TypeDetection6FileFormat.java index 842a365d4714..6fda574ae8f5 100644 --- a/filter/qa/complex/filter/misc/TypeDetection6FileFormat.java +++ b/filter/qa/complex/filter/misc/TypeDetection6FileFormat.java @@ -3,21 +3,31 @@ * * Created on 26. April 2004, 10:37 */ - package complex.filter.misc; import com.sun.star.container.XNameAccess; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; -import complexlib.ComplexTestCase; + import util.utils; +// ---------- junit imports ----------------- +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; +// ------------------------------------------ + /** * * @author cn93815 */ -public class TypeDetection6FileFormat extends ComplexTestCase { +public class TypeDetection6FileFormat +{ static XMultiServiceFactory xMSF; @@ -25,20 +35,20 @@ public class TypeDetection6FileFormat extends ComplexTestCase { * A function to tell the framework, which test functions are available. * @return All test methods. */ - public String[] getTestMethodNames() { - return new String[]{"checkFilterFactory", - "checkTypeDetection"}; - } - +// public String[] getTestMethodNames() { +// return new String[]{"checkFilterFactory", +// "checkTypeDetection"}; +// } /** Create the environment for following tests. * Use either a component loader from desktop or * from frame * @throws Exception Exception */ - public void before() throws Exception { + @Before public void before() throws Exception + { - xMSF = (XMultiServiceFactory)param.getMSF(); - assure("Could not get XMultiServiceFactory", xMSF != null); + xMSF = getMSF(); + assertNotNull("Could not get XMultiServiceFactory", xMSF); } @@ -46,7 +56,8 @@ public class TypeDetection6FileFormat extends ComplexTestCase { * call the function <CODE>checkFileFormatSupport</CODE> to test <CODE>com.sun.star.document.FilterFactory</CODE> * @see com.sun.star.document.FilterFactory */ - public void checkFilterFactory(){ + @Test public void checkFilterFactory() + { checkFileFormatSupport("com.sun.star.document.FilterFactory"); } @@ -54,7 +65,8 @@ public class TypeDetection6FileFormat extends ComplexTestCase { * call the function <CODE>checkFileFormatSupport</CODE> to test <CODE>com.sun.star.document.TypeDetection</CODE> * @see com.sun.star.document.TypeDetection */ - public void checkTypeDetection(){ + @Test public void checkTypeDetection() + { checkFileFormatSupport("com.sun.star.document.TypeDetection"); } @@ -64,42 +76,67 @@ public class TypeDetection6FileFormat extends ComplexTestCase { * The serve was created and the filter 'TypeDetection6FileFormat' was searched * @param serviceName the name of the service to test */ - private void checkFileFormatSupport(String serviceName){ - log.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); - log.println("testing service '" + serviceName + "'"); + private void checkFileFormatSupport(String serviceName) + { + System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); + System.out.println("testing service '" + serviceName + "'"); XInterface oObj = null; - try{ + try + { oObj = getTestObject(serviceName); - log.println("ImplName: "+utils.getImplName(oObj)); - } catch (java.lang.Exception e){ - failed("could not get test object"); + System.out.println("ImplName: " + utils.getImplName(oObj)); + } + catch (java.lang.Exception e) + { + fail("could not get test object"); } - XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface - (XNameAccess.class, oObj); + XNameAccess xNA = UnoRuntime.queryInterface(XNameAccess.class, oObj); String msg = "Could not find filter 'TypeDetection6FileFormat'!"; msg += "\nMaybe 'TypeDetection6FileFormat.xcu' is not registered."; - assure(msg, xNA.hasByName("TypeDetection6FileFormat"),CONTINUE); + assertTrue(msg, xNA.hasByName("TypeDetection6FileFormat")); } - /** + /** * Creates an instance for the given <CODE>serviceName</CODE> * @param serviceName the name of the service which should be created * @throws Exception was thrown if creataion failes * @return <CODE>XInterface</CODE> of service */ - public XInterface getTestObject(String serviceName) throws Exception{ + public XInterface getTestObject(String serviceName) throws Exception + { Object oInterface = xMSF.createInstance(serviceName); - if (oInterface == null) { - failed("Service wasn't created") ; - throw new Exception("could not create service '"+serviceName+"'"); + if (oInterface == null) + { + fail("Service wasn't created"); + throw new Exception("could not create service '" + serviceName + "'"); } return (XInterface) oInterface; } + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); } diff --git a/filter/qa/complex/filter/misc/makefile.mk b/filter/qa/complex/filter/misc/makefile.mk index 2792b2438b6e..5ac072a2e071 100755 --- a/filter/qa/complex/filter/misc/makefile.mk +++ b/filter/qa/complex/filter/misc/makefile.mk @@ -25,73 +25,35 @@ # #************************************************************************* -PRJ = ..$/..$/..$/.. -PRJNAME = filter -TARGET = Filter -PACKAGE = complex$/filter$/misc - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = FinalizedMandatoryTest.java TypeDetection6FileFormat.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 - -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE - -# --- Parameters for the test -------------------------------------- - -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: .ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand \ - "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF - -# test base is java complex -CT_TESTBASE = -TestBase java_complex - -# replace $/ with . in package name -CT_PACKAGE = -o $(PACKAGE:s\$/\.\) - -# start the runner application -CT_APP = org.openoffice.Runner +PRJ = ../../../.. +PRJNAME = filter +TARGET = qa_complex_filter_misc -# --- Targets ------------------------------------------------------ +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/filter/misc +JAVATESTFILES = \ + TypeDetection6FileFormat.java \ + FinalizedMandatoryTest.java -.IF "$(depend)" == "" -DisplayHint : ALLTAR -.ELSE -DisplayHint : ALLDEP -.ENDIF +JAVAFILES = $(JAVATESTFILES) -.INCLUDE : target.mk +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END -DisplayHint: - @echo "\ntype 'dmake FinalizedMandatoryTest'" - @echo "\ntype 'dmake TypeDetection6FileFormat'" - @echo "! BE SHURE YOU HAVE 'TypeDetection6FileFormat.xcu' SUCCESSFUL REGISTERED IN YOU OFFICE !" +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -RUN: run +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -run: \ - DisplayHint +ALLTAR : javatest +.END -FinalizedMandatoryTest: - java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_PACKAGE).FinalizedMandatoryTest - -TypeDetection6FileFormat: - java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_PACKAGE).TypeDetection6FileFormat diff --git a/filter/source/config/cache/filterconfig1.component b/filter/source/config/cache/filterconfig1.component new file mode 100644 index 000000000000..9d3c7c90fb31 --- /dev/null +++ b/filter/source/config/cache/filterconfig1.component @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.filter.config.ConfigFlush"> + <service name="com.sun.star.document.FilterConfigRefresh"/> + </implementation> + <implementation name="com.sun.star.comp.filter.config.ContentHandlerFactory"> + <service name="com.sun.star.frame.ContentHandlerFactory"/> + </implementation> + <implementation name="com.sun.star.comp.filter.config.FilterFactory"> + <service name="com.sun.star.document.FilterFactory"/> + </implementation> + <implementation name="com.sun.star.comp.filter.config.FrameLoaderFactory"> + <service name="com.sun.star.frame.FrameLoaderFactory"/> + </implementation> + <implementation name="com.sun.star.comp.filter.config.TypeDetection"> + <service name="com.sun.star.document.TypeDetection"/> + </implementation> +</component> diff --git a/filter/source/config/cache/makefile.mk b/filter/source/config/cache/makefile.mk index fbc4806b0a32..d94c81e35010 100644 --- a/filter/source/config/cache/makefile.mk +++ b/filter/source/config/cache/makefile.mk @@ -77,3 +77,11 @@ SHL1VERSIONMAP= $(SOLARENV)/src/component.map # --- Targets ---------------------------------- .INCLUDE : target.mk + +ALLTAR : $(MISC)/filterconfig1.component + +$(MISC)/filterconfig1.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt filterconfig1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt filterconfig1.component diff --git a/filter/source/config/cache/registration.cxx b/filter/source/config/cache/registration.cxx index a65f5c42fea8..2be110871ee1 100644 --- a/filter/source/config/cache/registration.cxx +++ b/filter/source/config/cache/registration.cxx @@ -94,30 +94,6 @@ static void InitConstants() // extern "C" component_getImplementationEnvironment() _COMPHELPER_COMPONENT_GETIMPLEMENTATIONENVIRONMENT -// extern "C" component_writeInfo() -_COMPHELPER_COMPONENT_WRITEINFO -( - _COMPHELPER_COMPONENTINFO( TypeDetection , - TypeDetection::impl_getImplementationName() , - TypeDetection::impl_getSupportedServiceNames()) - - _COMPHELPER_COMPONENTINFO( FilterFactory , - FilterFactory::impl_getImplementationName() , - FilterFactory::impl_getSupportedServiceNames()) - - _COMPHELPER_COMPONENTINFO( ContentHandlerFactory , - ContentHandlerFactory::impl_getImplementationName() , - ContentHandlerFactory::impl_getSupportedServiceNames()) - - _COMPHELPER_COMPONENTINFO( FrameLoaderFactory , - FrameLoaderFactory::impl_getImplementationName() , - FrameLoaderFactory::impl_getSupportedServiceNames()) - - _COMPHELPER_COMPONENTINFO( ConfigFlush , - ConfigFlush::impl_getImplementationName() , - ConfigFlush::impl_getSupportedServiceNames()) -) - // extern "C" component_getFactory() _COMPHELPER_COMPONENT_GETFACTORY ( diff --git a/filter/source/config/cache/registration.hxx b/filter/source/config/cache/registration.hxx index 38e5980c967a..d664cc365abb 100644 --- a/filter/source/config/cache/registration.hxx +++ b/filter/source/config/cache/registration.hxx @@ -31,10 +31,8 @@ //_______________________________________________ // includes -#include <com/sun/star/registry/XRegistryKey.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/registry/InvalidRegistryException.hpp> #include <rtl/ustrbuf.hxx> #include <cppuhelper/factory.hxx> @@ -59,97 +57,6 @@ namespace comphelper{ //_______________________________________________ -/** @short creates a new key inside component registry. - - @descr using: a) _COMPHELPER_COMPONENTINFO( MyClass, - MyClass::st_getImplName(), - MyClass::st_getServNames()) - - b) _COMPHELPER_COMPONENTINFO( MyClass, - ::rtl::OUString::createFromAscii("css.MyClass"), - lServiceNames) - - @param CLASS - must be the class name of the implementation - of an uno service, which should be registered here. - - @param IMPLEMENTATIONNAME - can be an uno implementation name from type [::rtl::OUString] - directly or any possible method call, which returns such - name. - - @param SERVICENAME - a list of supported uno service names from type - [css::uno::Sequence< ::rtl::OUString >] - or any possible method call, which returns such - list. - */ -#define _COMPHELPER_COMPONENTINFO(CLASS, IMPLEMENTATIONNAME, SERVICENAMES) \ - /*define new scope to prevent multiple using of the same variables ... */ \ - { \ - /* build new key name */ \ - ::rtl::OUStringBuffer sKeyBuf(256); \ - sKeyBuf.appendAscii("/" ); \ - sKeyBuf.append (IMPLEMENTATIONNAME); \ - sKeyBuf.appendAscii("/UNO/SERVICES" ); \ - ::rtl::OUString sKey = sKeyBuf.makeStringAndClear(); \ - \ - /* try to register this service ... thrown exception will be catched by COMPONENT_WRITEINFO! */ \ - css::uno::Reference< css::registry::XRegistryKey > xKey = xRoot->createKey(sKey); \ - if (!xKey.is()) \ - throw css::registry::InvalidRegistryException(sKey, css::uno::Reference< css::uno::XInterface >()); \ - \ - /* dont optimize it! it must work for simple types and function calls! */ \ - const css::uno::Sequence< ::rtl::OUString > lServiceNames = SERVICENAMES; \ - const ::rtl::OUString* pServiceNames = lServiceNames.getConstArray(); \ - sal_Int32 nCount = lServiceNames.getLength(); \ - \ - for (sal_Int32 i=0; i<nCount; ++i) \ - xKey->createKey(pServiceNames[i]); \ - } - -//_______________________________________________ - -/** @short implments extern C function component_writeInfo - - @descr using: _COMPHELPER_COMPONENT_WRITEINFO - ( - _COMPHELPER_COMPONENTINFO(...) - .. - _COMPHELPER_COMPONENTINFO(...) - ) - - @param INFOLIST - list of macros of type COMPONENTINFO without(!) any - seperator signs between two elements. - */ -#define _COMPHELPER_COMPONENT_WRITEINFO(INFOLIST) \ - extern "C" sal_Bool SAL_CALL component_writeInfo(void* pServiceManager, \ - void* pRegistryKey ) \ - { \ - if (!pServiceManager || !pRegistryKey) \ - return sal_False; \ - \ - css::uno::Reference< css::registry::XRegistryKey > xRoot = reinterpret_cast< css::registry::XRegistryKey* >(pRegistryKey); \ - \ - /*if one of following registration will fail ... an exception is thrown! */ \ - try \ - { \ - /* This parameter will expand to: */ \ - /* _COMPHELPER_COMPONENTINFO(1) */ \ - /* ... */ \ - /* _COMPHELPER_COMPONENTINFO(n) */ \ - INFOLIST \ - } \ - catch(const css::registry::InvalidRegistryException&) \ - { \ - return sal_False; \ - } \ - return sal_True; \ - } - -//_______________________________________________ - /** TODO doc */ #define _COMPHELPER_MULTIINSTANCEFACTORY(IMPLEMENTATIONNAME, SERVICENAMES, FACTORYMETHOD) \ diff --git a/filter/source/config/fragments/filters/MS_PowerPoint_97.xcu b/filter/source/config/fragments/filters/MS_PowerPoint_97.xcu index 7c61f7c14084..20c55429e465 100644 --- a/filter/source/config/fragments/filters/MS_PowerPoint_97.xcu +++ b/filter/source/config/fragments/filters/MS_PowerPoint_97.xcu @@ -1,5 +1,5 @@ <node oor:name="MS PowerPoint 97" oor:op="replace"> - <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN ENCRYPTION PASSWORDTOMODIFY</value></prop> + <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN</value></prop> <prop oor:name="UIComponent"/> <prop oor:name="FilterService"/> <prop oor:name="UserData"><value>sdfilt</value></prop> diff --git a/filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu b/filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu index 505084d4d39f..b0776fda9500 100644 --- a/filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu +++ b/filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu @@ -1,5 +1,5 @@ <node oor:name="MS PowerPoint 97 Vorlage" oor:op="replace"> - <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN ENCRYPTION PASSWORDTOMODIFY</value></prop> + <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN</value></prop> <prop oor:name="UIComponent"/> <prop oor:name="FilterService"/> <prop oor:name="UserData"><value>sdfilt</value></prop> diff --git a/filter/source/config/fragments/filters/MathML_XML__Math_.xcu b/filter/source/config/fragments/filters/MathML_XML__Math_.xcu index b6ab09ac89cd..7c80e41f6030 100644 --- a/filter/source/config/fragments/filters/MathML_XML__Math_.xcu +++ b/filter/source/config/fragments/filters/MathML_XML__Math_.xcu @@ -1,5 +1,5 @@ <node oor:name="MathML XML (Math)" oor:op="replace"> - <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE ENCRYPTION</value></prop> + <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE</value></prop> <prop oor:name="UIComponent"/> <prop oor:name="FilterService"/> <prop oor:name="UserData"><value></value></prop> diff --git a/filter/source/config/fragments/filters/Rich_Text_Format.xcu b/filter/source/config/fragments/filters/Rich_Text_Format.xcu index dc8b07e45536..d8fb18c96d06 100644 --- a/filter/source/config/fragments/filters/Rich_Text_Format.xcu +++ b/filter/source/config/fragments/filters/Rich_Text_Format.xcu @@ -1,7 +1,7 @@ <node oor:name="Rich Text Format" oor:op="replace"> - <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN PREFERRED</value></prop> + <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER PREFERRED</value></prop> <prop oor:name="UIComponent"/> - <prop oor:name="FilterService"/> + <prop oor:name="FilterService"><value>com.sun.star.comp.Writer.RtfFilter</value></prop> <prop oor:name="UserData"><value>RTF</value></prop> <prop oor:name="UIName"> <value xml:lang="x-default">Rich Text Format</value> diff --git a/filter/source/config/fragments/internalgraphicfilters/ras_Export.xcu b/filter/source/config/fragments/internalgraphicfilters/ras_Export.xcu index aabae28a10c4..69aa0147ea36 100644 --- a/filter/source/config/fragments/internalgraphicfilters/ras_Export.xcu +++ b/filter/source/config/fragments/internalgraphicfilters/ras_Export.xcu @@ -2,7 +2,7 @@ <prop oor:name="Type"><value>ras_Sun_Rasterfile</value></prop> <prop oor:name="FormatName"><value>era</value></prop> <prop oor:name="RealFilterName"/> - <prop oor:name="UIComponent"/> + <prop oor:name="UIComponent"><value>com.sun.star.svtools.SvFilterOptionsDialog</value></prop> <prop oor:name="UIName"> <value xml:lang="en-US">RAS - Sun Raster Image</value> </prop> diff --git a/filter/source/config/fragments/internalgraphicfilters/svg_Export.xcu b/filter/source/config/fragments/internalgraphicfilters/svg_Export.xcu index 72653869a68d..30b7122a654d 100644 --- a/filter/source/config/fragments/internalgraphicfilters/svg_Export.xcu +++ b/filter/source/config/fragments/internalgraphicfilters/svg_Export.xcu @@ -2,7 +2,7 @@ <prop oor:name="Type"><value>svg_Scalable_Vector_Graphics</value></prop> <prop oor:name="FormatName"><value>SVESVG</value></prop> <prop oor:name="RealFilterName"/> - <prop oor:name="UIComponent"/> + <prop oor:name="UIComponent"><value>com.sun.star.svtools.SvFilterOptionsDialog</value></prop> <prop oor:name="UIName"> <value xml:lang="en-US">SVG - Scalable Vector Graphics</value> </prop> diff --git a/filter/source/config/fragments/internalgraphicfilters/tif_Export.xcu b/filter/source/config/fragments/internalgraphicfilters/tif_Export.xcu index a7d39ebdc8a4..791335acce1f 100644 --- a/filter/source/config/fragments/internalgraphicfilters/tif_Export.xcu +++ b/filter/source/config/fragments/internalgraphicfilters/tif_Export.xcu @@ -2,7 +2,7 @@ <prop oor:name="Type"><value>tif_Tag_Image_File</value></prop> <prop oor:name="FormatName"><value>eti</value></prop> <prop oor:name="RealFilterName"/> - <prop oor:name="UIComponent"/> + <prop oor:name="UIComponent"><value>com.sun.star.svtools.SvFilterOptionsDialog</value></prop> <prop oor:name="UIName"> <value xml:lang="en-US">TIFF - Tagged Image File Format</value> </prop> diff --git a/filter/source/config/fragments/internalgraphicfilters/xpm_Export.xcu b/filter/source/config/fragments/internalgraphicfilters/xpm_Export.xcu index ee1effb786e9..660a240a6678 100644 --- a/filter/source/config/fragments/internalgraphicfilters/xpm_Export.xcu +++ b/filter/source/config/fragments/internalgraphicfilters/xpm_Export.xcu @@ -2,7 +2,7 @@ <prop oor:name="Type"><value>xpm_XPM</value></prop> <prop oor:name="FormatName"><value>exp</value></prop> <prop oor:name="RealFilterName"/> - <prop oor:name="UIComponent"/> + <prop oor:name="UIComponent"><value>com.sun.star.svtools.SvFilterOptionsDialog</value></prop> <prop oor:name="UIName"> <value xml:lang="en-US">XPM - X PixMap</value> </prop> diff --git a/filter/source/filtertracer/exports.dxp b/filter/source/filtertracer/exports.dxp index 0c2e3e7cddd7..0cb5620a1603 100644 --- a/filter/source/filtertracer/exports.dxp +++ b/filter/source/filtertracer/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory
\ No newline at end of file diff --git a/filter/source/filtertracer/filtertraceruno.cxx b/filter/source/filtertracer/filtertraceruno.cxx index f2254c8256f9..0e3097de3ff6 100644 --- a/filter/source/filtertracer/filtertraceruno.cxx +++ b/filter/source/filtertracer/filtertraceruno.cxx @@ -51,37 +51,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -// ----------------------- -// - component_writeInfo - -// ----------------------- - -extern "C" sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey ) -{ - sal_Bool bRet = sal_False; - - if( pRegistryKey ) - { - try - { - NMSP_UNO::Reference< com::sun::star::registry::XRegistryKey > xNewKey( - reinterpret_cast< com::sun::star::registry::XRegistryKey * >( pRegistryKey )->createKey( - FilterTracer_getImplementationName() ) ); - xNewKey = xNewKey->createKey( B2UCONST( "/UNO/SERVICES" ) ); - const SEQ( rtl::OUString )& rSNL = FilterTracer_getSupportedServiceNames(); - const rtl::OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); - bRet = sal_True; - } - catch( com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - - return bRet; -} - // ------------------------ // - component_getFactory - // ------------------------ diff --git a/filter/source/flash/flash.component b/filter/source/flash/flash.component new file mode 100644 index 000000000000..1ce69b3549bc --- /dev/null +++ b/filter/source/flash/flash.component @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.Impress.FlashExportDialog"> + <service name="com.sun.star.Impress.FlashExportDialog"/> + </implementation> + <implementation name="com.sun.star.comp.Impress.FlashExportFilter"> + <service name="com.sun.star.document.ExportFilter"/> + </implementation> +</component> diff --git a/filter/source/flash/impswfdialog.src b/filter/source/flash/impswfdialog.src index 3e38dde68441..83015a3adfeb 100644 --- a/filter/source/flash/impswfdialog.src +++ b/filter/source/flash/impswfdialog.src @@ -29,6 +29,7 @@ ModalDialog DLG_OPTIONS { + HelpID = "filter:ModalDialog:DLG_OPTIONS"; Size = MAP_APPFONT ( 200 , 200 ) ; OutputSize = TRUE ; SVLook = TRUE ; @@ -44,6 +45,7 @@ ModalDialog DLG_OPTIONS }; NumericField NUM_FLD_QUALITY { + HelpID = "filter:NumericField:DLG_OPTIONS:NUM_FLD_QUALITY"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 33 ) ; Size = MAP_APPFONT ( 50 , 12 ) ; @@ -57,6 +59,7 @@ ModalDialog DLG_OPTIONS }; CheckBox BOOL_EXPORT_ALL { + HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_ALL"; Pos = MAP_APPFONT ( 12 , 65 ) ; Size = MAP_APPFONT ( 10 , 14 ) ; TabStop = TRUE ; @@ -69,6 +72,7 @@ ModalDialog DLG_OPTIONS }; CheckBox BOOL_EXPORT_MULTIPLE_FILES { + HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_MULTIPLE_FILES"; Pos = MAP_APPFONT ( 12 , 80 ) ; Size = MAP_APPFONT ( 10 , 14 ) ; TabStop = TRUE ; @@ -81,6 +85,7 @@ ModalDialog DLG_OPTIONS }; CheckBox BOOL_EXPORT_BACKGROUNDS { + HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_BACKGROUNDS"; Pos = MAP_APPFONT ( 22 , 95 ) ; Size = MAP_APPFONT ( 10 , 14 ) ; TabStop = TRUE ; @@ -93,6 +98,7 @@ ModalDialog DLG_OPTIONS }; CheckBox BOOL_EXPORT_BACKGROUND_OBJECTS { + HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_BACKGROUND_OBJECTS"; Pos = MAP_APPFONT ( 22 , 107) ; Size = MAP_APPFONT ( 10 , 14 ) ; TabStop = TRUE ; @@ -105,6 +111,7 @@ ModalDialog DLG_OPTIONS }; CheckBox BOOL_EXPORT_SLIDE_CONTENTS { + HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_SLIDE_CONTENTS"; Pos = MAP_APPFONT ( 22 , 119 ) ; Size = MAP_APPFONT ( 10 , 14 ) ; TabStop = TRUE ; @@ -117,6 +124,7 @@ ModalDialog DLG_OPTIONS }; CheckBox BOOL_EXPORT_SOUND { + HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_SOUND"; Pos = MAP_APPFONT ( 12 , 134 ) ; Size = MAP_APPFONT ( 10 , 14 ) ; TabStop = TRUE ; @@ -129,6 +137,7 @@ ModalDialog DLG_OPTIONS }; CheckBox BOOL_EXPORT_OLE_AS_JPEG { + HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_OLE_AS_JPEG"; Pos = MAP_APPFONT ( 12 , 146 ) ; Size = MAP_APPFONT ( 10 , 14 ) ; TabStop = TRUE ; diff --git a/filter/source/flash/makefile.mk b/filter/source/flash/makefile.mk index e5ff1bf21c5e..69da217234d8 100644 --- a/filter/source/flash/makefile.mk +++ b/filter/source/flash/makefile.mk @@ -96,3 +96,11 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE : target.mk + +ALLTAR : $(MISC)/flash.component + +$(MISC)/flash.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + flash.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt flash.component diff --git a/filter/source/flash/swfuno.cxx b/filter/source/flash/swfuno.cxx index d4a11ebb921b..5ab572014ace 100644 --- a/filter/source/flash/swfuno.cxx +++ b/filter/source/flash/swfuno.cxx @@ -61,42 +61,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//================================================================================================== - -void singlecomponent_writeInfo( Reference< XRegistryKey >& xNewKey, const Sequence< OUString > & rSNL ) -{ - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); -} - -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * /* pServiceManager */, void * pRegistryKey ) -{ - if (pRegistryKey) - { - try - { - Reference< XRegistryKey > xNewKey( - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( FlashExportFilter_getImplementationName() ) ); - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - singlecomponent_writeInfo( xNewKey, FlashExportFilter_getSupportedServiceNames() ); - - xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( SWFDialog_getImplementationName() ); - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - - singlecomponent_writeInfo( xNewKey, SWFDialog_getSupportedServiceNames() ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; -} //================================================================================================== SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) diff --git a/filter/source/graphicfilter/egif/dlgegif.cxx b/filter/source/graphicfilter/egif/dlgegif.cxx deleted file mode 100644 index a9f1e60708b2..000000000000 --- a/filter/source/graphicfilter/egif/dlgegif.cxx +++ /dev/null @@ -1,108 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_filter.hxx" -#ifndef GCC -#endif -#include <tools/ref.hxx> -#include <svtools/FilterConfigItem.hxx> -#include <vcl/msgbox.hxx> -#include "dlgegif.hxx" -#include "dlgegif.hrc" -#include "strings.hrc" - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportEGIF::DlgExportEGIF( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_GIF, *rPara.pResMgr ) ), - rFltCallPara ( rPara ), - aCbxInterlaced ( this, ResId( CBX_INTERLACED, *rPara.pResMgr ) ), - aCbxTranslucent ( this, ResId( CBX_TRANSLUCENT, *rPara.pResMgr ) ), - aGrpMode ( this, ResId( GRP_MODE, *rPara.pResMgr ) ), - aGrpDraw ( this, ResId( GRP_DRAW, *rPara.pResMgr ) ), - aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ), - pMgr ( rPara.pResMgr ) -{ - FreeResource(); - - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/GIF" ) ); - pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); - - String aInterlaceStr( ResId( KEY_INTER, *pMgr ) ); - String aTranslucentStr( ResId( KEY_TRANS, *pMgr ) ); - // Config-Parameter lesen - sal_Bool bInterlaced = pConfigItem->ReadInt32( aInterlaceStr, 1 ) != 0; - sal_Bool bTranslucent = pConfigItem->ReadInt32( aTranslucentStr, 1 ) != 0; - - aCbxInterlaced.Check( bInterlaced ); - aCbxTranslucent.Check( bTranslucent ); - - aBtnOK.SetClickHdl( LINK( this, DlgExportEGIF, OK ) ); -} - -DlgExportEGIF::~DlgExportEGIF() -{ - delete pConfigItem; -} - -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEGIF, OK, void *, EMPTYARG ) -{ - - // Config-Parameter schreiben - String aInterlaceStr( ResId( KEY_INTER, *pMgr ) ); - String aTranslucentStr( ResId( KEY_TRANS, *pMgr ) ); - - sal_Int32 nValue = 0; - if ( aCbxInterlaced.IsChecked() ) - nValue++; - pConfigItem->WriteInt32( aInterlaceStr, nValue ); - - nValue = 0; - if ( aCbxTranslucent.IsChecked() ) - nValue++; - pConfigItem->WriteInt32( aTranslucentStr, nValue ); - rFltCallPara.aFilterData = pConfigItem->GetFilterData(); - EndDialog( RET_OK ); - - return 0; -} - - - diff --git a/filter/source/graphicfilter/egif/dlgegif.hrc b/filter/source/graphicfilter/egif/dlgegif.hrc deleted file mode 100644 index a2f9f4feb488..000000000000 --- a/filter/source/graphicfilter/egif/dlgegif.hrc +++ /dev/null @@ -1,36 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "filter.hrc" - -#define BTN_OK 1 -#define BTN_CANCEL 1 -#define BTN_HELP 1 -#define FI_DESCR 1 -#define GRP_MODE 1 -#define GRP_DRAW 2 -#define CBX_INTERLACED 1 -#define CBX_TRANSLUCENT 2 diff --git a/filter/source/graphicfilter/egif/dlgegif.hxx b/filter/source/graphicfilter/egif/dlgegif.hxx deleted file mode 100644 index 0dbe48a065a3..000000000000 --- a/filter/source/graphicfilter/egif/dlgegif.hxx +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef _DLGEGIF_HXX_ -#define _DLGEGIF_HXX_ - -#include <svtools/fltcall.hxx> -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen -|* -\************************************************************************/ - -class FilterConfigItem; -class ResMgr; - -class DlgExportEGIF : public ModalDialog -{ -private: - - FltCallDialogParameter& rFltCallPara; - - CheckBox aCbxInterlaced; - CheckBox aCbxTranslucent; - FixedLine aGrpMode; - FixedLine aGrpDraw; - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - - FilterConfigItem* pConfigItem; - ResMgr* pMgr; - - DECL_LINK( OK, void * ); - -public: - DlgExportEGIF( FltCallDialogParameter& rPara ); - ~DlgExportEGIF(); -}; - -#endif // _DLGEGIF_HXX_ - diff --git a/filter/source/graphicfilter/egif/dlgegif.src b/filter/source/graphicfilter/egif/dlgegif.src deleted file mode 100644 index 39f96bb7ac7a..000000000000 --- a/filter/source/graphicfilter/egif/dlgegif.src +++ /dev/null @@ -1,118 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "dlgegif.hrc" -ModalDialog DLG_EXPORT_GIF -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 169 , 70 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - Text [ en-US ] = "GIF Options" ; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 113 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 113 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 113 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - FixedLine GRP_MODE - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 100 , 8 ) ; - Text [ en-US ] = "Mode" ; - }; - CheckBox CBX_INTERLACED - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 86 , 12 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Interlaced" ; - }; - FixedLine GRP_DRAW - { - Pos = MAP_APPFONT ( 6 , 32 ) ; - Size = MAP_APPFONT ( 100 , 8 ) ; - Text [ en-US ] = "Drawing objects" ; - }; - CheckBox CBX_TRANSLUCENT - { - Pos = MAP_APPFONT ( 12 , 43 ) ; - Size = MAP_APPFONT ( 86 , 12 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Save ~transparency" ; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/filter/source/graphicfilter/egif/egif.cxx b/filter/source/graphicfilter/egif/egif.cxx index 93f9f5ec0b15..56715487148b 100644 --- a/filter/source/graphicfilter/egif/egif.cxx +++ b/filter/source/graphicfilter/egif/egif.cxx @@ -36,9 +36,6 @@ #include <svtools/fltcall.hxx> #include <svtools/FilterConfigItem.hxx> #include "giflzwc.hxx" -#include "strings.hrc" -#include "dlgegif.hrc" -#include "dlgegif.hxx" // ------------- // - GIFWriter - @@ -574,56 +571,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGrap } // ------------------------------------------------------------------------ - -extern "C" BOOL __LOADONCALLAPI DoExportDialog( FltCallDialogParameter& rPara ) -{ - BOOL bRet = FALSE; - - if ( rPara.pWindow ) - { - ByteString aResMgrName( "egi" ); - ResMgr* pResMgr; - - pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); - - if( pResMgr ) - { - rPara.pResMgr = pResMgr; - bRet = ( DlgExportEGIF( rPara ).Execute() == RET_OK ); - delete pResMgr; - } - else - bRet = TRUE; - } - - return bRet; -} - -// ------------------------------------------------------------------------ -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -// ------------------------------------------------------------------------ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/filter/source/graphicfilter/egif/egifstr.src b/filter/source/graphicfilter/egif/egifstr.src deleted file mode 100644 index ea258019d543..000000000000 --- a/filter/source/graphicfilter/egif/egifstr.src +++ /dev/null @@ -1,39 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include "strings.hrc" - -// Key fuer den Dialog -String KEY_INTER -{ - Text = "Interlaced"; -}; -String KEY_TRANS -{ - Text = "Translucent"; -}; diff --git a/filter/source/graphicfilter/egif/exports.map b/filter/source/graphicfilter/egif/exports.map index 61e4682c6551..d4e28c44700c 100644 --- a/filter/source/graphicfilter/egif/exports.map +++ b/filter/source/graphicfilter/egif/exports.map @@ -1,7 +1,6 @@ UDK_3_0_0 { global: GraphicExport; - DoExportDialog; local: *; diff --git a/filter/source/graphicfilter/egif/makefile.mk b/filter/source/graphicfilter/egif/makefile.mk index 27dae4906046..5579a301e020 100644 --- a/filter/source/graphicfilter/egif/makefile.mk +++ b/filter/source/graphicfilter/egif/makefile.mk @@ -42,20 +42,13 @@ DEPTARGET=vegif CDEFS+= -DEDITDEBUG .ENDIF -SRS1NAME=$(TARGET) -SRC1FILES = dlgegif.src \ - egifstr.src .IF "$(L10N_framework)"=="" SLOFILES= $(SLO)$/egif.obj \ - $(SLO)$/dlgegif.obj \ - $(SLO)$/giflzwc.obj + $(SLO)$/giflzwc.obj .ENDIF # ========================================================================== -RESLIB1NAME=$(TARGET2) -RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs - .IF "$(L10N_framework)"=="" SHL1TARGET= egi$(DLLPOSTFIX) SHL1IMPLIB= egif diff --git a/filter/source/graphicfilter/egif/strings.hrc b/filter/source/graphicfilter/egif/strings.hrc deleted file mode 100644 index 1566c0dfee81..000000000000 --- a/filter/source/graphicfilter/egif/strings.hrc +++ /dev/null @@ -1,28 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#define KEY_INTER 256 -#define KEY_TRANS 257 diff --git a/filter/source/graphicfilter/eos2met/dlgeos2.cxx b/filter/source/graphicfilter/eos2met/dlgeos2.cxx deleted file mode 100644 index 4c5bf1b0a429..000000000000 --- a/filter/source/graphicfilter/eos2met/dlgeos2.cxx +++ /dev/null @@ -1,179 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_filter.hxx" -#ifndef GCC -#endif -#include <com/sun/star/awt/Size.hpp> -#include <vcl/msgbox.hxx> -#include <svtools/FilterConfigItem.hxx> -#include "dlgeos2.hxx" -#include "dlgeos2.hrc" -#include "strings.hrc" - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportEMET::DlgExportEMET( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EMET, *rPara.pResMgr ) ), - rFltCallPara ( rPara ), - aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ), - aRbOriginal ( this, ResId( RB_ORIGINAL, *rPara.pResMgr ) ), - aRbSize ( this, ResId( RB_SIZE, *rPara.pResMgr ) ), - aGrpMode ( this, ResId( GRP_MODE, *rPara.pResMgr ) ), - aFtSizeX ( this, ResId( FT_SIZEX, *rPara.pResMgr ) ), - aMtfSizeX ( this, ResId( MTF_SIZEX, *rPara.pResMgr ) ), - aFtSizeY ( this, ResId( FT_SIZEY, *rPara.pResMgr ) ), - aMtfSizeY ( this, ResId( MTF_SIZEY, *rPara.pResMgr ) ), - aGrpSize ( this, ResId( GRP_SIZE, *rPara.pResMgr ) ), - pMgr ( rPara.pResMgr ) -{ - FreeResource(); - - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/MET" ) ); - pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); - - aBtnOK.SetClickHdl( LINK( this, DlgExportEMET, OK ) ); - aRbOriginal.SetClickHdl( LINK( this, DlgExportEMET, ClickRbOriginal ) ); - aRbSize.SetClickHdl( LINK( this, DlgExportEMET, ClickRbSize ) ); - - // Config-Parameter lesen - sal_Int32 nMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 ); - ::com::sun::star::awt::Size aDefault( 10000, 10000 ); - ::com::sun::star::awt::Size aSize; - aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault ); - - aMtfSizeX.SetDefaultUnit( FUNIT_MM ); - aMtfSizeY.SetDefaultUnit( FUNIT_MM ); - - aMtfSizeX.SetValue( aSize.Width ); - aMtfSizeY.SetValue( aSize.Height ); - - switch ( rPara.eFieldUnit ) - { -// case FUNIT_NONE : -// case FUNIT_KM : -// case FUNIT_PERCENT : -// case FUNIT_CUSTOM : -// case FUNIT_MILE : -// case FUNIT_FOOT : -// case FUNIT_M : - case FUNIT_MM : - case FUNIT_CM : - case FUNIT_TWIP : - case FUNIT_POINT : - case FUNIT_PICA : - case FUNIT_INCH : - case FUNIT_100TH_MM : - { - aMtfSizeX.SetUnit( rPara.eFieldUnit ); - aMtfSizeY.SetUnit( rPara.eFieldUnit ); - } - break; - default: - break; // multiple other value not handled -Wall - } - if ( nMode == 1 ) - { - aRbSize.Check( TRUE ); - ClickRbSize( NULL ); - } - else - { - aRbOriginal.Check( TRUE ); - ClickRbOriginal( NULL ); - } -} - -DlgExportEMET::~DlgExportEMET() -{ - delete pConfigItem; -} - -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEMET, OK, void *, EMPTYARG ) -{ - // Config-Parameter schreiben - ::com::sun::star::awt::Size aSize( - (sal_Int32)MetricField::ConvertDoubleValue( aMtfSizeX.GetValue(), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM ), - (sal_Int32)MetricField::ConvertDoubleValue( aMtfSizeY.GetValue(), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM ) ); - sal_Int32 nStrMode = ( aRbSize.IsChecked() ) ? 1 : 0; - - pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nStrMode ); - pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize ); - rFltCallPara.aFilterData = pConfigItem->GetFilterData(); - EndDialog( RET_OK ); - - return 0; -} - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEMET, ClickRbOriginal, void*, EMPTYARG ) -{ - aGrpSize.Disable(); - aFtSizeX.Disable(); - aMtfSizeX.Disable(); - aFtSizeY.Disable(); - aMtfSizeY.Disable(); - - return 0; -} - - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEMET, ClickRbSize, void*, EMPTYARG ) -{ - aGrpSize.Enable(); - aFtSizeX.Enable(); - aMtfSizeX.Enable(); - aFtSizeY.Enable(); - aMtfSizeY.Enable(); - - return 0; -} - diff --git a/filter/source/graphicfilter/eos2met/dlgeos2.hrc b/filter/source/graphicfilter/eos2met/dlgeos2.hrc deleted file mode 100644 index 5e4ec5b160fc..000000000000 --- a/filter/source/graphicfilter/eos2met/dlgeos2.hrc +++ /dev/null @@ -1,41 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "filter.hrc" - -#define BTN_OK 1 -#define BTN_CANCEL 1 -#define BTN_HELP 1 -#define CBX_SIZE 2 -#define MTF_SIZEX 1 -#define MTF_SIZEY 2 -#define FT_SIZEX 1 -#define FT_SIZEY 2 -#define GRP_SIZE 1 -#define GRP_MODE 2 -#define RB_ORIGINAL 1 -#define RB_SIZE 2 - diff --git a/filter/source/graphicfilter/eos2met/dlgeos2.hxx b/filter/source/graphicfilter/eos2met/dlgeos2.hxx deleted file mode 100644 index 6387be453494..000000000000 --- a/filter/source/graphicfilter/eos2met/dlgeos2.hxx +++ /dev/null @@ -1,80 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef _DLGEOS2_HXX_ -#define _DLGEOS2_HXX_ -#include <svtools/fltcall.hxx> -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen bei Vektorformaten -|* -\************************************************************************/ - -class FilterConfigItem; -class ResMgr; - -class DlgExportEMET : public ModalDialog -{ -private: - - FltCallDialogParameter& rFltCallPara; - - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - - RadioButton aRbOriginal; - RadioButton aRbSize; - FixedLine aGrpMode; - - FixedText aFtSizeX; - MetricField aMtfSizeX; - FixedText aFtSizeY; - MetricField aMtfSizeY; - FixedLine aGrpSize; - - FilterConfigItem* pConfigItem; - ResMgr* pMgr; - - DECL_LINK( OK, void* p ); - DECL_LINK( ClickRbOriginal,void* p ); - DECL_LINK( ClickRbSize,void* p ); - -public: - DlgExportEMET( FltCallDialogParameter& rPara ); - ~DlgExportEMET(); -}; - - -#endif // _DLGEMET_HXX_ - diff --git a/filter/source/graphicfilter/eos2met/dlgeos2.src b/filter/source/graphicfilter/eos2met/dlgeos2.src deleted file mode 100644 index 6c9e474e25db..000000000000 --- a/filter/source/graphicfilter/eos2met/dlgeos2.src +++ /dev/null @@ -1,162 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include "dlgeos2.hrc" - -ModalDialog DLG_EXPORT_EMET -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 178 , 89 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - Text [ en-US ] = "MET Options" ; - MetricField MTF_SIZEX - { - Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 55 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 100 ; - Maximum = 99999 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - First = 100 ; - Last = 99999 ; - SpinSize = 100 ; - }; - MetricField MTF_SIZEY - { - Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 71 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 100 ; - Maximum = 99999 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - First = 100 ; - Last = 99999 ; - SpinSize = 100 ; - }; - FixedLine GRP_SIZE - { - Pos = MAP_APPFONT ( 6 , 44 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "Size" ; - }; - FixedText FT_SIZEX - { - Pos = MAP_APPFONT ( 12 , 56 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "Width" ; - }; - FixedText FT_SIZEY - { - Pos = MAP_APPFONT ( 12 , 72 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "Height" ; - }; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 122 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 122 , 24 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 122 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - RadioButton RB_ORIGINAL - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 98 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Original" ; - }; - RadioButton RB_SIZE - { - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 98 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Size" ; - }; - FixedLine GRP_MODE - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "Mode" ; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx index 5ef86b9c1b98..4fce357a91e8 100644 --- a/filter/source/graphicfilter/eos2met/eos2met.cxx +++ b/filter/source/graphicfilter/eos2met/eos2met.cxx @@ -45,8 +45,6 @@ #include <vcl/svapp.hxx> #include <vcl/msgbox.hxx> #include <svl/solar.hrc> -#include "strings.hrc" -#include "dlgeos2.hxx" // -----------------------------Feld-Typen------------------------------- @@ -2594,55 +2592,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream & rStream, Graphic & rGr } } -//================== GraphicDialog - die exportierte Funktion ================ - -extern "C" BOOL SAL_CALL DoExportDialog( FltCallDialogParameter& rPara ) -{ - BOOL bRet = FALSE; - - if ( rPara.pWindow ) - { - ByteString aResMgrName( "eme" ); - ResMgr* pResMgr; - - pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); - - if( pResMgr ) - { - rPara.pResMgr = pResMgr; - bRet = ( DlgExportEMET( rPara ).Execute() == RET_OK ); - delete pResMgr; - } - else - bRet = TRUE; - } - - return bRet; -} - -//================== ein bischen Muell fuer Windows ========================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/filter/source/graphicfilter/eos2met/eos2mstr.src b/filter/source/graphicfilter/eos2met/eos2mstr.src deleted file mode 100644 index 8afebcb7564c..000000000000 --- a/filter/source/graphicfilter/eos2met/eos2mstr.src +++ /dev/null @@ -1,38 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "strings.hrc" - -String KEY_MODE -{ - Text = "ExportMode"; -}; - -String KEY_SIZE -{ - Text = "Size"; -}; diff --git a/filter/source/graphicfilter/eos2met/exports.map b/filter/source/graphicfilter/eos2met/exports.map index 61e4682c6551..d4e28c44700c 100644 --- a/filter/source/graphicfilter/eos2met/exports.map +++ b/filter/source/graphicfilter/eos2met/exports.map @@ -1,7 +1,6 @@ UDK_3_0_0 { global: GraphicExport; - DoExportDialog; local: *; diff --git a/filter/source/graphicfilter/eos2met/makefile.mk b/filter/source/graphicfilter/eos2met/makefile.mk index 9f8deb74c7ca..da9ac4b53e15 100644 --- a/filter/source/graphicfilter/eos2met/makefile.mk +++ b/filter/source/graphicfilter/eos2met/makefile.mk @@ -42,17 +42,12 @@ DEPTARGET=veos2met CDEFS+= -DEDITDEBUG .ENDIF -SRS1NAME=$(TARGET) -SRC1FILES= dlgeos2.src \ - eos2mstr.src .IF "$(L10N_framework)"=="" -SLOFILES = $(SLO)$/eos2met.obj \ - $(SLO)$/dlgeos2.obj +SLOFILES = $(SLO)$/eos2met.obj + .ENDIF # ========================================================================== -RESLIB1NAME=$(TARGET2) -RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs .IF "$(L10N_framework)"=="" SHL1TARGET= eme$(DLLPOSTFIX) SHL1IMPLIB= eos2met diff --git a/filter/source/graphicfilter/eos2met/strings.hrc b/filter/source/graphicfilter/eos2met/strings.hrc deleted file mode 100644 index 7834e3ea2bc0..000000000000 --- a/filter/source/graphicfilter/eos2met/strings.hrc +++ /dev/null @@ -1,29 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#define KEY_MODE 260 -#define KEY_SIZE 261 - diff --git a/filter/source/graphicfilter/epbm/dlgepbm.cxx b/filter/source/graphicfilter/epbm/dlgepbm.cxx deleted file mode 100644 index 932fb7ff5bb9..000000000000 --- a/filter/source/graphicfilter/epbm/dlgepbm.cxx +++ /dev/null @@ -1,99 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_filter.hxx" -#ifndef GCC -#endif - -#include <tools/ref.hxx> -#include <svtools/FilterConfigItem.hxx> -#include <vcl/msgbox.hxx> -#include "dlgepbm.hxx" -#include "dlgepbm.hrc" -#include "strings.hrc" - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportEPBM::DlgExportEPBM( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPBM, *rPara.pResMgr ) ), - rFltCallPara ( rPara ), - aGrpFormat ( this, ResId( GRP_FORMAT, *rPara.pResMgr ) ), - aRBRaw ( this, ResId( RB_RAW, *rPara.pResMgr ) ), - aRBASCII ( this, ResId( RB_ASCII, *rPara.pResMgr ) ), - aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ), - pMgr ( rPara.pResMgr ) -{ - FreeResource(); - - // Config-Parameter lesen - - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PBM" ) ); - pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); - sal_Int32 nFormat = pConfigItem->ReadInt32( String( ResId( KEY_FORMAT, *pMgr ) ), 1 ); - - BOOL bCheck = FALSE; - if ( !nFormat ) - bCheck ^= TRUE; - - aRBRaw.Check( bCheck ); - bCheck ^= TRUE; - aRBASCII.Check( bCheck ); - - aBtnOK.SetClickHdl( LINK( this, DlgExportEPBM, OK ) ); -} - -DlgExportEPBM::~DlgExportEPBM() -{ - delete pConfigItem; -} - -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEPBM, OK, void *, EMPTYARG ) -{ - - // Config-Parameter schreiben - sal_Int32 nFormat = 0; - if ( aRBASCII.IsChecked() ) - nFormat++; - pConfigItem->WriteInt32( String( ResId( KEY_FORMAT, *pMgr ) ), nFormat ); - rFltCallPara.aFilterData = pConfigItem->GetFilterData(); - EndDialog( RET_OK ); - - return 0; -} diff --git a/filter/source/graphicfilter/epbm/dlgepbm.hrc b/filter/source/graphicfilter/epbm/dlgepbm.hrc deleted file mode 100644 index 876dfa840997..000000000000 --- a/filter/source/graphicfilter/epbm/dlgepbm.hrc +++ /dev/null @@ -1,34 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "filter.hrc" - -#define BTN_OK 1 -#define BTN_CANCEL 1 -#define BTN_HELP 1 -#define GRP_FORMAT 1 -#define RB_RAW 1 -#define RB_ASCII 2 diff --git a/filter/source/graphicfilter/epbm/dlgepbm.hxx b/filter/source/graphicfilter/epbm/dlgepbm.hxx deleted file mode 100644 index 780eac366020..000000000000 --- a/filter/source/graphicfilter/epbm/dlgepbm.hxx +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef _DLGEPBM_HXX_ -#define _DLGEPBM_HXX_ -#include <svtools/fltcall.hxx> -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <svtools/stdctrl.hxx> - - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen -|* -\************************************************************************/ - -class ResMgr; - -class FilterConfigItem; -class DlgExportEPBM : public ModalDialog -{ -private: - - FltCallDialogParameter& rFltCallPara; - - FixedLine aGrpFormat; - RadioButton aRBRaw; - RadioButton aRBASCII; - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - - FilterConfigItem* pConfigItem; - ResMgr* pMgr; - - DECL_LINK( OK, void * ); - -public: - DlgExportEPBM( FltCallDialogParameter& rPara ); - ~DlgExportEPBM(); -}; - -#endif // _DLGEPBM_HXX_ diff --git a/filter/source/graphicfilter/epbm/dlgepbm.src b/filter/source/graphicfilter/epbm/dlgepbm.src deleted file mode 100644 index b4e6eb2decf2..000000000000 --- a/filter/source/graphicfilter/epbm/dlgepbm.src +++ /dev/null @@ -1,106 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "dlgepbm.hrc" -ModalDialog DLG_EXPORT_EPBM -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 133 , 63 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - Text [ en-US ] = "PBM Options" ; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 73 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 73 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 73 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - FixedLine GRP_FORMAT - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Text [ en-US ] = "File format"; - }; - RadioButton RB_RAW - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Binary"; - }; - RadioButton RB_ASCII - { - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Text"; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/filter/source/graphicfilter/epbm/epbm.cxx b/filter/source/graphicfilter/epbm/epbm.cxx index fe8dc77fc704..b4f5b9b680ce 100644 --- a/filter/source/graphicfilter/epbm/epbm.cxx +++ b/filter/source/graphicfilter/epbm/epbm.cxx @@ -35,9 +35,6 @@ #include <svl/solar.hrc> #include <svtools/fltcall.hxx> #include <svtools/FilterConfigItem.hxx> -#include "strings.hrc" -#include "dlgepbm.hrc" -#include "dlgepbm.hxx" //============================ PBMWriter ================================== @@ -215,58 +212,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGrap } // ------------------------------------------------------------------------ - -extern "C" BOOL __LOADONCALLAPI DoExportDialog( FltCallDialogParameter& rPara ) -{ - BOOL bRet = FALSE; - - if ( rPara.pWindow ) - { - ByteString aResMgrName( "epb" ); - ResMgr* pResMgr; - - pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); - - if( pResMgr ) - { - rPara.pResMgr = pResMgr; - bRet = ( DlgExportEPBM( rPara ).Execute() == RET_OK ); - delete pResMgr; - } - else - bRet = TRUE; - } - - return bRet; -} - -// ------------------------------------------------------------------------ -#ifndef GCC -#endif - -// --------------- -// - Win16 trash - -// --------------- - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ - if ( nHeap ) - UnlockData( 0 ); - - hDLLInst = hDLL; - - return TRUE; -} - -// ------------------------------------------------------------------------ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/filter/source/graphicfilter/epbm/epbmstr.src b/filter/source/graphicfilter/epbm/epbmstr.src deleted file mode 100644 index 8424505dbcd1..000000000000 --- a/filter/source/graphicfilter/epbm/epbmstr.src +++ /dev/null @@ -1,35 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include "strings.hrc" - -// Key fuer den Dialog -String KEY_FORMAT -{ - Text = "FileFormat"; -}; diff --git a/filter/source/graphicfilter/epbm/exports.map b/filter/source/graphicfilter/epbm/exports.map index 61e4682c6551..d4e28c44700c 100644 --- a/filter/source/graphicfilter/epbm/exports.map +++ b/filter/source/graphicfilter/epbm/exports.map @@ -1,7 +1,6 @@ UDK_3_0_0 { global: GraphicExport; - DoExportDialog; local: *; diff --git a/filter/source/graphicfilter/epbm/makefile.mk b/filter/source/graphicfilter/epbm/makefile.mk index 3b248222cda1..609eae204aa4 100644 --- a/filter/source/graphicfilter/epbm/makefile.mk +++ b/filter/source/graphicfilter/epbm/makefile.mk @@ -42,17 +42,11 @@ DEPTARGET=vepbm CDEFS+= -DEDITDEBUG .ENDIF -SRS1NAME=$(TARGET) -SRC1FILES= dlgepbm.src \ - epbmstr.src .IF "$(L10N_framework)"=="" -SLOFILES = $(SLO)$/epbm.obj \ - $(SLO)$/dlgepbm.obj +SLOFILES = $(SLO)$/epbm.obj .ENDIF # ========================================================================== -RESLIB1NAME=$(TARGET2) -RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs .IF "$(L10N_framework)"=="" SHL1TARGET= epb$(DLLPOSTFIX) SHL1IMPLIB= epbm diff --git a/filter/source/graphicfilter/epbm/strings.hrc b/filter/source/graphicfilter/epbm/strings.hrc deleted file mode 100644 index 122719e87d4b..000000000000 --- a/filter/source/graphicfilter/epbm/strings.hrc +++ /dev/null @@ -1,27 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#define KEY_FORMAT 256 diff --git a/filter/source/graphicfilter/epgm/dlgepgm.cxx b/filter/source/graphicfilter/epgm/dlgepgm.cxx deleted file mode 100644 index 3aa960b25a26..000000000000 --- a/filter/source/graphicfilter/epgm/dlgepgm.cxx +++ /dev/null @@ -1,97 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_filter.hxx" -#ifndef GCC -#endif - -#include <tools/ref.hxx> -#include <svtools/FilterConfigItem.hxx> -#include <vcl/msgbox.hxx> -#include "dlgepgm.hxx" -#include "dlgepgm.hrc" -#include "strings.hrc" - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportEPGM::DlgExportEPGM( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPGM, *rPara.pResMgr ) ), - rFltCallPara ( rPara ), - aGrpFormat ( this, ResId( GRP_FORMAT, *rPara.pResMgr ) ), - aRBRaw ( this, ResId( RB_RAW, *rPara.pResMgr ) ), - aRBASCII ( this, ResId( RB_ASCII, *rPara.pResMgr ) ), - aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ), - pMgr ( rPara.pResMgr ) -{ - FreeResource(); - - // Config-Parameter lesen - - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PGM" ) ); - pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); - sal_Int32 nFormat = pConfigItem->ReadInt32( String( ResId( KEY_FORMAT, *pMgr ) ), 0 ); - - BOOL bCheck = FALSE; - if ( !nFormat ) - bCheck ^= TRUE; - aRBRaw.Check( bCheck ); - bCheck ^= TRUE; - aRBASCII.Check( bCheck ); - - aBtnOK.SetClickHdl( LINK( this, DlgExportEPGM, OK ) ); -} - -DlgExportEPGM::~DlgExportEPGM() -{ - delete pConfigItem; -} - -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEPGM, OK, void *, EMPTYARG ) -{ - // Config-Parameter schreiben - sal_Int32 nFormat = 0; - if ( aRBASCII.IsChecked() ) - nFormat++; - pConfigItem->WriteInt32( String( ResId( KEY_FORMAT, *pMgr ) ), nFormat ); - rFltCallPara.aFilterData = pConfigItem->GetFilterData(); - EndDialog( RET_OK ); - - return 0; -} diff --git a/filter/source/graphicfilter/epgm/dlgepgm.hrc b/filter/source/graphicfilter/epgm/dlgepgm.hrc deleted file mode 100644 index 876dfa840997..000000000000 --- a/filter/source/graphicfilter/epgm/dlgepgm.hrc +++ /dev/null @@ -1,34 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "filter.hrc" - -#define BTN_OK 1 -#define BTN_CANCEL 1 -#define BTN_HELP 1 -#define GRP_FORMAT 1 -#define RB_RAW 1 -#define RB_ASCII 2 diff --git a/filter/source/graphicfilter/epgm/dlgepgm.hxx b/filter/source/graphicfilter/epgm/dlgepgm.hxx deleted file mode 100644 index 3eb91bdb5fc6..000000000000 --- a/filter/source/graphicfilter/epgm/dlgepgm.hxx +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef _DLGEPGM_HXX_ -#define _DLGEPGM_HXX_ -#include <svtools/fltcall.hxx> -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <svtools/stdctrl.hxx> - - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen -|* -\************************************************************************/ - -class FilterConfigItem; -class ResMgr; - -class DlgExportEPGM : public ModalDialog -{ -private: - - FltCallDialogParameter& rFltCallPara; - - FixedLine aGrpFormat; - RadioButton aRBRaw; - RadioButton aRBASCII; - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - - FilterConfigItem* pConfigItem; - ResMgr* pMgr; - - DECL_LINK( OK, void * ); - -public: - DlgExportEPGM( FltCallDialogParameter& rPara ); - ~DlgExportEPGM(); -}; - -#endif // _DLGEPGM_HXX_ diff --git a/filter/source/graphicfilter/epgm/dlgepgm.src b/filter/source/graphicfilter/epgm/dlgepgm.src deleted file mode 100644 index 39e91d29fdf5..000000000000 --- a/filter/source/graphicfilter/epgm/dlgepgm.src +++ /dev/null @@ -1,105 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "dlgepgm.hrc" -ModalDialog DLG_EXPORT_EPGM -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 133 , 63 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - Text [ en-US ] = "PGM Options" ; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 73 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 73 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 73 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - FixedLine GRP_FORMAT - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Text [ en-US ] = "File format"; - }; - RadioButton RB_RAW - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Binary"; - }; - RadioButton RB_ASCII - { - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Text"; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/filter/source/graphicfilter/epgm/epgm.cxx b/filter/source/graphicfilter/epgm/epgm.cxx index 89fbc9929ab0..1f5da40dee43 100644 --- a/filter/source/graphicfilter/epgm/epgm.cxx +++ b/filter/source/graphicfilter/epgm/epgm.cxx @@ -35,9 +35,6 @@ #include <svl/solar.hrc> #include <svtools/fltcall.hxx> #include <svtools/FilterConfigItem.hxx> -#include "strings.hrc" -#include "dlgepgm.hrc" -#include "dlgepgm.hxx" //============================ PGMWriter ================================== @@ -240,58 +237,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGrap } // ------------------------------------------------------------------------ - -extern "C" BOOL __LOADONCALLAPI DoExportDialog( FltCallDialogParameter& rPara ) -{ - BOOL bRet = FALSE; - - if ( rPara.pWindow ) - { - ByteString aResMgrName( "epg" ); - ResMgr* pResMgr; - - pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); - - if( pResMgr ) - { - rPara.pResMgr = pResMgr; - bRet = ( DlgExportEPGM( rPara ).Execute() == RET_OK ); - delete pResMgr; - } - else - bRet = TRUE; - } - - return bRet; -} - -// ------------------------------------------------------------------------ -#ifndef GCC -#endif - -// --------------- -// - Win16 trash - -// --------------- - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ - if ( nHeap ) - UnlockData( 0 ); - - hDLLInst = hDLL; - - return TRUE; -} - -// ------------------------------------------------------------------------ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/filter/source/graphicfilter/epgm/epgmstr.src b/filter/source/graphicfilter/epgm/epgmstr.src deleted file mode 100644 index 8424505dbcd1..000000000000 --- a/filter/source/graphicfilter/epgm/epgmstr.src +++ /dev/null @@ -1,35 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include "strings.hrc" - -// Key fuer den Dialog -String KEY_FORMAT -{ - Text = "FileFormat"; -}; diff --git a/filter/source/graphicfilter/epgm/exports.map b/filter/source/graphicfilter/epgm/exports.map index 61e4682c6551..d4e28c44700c 100644 --- a/filter/source/graphicfilter/epgm/exports.map +++ b/filter/source/graphicfilter/epgm/exports.map @@ -1,7 +1,6 @@ UDK_3_0_0 { global: GraphicExport; - DoExportDialog; local: *; diff --git a/filter/source/graphicfilter/epgm/makefile.mk b/filter/source/graphicfilter/epgm/makefile.mk index 70ab5ec93c68..63d961feec97 100644 --- a/filter/source/graphicfilter/epgm/makefile.mk +++ b/filter/source/graphicfilter/epgm/makefile.mk @@ -43,17 +43,11 @@ DEPTARGET=vepgm CDEFS+= -DEDITDEBUG .ENDIF -SRS1NAME=$(TARGET) -SRC1FILES= dlgepgm.src \ - epgmstr.src .IF "$(L10N_framework)"=="" -SLOFILES = $(SLO)$/epgm.obj \ - $(SLO)$/dlgepgm.obj +SLOFILES = $(SLO)$/epgm.obj .ENDIF # ========================================================================== -RESLIB1NAME=$(TARGET2) -RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs .IF "$(L10N_framework)"=="" SHL1TARGET= epg$(DLLPOSTFIX) SHL1IMPLIB= epgm diff --git a/filter/source/graphicfilter/epgm/strings.hrc b/filter/source/graphicfilter/epgm/strings.hrc deleted file mode 100644 index 122719e87d4b..000000000000 --- a/filter/source/graphicfilter/epgm/strings.hrc +++ /dev/null @@ -1,27 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#define KEY_FORMAT 256 diff --git a/filter/source/graphicfilter/epict/dlgepct.cxx b/filter/source/graphicfilter/epict/dlgepct.cxx deleted file mode 100644 index c274dc873560..000000000000 --- a/filter/source/graphicfilter/epict/dlgepct.cxx +++ /dev/null @@ -1,183 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_filter.hxx" -#ifndef GCC -#endif - -#include <vcl/msgbox.hxx> -#include <svtools/FilterConfigItem.hxx> -#include <com/sun/star/awt/Size.hpp> -#include "dlgepct.hxx" -#include "dlgepct.hrc" -#include "strings.hrc" - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportEPCT::DlgExportEPCT( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPCT, *rPara.pResMgr ) ), - rFltCallPara ( rPara ), - aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ), - aRbOriginal ( this, ResId( RB_ORIGINAL, *rPara.pResMgr ) ), - aRbSize ( this, ResId( RB_SIZE, *rPara.pResMgr ) ), - aGrpMode ( this, ResId( GRP_MODE, *rPara.pResMgr ) ), - aFtSizeX ( this, ResId( FT_SIZEX, *rPara.pResMgr ) ), - aMtfSizeX ( this, ResId( MTF_SIZEX, *rPara.pResMgr ) ), - aFtSizeY ( this, ResId( FT_SIZEY, *rPara.pResMgr ) ), - aMtfSizeY ( this, ResId( MTF_SIZEY, *rPara.pResMgr ) ), - aGrpSize ( this, ResId( GRP_SIZE, *rPara.pResMgr ) ), - pMgr ( rPara.pResMgr ) -{ - FreeResource(); - - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PCT" ) ); - pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); - - aBtnOK.SetClickHdl( LINK( this, DlgExportEPCT, OK ) ); - aRbOriginal.SetClickHdl( LINK( this, DlgExportEPCT, ClickRbOriginal ) ); - aRbSize.SetClickHdl( LINK( this, DlgExportEPCT, ClickRbSize ) ); - - // Config-Parameter lesen - sal_Int32 nStrMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 ); - ::com::sun::star::awt::Size aDefault( 10000, 10000 ); - ::com::sun::star::awt::Size aSize; - aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault ); - - aMtfSizeX.SetDefaultUnit( FUNIT_MM ); - aMtfSizeY.SetDefaultUnit( FUNIT_MM ); - aMtfSizeX.SetValue( aSize.Width ); - aMtfSizeY.SetValue( aSize.Height ); - - switch ( rPara.eFieldUnit ) - { - case FUNIT_NONE : - case FUNIT_KM : - case FUNIT_PERCENT : - case FUNIT_CUSTOM : - case FUNIT_MILE : - case FUNIT_FOOT : - case FUNIT_M : - break; // -Wall not handled. - case FUNIT_MM : - case FUNIT_CM : - case FUNIT_TWIP : - case FUNIT_POINT : - case FUNIT_PICA : - case FUNIT_INCH : - case FUNIT_100TH_MM : - { - aMtfSizeX.SetUnit( rPara.eFieldUnit ); - aMtfSizeY.SetUnit( rPara.eFieldUnit ); - } - break; - } - if ( nStrMode == 1 ) - { - aRbSize.Check( TRUE ); - ClickRbSize( NULL ); - } - else - { - aRbOriginal.Check( TRUE ); - ClickRbOriginal( NULL ); - } -} - -DlgExportEPCT::~DlgExportEPCT() -{ - delete pConfigItem; -} - -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\**************************************** ********************************/ - -IMPL_LINK( DlgExportEPCT, OK, void *, EMPTYARG ) -{ - // Config-Parameter schreiben - ::com::sun::star::awt::Size aSize( - (sal_Int32)MetricField::ConvertDoubleValue( aMtfSizeX.GetValue(), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM ), - (sal_Int32)MetricField::ConvertDoubleValue( aMtfSizeY.GetValue(), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM ) ); - - sal_Int32 nStrMode = 0; - if ( aRbSize.IsChecked() ) - nStrMode++; - - pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nStrMode ); - pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize ); - rFltCallPara.aFilterData = pConfigItem->GetFilterData(); - EndDialog( RET_OK ); - - return 0; -} - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEPCT, ClickRbOriginal, void*, EMPTYARG ) -{ - aGrpSize.Disable(); - aFtSizeX.Disable(); - aMtfSizeX.Disable(); - aFtSizeY.Disable(); - aMtfSizeY.Disable(); - - return 0; -} - - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEPCT, ClickRbSize, void*, EMPTYARG ) -{ - aGrpSize.Enable(); - aFtSizeX.Enable(); - aMtfSizeX.Enable(); - aFtSizeY.Enable(); - aMtfSizeY.Enable(); - - return 0; -} - - - diff --git a/filter/source/graphicfilter/epict/dlgepct.hrc b/filter/source/graphicfilter/epict/dlgepct.hrc deleted file mode 100644 index 0f92aa9bda3c..000000000000 --- a/filter/source/graphicfilter/epict/dlgepct.hrc +++ /dev/null @@ -1,41 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include <filter.hrc> - -#define BTN_OK 1 -#define BTN_CANCEL 1 -#define BTN_HELP 1 -#define CBX_SIZE 2 -#define MTF_SIZEX 1 -#define MTF_SIZEY 2 -#define FT_SIZEX 1 -#define FT_SIZEY 2 -#define GRP_SIZE 1 -#define GRP_MODE 2 -#define RB_ORIGINAL 1 -#define RB_SIZE 2 - diff --git a/filter/source/graphicfilter/epict/dlgepct.hxx b/filter/source/graphicfilter/epict/dlgepct.hxx deleted file mode 100644 index e879822ab1f5..000000000000 --- a/filter/source/graphicfilter/epict/dlgepct.hxx +++ /dev/null @@ -1,80 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef _DLGEPCT_HXX_ -#define _DLGEPCT_HXX_ - -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <svtools/fltcall.hxx> - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen bei Vektorformaten -|* -\************************************************************************/ - -class FilterConfigItem; -class ResMgr; - -class DlgExportEPCT : public ModalDialog -{ -private: - - FltCallDialogParameter& rFltCallPara; - - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - - RadioButton aRbOriginal; - RadioButton aRbSize; - FixedLine aGrpMode; - - FixedText aFtSizeX; - MetricField aMtfSizeX; - FixedText aFtSizeY; - MetricField aMtfSizeY; - FixedLine aGrpSize; - - FilterConfigItem* pConfigItem; - ResMgr* pMgr; - - DECL_LINK( OK, void* p ); - DECL_LINK( ClickRbOriginal,void* p ); - DECL_LINK( ClickRbSize,void* p ); - -public: - DlgExportEPCT( FltCallDialogParameter& rPara ); - ~DlgExportEPCT(); -}; - -#endif // _DLGEPCT_HXX_ - diff --git a/filter/source/graphicfilter/epict/dlgepct.src b/filter/source/graphicfilter/epict/dlgepct.src deleted file mode 100644 index d503c53cf89c..000000000000 --- a/filter/source/graphicfilter/epict/dlgepct.src +++ /dev/null @@ -1,163 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "dlgepct.hrc" - -ModalDialog DLG_EXPORT_EPCT -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 178 , 89 ) ; - Text [ en-US ] = "PICT Options" ; - Moveable = TRUE ; - Closeable = TRUE ; - MetricField MTF_SIZEX - { - Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 55 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 100 ; - Maximum = 99999 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - First = 100 ; - Last = 99999 ; - SpinSize = 100 ; - }; - MetricField MTF_SIZEY - { - Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 71 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 100 ; - Maximum = 99999 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - First = 100 ; - Last = 99999 ; - SpinSize = 100 ; - }; - FixedLine GRP_SIZE - { - Pos = MAP_APPFONT ( 6 , 44 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "Size" ; - }; - FixedText FT_SIZEX - { - Pos = MAP_APPFONT ( 12 , 57 ) ; - Size = MAP_APPFONT ( 45 , 8 ) ; - Text [ en-US ] = "Width" ; - }; - FixedText FT_SIZEY - { - Pos = MAP_APPFONT ( 12 , 73 ) ; - Size = MAP_APPFONT ( 45 , 8 ) ; - Text [ en-US ] = "Height" ; - }; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 122 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 122 , 24 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 122 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - RadioButton RB_ORIGINAL - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 98 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Original" ; - }; - RadioButton RB_SIZE - { - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 98 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Size" ; - }; - FixedLine GRP_MODE - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "Mode" ; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx index 7e81077e3810..53bdfbdad6ff 100644 --- a/filter/source/graphicfilter/epict/epict.cxx +++ b/filter/source/graphicfilter/epict/epict.cxx @@ -48,9 +48,6 @@ #include <vcl/gdimtf.hxx> #include <tools/bigint.hxx> -#include "strings.hrc" -#include "dlgepct.hrc" -#include "dlgepct.hxx" #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> @@ -2331,57 +2328,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport(SvStream & rStream, Graphic & rGra } } -//================== GraphicDialog - die exportierte Funktion ================ - -extern "C" BOOL SAL_CALL DoExportDialog( FltCallDialogParameter& rPara ) -{ - BOOL bRet = FALSE; - - if ( rPara.pWindow ) - { - ByteString aResMgrName( "ept" ); - ResMgr* pResMgr; - - pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); - - if( pResMgr ) - { - rPara.pResMgr = pResMgr; - bRet = ( DlgExportEPCT( rPara ).Execute() == RET_OK ); - delete pResMgr; - } - else - bRet = TRUE; - } - - return bRet; -} - - -//=============================== fuer Windows ============================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - diff --git a/filter/source/graphicfilter/epict/epictstr.src b/filter/source/graphicfilter/epict/epictstr.src deleted file mode 100644 index 8afebcb7564c..000000000000 --- a/filter/source/graphicfilter/epict/epictstr.src +++ /dev/null @@ -1,38 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "strings.hrc" - -String KEY_MODE -{ - Text = "ExportMode"; -}; - -String KEY_SIZE -{ - Text = "Size"; -}; diff --git a/filter/source/graphicfilter/epict/exports.map b/filter/source/graphicfilter/epict/exports.map index 61e4682c6551..d4e28c44700c 100644 --- a/filter/source/graphicfilter/epict/exports.map +++ b/filter/source/graphicfilter/epict/exports.map @@ -1,7 +1,6 @@ UDK_3_0_0 { global: GraphicExport; - DoExportDialog; local: *; diff --git a/filter/source/graphicfilter/epict/makefile.mk b/filter/source/graphicfilter/epict/makefile.mk index a7c99eb3f732..1e030e52dd9b 100644 --- a/filter/source/graphicfilter/epict/makefile.mk +++ b/filter/source/graphicfilter/epict/makefile.mk @@ -43,17 +43,11 @@ DEPTARGET=vepict CDEFS+= -DEDITDEBUG .ENDIF -SRS1NAME=$(TARGET) -SRC1FILES = dlgepct.src \ - epictstr.src .IF "$(L10N_framework)"=="" -SLOFILES = $(SLO)$/epict.obj \ - $(SLO)$/dlgepct.obj +SLOFILES = $(SLO)$/epict.obj .ENDIF # ========================================================================== -RESLIB1NAME=$(TARGET2) -RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs .IF "$(L10N_framework)"=="" SHL1TARGET= ept$(DLLPOSTFIX) SHL1IMPLIB= epict diff --git a/filter/source/graphicfilter/epict/strings.hrc b/filter/source/graphicfilter/epict/strings.hrc deleted file mode 100644 index 7834e3ea2bc0..000000000000 --- a/filter/source/graphicfilter/epict/strings.hrc +++ /dev/null @@ -1,29 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#define KEY_MODE 260 -#define KEY_SIZE 261 - diff --git a/filter/source/graphicfilter/eppm/dlgeppm.cxx b/filter/source/graphicfilter/eppm/dlgeppm.cxx deleted file mode 100644 index 23822bfebf7c..000000000000 --- a/filter/source/graphicfilter/eppm/dlgeppm.cxx +++ /dev/null @@ -1,96 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_filter.hxx" -#ifndef GCC -#endif -#include <tools/ref.hxx> -#include <svtools/FilterConfigItem.hxx> -#include <vcl/msgbox.hxx> -#include "dlgeppm.hxx" -#include "dlgeppm.hrc" -#include "strings.hrc" - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportEPPM::DlgExportEPPM( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPPM, *rPara.pResMgr ) ), - rFltCallPara ( rPara ), - aGrpFormat ( this, ResId( GRP_FORMAT, *rPara.pResMgr ) ), - aRBRaw ( this, ResId( RB_RAW, *rPara.pResMgr ) ), - aRBASCII ( this, ResId( RB_ASCII, *rPara.pResMgr ) ), - aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ), - pMgr ( rPara.pResMgr ) -{ - FreeResource(); - - // Config-Parameter lesen - - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PPM" ) ); - pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); - sal_Int32 nFormat = pConfigItem->ReadInt32( String( ResId( KEY_FORMAT, *pMgr ) ), 0 ); - - BOOL bCheck = FALSE; - if ( !nFormat ) - bCheck ^= TRUE; - aRBRaw.Check( bCheck ); - bCheck ^= TRUE; - aRBASCII.Check( bCheck ); - - aBtnOK.SetClickHdl( LINK( this, DlgExportEPPM, OK ) ); -} - -DlgExportEPPM::~DlgExportEPPM() -{ - delete pConfigItem; -} - -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEPPM, OK, void *, EMPTYARG ) -{ - // Config-Parameter schreiben - sal_Int32 nFormat = 0; - if ( aRBASCII.IsChecked() ) - nFormat++; - pConfigItem->WriteInt32( String( ResId( KEY_FORMAT, *pMgr ) ), nFormat ); - rFltCallPara.aFilterData = pConfigItem->GetFilterData(); - EndDialog( RET_OK ); - - return 0; -} diff --git a/filter/source/graphicfilter/eppm/dlgeppm.hrc b/filter/source/graphicfilter/eppm/dlgeppm.hrc deleted file mode 100644 index 876dfa840997..000000000000 --- a/filter/source/graphicfilter/eppm/dlgeppm.hrc +++ /dev/null @@ -1,34 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "filter.hrc" - -#define BTN_OK 1 -#define BTN_CANCEL 1 -#define BTN_HELP 1 -#define GRP_FORMAT 1 -#define RB_RAW 1 -#define RB_ASCII 2 diff --git a/filter/source/graphicfilter/eppm/dlgeppm.hxx b/filter/source/graphicfilter/eppm/dlgeppm.hxx deleted file mode 100644 index a03ca3ad24f0..000000000000 --- a/filter/source/graphicfilter/eppm/dlgeppm.hxx +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef _DLGEPPM_HXX_ -#define _DLGEPPM_HXX_ -#include <svtools/fltcall.hxx> -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <svtools/stdctrl.hxx> - - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen -|* -\************************************************************************/ - -class FilterConfigItem; -class ResMgr; - -class DlgExportEPPM : public ModalDialog -{ -private: - - FltCallDialogParameter& rFltCallPara; - - FixedLine aGrpFormat; - RadioButton aRBRaw; - RadioButton aRBASCII; - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - - FilterConfigItem* pConfigItem; - ResMgr* pMgr; - - DECL_LINK( OK, void * ); - -public: - DlgExportEPPM( FltCallDialogParameter& rPara ); - ~DlgExportEPPM(); -}; - -#endif // _DLGEPPM_HXX_ diff --git a/filter/source/graphicfilter/eppm/dlgeppm.src b/filter/source/graphicfilter/eppm/dlgeppm.src deleted file mode 100644 index bf6c6ec653cb..000000000000 --- a/filter/source/graphicfilter/eppm/dlgeppm.src +++ /dev/null @@ -1,106 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "dlgeppm.hrc" -ModalDialog DLG_EXPORT_EPPM -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 133 , 63 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - Text [ en-US ] = "PPM Options" ; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 73 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 73 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 73 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - FixedLine GRP_FORMAT - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Text [ en-US ] = "File format"; - }; - RadioButton RB_RAW - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Binary"; - }; - RadioButton RB_ASCII - { - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Text"; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/filter/source/graphicfilter/eppm/eppm.cxx b/filter/source/graphicfilter/eppm/eppm.cxx index bef9ce9d3077..856b2abf352b 100644 --- a/filter/source/graphicfilter/eppm/eppm.cxx +++ b/filter/source/graphicfilter/eppm/eppm.cxx @@ -35,9 +35,6 @@ #include <svl/solar.hrc> #include <svtools/fltcall.hxx> #include <svtools/FilterConfigItem.hxx> -#include "strings.hrc" -#include "dlgeppm.hrc" -#include "dlgeppm.hxx" //============================ PPMWriter ================================== @@ -248,58 +245,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGrap // ------------------------------------------------------------------------ -extern "C" BOOL __LOADONCALLAPI DoExportDialog( FltCallDialogParameter& rPara ) -{ - BOOL bRet = FALSE; - - if ( rPara.pWindow ) - { - ByteString aResMgrName( "epp" ); - ResMgr* pResMgr; - - pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); - - if( pResMgr ) - { - rPara.pResMgr = pResMgr; - bRet = ( DlgExportEPPM( rPara ).Execute() == RET_OK ); - delete pResMgr; - } - else - bRet = TRUE; - } - - return bRet; -} - -#ifndef GCC -#endif - -// ------------------------------------------------------------------------ - -// --------------- -// - Win16 trash - -// --------------- - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ - if ( nHeap ) - UnlockData( 0 ); - - hDLLInst = hDLL; - - return TRUE; -} - -// ------------------------------------------------------------------------ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/filter/source/graphicfilter/eppm/eppmstr.src b/filter/source/graphicfilter/eppm/eppmstr.src deleted file mode 100644 index 8424505dbcd1..000000000000 --- a/filter/source/graphicfilter/eppm/eppmstr.src +++ /dev/null @@ -1,35 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include "strings.hrc" - -// Key fuer den Dialog -String KEY_FORMAT -{ - Text = "FileFormat"; -}; diff --git a/filter/source/graphicfilter/eppm/exports.map b/filter/source/graphicfilter/eppm/exports.map index 61e4682c6551..d4e28c44700c 100644 --- a/filter/source/graphicfilter/eppm/exports.map +++ b/filter/source/graphicfilter/eppm/exports.map @@ -1,7 +1,6 @@ UDK_3_0_0 { global: GraphicExport; - DoExportDialog; local: *; diff --git a/filter/source/graphicfilter/eppm/makefile.mk b/filter/source/graphicfilter/eppm/makefile.mk index 44e6ca11d34a..6a41d81f1da6 100644 --- a/filter/source/graphicfilter/eppm/makefile.mk +++ b/filter/source/graphicfilter/eppm/makefile.mk @@ -42,17 +42,11 @@ DEPTARGET=veppm CDEFS+= -DEDITDEBUG .ENDIF -SRS1NAME=$(TARGET) -SRC1FILES= dlgeppm.src \ - eppmstr.src .IF "$(L10N_framework)"=="" -SLOFILES = $(SLO)$/eppm.obj \ - $(SLO)$/dlgeppm.obj +SLOFILES = $(SLO)$/eppm.obj .ENDIF # ========================================================================== -RESLIB1NAME=$(TARGET2) -RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs .IF "$(L10N_framework)"=="" SHL1TARGET= epp$(DLLPOSTFIX) SHL1IMPLIB= eppm diff --git a/filter/source/graphicfilter/eppm/strings.hrc b/filter/source/graphicfilter/eppm/strings.hrc deleted file mode 100644 index 122719e87d4b..000000000000 --- a/filter/source/graphicfilter/eppm/strings.hrc +++ /dev/null @@ -1,27 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#define KEY_FORMAT 256 diff --git a/filter/source/graphicfilter/eps/dlgeps.cxx b/filter/source/graphicfilter/eps/dlgeps.cxx deleted file mode 100644 index c6f2abba5912..000000000000 --- a/filter/source/graphicfilter/eps/dlgeps.cxx +++ /dev/null @@ -1,206 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_filter.hxx" -#ifndef GCC -#endif - -#include <tools/ref.hxx> -#include <vcl/msgbox.hxx> -#include <svtools/FilterConfigItem.hxx> -#include "dlgeps.hxx" -#include "dlgeps.hrc" -#include "strings.hrc" - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportEPS::DlgExportEPS( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPS, *rPara.pResMgr ) ), - rFltCallPara ( rPara ), - aGrpPreview ( this, ResId( GRP_PREVIEW, *rPara.pResMgr ) ), - aCBPreviewTiff ( this, ResId( CB_PREVIEW_TIFF, *rPara.pResMgr ) ), - aCBPreviewEPSI ( this, ResId( CB_PREVIEW_EPSI, *rPara.pResMgr ) ), - aGrpVersion ( this, ResId( GRP_VERSION, *rPara.pResMgr ) ), - aRBLevel1 ( this, ResId( RB_LEVEL1, *rPara.pResMgr ) ), - aRBLevel2 ( this, ResId( RB_LEVEL2, *rPara.pResMgr ) ), - aGrpColor ( this, ResId( GRP_COLOR, *rPara.pResMgr ) ), - aRBColor ( this, ResId( RB_COLOR, *rPara.pResMgr ) ), - aRBGrayscale ( this, ResId( RB_GRAYSCALE, *rPara.pResMgr ) ), - aGrpCompression ( this, ResId( GRP_COMPRESSION, *rPara.pResMgr ) ), - aRBCompressionLZW ( this, ResId( RB_COMPRESSION_LZW, *rPara.pResMgr ) ), - aRBCompressionNone ( this, ResId( RB_COMPRESSION_NONE, *rPara.pResMgr ) ), - aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ), - pMgr ( rPara.pResMgr ) -{ - FreeResource(); - - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/EPS" ) ); - pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); - - // Config-Parameter lesen - String sPreview( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) ); - String sVersion( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ); - String sColorFormat( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) ); - String sCompressionMode( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) ); - String sTextMode( RTL_CONSTASCII_USTRINGPARAM( "TextMode" ) ); - - sal_Int32 nPreview = pConfigItem->ReadInt32( sPreview, 0 ); - sal_Int32 nVersion = pConfigItem->ReadInt32( sVersion, 2 ); - sal_Int32 nColor = pConfigItem->ReadInt32( sColorFormat, 0 ); - sal_Int32 nCompr = pConfigItem->ReadInt32( sCompressionMode, 2 ); - - /* SJ: The following line is not superfluous, reading the item will also #106652# - create the corresponding FilterData Property. Since all filter - are no longer accessing the configuration itself, we have fill the - FilterData sequence with all available configuration items */ - pConfigItem->ReadInt32( sTextMode, 0 ); - - BOOL bCheck = FALSE; - if ( nPreview & 1 ) - bCheck = TRUE; - aCBPreviewTiff.Check( bCheck ); - if ( nPreview & 2 ) - bCheck = TRUE; - aCBPreviewEPSI.Check( bCheck ); - - bCheck = FALSE; - if ( nVersion == 1 ) - bCheck ^= TRUE; - aRBLevel1.Check( bCheck ); - bCheck ^= TRUE; - aRBLevel2.Check( bCheck ); - - bCheck = FALSE; - if ( nColor == 1 ) - bCheck ^= TRUE; - aRBColor.Check( bCheck ); - bCheck ^= TRUE; - aRBGrayscale.Check( bCheck ); - - bCheck = FALSE; - if ( nCompr == 1 ) - bCheck ^= TRUE; - aRBCompressionLZW.Check( bCheck ); - bCheck ^= TRUE; - aRBCompressionNone.Check( bCheck ); - - if ( aRBLevel1.IsChecked() ) - { - aRBColor.Disable(); - aRBGrayscale.Disable(); - aRBCompressionNone.Disable(); - aRBCompressionLZW.Disable(); - aRBCompressionNone.Disable(); - } - - aBtnOK.SetClickHdl( LINK( this, DlgExportEPS, OK ) ); - aRBLevel1.SetClickHdl( LINK( this, DlgExportEPS, LEVEL1 ) ); - aRBLevel2.SetClickHdl( LINK( this, DlgExportEPS, LEVEL2 ) ); -} - -DlgExportEPS::~DlgExportEPS() -{ - delete pConfigItem; -} - -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEPS, OK, void *, EMPTYARG ) -{ - - // Config-Parameter schreiben - sal_Int32 nCheck = 0; - if ( aCBPreviewTiff.IsChecked() ) - nCheck++; - if ( aCBPreviewEPSI.IsChecked() ) - nCheck += 2; - - String sPreview( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) ); - pConfigItem->WriteInt32( sPreview, nCheck ); - - nCheck = 1; - if ( aRBLevel2.IsChecked() ) - nCheck++; - String sVersion( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ); - pConfigItem->WriteInt32( sVersion, nCheck ); - - nCheck = 1; - if ( aRBGrayscale.IsChecked() ) - nCheck++; - String sColorFormat( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) ); - pConfigItem->WriteInt32( sColorFormat, nCheck ); - - nCheck = 1; - if ( aRBCompressionNone.IsChecked() ) - nCheck++; - String sCompressionMode( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) ); - pConfigItem->WriteInt32( sCompressionMode, nCheck ); - - rFltCallPara.aFilterData = pConfigItem->GetFilterData(); - EndDialog( RET_OK ); - - return 0; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( DlgExportEPS, LEVEL1, void*, EMPTYARG ) -{ - if ( aRBLevel1.IsChecked() ) - { - aRBColor.Disable(); - aRBGrayscale.Disable(); - aRBCompressionLZW.Disable(); - aRBCompressionNone.Disable(); - } - return 0; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( DlgExportEPS, LEVEL2, void*, EMPTYARG ) -{ - if ( aRBLevel2.IsChecked() ) - { - aRBColor.Enable(); - aRBGrayscale.Enable(); - aRBCompressionLZW.Enable(); - aRBCompressionNone.Enable(); - } - return 0; -} diff --git a/filter/source/graphicfilter/eps/dlgeps.hrc b/filter/source/graphicfilter/eps/dlgeps.hrc deleted file mode 100644 index 061c8b2db6cb..000000000000 --- a/filter/source/graphicfilter/eps/dlgeps.hrc +++ /dev/null @@ -1,43 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "filter.hrc" - -#define BTN_OK 1 -#define BTN_CANCEL 1 -#define BTN_HELP 1 -#define GRP_PREVIEW 1 -#define GRP_VERSION 2 -#define GRP_COLOR 3 -#define GRP_COMPRESSION 4 -#define CB_PREVIEW_TIFF 1 -#define CB_PREVIEW_EPSI 2 -#define RB_LEVEL1 1 -#define RB_LEVEL2 2 -#define RB_COLOR 3 -#define RB_GRAYSCALE 4 -#define RB_COMPRESSION_LZW 5 -#define RB_COMPRESSION_NONE 6 diff --git a/filter/source/graphicfilter/eps/dlgeps.hxx b/filter/source/graphicfilter/eps/dlgeps.hxx deleted file mode 100644 index ada390b44e87..000000000000 --- a/filter/source/graphicfilter/eps/dlgeps.hxx +++ /dev/null @@ -1,82 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _DLGEPS_HXX_ -#define _DLGEPS_HXX_ -#include <svtools/fltcall.hxx> -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <vcl/lstbox.hxx> -#include <svtools/stdctrl.hxx> - - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen -|* -\************************************************************************/ - -class FilterConfigItem; -class ResMgr; - -class DlgExportEPS : public ModalDialog -{ -private: - - FltCallDialogParameter& rFltCallPara; - - FixedLine aGrpPreview; - CheckBox aCBPreviewTiff; - CheckBox aCBPreviewEPSI; - FixedLine aGrpVersion; - RadioButton aRBLevel1; - RadioButton aRBLevel2; - FixedLine aGrpColor; - RadioButton aRBColor; - RadioButton aRBGrayscale; - FixedLine aGrpCompression; - RadioButton aRBCompressionLZW; - RadioButton aRBCompressionNone; - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - - FilterConfigItem* pConfigItem; - ResMgr* pMgr; - - DECL_LINK( OK, void * ); - DECL_LINK( LEVEL1, void* ); - DECL_LINK( LEVEL2, void* ); - -public: - DlgExportEPS( FltCallDialogParameter& rPara ); - ~DlgExportEPS(); -}; - -#endif // _DLGEPS_HXX_ diff --git a/filter/source/graphicfilter/eps/dlgeps.src b/filter/source/graphicfilter/eps/dlgeps.src deleted file mode 100644 index 31ddccd5be4f..000000000000 --- a/filter/source/graphicfilter/eps/dlgeps.src +++ /dev/null @@ -1,160 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "dlgeps.hrc" -ModalDialog DLG_EXPORT_EPS -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 230, 161 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - Text [ en-US ] = "EPS Export Options"; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 174 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 174, 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 174 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - - FixedLine GRP_PREVIEW - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 162 , 8 ) ; - Text [ en-US ] = "Preview"; - }; - CheckBox CB_PREVIEW_TIFF - { - Pos = MAP_APPFONT ( 12, 14 ) ; - Size = MAP_APPFONT ( 150 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Image ~preview (TIFF)"; - }; - CheckBox CB_PREVIEW_EPSI - { - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 150, 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Interchange (EPSI)"; - }; - FixedLine GRP_VERSION - { - Pos = MAP_APPFONT ( 6, 41 ) ; - Size = MAP_APPFONT ( 162 , 8 ) ; - Text [ en-US ] = "Version"; - }; - RadioButton RB_LEVEL1 - { - Pos = MAP_APPFONT ( 12 , 52 ) ; - Size = MAP_APPFONT ( 150 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Level ~1"; - }; - RadioButton RB_LEVEL2 - { - Pos = MAP_APPFONT ( 12 , 66 ) ; - Size = MAP_APPFONT ( 150, 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Level ~2"; - }; - - FixedLine GRP_COLOR - { - Pos = MAP_APPFONT ( 6 , 79 ) ; - Size = MAP_APPFONT ( 162 , 8 ) ; - Text [ en-US ] = "Color format"; - }; - RadioButton RB_COLOR - { - Pos = MAP_APPFONT ( 12 , 90 ) ; - Size = MAP_APPFONT ( 150, 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Color"; - }; - RadioButton RB_GRAYSCALE - { - Pos = MAP_APPFONT ( 12 , 104 ) ; - Size = MAP_APPFONT ( 150, 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Grayscale"; - }; - - FixedLine GRP_COMPRESSION - { - Pos = MAP_APPFONT ( 6 , 117 ) ; - Size = MAP_APPFONT ( 162 , 8 ) ; - Text [ en-US ] = "Compression"; - }; - RadioButton RB_COMPRESSION_LZW - { - Pos = MAP_APPFONT ( 12, 128 ); - Size = MAP_APPFONT ( 150, 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "LZW encoding"; - }; - RadioButton RB_COMPRESSION_NONE - { - Pos = MAP_APPFONT ( 12, 141 ) ; - Size = MAP_APPFONT ( 150, 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "None"; - }; -}; - - - - - - - - - - - - - - - - - - - - - diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index 5e221b58c72e..7c3a26844bc6 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -48,8 +48,6 @@ #include <svtools/FilterConfigItem.hxx> #include <vcl/graphictools.hxx> #include "strings.hrc" -#include "dlgeps.hrc" -#include "dlgeps.hxx" #include <math.h> @@ -2739,55 +2737,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream & rStream, Graphic & rGr return aPSWriter.WritePS( rGraphic, rStream, pFilterConfigItem ); } -//--------------------------------------------------------------------------------- - -extern "C" BOOL __LOADONCALLAPI DoExportDialog( FltCallDialogParameter& rPara ) -{ - BOOL bRet = FALSE; - - if ( rPara.pWindow ) - { - ByteString aResMgrName( "eps" ); - ResMgr* pResMgr; - - pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); - - if( pResMgr ) - { - rPara.pResMgr = pResMgr; - bRet = ( DlgExportEPS( rPara ).Execute() == RET_OK ); - delete pResMgr; - } - else - bRet = TRUE; - } - - return bRet; -} - -//================== ein bischen Muell fuer Windows ========================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/filter/source/graphicfilter/eps/exports.map b/filter/source/graphicfilter/eps/exports.map index 61e4682c6551..d4e28c44700c 100644 --- a/filter/source/graphicfilter/eps/exports.map +++ b/filter/source/graphicfilter/eps/exports.map @@ -1,7 +1,6 @@ UDK_3_0_0 { global: GraphicExport; - DoExportDialog; local: *; diff --git a/filter/source/graphicfilter/eps/makefile.mk b/filter/source/graphicfilter/eps/makefile.mk index 189972e80e6e..8ed7f1610014 100644 --- a/filter/source/graphicfilter/eps/makefile.mk +++ b/filter/source/graphicfilter/eps/makefile.mk @@ -44,12 +44,10 @@ CDEFS+= -DEDITDEBUG .ENDIF SRS1NAME=$(TARGET) -SRC1FILES = dlgeps.src \ - epsstr.src +SRC1FILES = epsstr.src .IF "$(L10N_framework)"=="" EXCEPTIONSFILES=$(SLO)$/eps.obj -SLOFILES = $(SLO)$/eps.obj \ - $(SLO)$/dlgeps.obj +SLOFILES = $(SLO)$/eps.obj .ENDIF # ========================================================================== diff --git a/filter/source/graphicfilter/eras/eras.cxx b/filter/source/graphicfilter/eras/eras.cxx index 845dbf6ff83a..cb9005fdf0eb 100644 --- a/filter/source/graphicfilter/eras/eras.cxx +++ b/filter/source/graphicfilter/eras/eras.cxx @@ -286,32 +286,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGrap return aRASWriter.WriteRAS( rGraphic, rStream, pFilterConfigItem ); } -#ifndef GCC -#endif - -// --------------- -// - Win16 trash - -// --------------- - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ - if ( nHeap ) - UnlockData( 0 ); - - hDLLInst = hDLL; - - return TRUE; -} - -// ------------------------------------------------------------------------ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/filter/source/graphicfilter/etiff/etiff.cxx index 0e71141eb812..af3142806a12 100644 --- a/filter/source/graphicfilter/etiff/etiff.cxx +++ b/filter/source/graphicfilter/etiff/etiff.cxx @@ -616,33 +616,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGrap return TIFFWriter().WriteTIFF( rGraphic, rStream, pFilterConfigItem ); } -#ifndef GCC -#endif - -// --------------- -// - Win16 trash - -// --------------- - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ - if ( nHeap ) - UnlockData( 0 ); - - hDLLInst = hDLL; - - return TRUE; -} - -// ------------------------------------------------------------------------ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - diff --git a/filter/source/graphicfilter/expm/expm.cxx b/filter/source/graphicfilter/expm/expm.cxx index cd05331e5ade..083fb0f2f7b3 100644 --- a/filter/source/graphicfilter/expm/expm.cxx +++ b/filter/source/graphicfilter/expm/expm.cxx @@ -271,32 +271,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGrap return aXPMWriter.WriteXPM( rGraphic, rStream, pFilterConfigItem ); } -#ifndef GCC -#endif - -// --------------- -// - Win16 trash - -// --------------- - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ - if ( nHeap ) - UnlockData( 0 ); - - hDLLInst = hDLL; - - return TRUE; -} - -// ------------------------------------------------------------------------ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/filter/source/graphicfilter/idxf/idxf.cxx b/filter/source/graphicfilter/idxf/idxf.cxx index 149f4c2feb78..da8f830d32d5 100644 --- a/filter/source/graphicfilter/idxf/idxf.cxx +++ b/filter/source/graphicfilter/idxf/idxf.cxx @@ -51,32 +51,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGra return TRUE; } - -//============================= fuer Windows ================================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - - diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index 097fc83e35fe..caadcd4f3cdd 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -742,30 +742,3 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf return ( bRetValue ); } -//================== ein bischen Muell fuer Windows ========================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index 6cab0cdc4e18..e0ffce9c6081 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -2755,30 +2755,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGra return bRet; } -//================== ein bischen Muell fuer Windows ========================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - diff --git a/filter/source/graphicfilter/ipbm/ipbm.cxx b/filter/source/graphicfilter/ipbm/ipbm.cxx index 6b83fc1021c7..80c825c80791 100644 --- a/filter/source/graphicfilter/ipbm/ipbm.cxx +++ b/filter/source/graphicfilter/ipbm/ipbm.cxx @@ -536,30 +536,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGra return aPBMReader.ReadPBM( rStream, rGraphic ); } -//================== ein bischen Muell fuer Windows ========================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - diff --git a/filter/source/graphicfilter/ipcd/ipcd.cxx b/filter/source/graphicfilter/ipcd/ipcd.cxx index 0d44993c252d..0b0b56acc5e5 100644 --- a/filter/source/graphicfilter/ipcd/ipcd.cxx +++ b/filter/source/graphicfilter/ipcd/ipcd.cxx @@ -392,31 +392,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGra return aPCDReader.ReadPCD( rStream, rGraphic, pConfigItem ); } -//============================= fuer Windows ================================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - - diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx index 02c552744299..ca77be58a02e 100644 --- a/filter/source/graphicfilter/ipcx/ipcx.cxx +++ b/filter/source/graphicfilter/ipcx/ipcx.cxx @@ -429,30 +429,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGra return nRetValue; } -//================== ein bischen Muell fuer Windows ========================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index d1af028149b7..244ca56971be 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -36,12 +36,107 @@ #include <svtools/fltcall.hxx> #include <math.h> -// MT: NOOLDSV, someone should change the code... -enum PenStyle { PEN_NULL, PEN_SOLID, PEN_DOT, PEN_DASH, PEN_DASHDOT }; -enum BrushStyle { BRUSH_NULL, BRUSH_SOLID, BRUSH_HORZ, BRUSH_VERT, - BRUSH_CROSS, BRUSH_DIAGCROSS, BRUSH_UPDIAG, BRUSH_DOWNDIAG, - BRUSH_25, BRUSH_50, BRUSH_75, - BRUSH_BITMAP }; +namespace PictReaderInternal { + //! utilitary class to store a pattern, ... + class Pattern { + public: + //! constructor + Pattern() { + isColor = false; isRead = false; + penStyle=PEN_SOLID; brushStyle = BRUSH_SOLID; + nBitCount = 64; + } + + //! reads black/white pattern from SvStream + ULONG read(SvStream &stream); + //! sets the color + void setColor(Color &col) { isColor = true; color = col; } + /** returns a color which can be "used" to replace the pattern, + * created from ForeColor and BackColor, ... + * + * note: maybe, we must also use some mode PatCopy, ... to define the color + */ + Color getColor(Color bkColor=COL_WHITE, Color fgColor = COL_BLACK) const { + if (isColor) return color; + // we create a gray pattern from nBitCount + double alpha = nBitCount / 64.0; + return Color(BYTE(alpha*fgColor.GetRed()+(1.0-alpha)*bkColor.GetRed()), + BYTE(alpha*fgColor.GetGreen()+(1.0-alpha)*bkColor.GetGreen()), + BYTE(alpha*fgColor.GetBlue()+(1.0-alpha)*bkColor.GetBlue())); + } + + //! returns true if this is the default pattern + bool isDefault() const { return isRead == false; } + + // MT: NOOLDSV, someone should change the code... + enum PenStyle { PEN_NULL, PEN_SOLID, PEN_DOT, PEN_DASH, PEN_DASHDOT }; + enum BrushStyle { BRUSH_NULL, BRUSH_SOLID, BRUSH_HORZ, BRUSH_VERT, + BRUSH_CROSS, BRUSH_DIAGCROSS, BRUSH_UPDIAG, BRUSH_DOWNDIAG, + BRUSH_25, BRUSH_50, BRUSH_75, + BRUSH_BITMAP }; + // Data + enum PenStyle penStyle; + enum BrushStyle brushStyle; + short nBitCount; + + bool isColor; // true if it is a color pattern + Color color; + + protected: + // flag to know if the pattern came from reading the picture, or if it is the default pattern + bool isRead; + }; + + ULONG Pattern::read(SvStream &stream) { + short nx,ny; + unsigned char nbyte[8]; + ULONG nHiBytes, nLoBytes; + isColor = false; + + // Anzahl der Bits im Pattern zaehlen, die auf 1 gesetzt sind: + nBitCount=0; + for (ny=0; ny<8; ny++) { + stream >> ((char&)nbyte[ny]); + for (nx=0; nx<8; nx++) { + if ( (nbyte[ny] & (1<<nx)) != 0 ) nBitCount++; + } + } + + // Pattern in 2 Langworten unterbringen: + nHiBytes=(((((((ULONG)nbyte[0])<<8)| + (ULONG)nbyte[1])<<8)| + (ULONG)nbyte[2])<<8)| + (ULONG)nbyte[3]; + nLoBytes=(((((((ULONG)nbyte[4])<<8)| + (ULONG)nbyte[5])<<8)| + (ULONG)nbyte[6])<<8)| + (ULONG)nbyte[7]; + + // Einen PenStyle machen: + if (nBitCount<=0) penStyle=PEN_NULL; + else if (nBitCount<=16) penStyle=PEN_DOT; + else if (nBitCount<=32) penStyle=PEN_DASHDOT; + else if (nBitCount<=48) penStyle=PEN_DASH; + else penStyle=PEN_SOLID; + + // Einen BrushStyle machen: + if (nHiBytes==0xffffffff && nLoBytes==0xffffffff) brushStyle=BRUSH_SOLID; + else if (nHiBytes==0xff000000 && nLoBytes==0x00000000) brushStyle=BRUSH_HORZ; + else if (nHiBytes==0x80808080 && nLoBytes==0x80808080) brushStyle=BRUSH_VERT; + else if (nHiBytes==0xff808080 && nLoBytes==0x80808080) brushStyle=BRUSH_CROSS; + else if (nHiBytes==0x01824428 && nLoBytes==0x10284482) brushStyle=BRUSH_DIAGCROSS; + else if (nHiBytes==0x80402010 && nLoBytes==0x08040201) brushStyle=BRUSH_UPDIAG; + else if (nHiBytes==0x01020408 && nLoBytes==0x10204080) brushStyle=BRUSH_DOWNDIAG; + else if (nBitCount<=24) brushStyle=BRUSH_25; + else if (nBitCount<=40) brushStyle=BRUSH_50; + else if (nBitCount<=56) brushStyle=BRUSH_75; + else brushStyle=BRUSH_SOLID; + + isRead = true; + + return 8; + } +} //============================ PictReader ================================== @@ -51,7 +146,7 @@ enum PictDrawingMethod { }; class PictReader { - + typedef class PictReaderInternal::Pattern Pattern; private: SvStream * pPict; // Die einzulesende Pict-Datei @@ -67,11 +162,11 @@ private: Point aTextPosition; Color aActForeColor; Color aActBackColor; - PenStyle eActPenPenStyle; - BrushStyle eActPenBrushStyle; - BrushStyle eActFillStyle; - BrushStyle eActBackStyle; + Pattern eActPenPattern; + Pattern eActFillPattern; + Pattern eActBackPattern; USHORT nActPenSize; + // Note: Postscript mode is stored by setting eActRop to ROP_1 RasterOp eActROP; PictDrawingMethod eActMethod; Size aActOvalSize; @@ -100,9 +195,7 @@ private: ULONG ReadPolygon(Polygon & rPoly); - ULONG ReadPattern(PenStyle * pPenStyle, BrushStyle * pBrushStyle); - - ULONG ReadPixPattern(PenStyle * pPenStyle, BrushStyle * pBrushStyle); + ULONG ReadPixPattern(Pattern &pattern); Rectangle aLastRect; ULONG ReadAndDrawRect(PictDrawingMethod eMethod); @@ -146,9 +239,11 @@ private: void SetLineColor( const Color& rColor ); void SetFillColor( const Color& rColor ); + // OSNOLA: returns the text encoding which must be used for system id + static rtl_TextEncoding GetTextEncoding (USHORT fId = 0xFFFF); public: - PictReader() {} + PictReader() { aActFont.SetCharSet(GetTextEncoding()); } void ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile ); // Liesst aus dem Stream eine Pict-Datei und fuellt das GDIMetaFile @@ -208,6 +303,42 @@ public: } //=================== Methoden von PictReader ============================== +rtl_TextEncoding PictReader::GetTextEncoding (USHORT fId) { + static bool first = true; + static rtl_TextEncoding enc = RTL_TEXTENCODING_APPLE_ROMAN; + if (first) { + rtl_TextEncoding def = gsl_getSystemTextEncoding(); + // we keep gsl_getSystemTextEncoding only if it is a mac encoding + switch(def) { + case RTL_TEXTENCODING_APPLE_ROMAN: + case RTL_TEXTENCODING_APPLE_ARABIC: + case RTL_TEXTENCODING_APPLE_CENTEURO: + case RTL_TEXTENCODING_APPLE_CROATIAN: + case RTL_TEXTENCODING_APPLE_CYRILLIC: + case RTL_TEXTENCODING_APPLE_DEVANAGARI: + case RTL_TEXTENCODING_APPLE_FARSI: + case RTL_TEXTENCODING_APPLE_GREEK: + case RTL_TEXTENCODING_APPLE_GUJARATI: + case RTL_TEXTENCODING_APPLE_GURMUKHI: + case RTL_TEXTENCODING_APPLE_HEBREW: + case RTL_TEXTENCODING_APPLE_ICELAND: + case RTL_TEXTENCODING_APPLE_ROMANIAN: + case RTL_TEXTENCODING_APPLE_THAI: + case RTL_TEXTENCODING_APPLE_TURKISH: + case RTL_TEXTENCODING_APPLE_UKRAINIAN: + case RTL_TEXTENCODING_APPLE_CHINSIMP: + case RTL_TEXTENCODING_APPLE_CHINTRAD: + case RTL_TEXTENCODING_APPLE_JAPANESE: + case RTL_TEXTENCODING_APPLE_KOREAN: + enc = def; break; + default: break; + } + first = false; + } + if (fId == 13) return RTL_TEXTENCODING_ADOBE_DINGBATS; // CHECKME + if (fId == 23) return RTL_TEXTENCODING_ADOBE_SYMBOL; + return enc; +} void PictReader::SetLineColor( const Color& rColor ) { @@ -344,61 +475,7 @@ ULONG PictReader::ReadPolygon(Polygon & rPoly) return nDataSize; } -ULONG PictReader::ReadPattern(PenStyle * pPenStyle, BrushStyle * pBrushStyle) -{ - short nx,ny,nBitCount; - unsigned char nbyte[8]; - BrushStyle eBrStyle; - PenStyle ePnStyle; - ULONG nHiBytes, nLoBytes; - - // Anzahl der Bits im Pattern zaehlen, die auf 1 gesetzt sind: - nBitCount=0; - for (ny=0; ny<8; ny++) { - *pPict >> ((char&)nbyte[ny]); - for (nx=0; nx<8; nx++) { - if ( (nbyte[ny] & (1<<nx)) != 0 ) nBitCount++; - } - } - - // Pattern in 2 Langworten unterbringen: - nHiBytes=(((((((ULONG)nbyte[0])<<8)| - (ULONG)nbyte[1])<<8)| - (ULONG)nbyte[2])<<8)| - (ULONG)nbyte[3]; - nLoBytes=(((((((ULONG)nbyte[4])<<8)| - (ULONG)nbyte[5])<<8)| - (ULONG)nbyte[6])<<8)| - (ULONG)nbyte[7]; - - // Einen PenStyle machen: - if (nBitCount<=0) ePnStyle=PEN_NULL; - else if (nBitCount<=16) ePnStyle=PEN_DOT; - else if (nBitCount<=32) ePnStyle=PEN_DASHDOT; - else if (nBitCount<=48) ePnStyle=PEN_DASH; - else ePnStyle=PEN_SOLID; - - // Einen BrushStyle machen: - if (nHiBytes==0xffffffff && nLoBytes==0xffffffff) eBrStyle=BRUSH_SOLID; - else if (nHiBytes==0xff000000 && nLoBytes==0x00000000) eBrStyle=BRUSH_HORZ; - else if (nHiBytes==0x80808080 && nLoBytes==0x80808080) eBrStyle=BRUSH_VERT; - else if (nHiBytes==0xff808080 && nLoBytes==0x80808080) eBrStyle=BRUSH_CROSS; - else if (nHiBytes==0x01824428 && nLoBytes==0x10284482) eBrStyle=BRUSH_DIAGCROSS; - else if (nHiBytes==0x80402010 && nLoBytes==0x08040201) eBrStyle=BRUSH_UPDIAG; - else if (nHiBytes==0x01020408 && nLoBytes==0x10204080) eBrStyle=BRUSH_DOWNDIAG; - else if (nBitCount<=24) eBrStyle=BRUSH_25; - else if (nBitCount<=40) eBrStyle=BRUSH_50; - else if (nBitCount<=56) eBrStyle=BRUSH_75; - else eBrStyle=BRUSH_SOLID; - - if (pPenStyle!=0) *pPenStyle=ePnStyle; - - if (pBrushStyle!=0) *pBrushStyle=eBrStyle; - - return 8; -} - -ULONG PictReader::ReadPixPattern(PenStyle * pPenStyle, BrushStyle * pBrushStyle) +ULONG PictReader::ReadPixPattern(PictReader::Pattern &pattern) { // Keine Ahnung, ob dies richtig ist, weil kein Bild gefunden, das // PixPatterns enthaelt. Auch hier nur der Versuch, die Groesse der Daten zu @@ -411,13 +488,18 @@ ULONG PictReader::ReadPixPattern(PenStyle * pPenStyle, BrushStyle * pBrushStyle) *pPict >> nPatType; if (nPatType==1) { - ReadPattern(pPenStyle,pBrushStyle); + pattern.read(*pPict); nDataSize=ReadPixMapEtc(aBMP,FALSE,TRUE,NULL,NULL,FALSE,FALSE); + // CHANGEME: use average pixmap colors to update the pattern, ... if (nDataSize!=0xffffffff) nDataSize+=10; } else if (nPatType==2) { - ReadPattern(pPenStyle,pBrushStyle); - pPict->SeekRel(6); // RGBColor + pattern.read(*pPict); + // RGBColor + USHORT nR, nG, nB; + *pPict >> nR >> nG >> nB; + Color col((BYTE) ( nR >> 8 ), (BYTE) ( nG >> 8 ), (BYTE) ( nB >> 8 ) ); + pattern.setColor(col); nDataSize=16; } else nDataSize=0xffffffff; @@ -444,14 +526,15 @@ ULONG PictReader::ReadAndDrawRoundRect(PictDrawingMethod eMethod) { ReadRectangle(aLastRoundRect); DrawingMethod(eMethod); - pVirDev->DrawRect(aLastRoundRect,aActOvalSize.Width(),aActOvalSize.Height()); + // Osnola: the corner's size is equal to aActOvalSize/2, see Quickdraw Drawing Reference 3-63 + pVirDev->DrawRect(aLastRoundRect,(aActOvalSize.Width()+1)/2,(aActOvalSize.Height()+1)/2); return 8; } ULONG PictReader::ReadAndDrawSameRoundRect(PictDrawingMethod eMethod) { DrawingMethod(eMethod); - pVirDev->DrawRect(aLastRoundRect,aActOvalSize.Width(),aActOvalSize.Height()); + pVirDev->DrawRect(aLastRoundRect,(aActOvalSize.Width()+1)/2,(aActOvalSize.Height()+1)/2); return 0; } @@ -561,6 +644,23 @@ ULONG PictReader::ReadAndDrawSameRgn(PictDrawingMethod eMethod) void PictReader::DrawingMethod(PictDrawingMethod eMethod) { if( eActMethod==eMethod ) return; + if (eActROP == ROP_1) { + // Osnola: ignore postscript command + if (eMethod == PDM_TEXT) { + Font invisibleFont; + invisibleFont.SetColor(Color(COL_TRANSPARENT)); + invisibleFont.SetFillColor(Color(COL_TRANSPARENT)); + invisibleFont.SetTransparent(TRUE); + pVirDev->SetFont(invisibleFont); + } + else { + SetLineColor( Color(COL_TRANSPARENT) ); + SetFillColor( Color(COL_TRANSPARENT) ); + } + pVirDev->SetRasterOp(ROP_OVERPAINT); + eActMethod=eMethod; + return; + } switch (eMethod) { case PDM_FRAME: SetLineColor( aActForeColor ); @@ -569,22 +669,31 @@ void PictReader::DrawingMethod(PictDrawingMethod eMethod) break; case PDM_PAINT: SetLineColor( Color(COL_TRANSPARENT) ); - SetFillColor( aActForeColor ); + if (eActPenPattern.isDefault()) + SetFillColor( aActForeColor ); + else + SetFillColor(eActPenPattern.getColor(aActBackColor, aActForeColor)); pVirDev->SetRasterOp(eActROP); break; case PDM_ERASE: SetLineColor( Color(COL_TRANSPARENT) ); - SetFillColor( aActForeColor ); + if (eActBackPattern.isDefault()) + SetFillColor( aActBackColor );// Osnola: previously aActForeColor + else // checkMe + SetFillColor(eActBackPattern.getColor(COL_BLACK, aActBackColor)); pVirDev->SetRasterOp(ROP_OVERPAINT); break; - case PDM_INVERT: + case PDM_INVERT: // checkme SetLineColor( Color(COL_TRANSPARENT)); SetFillColor( Color( COL_BLACK ) ); pVirDev->SetRasterOp(ROP_INVERT); break; case PDM_FILL: SetLineColor( Color(COL_TRANSPARENT) ); - SetFillColor( aActForeColor ); + if (eActFillPattern.isDefault()) + SetFillColor( aActForeColor ); + else + SetFillColor(eActFillPattern.getColor(aActBackColor, aActForeColor)); pVirDev->SetRasterOp(ROP_OVERPAINT); break; case PDM_TEXT: @@ -615,7 +724,7 @@ ULONG PictReader::ReadAndDrawText() while ( nLen > 0 && ( (unsigned char)sText[ nLen - 1 ] ) < 32 ) nLen--; sText[ nLen ] = 0; - String aString( (const sal_Char*)&sText, gsl_getSystemTextEncoding() ); + String aString( (const sal_Char*)&sText, aActFont.GetCharSet());// OSNOLA: gsl_getSystemTextEncoding() ); pVirDev->DrawText( Point( aTextPosition.X(), aTextPosition.Y() ), aString ); return nDataLen; } @@ -1116,9 +1225,9 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; } case 0x0002: // BkPat - nDataSize=ReadPattern(NULL,&eActBackStyle); - eActMethod=PDM_UNDEFINED; - break; + nDataSize=eActBackPattern.read(*pPict); + eActMethod=PDM_UNDEFINED; + break; case 0x0003: // TxFont *pPict >> nUSHORT; @@ -1129,8 +1238,7 @@ ULONG PictReader::ReadData(USHORT nOpcode) else if (nUSHORT == 22) aActFont.SetFamily(FAMILY_MODERN); else if (nUSHORT <= 1023) aActFont.SetFamily(FAMILY_SWISS); else aActFont.SetFamily(FAMILY_ROMAN); - if ( nUSHORT == 23 ) aActFont.SetCharSet( RTL_TEXTENCODING_SYMBOL ); - else aActFont.SetCharSet( gsl_getSystemTextEncoding() ); + aActFont.SetCharSet(GetTextEncoding(nUSHORT)); eActMethod=PDM_UNDEFINED; nDataSize=2; break; @@ -1170,7 +1278,10 @@ ULONG PictReader::ReadData(USHORT nOpcode) } case 0x0008: // PnMode *pPict >> nUSHORT; - switch (nUSHORT & 0x0007) { + // internal code for postscript command (Quickdraw Reference Drawing B-30,B-34) + if (nUSHORT==23) eActROP = ROP_1; + else { + switch (nUSHORT & 0x0007) { case 0: eActROP=ROP_OVERPAINT; break; // Copy case 1: eActROP=ROP_OVERPAINT; break; // Or case 2: eActROP=ROP_XOR; break; // Xor @@ -1179,18 +1290,19 @@ ULONG PictReader::ReadData(USHORT nOpcode) case 5: eActROP=ROP_OVERPAINT; break; // notOr case 6: eActROP=ROP_XOR; break; // notXor case 7: eActROP=ROP_OVERPAINT; break; // notBic + } } eActMethod=PDM_UNDEFINED; nDataSize=2; break; case 0x0009: // PnPat - nDataSize=ReadPattern(&eActPenPenStyle,&eActPenBrushStyle); + nDataSize=eActPenPattern.read(*pPict); eActMethod=PDM_UNDEFINED; break; case 0x000a: // FillPat - nDataSize=ReadPattern(NULL,&eActFillStyle); + nDataSize=eActFillPattern.read(*pPict); eActMethod=PDM_UNDEFINED; break; @@ -1232,17 +1344,17 @@ ULONG PictReader::ReadData(USHORT nOpcode) break; case 0x0012: // BkPixPat - nDataSize=ReadPixPattern(NULL,&eActBackStyle); + nDataSize=ReadPixPattern(eActBackPattern); eActMethod=PDM_UNDEFINED; break; case 0x0013: // PnPixPat - nDataSize=ReadPixPattern(&eActPenPenStyle,&eActPenBrushStyle); + nDataSize=ReadPixPattern(eActPenPattern); eActMethod=PDM_UNDEFINED; break; case 0x0014: // FillPixPat - nDataSize=ReadPixPattern(NULL,&eActFillStyle); + nDataSize=ReadPixPattern(eActFillPattern); eActMethod=PDM_UNDEFINED; break; @@ -1361,8 +1473,7 @@ ULONG PictReader::ReadData(USHORT nOpcode) else if (nUSHORT == 22) aActFont.SetFamily(FAMILY_MODERN); else if (nUSHORT <= 1023) aActFont.SetFamily(FAMILY_SWISS); else aActFont.SetFamily(FAMILY_ROMAN); - if (nUSHORT==23) aActFont.SetCharSet( RTL_TEXTENCODING_SYMBOL); - else aActFont.SetCharSet( gsl_getSystemTextEncoding() ); + aActFont.SetCharSet(GetTextEncoding(nUSHORT)); *pPict >> nByteLen; nLen=((USHORT)nByteLen)&0x00ff; pPict->Read( &sFName, nLen ); sFName[ nLen ] = 0; @@ -1803,16 +1914,12 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile ) aActForeColor = Color(COL_BLACK); aActBackColor = Color(COL_WHITE); - eActPenPenStyle = PEN_SOLID; - eActPenBrushStyle = BRUSH_SOLID; - eActFillStyle = BRUSH_SOLID; - eActBackStyle = BRUSH_SOLID; nActPenSize = 1; eActROP = ROP_OVERPAINT; eActMethod = PDM_UNDEFINED; aActOvalSize = Size(1,1); - aActFont.SetCharSet( gsl_getSystemTextEncoding() ); + aActFont.SetCharSet( GetTextEncoding()); aActFont.SetFamily(FAMILY_SWISS); aActFont.SetSize(Size(0,12)); aActFont.SetAlign(ALIGN_BASELINE); @@ -1909,29 +2016,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicImport( SvStream& rIStm, Graphic & rGraph return bRet; } -//================== ein bischen Muell fuer Windows ========================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx index 70cd1ab13f29..5a52c17956ed 100644 --- a/filter/source/graphicfilter/ipsd/ipsd.cxx +++ b/filter/source/graphicfilter/ipsd/ipsd.cxx @@ -735,29 +735,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGra return aPSDReader.ReadPSD( rStream, rGraphic ); } -//================== ein bischen Muell fuer Windows ========================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/filter/source/graphicfilter/iras/iras.cxx b/filter/source/graphicfilter/iras/iras.cxx index 6255dc486537..c20a85354471 100644 --- a/filter/source/graphicfilter/iras/iras.cxx +++ b/filter/source/graphicfilter/iras/iras.cxx @@ -354,30 +354,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGra return aRASReader.ReadRAS( rStream, rGraphic ); } -//================== ein bischen Muell fuer Windows ========================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx index 5dcb5f82ccab..38b97a025b16 100644 --- a/filter/source/graphicfilter/itga/itga.cxx +++ b/filter/source/graphicfilter/itga/itga.cxx @@ -729,30 +729,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGra return aTGAReader.ReadTGA( rStream, rGraphic ); } -//================== ein bischen Muell fuer Windows ========================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx index 5ad400fc3149..f10b8a15f3ef 100644 --- a/filter/source/graphicfilter/itiff/itiff.cxx +++ b/filter/source/graphicfilter/itiff/itiff.cxx @@ -1312,31 +1312,3 @@ extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGra return TRUE; } -//============================= fuer Windows ================================== -#ifndef GCC -#endif - -#ifdef WIN - -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - - diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 2ad33b1e6195..82b0480a3d0c 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -94,9 +94,7 @@ #include <vcl/virdev.hxx> #include <rtl/crc.h> #include <vos/xception.hxx> -#ifndef _VOS_NO_NAMESPACE using namespace vos; -#endif using namespace ::rtl; using namespace ::com::sun::star; @@ -2094,6 +2092,13 @@ void ConvertEnhancedCustomShapeEquation( SdrObjCustomShape* pCustoShape, aEquation.nPara[ 0 ] = 1; // hoping that this will not break anything rEquations.push_back( aEquation ); } + catch ( ... ) + { + EnhancedCustomShapeEquation aEquation; // #i112309# EnhancedCustomShape::Parse error + aEquation.nOperation = 0; // not catched on linux platform + aEquation.nPara[ 0 ] = 1; + rEquations.push_back( aEquation ); + } rEquationOrder.push_back( rEquations.size() - 1 ); } // now updating our old equation indices, they are marked with a bit in the hiword of nOperation diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 05411501218e..29874b933d85 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -128,9 +128,7 @@ #include <ucbhelper/content.hxx> #include <ucbhelper/contentbroker.hxx> #include <vos/xception.hxx> -#ifndef _VOS_NO_NAMESPACE using namespace vos; -#endif #include "svx/EnhancedCustomShapeTypeNames.hxx" #include "svx/EnhancedCustomShapeGeometry.hxx" #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> @@ -5373,8 +5371,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r aSet.Put( SdrEdgeNode2VertDistItem( n2VertDist ) ); ((SdrEdgeObj*)pRet)->SetEdgeTrackPath( aPoly ); + pRet->SetMergedItemSet( aSet ); } - pRet->SetMergedItemSet( aSet ); } } diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx index 18ecc5ae6530..19e93dbb791a 100644 --- a/filter/source/msfilter/msvbahelper.cxx +++ b/filter/source/msfilter/msvbahelper.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/document/XDocumentInfoSupplier.hpp> #include <tools/urlobj.hxx> #include <osl/file.hxx> +#include <unotools/pathoptions.hxx> using namespace ::com::sun::star; @@ -108,7 +109,24 @@ SfxObjectShell* findShellForUrl( const rtl::OUString& sMacroURLOrPath ) } else { - if ( aURL.equals( xModel->getURL() ) ) + // sometimes just the name of the document ( without the path + // is used + bool bDocNameNoPathMatch = false; + if ( aURL.getLength() && aURL.indexOf( '/' ) == -1 ) + { + sal_Int32 lastSlashIndex = xModel->getURL().lastIndexOf( '/' ); + if ( lastSlashIndex > -1 ) + { + bDocNameNoPathMatch = xModel->getURL().copy( lastSlashIndex + 1 ).equals( aURL ); + if ( !bDocNameNoPathMatch ) + { + rtl::OUString aTmpName = rtl::OUString::createFromAscii("'") + xModel->getURL().copy( lastSlashIndex + 1 ) + rtl::OUString::createFromAscii("'"); + bDocNameNoPathMatch = aTmpName.equals( aURL ); + } + } + } + + if ( aURL.equals( xModel->getURL() ) || bDocNameNoPathMatch ) { pFoundShell = pShell; break; @@ -221,9 +239,19 @@ VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUStrin String sDocUrlOrPath = sMacroUrl.copy( 0, nDocSepIndex ); sMacroUrl = sMacroUrl.copy( nDocSepIndex + 1 ); OSL_TRACE("doc search, current shell is 0x%x", pShell ); - SfxObjectShell* pFoundShell = findShellForUrl( sDocUrlOrPath ); + SfxObjectShell* pFoundShell = NULL; + if( bSearchGlobalTemplates ) + { + SvtPathOptions aPathOpt; + String aAddinPath = aPathOpt.GetAddinPath(); + if( rtl::OUString( sDocUrlOrPath ).indexOf( aAddinPath ) == 0 ) + pFoundShell = pShell; + } + if( pFoundShell == NULL ) + pFoundShell = findShellForUrl( sDocUrlOrPath ); OSL_TRACE("doc search, after find, found shell is 0x%x", pFoundShell ); - aRes = resolveVBAMacro( pFoundShell, sMacroUrl ); + aRes = resolveVBAMacro( pFoundShell, sMacroUrl, bSearchGlobalTemplates ); + return aRes; } else { @@ -337,14 +365,14 @@ VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUStrin break; } } + aRes.SetResolvedMacro( sProcedure.Insert( '.', 0 ).Insert( sModule, 0).Insert( '.', 0 ).Insert( sContainer, 0 ) ); } - aRes.SetResolvedMacro( sProcedure.Insert( '.', 0 ).Insert( sModule, 0).Insert( '.', 0 ).Insert( sContainer, 0 ) ); return aRes; } // Treat the args as possible inouts ( convertion at bottom of method ) -sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, uno::Sequence< uno::Any >& aArgs, uno::Any& /*aRet*/, const uno::Any& aCaller ) +sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, uno::Sequence< uno::Any >& aArgs, uno::Any& aRet, const uno::Any& /*aCaller*/) { sal_Bool bRes = sal_False; if ( !pShell ) @@ -355,42 +383,25 @@ sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, uno::Se uno::Sequence< uno::Any > aOutArgs; try - { - uno::Reference< script::provider::XScriptProvider > xScriptProvider; - uno::Reference< script::provider::XScriptProviderSupplier > xSPS( pShell->GetModel(), uno::UNO_QUERY_THROW ); - - xScriptProvider.set( xSPS->getScriptProvider(), uno::UNO_QUERY_THROW ); - - uno::Reference< script::provider::XScript > xScript( xScriptProvider->getScript( sUrl ), uno::UNO_QUERY_THROW ); - - if ( aCaller.hasValue() ) + { ErrCode nErr( ERRCODE_BASIC_INTERNAL_ERROR ); + if ( pShell ) { - uno::Reference< beans::XPropertySet > xProps( xScript, uno::UNO_QUERY ); - if ( xProps.is() ) + nErr = pShell->CallXScript( sUrl, + aArgs, aRet, aOutArgsIndex, aOutArgs, false ); + sal_Int32 nLen = aOutArgs.getLength(); + // convert any out params to seem like they were inouts + if ( nLen ) { - uno::Sequence< uno::Any > aCallerHack(1); - aCallerHack[ 0 ] = aCaller; - xProps->setPropertyValue( rtl::OUString::createFromAscii( "Caller" ), uno::makeAny( aCallerHack ) ); + for ( sal_Int32 index=0; index < nLen; ++index ) + { + sal_Int32 nOutIndex = aOutArgsIndex[ index ]; + aArgs[ nOutIndex ] = aOutArgs[ index ]; + } } } - - - xScript->invoke( aArgs, aOutArgsIndex, aOutArgs ); - - sal_Int32 nLen = aOutArgs.getLength(); - // convert any out params to seem like they were inouts - if ( nLen ) - { - for ( sal_Int32 index=0; index < nLen; ++index ) - { - sal_Int32 nOutIndex = aOutArgsIndex[ index ]; - aArgs[ nOutIndex ] = aOutArgs[ index ]; - } - } - - bRes = sal_True; + bRes = ( nErr == ERRCODE_NONE ); } - catch ( uno::Exception& e ) + catch ( uno::Exception& ) { bRes = sal_False; } diff --git a/filter/source/msfilter/powerpoint/pptimporteruno.cxx b/filter/source/msfilter/powerpoint/pptimporteruno.cxx index c1089f66a5c3..325d360344cf 100644 --- a/filter/source/msfilter/powerpoint/pptimporteruno.cxx +++ b/filter/source/msfilter/powerpoint/pptimporteruno.cxx @@ -51,37 +51,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -// ----------------------- -// - component_writeInfo - -// ----------------------- - -extern "C" sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey ) -{ - sal_Bool bRet = sal_False; - - if( pRegistryKey ) - { - try - { - NMSP_UNO::Reference< NMSP_REGISTRY::XRegistryKey > xNewKey( - reinterpret_cast< NMSP_REGISTRY::XRegistryKey * >( pRegistryKey )->createKey( - PptImporter_getImplementationName() ) ); - xNewKey = xNewKey->createKey( B2UCONST( "/UNO/SERVICES" ) ); - const SEQ( NMSP_RTL::OUString )& rSNL = PptImporter_getSupportedServiceNames(); - const NMSP_RTL::OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); - bRet = sal_True; - } - catch( NMSP_REGISTRY::InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - - return bRet; -} - // ------------------------ // - component_getFactory - // ------------------------ diff --git a/filter/source/msfilter/svxmsbas.cxx b/filter/source/msfilter/svxmsbas.cxx index 49fd4a7544f3..5214b2d022c3 100644 --- a/filter/source/msfilter/svxmsbas.cxx +++ b/filter/source/msfilter/svxmsbas.cxx @@ -52,8 +52,8 @@ using namespace com::sun::star::awt; #include <com/sun/star/script/XLibraryContainer.hpp> #include <com/sun/star/script/ModuleInfo.hpp> #include <com/sun/star/script/ModuleType.hpp> -#include <com/sun/star/script/XVBAModuleInfo.hpp> -#include <com/sun/star/script/XVBACompat.hpp> +#include <com/sun/star/script/vba/XVBACompatibility.hpp> +#include <com/sun/star/script/vba/XVBAModuleInfo.hpp> using namespace com::sun::star::container; using namespace com::sun::star::script; @@ -250,13 +250,21 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName, { SFX_APP()->EnterBasicCall(); Reference<XLibraryContainer> xLibContainer = rDocSh.GetBasicContainer(); - Reference<XVBACompat> xVBACompat( xLibContainer, UNO_QUERY ); - - if ( xVBACompat.is() && !bAsComment ) - xVBACompat->setVBACompatModeOn( sal_True ); - DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" ); + if( !bAsComment ) try + { + Reference< vba::XVBACompatibility > xVBACompat( xLibContainer, UNO_QUERY_THROW ); + xVBACompat->setVBACompatibilityMode( sal_True ); + /* Force creation of the VBAGlobals object, each application will + create the right one and store it at the Basic manager. */ + Reference< XMultiServiceFactory > xFactory( rDocSh.GetModel(), UNO_QUERY_THROW ); + xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals" ) ) ); + } + catch( Exception& ) + { + } + UINT16 nStreamCount = aVBA.GetNoStreams(); Reference<XNameContainer> xLib; String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) ); @@ -270,7 +278,7 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName, } if( xLib.is() ) { - Reference< script::XVBAModuleInfo > xVBAModuleInfo( xLib, UNO_QUERY ); + Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, UNO_QUERY ); Reference< container::XNameAccess > xVBACodeNamedObjectAccess; if ( !bAsComment ) { diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src index 76e64e87c173..248d7d8491f7 100644 --- a/filter/source/pdf/impdialog.src +++ b/filter/source/pdf/impdialog.src @@ -65,24 +65,28 @@ TabPage RID_PDF_TAB_GENER }; RadioButton RB_ALL { + HelpID = "filter:RadioButton:RID_PDF_TAB_GENER:RB_ALL"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text[ en-US ] = "~All"; }; RadioButton RB_RANGE { + HelpID = "filter:RadioButton:RID_PDF_TAB_GENER:RB_RANGE"; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 101 , 10 ) ; Text[ en-US ] = "~Pages"; }; Edit ED_PAGES { + HelpID = "filter:Edit:RID_PDF_TAB_GENER:ED_PAGES"; Border = TRUE ; Pos = MAP_APPFONT ( 116, 26 ) ; Size = MAP_APPFONT ( 48 , 12 ) ; }; RadioButton RB_SELECTION { + HelpID = "filter:RadioButton:RID_PDF_TAB_GENER:RB_SELECTION"; Pos = MAP_APPFONT ( 12 , 40 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text[ en-US ] = "~Selection"; @@ -95,12 +99,14 @@ TabPage RID_PDF_TAB_GENER }; RadioButton RB_LOSSLESSCOMPRESSION { + HelpID = "filter:RadioButton:RID_PDF_TAB_GENER:RB_LOSSLESSCOMPRESSION"; Pos = MAP_APPFONT ( 12 , 64 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text[ en-US ] = "~Lossless compression"; }; RadioButton RB_JPEGCOMPRESSION { + HelpID = "filter:RadioButton:RID_PDF_TAB_GENER:RB_JPEGCOMPRESSION"; Pos = MAP_APPFONT ( 12 , 76 ) ; Size = MAP_APPFONT ( 158, 10 ) ; Text[ en-US ] = "~JPEG compression"; @@ -113,6 +119,7 @@ TabPage RID_PDF_TAB_GENER }; MetricField NF_QUALITY { + HelpID = "filter:MetricField:RID_PDF_TAB_GENER:NF_QUALITY"; Border = TRUE ; Pos = MAP_APPFONT ( 116, 88 ) ; Size = MAP_APPFONT ( 48, 12 ) ; @@ -124,6 +131,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_REDUCEIMAGERESOLUTION { + HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_REDUCEIMAGERESOLUTION"; Pos = MAP_APPFONT ( 12 , 103 ) ; Size = MAP_APPFONT ( 101 , 10 ) ; TabStop = TRUE ; @@ -131,6 +139,7 @@ TabPage RID_PDF_TAB_GENER }; ComboBox CO_REDUCEIMAGERESOLUTION { + HelpID = "filter:ComboBox:RID_PDF_TAB_GENER:CO_REDUCEIMAGERESOLUTION"; Pos = MAP_APPFONT ( 116 , 102 ) ; Size = MAP_APPFONT ( 48 , 50 ) ; TabStop = TRUE ; @@ -152,6 +161,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_PDFA_1B_SELECT { + HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_PDFA_1B_SELECT"; Pos = MAP_APPFONT ( 12, 128 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -159,6 +169,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_TAGGEDPDF { + HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_TAGGEDPDF"; Pos = MAP_APPFONT ( 12 , 141 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -166,6 +177,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_EXPORTFORMFIELDS { + HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTFORMFIELDS"; Pos = MAP_APPFONT ( 12 , 154 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -179,6 +191,7 @@ TabPage RID_PDF_TAB_GENER }; ListBox LB_FORMSFORMAT { + HelpID = "filter:ListBox:RID_PDF_TAB_GENER:LB_FORMSFORMAT"; Border = TRUE ; Pos = MAP_APPFONT ( 126, 166 ) ; Size = MAP_APPFONT ( 38, 48 ) ; @@ -195,6 +208,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_ALLOWDUPLICATEFIELDNAMES { + HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_ALLOWDUPLICATEFIELDNAMES"; Pos = MAP_APPFONT( 30, 178 ); Size = MAP_APPFONT( 128, 10 ); TabStop = TRUE; @@ -202,6 +216,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_EXPORTBOOKMARKS { + HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTBOOKMARKS"; Pos = MAP_APPFONT ( 12 , 190 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -209,6 +224,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_EXPORTNOTES { + HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTNOTES"; Pos = MAP_APPFONT ( 12 , 203 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -216,6 +232,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_EXPORTNOTESPAGES { + HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTNOTESPAGES"; Pos = MAP_APPFONT ( 12 , 216 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -223,6 +240,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_EXPORTEMPTYPAGES { + HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTEMPTYPAGES"; Pos = MAP_APPFONT ( 12 , 229 ) ; Size = MAP_APPFONT ( 158 , 16 ) ; TabStop = TRUE ; @@ -231,6 +249,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_EMBEDSTANDARDFONTS { + HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EMBEDSTANDARDFONTS"; Pos = MAP_APPFONT ( 12 , 248 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -238,6 +257,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_ADDSTREAM { + HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_ADDSTREAM"; Pos = MAP_APPFONT ( 12 , 261 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -263,18 +283,21 @@ TabPage RID_PDF_TAB_OPNFTR }; RadioButton RB_OPNMODE_PAGEONLY { + HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_OPNMODE_PAGEONLY"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text[ en-US ] = "~Page only" ; }; RadioButton RB_OPNMODE_OUTLINE { + HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_OPNMODE_OUTLINE"; Pos = MAP_APPFONT ( 12 , 26 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text[ en-US ] = "~Bookmarks and page" ; }; RadioButton RB_OPNMODE_THUMBS { + HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_OPNMODE_THUMBS"; Pos = MAP_APPFONT ( 12 , 38 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text[ en-US ] = "~Thumbnails and page" ; @@ -288,6 +311,7 @@ TabPage RID_PDF_TAB_OPNFTR }; NumericField NUM_MAGNF_INITIAL_PAGE { + HelpID = "filter:NumericField:RID_PDF_TAB_OPNFTR:NUM_MAGNF_INITIAL_PAGE"; Pos = MAP_APPFONT( 124, 52 ); Size = MAP_APPFONT( 40, 12 ); Value = 1; @@ -305,6 +329,7 @@ TabPage RID_PDF_TAB_OPNFTR }; RadioButton RB_MAGNF_DEFAULT { + HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_MAGNF_DEFAULT"; // see PDF ref v 1.5 tab 8.2, pg. 542 ( /XYZ ) Pos = MAP_APPFONT ( 12 , 80 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; @@ -312,6 +337,7 @@ TabPage RID_PDF_TAB_OPNFTR }; RadioButton RB_MAGNF_WIND { + HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_MAGNF_WIND"; // see PDF ref v 1.5 tab 8.2, pg. 542 ( /Fit ) Pos = MAP_APPFONT ( 12 , 92 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; @@ -319,6 +345,7 @@ TabPage RID_PDF_TAB_OPNFTR }; RadioButton RB_MAGNF_WIDTH { + HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_MAGNF_WIDTH"; // see PDF ref v 1.5 tab 8.2, pg. 542 ( /FitH top ) Pos = MAP_APPFONT ( 12 , 104 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; @@ -326,6 +353,7 @@ TabPage RID_PDF_TAB_OPNFTR }; RadioButton RB_MAGNF_VISIBLE { + HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_MAGNF_VISIBLE"; // see PDF ref v 1.5 tab 8.2, pg. 542 ( /FitBH top ) Pos = MAP_APPFONT ( 12 , 116 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; @@ -333,6 +361,7 @@ TabPage RID_PDF_TAB_OPNFTR }; RadioButton RB_MAGNF_ZOOM { + HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_MAGNF_ZOOM"; // see PDF ref v 1.6 tab 8.2, pg. 551 ( /XYZ left top zoom ) Pos = MAP_APPFONT ( 12 , 128 ) ; Size = MAP_APPFONT ( 109 , 10 ) ; @@ -340,6 +369,7 @@ TabPage RID_PDF_TAB_OPNFTR }; MetricField NUM_MAGNF_ZOOM { + HelpID = "filter:MetricField:RID_PDF_TAB_OPNFTR:NUM_MAGNF_ZOOM"; Pos = MAP_APPFONT( 124, 128 ) ; Size = MAP_APPFONT( 40, 12 ) ; Unit = FUNIT_PERCENT; @@ -358,30 +388,35 @@ TabPage RID_PDF_TAB_OPNFTR }; RadioButton RB_PGLY_DEFAULT { + HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_PGLY_DEFAULT"; Pos = MAP_APPFONT ( 12 , 158 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text[ en-US ] = "D~efault" ; }; RadioButton RB_PGLY_SINGPG { + HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_PGLY_SINGPG"; Pos = MAP_APPFONT ( 12 , 170 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text[ en-US ] = "~Single page" ; }; RadioButton RB_PGLY_CONT { + HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_PGLY_CONT"; Pos = MAP_APPFONT ( 12 , 182 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text[ en-US ] = "~Continuous" ; }; RadioButton RB_PGLY_CONTFAC { + HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_PGLY_CONTFAC"; Pos = MAP_APPFONT ( 12 , 194 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text[ en-US ] = "C~ontinuous facing" ; }; CheckBox CB_PGLY_FIRSTLEFT { + HelpID = "filter:CheckBox:RID_PDF_TAB_OPNFTR:CB_PGLY_FIRSTLEFT"; Pos = MAP_APPFONT ( 22 , 206 ) ; Size = MAP_APPFONT ( 148 , 10 ) ; Text[ en-US ] = "First page is ~left" ; @@ -407,6 +442,7 @@ TabPage RID_PDF_TAB_VPREFER CheckBox CB_WNDOPT_RESINIT { + HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_WNDOPT_RESINIT"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -414,6 +450,7 @@ TabPage RID_PDF_TAB_VPREFER }; CheckBox CB_WNDOPT_CNTRWIN { + HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_WNDOPT_CNTRWIN"; Pos = MAP_APPFONT ( 12 , 26 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -421,12 +458,14 @@ TabPage RID_PDF_TAB_VPREFER }; CheckBox CB_WNDOPT_OPNFULL { + HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_WNDOPT_OPNFULL"; Pos = MAP_APPFONT ( 12 , 38 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text[ en-US ] = "~Open in full screen mode" ; }; CheckBox CB_DISPDOCTITLE { + HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_DISPDOCTITLE"; Pos = MAP_APPFONT ( 12 , 50 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -442,6 +481,7 @@ TabPage RID_PDF_TAB_VPREFER }; CheckBox CB_UOP_HIDEVMENUBAR { + HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_UOP_HIDEVMENUBAR"; Pos = MAP_APPFONT ( 12 , 76 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -449,6 +489,7 @@ TabPage RID_PDF_TAB_VPREFER }; CheckBox CB_UOP_HIDEVTOOLBAR { + HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_UOP_HIDEVTOOLBAR"; Pos = MAP_APPFONT ( 12 , 88 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -456,6 +497,7 @@ TabPage RID_PDF_TAB_VPREFER }; CheckBox CB_UOP_HIDEVWINCTRL { + HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_UOP_HIDEVWINCTRL"; Pos = MAP_APPFONT ( 12 , 100 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -471,6 +513,7 @@ TabPage RID_PDF_TAB_VPREFER }; CheckBox CB_TRANSITIONEFFECTS { + HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_TRANSITIONEFFECTS"; Pos = MAP_APPFONT ( 12 , 126 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -485,18 +528,21 @@ TabPage RID_PDF_TAB_VPREFER }; RadioButton RB_ALLBOOKMARKLEVELS { + HelpID = "filter:RadioButton:RID_PDF_TAB_VPREFER:RB_ALLBOOKMARKLEVELS"; Pos = MAP_APPFONT ( 12 , 152 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; Text[ en-US ] = "All bookmark levels"; }; RadioButton RB_VISIBLEBOOKMARKLEVELS { + HelpID = "filter:RadioButton:RID_PDF_TAB_VPREFER:RB_VISIBLEBOOKMARKLEVELS"; Pos = MAP_APPFONT ( 12 , 166 ) ; Size = MAP_APPFONT ( 117 , 10 ) ; Text[ en-US ] = "Visible bookmark levels"; }; NumericField NUM_BOOKMARKLEVELS { + HelpID = "filter:NumericField:RID_PDF_TAB_VPREFER:NUM_BOOKMARKLEVELS"; Pos = MAP_APPFONT ( 132 , 165 ) ; Size = MAP_APPFONT ( 32 , 12 ) ; Border = TRUE; @@ -518,6 +564,7 @@ TabPage RID_PDF_TAB_SECURITY ////////////////////////////////////// PushButton BTN_USER_PWD { + HelpID = "filter:PushButton:RID_PDF_TAB_SECURITY:BTN_USER_PWD"; TabStop = TRUE ; Disable = TRUE ; Pos = MAP_APPFONT ( 12, 5 ) ; @@ -553,6 +600,7 @@ TabPage RID_PDF_TAB_SECURITY PushButton BTN_OWNER_PWD { + HelpID = "filter:PushButton:RID_PDF_TAB_SECURITY:BTN_OWNER_PWD"; TabStop = TRUE ; Disable = TRUE ; Pos = MAP_APPFONT ( 12, 45 ) ; @@ -595,18 +643,21 @@ TabPage RID_PDF_TAB_SECURITY }; RadioButton RB_PRINT_NONE { + HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_PRINT_NONE"; Pos = MAP_APPFONT ( 18 , 101 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text[ en-US ] = "~Not permitted"; }; RadioButton RB_PRINT_LOWRES { + HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_PRINT_LOWRES"; Pos = MAP_APPFONT ( 18 , 112 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text[ en-US ] = "~Low resolution (150 dpi)"; }; RadioButton RB_PRINT_HIGHRES { + HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_PRINT_HIGHRES"; Pos = MAP_APPFONT ( 18 , 123 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text[ en-US ] = "~High resolution"; @@ -621,24 +672,28 @@ TabPage RID_PDF_TAB_SECURITY }; RadioButton RB_CHANGES_NONE { + HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_NONE"; Pos = MAP_APPFONT ( 18 , 145 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text[ en-US ] = "No~t permitted"; }; RadioButton RB_CHANGES_INSDEL { + HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_INSDEL"; Pos = MAP_APPFONT ( 18 , 157 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text[ en-US ] = "~Inserting, deleting, and rotating pages"; }; RadioButton RB_CHANGES_FILLFORM { + HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_FILLFORM"; Pos = MAP_APPFONT ( 18 , 168 ) ; Size = MAP_APPFONT ( 150 , 10 ) ; Text[ en-US ] = "~Filling in form fields"; }; RadioButton RB_CHANGES_COMMENT { + HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_COMMENT"; Pos = MAP_APPFONT ( 18 , 179 ) ; Size = MAP_APPFONT ( 152 , 16 ) ; WordBreak = TRUE ; @@ -646,6 +701,7 @@ TabPage RID_PDF_TAB_SECURITY }; RadioButton RB_CHANGES_ANY_NOCOPY { + HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_ANY_NOCOPY"; Pos = MAP_APPFONT ( 18 , 198 ) ; Size = MAP_APPFONT ( 152 , 10 ) ; Text[ en-US ] = "~Any except extracting pages"; @@ -653,6 +709,7 @@ TabPage RID_PDF_TAB_SECURITY CheckBox CB_ENDAB_COPY { + HelpID = "filter:CheckBox:RID_PDF_TAB_SECURITY:CB_ENDAB_COPY"; Pos = MAP_APPFONT ( 12 , 211 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -661,6 +718,7 @@ TabPage RID_PDF_TAB_SECURITY CheckBox CB_ENAB_ACCESS { + HelpID = "filter:CheckBox:RID_PDF_TAB_SECURITY:CB_ENAB_ACCESS"; Pos = MAP_APPFONT ( 12 , 224 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -679,6 +737,7 @@ TabPage RID_PDF_TAB_LINKS CheckBox CB_EXP_BMRK_TO_DEST { + HelpID = "filter:CheckBox:RID_PDF_TAB_LINKS:CB_EXP_BMRK_TO_DEST"; Pos = MAP_APPFONT ( 6 , 3 ) ; Size = MAP_APPFONT ( 164 , 16 ) ; TabStop = TRUE ; @@ -688,6 +747,7 @@ TabPage RID_PDF_TAB_LINKS CheckBox CB_CNV_OOO_DOCTOPDF { + HelpID = "filter:CheckBox:RID_PDF_TAB_LINKS:CB_CNV_OOO_DOCTOPDF"; Pos = MAP_APPFONT ( 6 , 22 ) ; Size = MAP_APPFONT ( 164 , 16 ) ; TabStop = TRUE ; @@ -697,6 +757,7 @@ TabPage RID_PDF_TAB_LINKS CheckBox CB_ENAB_RELLINKFSYS { + HelpID = "filter:CheckBox:RID_PDF_TAB_LINKS:CB_ENAB_RELLINKFSYS"; Pos = MAP_APPFONT ( 6 , 41 ) ; Size = MAP_APPFONT ( 164 , 16 ) ; TabStop = TRUE ; @@ -713,6 +774,7 @@ TabPage RID_PDF_TAB_LINKS RadioButton CB_VIEW_PDF_DEFAULT { + HelpID = "filter:RadioButton:RID_PDF_TAB_LINKS:CB_VIEW_PDF_DEFAULT"; Pos = MAP_APPFONT ( 12 , 71 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -721,6 +783,7 @@ TabPage RID_PDF_TAB_LINKS RadioButton CB_VIEW_PDF_APPLICATION { + HelpID = "filter:RadioButton:RID_PDF_TAB_LINKS:CB_VIEW_PDF_APPLICATION"; Pos = MAP_APPFONT ( 12 , 84 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -729,6 +792,7 @@ TabPage RID_PDF_TAB_LINKS RadioButton CB_VIEW_PDF_BROWSER { + HelpID = "filter:RadioButton:RID_PDF_TAB_LINKS:CB_VIEW_PDF_BROWSER"; Pos = MAP_APPFONT ( 12 , 97 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; @@ -782,6 +846,7 @@ TabDialog RID_PDF_EXPORT_DLG ModalDialog RID_PDF_ERROR_DLG { + HelpID = "filter:ModalDialog:RID_PDF_ERROR_DLG"; OutputSize = TRUE; SVLook = TRUE; Moveable = TRUE; diff --git a/filter/source/pdf/makefile.mk b/filter/source/pdf/makefile.mk index edf3147a822c..776729ac0d97 100644 --- a/filter/source/pdf/makefile.mk +++ b/filter/source/pdf/makefile.mk @@ -81,3 +81,11 @@ DEF1NAME=$(SHL1TARGET) # --- Targets ---------------------------------- .INCLUDE : target.mk + +ALLTAR : $(MISC)/pdffilter.component + +$(MISC)/pdffilter.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + pdffilter.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt pdffilter.component diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 8115f36d76f8..a8d4e1d0d14c 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -50,6 +50,8 @@ #include <svtools/filter.hxx> #include <svl/solar.hrc> #include <comphelper/string.hxx> +#include <unotools/streamwrap.hxx> +#include <com/sun/star/io/XSeekable.hpp> #include "basegfx/polygon/b2dpolygon.hxx" #include "basegfx/polygon/b2dpolypolygon.hxx" #include "basegfx/polygon/b2dpolygontools.hxx" @@ -72,6 +74,7 @@ #include <unotools/configmgr.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/drawing/XShapes.hpp> +#include <com/sun/star/graphic/XGraphicProvider.hpp> using namespace ::rtl; using namespace ::vcl; @@ -80,6 +83,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::view; +using namespace ::com::sun::star::graphic; // ------------- // - PDFExport - @@ -791,7 +795,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue pPDFExtOutDevData->SetIsReduceImageResolution( mbReduceImageResolution ); pPDFExtOutDevData->SetIsExportNamedDestinations( mbExportBmkToDest ); - Sequence< PropertyValue > aRenderOptions( 6 ); + Sequence< PropertyValue > aRenderOptions( 5 ); aRenderOptions[ 0 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ); aRenderOptions[ 0 ].Value <<= Reference< awt::XDevice >( pXDevice ); aRenderOptions[ 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ); @@ -801,10 +805,14 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue aRenderOptions[ 2 ].Value <<= sal_True; aRenderOptions[ 3 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "IsLastPage" ) ); aRenderOptions[ 3 ].Value <<= sal_False; - aRenderOptions[ 4 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ); - aRenderOptions[ 4 ].Value <<= aPageRange; - aRenderOptions[ 5 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ); - aRenderOptions[ 5 ].Value <<= mbSkipEmptyPages; + aRenderOptions[ 4 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ); + aRenderOptions[ 4 ].Value <<= mbSkipEmptyPages; + #if 0 + // #i113919# writer has to begun "PageRange" for itself changing its renderer count + // we should unify this behavior but not for OOo 3.3 + aRenderOptions[ 5 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ); + aRenderOptions[ 5 ].Value <<= aPageRange; + #endif if( aPageRange.getLength() || !aSelection.hasValue() ) { @@ -931,21 +939,37 @@ void PDFExport::showErrors( const std::set< PDFWriter::ErrorCode >& rErrors ) sal_Bool PDFExport::ImplExportPage( PDFWriter& rWriter, PDFExtOutDevData& rPDFExtOutDevData, const GDIMetaFile& rMtf ) { - VirtualDevice aDummyVDev; + vcl::PDFWriter::PlayMetafileContext aCtx; + + GDIMetaFile aMtf; + if( mbRemoveTransparencies ) + { + aCtx.m_bTransparenciesWereRemoved = rWriter.GetReferenceDevice()-> + RemoveTransparenciesFromMetaFile( rMtf, aMtf, mnMaxImageResolution, mnMaxImageResolution, + false, true, mbReduceImageResolution ); + } + else + { + aMtf = rMtf; + } + aCtx.m_nMaxImageResolution = mbReduceImageResolution ? mnMaxImageResolution : 0; + aCtx.m_bOnlyLosslessCompression = mbUseLosslessCompression; + aCtx.m_nJPEGQuality = mnQuality; + + const Size aSizePDF( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_POINT ) ); Point aOrigin; Rectangle aPageRect( aOrigin, rMtf.GetPrefSize() ); - sal_Bool bRet = sal_False; - - aDummyVDev.EnableOutput( sal_False ); - aDummyVDev.SetMapMode( rMtf.GetPrefMapMode() ); + sal_Bool bRet = sal_True; rWriter.NewPage( aSizePDF.Width(), aSizePDF.Height() ); rWriter.SetMapMode( rMtf.GetPrefMapMode() ); basegfx::B2DRectangle aB2DRect( aPageRect.Left(), aPageRect.Top(), aPageRect.Right(), aPageRect.Bottom() ); rWriter.SetClipRegion( basegfx::B2DPolyPolygon( basegfx::tools::createPolygonFromRect( aB2DRect ) ) ); - bRet = ImplWriteActions( rWriter, &rPDFExtOutDevData, rMtf, aDummyVDev ); + + rWriter.PlayMetafile( aMtf, aCtx, &rPDFExtOutDevData ); + rPDFExtOutDevData.ResetSyncData(); if( mbWatermark ) @@ -1027,949 +1051,4 @@ void PDFExport::ImplWriteWatermark( PDFWriter& rWriter, const Size& rPageSize ) rWriter.Pop(); } -// ----------------------------------------------------------------------------- - -sal_Bool PDFExport::ImplWriteActions( PDFWriter& rWriter, PDFExtOutDevData* pPDFExtOutDevData, - const GDIMetaFile& rInMtf, VirtualDevice& rDummyVDev ) -{ - bool bAssertionFired( false ); - - GDIMetaFile aMtf; - bool bTransparenciesRemoved = false; - if( mbRemoveTransparencies ) - { - bTransparenciesRemoved = rWriter.GetReferenceDevice()-> - RemoveTransparenciesFromMetaFile( rInMtf, aMtf, mnMaxImageResolution, mnMaxImageResolution, - false, true, mbReduceImageResolution ); - } - else - { - aMtf = rInMtf; - } - - - for( sal_uInt32 i = 0, nCount = aMtf.GetActionCount(); i < nCount; ) - { - if ( !pPDFExtOutDevData || !pPDFExtOutDevData->PlaySyncPageAct( rWriter, i ) ) - { - const MetaAction* pAction = aMtf.GetAction( i ); - const USHORT nType = pAction->GetType(); - - switch( nType ) - { - case( META_PIXEL_ACTION ): - { - const MetaPixelAction* pA = (const MetaPixelAction*) pAction; - rWriter.DrawPixel( pA->GetPoint(), pA->GetColor() ); - } - break; - - case( META_POINT_ACTION ): - { - const MetaPointAction* pA = (const MetaPointAction*) pAction; - rWriter.DrawPixel( pA->GetPoint() ); - } - break; - - case( META_LINE_ACTION ): - { - const MetaLineAction* pA = (const MetaLineAction*) pAction; - if ( pA->GetLineInfo().IsDefault() ) - rWriter.DrawLine( pA->GetStartPoint(), pA->GetEndPoint() ); - else - rWriter.DrawLine( pA->GetStartPoint(), pA->GetEndPoint(), pA->GetLineInfo() ); - } - break; - - case( META_RECT_ACTION ): - { - const MetaRectAction* pA = (const MetaRectAction*) pAction; - rWriter.DrawRect( pA->GetRect() ); - } - break; - - case( META_ROUNDRECT_ACTION ): - { - const MetaRoundRectAction* pA = (const MetaRoundRectAction*) pAction; - rWriter.DrawRect( pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() ); - } - break; - - case( META_ELLIPSE_ACTION ): - { - const MetaEllipseAction* pA = (const MetaEllipseAction*) pAction; - rWriter.DrawEllipse( pA->GetRect() ); - } - break; - - case( META_ARC_ACTION ): - { - const MetaArcAction* pA = (const MetaArcAction*) pAction; - rWriter.DrawArc( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() ); - } - break; - - case( META_PIE_ACTION ): - { - const MetaArcAction* pA = (const MetaArcAction*) pAction; - rWriter.DrawPie( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() ); - } - break; - - case( META_CHORD_ACTION ): - { - const MetaChordAction* pA = (const MetaChordAction*) pAction; - rWriter.DrawChord( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() ); - } - break; - - case( META_POLYGON_ACTION ): - { - const MetaPolygonAction* pA = (const MetaPolygonAction*) pAction; - rWriter.DrawPolygon( pA->GetPolygon() ); - } - break; - - case( META_POLYLINE_ACTION ): - { - const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pAction; - if ( pA->GetLineInfo().IsDefault() ) - rWriter.DrawPolyLine( pA->GetPolygon() ); - else - rWriter.DrawPolyLine( pA->GetPolygon(), pA->GetLineInfo() ); - } - break; - - case( META_POLYPOLYGON_ACTION ): - { - const MetaPolyPolygonAction* pA = (const MetaPolyPolygonAction*) pAction; - rWriter.DrawPolyPolygon( pA->GetPolyPolygon() ); - } - break; - - case( META_GRADIENT_ACTION ): - { - const MetaGradientAction* pA = (const MetaGradientAction*) pAction; - const PolyPolygon aPolyPoly( pA->GetRect() ); - - ImplWriteGradient( rWriter, aPolyPoly, pA->GetGradient(), rDummyVDev ); - } - break; - - case( META_GRADIENTEX_ACTION ): - { - const MetaGradientExAction* pA = (const MetaGradientExAction*) pAction; - ImplWriteGradient( rWriter, pA->GetPolyPolygon(), pA->GetGradient(), rDummyVDev ); - } - break; - - case META_HATCH_ACTION: - { - const MetaHatchAction* pA = (const MetaHatchAction*) pAction; - rWriter.DrawHatch( pA->GetPolyPolygon(), pA->GetHatch() ); - } - break; - - case( META_TRANSPARENT_ACTION ): - { - const MetaTransparentAction* pA = (const MetaTransparentAction*) pAction; - rWriter.DrawTransparent( pA->GetPolyPolygon(), pA->GetTransparence() ); - } - break; - - case( META_FLOATTRANSPARENT_ACTION ): - { - const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*) pAction; - - GDIMetaFile aTmpMtf( pA->GetGDIMetaFile() ); - const Point& rPos = pA->GetPoint(); - const Size& rSize= pA->GetSize(); - const Gradient& rTransparenceGradient = pA->GetGradient(); - - // special case constant alpha value - if( rTransparenceGradient.GetStartColor() == rTransparenceGradient.GetEndColor() ) - { - const Color aTransCol( rTransparenceGradient.GetStartColor() ); - const USHORT nTransPercent = aTransCol.GetLuminance() * 100 / 255; - rWriter.BeginTransparencyGroup(); - ImplWriteActions( rWriter, NULL, aTmpMtf, rDummyVDev ); - rWriter.EndTransparencyGroup( Rectangle( rPos, rSize ), nTransPercent ); - } - else - { - const Size aDstSizeTwip( rDummyVDev.PixelToLogic( rDummyVDev.LogicToPixel( rSize ), MAP_TWIP ) ); - sal_Int32 nMaxBmpDPI = mbUseLosslessCompression ? 300 : 72; - if ( mbReduceImageResolution ) - { - if ( nMaxBmpDPI > mnMaxImageResolution ) - nMaxBmpDPI = mnMaxImageResolution; - } - const sal_Int32 nPixelX = (sal_Int32)((double)aDstSizeTwip.Width() * (double)nMaxBmpDPI / 1440.0); - const sal_Int32 nPixelY = (sal_Int32)((double)aDstSizeTwip.Height() * (double)nMaxBmpDPI / 1440.0); - if ( nPixelX && nPixelY ) - { - Size aDstSizePixel( nPixelX, nPixelY ); - VirtualDevice* pVDev = new VirtualDevice; - if( pVDev->SetOutputSizePixel( aDstSizePixel ) ) - { - Bitmap aPaint, aMask; - AlphaMask aAlpha; - Point aPoint; - - MapMode aMapMode( rDummyVDev.GetMapMode() ); - aMapMode.SetOrigin( aPoint ); - pVDev->SetMapMode( aMapMode ); - Size aDstSize( pVDev->PixelToLogic( aDstSizePixel ) ); - - Point aMtfOrigin( aTmpMtf.GetPrefMapMode().GetOrigin() ); - if ( aMtfOrigin.X() || aMtfOrigin.Y() ) - aTmpMtf.Move( -aMtfOrigin.X(), -aMtfOrigin.Y() ); - double fScaleX = (double)aDstSize.Width() / (double)aTmpMtf.GetPrefSize().Width(); - double fScaleY = (double)aDstSize.Height() / (double)aTmpMtf.GetPrefSize().Height(); - if( fScaleX != 1.0 || fScaleY != 1.0 ) - aTmpMtf.Scale( fScaleX, fScaleY ); - aTmpMtf.SetPrefMapMode( aMapMode ); - - // create paint bitmap - aTmpMtf.WindStart(); - aTmpMtf.Play( pVDev, aPoint, aDstSize ); - aTmpMtf.WindStart(); - - pVDev->EnableMapMode( FALSE ); - aPaint = pVDev->GetBitmap( aPoint, aDstSizePixel ); - pVDev->EnableMapMode( TRUE ); - - // create mask bitmap - pVDev->SetLineColor( COL_BLACK ); - pVDev->SetFillColor( COL_BLACK ); - pVDev->DrawRect( Rectangle( aPoint, aDstSize ) ); - pVDev->SetDrawMode( DRAWMODE_WHITELINE | DRAWMODE_WHITEFILL | DRAWMODE_WHITETEXT | - DRAWMODE_WHITEBITMAP | DRAWMODE_WHITEGRADIENT ); - aTmpMtf.WindStart(); - aTmpMtf.Play( pVDev, aPoint, aDstSize ); - aTmpMtf.WindStart(); - pVDev->EnableMapMode( FALSE ); - aMask = pVDev->GetBitmap( aPoint, aDstSizePixel ); - pVDev->EnableMapMode( TRUE ); - - // create alpha mask from gradient - pVDev->SetDrawMode( DRAWMODE_GRAYGRADIENT ); - pVDev->DrawGradient( Rectangle( aPoint, aDstSize ), rTransparenceGradient ); - pVDev->SetDrawMode( DRAWMODE_DEFAULT ); - pVDev->EnableMapMode( FALSE ); - pVDev->DrawMask( aPoint, aDstSizePixel, aMask, Color( COL_WHITE ) ); - aAlpha = pVDev->GetBitmap( aPoint, aDstSizePixel ); - ImplWriteBitmapEx( rWriter, rDummyVDev, rPos, rSize, BitmapEx( aPaint, aAlpha ) ); - } - delete pVDev; - } - } - } - break; - - case( META_EPS_ACTION ): - { - const MetaEPSAction* pA = (const MetaEPSAction*) pAction; - const GDIMetaFile aSubstitute( pA->GetSubstitute() ); - - rWriter.Push(); - rDummyVDev.Push(); - - MapMode aMapMode( aSubstitute.GetPrefMapMode() ); - Size aOutSize( rDummyVDev.LogicToLogic( pA->GetSize(), rDummyVDev.GetMapMode(), aMapMode ) ); - aMapMode.SetScaleX( Fraction( aOutSize.Width(), aSubstitute.GetPrefSize().Width() ) ); - aMapMode.SetScaleY( Fraction( aOutSize.Height(), aSubstitute.GetPrefSize().Height() ) ); - aMapMode.SetOrigin( rDummyVDev.LogicToLogic( pA->GetPoint(), rDummyVDev.GetMapMode(), aMapMode ) ); - - rWriter.SetMapMode( aMapMode ); - rDummyVDev.SetMapMode( aMapMode ); - ImplWriteActions( rWriter, NULL, aSubstitute, rDummyVDev ); - rDummyVDev.Pop(); - rWriter.Pop(); - } - break; - - case( META_COMMENT_ACTION ): - if( ! bTransparenciesRemoved ) - { - const MetaCommentAction* pA = (const MetaCommentAction*) pAction; - String aSkipComment; - - if( pA->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL ) - { - const MetaGradientExAction* pGradAction = NULL; - sal_Bool bDone = sal_False; - - while( !bDone && ( ++i < nCount ) ) - { - pAction = aMtf.GetAction( i ); - - if( pAction->GetType() == META_GRADIENTEX_ACTION ) - pGradAction = (const MetaGradientExAction*) pAction; - else if( ( pAction->GetType() == META_COMMENT_ACTION ) && - ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) ) - { - bDone = sal_True; - } - } - - if( pGradAction ) - ImplWriteGradient( rWriter, pGradAction->GetPolyPolygon(), pGradAction->GetGradient(), rDummyVDev ); - } - else - { - const BYTE* pData = pA->GetData(); - if ( pData ) - { - SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ ); - sal_Bool bSkipSequence = sal_False; - ByteString sSeqEnd; - - if( pA->GetComment().Equals( "XPATHSTROKE_SEQ_BEGIN" ) ) - { - sSeqEnd = ByteString( "XPATHSTROKE_SEQ_END" ); - SvtGraphicStroke aStroke; - aMemStm >> aStroke; - - Polygon aPath; - aStroke.getPath( aPath ); - - PolyPolygon aStartArrow; - PolyPolygon aEndArrow; - double fTransparency( aStroke.getTransparency() ); - double fStrokeWidth( aStroke.getStrokeWidth() ); - SvtGraphicStroke::DashArray aDashArray; - - aStroke.getStartArrow( aStartArrow ); - aStroke.getEndArrow( aEndArrow ); - aStroke.getDashArray( aDashArray ); - - bSkipSequence = sal_True; - if ( aStartArrow.Count() || aEndArrow.Count() ) - bSkipSequence = sal_False; - if ( aDashArray.size() && ( fStrokeWidth != 0.0 ) && ( fTransparency == 0.0 ) ) - bSkipSequence = sal_False; - if ( bSkipSequence ) - { - PDFWriter::ExtLineInfo aInfo; - aInfo.m_fLineWidth = fStrokeWidth; - aInfo.m_fTransparency = fTransparency; - aInfo.m_fMiterLimit = aStroke.getMiterLimit(); - switch( aStroke.getCapType() ) - { - default: - case SvtGraphicStroke::capButt: aInfo.m_eCap = PDFWriter::capButt;break; - case SvtGraphicStroke::capRound: aInfo.m_eCap = PDFWriter::capRound;break; - case SvtGraphicStroke::capSquare: aInfo.m_eCap = PDFWriter::capSquare;break; - } - switch( aStroke.getJoinType() ) - { - default: - case SvtGraphicStroke::joinMiter: aInfo.m_eJoin = PDFWriter::joinMiter;break; - case SvtGraphicStroke::joinRound: aInfo.m_eJoin = PDFWriter::joinRound;break; - case SvtGraphicStroke::joinBevel: aInfo.m_eJoin = PDFWriter::joinBevel;break; - case SvtGraphicStroke::joinNone: - aInfo.m_eJoin = PDFWriter::joinMiter; - aInfo.m_fMiterLimit = 0.0; - break; - } - aInfo.m_aDashArray = aDashArray; - - if(SvtGraphicStroke::joinNone == aStroke.getJoinType() - && fStrokeWidth > 0.0) - { - // emulate no edge rounding by handling single edges - const sal_uInt16 nPoints(aPath.GetSize()); - const bool bCurve(aPath.HasFlags()); - - for(sal_uInt16 a(0); a + 1 < nPoints; a++) - { - if(bCurve - && POLY_NORMAL != aPath.GetFlags(a + 1) - && a + 2 < nPoints - && POLY_NORMAL != aPath.GetFlags(a + 2) - && a + 3 < nPoints) - { - const Polygon aSnippet(4, - aPath.GetConstPointAry() + a, - aPath.GetConstFlagAry() + a); - rWriter.DrawPolyLine( aSnippet, aInfo ); - a += 2; - } - else - { - const Polygon aSnippet(2, - aPath.GetConstPointAry() + a); - rWriter.DrawPolyLine( aSnippet, aInfo ); - } - } - } - else - { - rWriter.DrawPolyLine( aPath, aInfo ); - } - } - } - else if ( pA->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) ) - { - sSeqEnd = ByteString( "XPATHFILL_SEQ_END" ); - SvtGraphicFill aFill; - aMemStm >> aFill; - - if ( ( aFill.getFillType() == SvtGraphicFill::fillSolid ) && ( aFill.getFillRule() == SvtGraphicFill::fillEvenOdd ) ) - { - double fTransparency = aFill.getTransparency(); - if ( fTransparency == 0.0 ) - { - PolyPolygon aPath; - aFill.getPath( aPath ); - - bSkipSequence = sal_True; - rWriter.DrawPolyPolygon( aPath ); - } - else if ( fTransparency == 1.0 ) - bSkipSequence = sal_True; - } -/* #i81548# removing optimization for fill textures, because most of the texture settings are not - exported properly. In OpenOffice 3.1 the drawing layer will support graphic primitives, then it - will not be a problem to optimize the filltexture export. But for wysiwyg is more important than - filesize. - else if( aFill.getFillType() == SvtGraphicFill::fillTexture && aFill.isTiling() ) - { - sal_Int32 nPattern = mnCachePatternId; - Graphic aPatternGraphic; - aFill.getGraphic( aPatternGraphic ); - bool bUseCache = false; - SvtGraphicFill::Transform aPatTransform; - aFill.getTransform( aPatTransform ); - - if( mnCachePatternId >= 0 ) - { - SvtGraphicFill::Transform aCacheTransform; - maCacheFill.getTransform( aCacheTransform ); - if( aCacheTransform.matrix[0] == aPatTransform.matrix[0] && - aCacheTransform.matrix[1] == aPatTransform.matrix[1] && - aCacheTransform.matrix[2] == aPatTransform.matrix[2] && - aCacheTransform.matrix[3] == aPatTransform.matrix[3] && - aCacheTransform.matrix[4] == aPatTransform.matrix[4] && - aCacheTransform.matrix[5] == aPatTransform.matrix[5] - ) - { - Graphic aCacheGraphic; - maCacheFill.getGraphic( aCacheGraphic ); - if( aCacheGraphic == aPatternGraphic ) - bUseCache = true; - } - } - - if( ! bUseCache ) - { - - // paint graphic to metafile - GDIMetaFile aPattern; - rDummyVDev.SetConnectMetaFile( &aPattern ); - rDummyVDev.Push(); - rDummyVDev.SetMapMode( aPatternGraphic.GetPrefMapMode() ); - - aPatternGraphic.Draw( &rDummyVDev, Point( 0, 0 ) ); - rDummyVDev.Pop(); - rDummyVDev.SetConnectMetaFile( NULL ); - aPattern.WindStart(); - - MapMode aPatternMapMode( aPatternGraphic.GetPrefMapMode() ); - // prepare pattern from metafile - Size aPrefSize( aPatternGraphic.GetPrefSize() ); - // FIXME: this magic -1 shouldn't be necessary - aPrefSize.Width() -= 1; - aPrefSize.Height() -= 1; - aPrefSize = rWriter.GetReferenceDevice()-> - LogicToLogic( aPrefSize, - &aPatternMapMode, - &rWriter.GetReferenceDevice()->GetMapMode() ); - // build bounding rectangle of pattern - Rectangle aBound( Point( 0, 0 ), aPrefSize ); - rWriter.BeginPattern( aBound ); - rWriter.Push(); - rDummyVDev.Push(); - rWriter.SetMapMode( aPatternMapMode ); - rDummyVDev.SetMapMode( aPatternMapMode ); - ImplWriteActions( rWriter, NULL, aPattern, rDummyVDev ); - rDummyVDev.Pop(); - rWriter.Pop(); - - nPattern = rWriter.EndPattern( aPatTransform ); - - // try some caching and reuse pattern - mnCachePatternId = nPattern; - maCacheFill = aFill; - } - - // draw polypolygon with pattern fill - PolyPolygon aPath; - aFill.getPath( aPath ); - rWriter.DrawPolyPolygon( aPath, nPattern, aFill.getFillRule() == SvtGraphicFill::fillEvenOdd ); - - bSkipSequence = sal_True; - } -*/ - } - if ( bSkipSequence ) - { - while( ++i < nCount ) - { - pAction = aMtf.GetAction( i ); - if ( pAction->GetType() == META_COMMENT_ACTION ) - { - ByteString sComment( ((MetaCommentAction*)pAction)->GetComment() ); - if ( sComment.Equals( sSeqEnd ) ) - break; - } - // #i44496# - // the replacement action for stroke is a filled rectangle - // the set fillcolor of the replacement is part of the graphics - // state and must not be skipped - else if( pAction->GetType() == META_FILLCOLOR_ACTION ) - { - const MetaFillColorAction* pMA = (const MetaFillColorAction*) pAction; - if( pMA->IsSetting() ) - rWriter.SetFillColor( pMA->GetColor() ); - else - rWriter.SetFillColor(); - } - } - } - } - } - } - break; - - case( META_BMP_ACTION ): - { - const MetaBmpAction* pA = (const MetaBmpAction*) pAction; - BitmapEx aBitmapEx( pA->GetBitmap() ); - Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(), - aBitmapEx.GetPrefMapMode(), rDummyVDev.GetMapMode() ) ); - if( ! ( aSize.Width() && aSize.Height() ) ) - aSize = rDummyVDev.PixelToLogic( aBitmapEx.GetSizePixel() ); - ImplWriteBitmapEx( rWriter, rDummyVDev, pA->GetPoint(), aSize, aBitmapEx ); - } - break; - - case( META_BMPSCALE_ACTION ): - { - const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*) pAction; - ImplWriteBitmapEx( rWriter, rDummyVDev, pA->GetPoint(), pA->GetSize(), BitmapEx( pA->GetBitmap() ) ); - } - break; - - case( META_BMPSCALEPART_ACTION ): - { - const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*) pAction; - BitmapEx aBitmapEx( pA->GetBitmap() ); - aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ); - ImplWriteBitmapEx( rWriter, rDummyVDev, pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx ); - } - break; - - case( META_BMPEX_ACTION ): - { - const MetaBmpExAction* pA = (const MetaBmpExAction*) pAction; - BitmapEx aBitmapEx( pA->GetBitmapEx() ); - Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(), - aBitmapEx.GetPrefMapMode(), rDummyVDev.GetMapMode() ) ); - ImplWriteBitmapEx( rWriter, rDummyVDev, pA->GetPoint(), aSize, aBitmapEx ); - } - break; - - case( META_BMPEXSCALE_ACTION ): - { - const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*) pAction; - ImplWriteBitmapEx( rWriter, rDummyVDev, pA->GetPoint(), pA->GetSize(), pA->GetBitmapEx() ); - } - break; - - case( META_BMPEXSCALEPART_ACTION ): - { - const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*) pAction; - BitmapEx aBitmapEx( pA->GetBitmapEx() ); - aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ); - ImplWriteBitmapEx( rWriter, rDummyVDev, pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx ); - } - break; - - case( META_MASK_ACTION ): - case( META_MASKSCALE_ACTION ): - case( META_MASKSCALEPART_ACTION ): - { - DBG_ERROR( "MetaMask...Action not supported yet" ); - } - break; - - case( META_TEXT_ACTION ): - { - const MetaTextAction* pA = (const MetaTextAction*) pAction; - rWriter.DrawText( pA->GetPoint(), String( pA->GetText(), pA->GetIndex(), pA->GetLen() ) ); - } - break; - - case( META_TEXTRECT_ACTION ): - { - const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction; - rWriter.DrawText( pA->GetRect(), String( pA->GetText() ), pA->GetStyle() ); - } - break; - - case( META_TEXTARRAY_ACTION ): - { - const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pAction; - rWriter.DrawTextArray( pA->GetPoint(), pA->GetText(), pA->GetDXArray(), pA->GetIndex(), pA->GetLen() ); - } - break; - - case( META_STRETCHTEXT_ACTION ): - { - const MetaStretchTextAction* pA = (const MetaStretchTextAction*) pAction; - rWriter.DrawStretchText( pA->GetPoint(), pA->GetWidth(), pA->GetText(), pA->GetIndex(), pA->GetLen() ); - } - break; - - - case( META_TEXTLINE_ACTION ): - { - const MetaTextLineAction* pA = (const MetaTextLineAction*) pAction; - rWriter.DrawTextLine( pA->GetStartPoint(), pA->GetWidth(), pA->GetStrikeout(), pA->GetUnderline(), pA->GetOverline() ); - - } - break; - - case( META_CLIPREGION_ACTION ): - { - const MetaClipRegionAction* pA = (const MetaClipRegionAction*) pAction; - - if( pA->IsClipping() ) - { - if( pA->GetRegion().IsEmpty() ) - rWriter.SetClipRegion( basegfx::B2DPolyPolygon() ); - else - { - Region aReg( pA->GetRegion() ); - rWriter.SetClipRegion( aReg.ConvertToB2DPolyPolygon() ); - } - } - else - rWriter.SetClipRegion(); - } - break; - - case( META_ISECTRECTCLIPREGION_ACTION ): - { - const MetaISectRectClipRegionAction* pA = (const MetaISectRectClipRegionAction*) pAction; - rWriter.IntersectClipRegion( pA->GetRect() ); - } - break; - - case( META_ISECTREGIONCLIPREGION_ACTION ): - { - const MetaISectRegionClipRegionAction* pA = (const MetaISectRegionClipRegionAction*) pAction; - Region aReg( pA->GetRegion() ); - rWriter.IntersectClipRegion( aReg.ConvertToB2DPolyPolygon() ); - } - break; - - case( META_MOVECLIPREGION_ACTION ): - { - const MetaMoveClipRegionAction* pA = (const MetaMoveClipRegionAction*) pAction; - rWriter.MoveClipRegion( pA->GetHorzMove(), pA->GetVertMove() ); - } - break; - - case( META_MAPMODE_ACTION ): - { - const_cast< MetaAction* >( pAction )->Execute( &rDummyVDev ); - rWriter.SetMapMode( rDummyVDev.GetMapMode() ); - } - break; - - case( META_LINECOLOR_ACTION ): - { - const MetaLineColorAction* pA = (const MetaLineColorAction*) pAction; - - if( pA->IsSetting() ) - rWriter.SetLineColor( pA->GetColor() ); - else - rWriter.SetLineColor(); - } - break; - - case( META_FILLCOLOR_ACTION ): - { - const MetaFillColorAction* pA = (const MetaFillColorAction*) pAction; - - if( pA->IsSetting() ) - rWriter.SetFillColor( pA->GetColor() ); - else - rWriter.SetFillColor(); - } - break; - - case( META_TEXTLINECOLOR_ACTION ): - { - const MetaTextLineColorAction* pA = (const MetaTextLineColorAction*) pAction; - - if( pA->IsSetting() ) - rWriter.SetTextLineColor( pA->GetColor() ); - else - rWriter.SetTextLineColor(); - } - break; - - case( META_OVERLINECOLOR_ACTION ): - { - const MetaOverlineColorAction* pA = (const MetaOverlineColorAction*) pAction; - - if( pA->IsSetting() ) - rWriter.SetOverlineColor( pA->GetColor() ); - else - rWriter.SetOverlineColor(); - } - break; - - case( META_TEXTFILLCOLOR_ACTION ): - { - const MetaTextFillColorAction* pA = (const MetaTextFillColorAction*) pAction; - - if( pA->IsSetting() ) - rWriter.SetTextFillColor( pA->GetColor() ); - else - rWriter.SetTextFillColor(); - } - break; - - case( META_TEXTCOLOR_ACTION ): - { - const MetaTextColorAction* pA = (const MetaTextColorAction*) pAction; - rWriter.SetTextColor( pA->GetColor() ); - } - break; - - case( META_TEXTALIGN_ACTION ): - { - const MetaTextAlignAction* pA = (const MetaTextAlignAction*) pAction; - rWriter.SetTextAlign( pA->GetTextAlign() ); - } - break; - - case( META_FONT_ACTION ): - { - const MetaFontAction* pA = (const MetaFontAction*) pAction; - rWriter.SetFont( pA->GetFont() ); - } - break; - - case( META_PUSH_ACTION ): - { - const MetaPushAction* pA = (const MetaPushAction*) pAction; - - rDummyVDev.Push( pA->GetFlags() ); - rWriter.Push( pA->GetFlags() ); - } - break; - - case( META_POP_ACTION ): - { - rDummyVDev.Pop(); - rWriter.Pop(); - } - break; - - case( META_LAYOUTMODE_ACTION ): - { - const MetaLayoutModeAction* pA = (const MetaLayoutModeAction*) pAction; - rWriter.SetLayoutMode( pA->GetLayoutMode() ); - } - break; - - case META_TEXTLANGUAGE_ACTION: - { - const MetaTextLanguageAction* pA = (const MetaTextLanguageAction*) pAction; - rWriter.SetDigitLanguage( pA->GetTextLanguage() ); - } - break; - - case( META_WALLPAPER_ACTION ): - { - const MetaWallpaperAction* pA = (const MetaWallpaperAction*) pAction; - rWriter.DrawWallpaper( pA->GetRect(), pA->GetWallpaper() ); - } - break; - - case( META_RASTEROP_ACTION ): - { - // !!! >>> we don't want to support this actions - } - break; - - case( META_REFPOINT_ACTION ): - { - // !!! >>> we don't want to support this actions - } - break; - - default: - // #i24604# Made assertion fire only once per - // metafile. The asserted actions here are all - // deprecated - if( !bAssertionFired ) - { - bAssertionFired = true; - DBG_ERROR( "PDFExport::ImplWriteActions: deprecated and unsupported MetaAction encountered" ); - } - break; - } - i++; - } - } - - return sal_True; -} - -// ----------------------------------------------------------------------------- - -void PDFExport::ImplWriteGradient( PDFWriter& rWriter, const PolyPolygon& rPolyPoly, const Gradient& rGradient, VirtualDevice& rDummyVDev ) -{ - GDIMetaFile aTmpMtf; - - rDummyVDev.AddGradientActions( rPolyPoly.GetBoundRect(), rGradient, aTmpMtf ); - - rWriter.Push(); - rWriter.IntersectClipRegion( rPolyPoly.getB2DPolyPolygon() ); - ImplWriteActions( rWriter, NULL, aTmpMtf, rDummyVDev ); - rWriter.Pop(); -} - -// ----------------------------------------------------------------------------- - -void PDFExport::ImplWriteBitmapEx( PDFWriter& rWriter, VirtualDevice& rDummyVDev, - const Point& rPoint, const Size& rSize, const BitmapEx& rBitmapEx ) -{ - if ( !rBitmapEx.IsEmpty() && rSize.Width() && rSize.Height() ) - { - BitmapEx aBitmapEx( rBitmapEx ); - Point aPoint( rPoint ); - Size aSize( rSize ); - - // #i19065# Negative sizes have mirror semantics on - // OutputDevice. BitmapEx and co. have no idea about that, so - // perform that _before_ doing anything with aBitmapEx. - ULONG nMirrorFlags(BMP_MIRROR_NONE); - if( aSize.Width() < 0 ) - { - aSize.Width() *= -1; - aPoint.X() -= aSize.Width(); - nMirrorFlags |= BMP_MIRROR_HORZ; - } - if( aSize.Height() < 0 ) - { - aSize.Height() *= -1; - aPoint.Y() -= aSize.Height(); - nMirrorFlags |= BMP_MIRROR_VERT; - } - - if( nMirrorFlags != BMP_MIRROR_NONE ) - { - aBitmapEx.Mirror( nMirrorFlags ); - } - if ( mbReduceImageResolution ) - { - // do downsampling if neccessary - const Size aDstSizeTwip( rDummyVDev.PixelToLogic( rDummyVDev.LogicToPixel( aSize ), MAP_TWIP ) ); - const Size aBmpSize( aBitmapEx.GetSizePixel() ); - const double fBmpPixelX = aBmpSize.Width(); - const double fBmpPixelY = aBmpSize.Height(); - const double fMaxPixelX = aDstSizeTwip.Width() * mnMaxImageResolution / 1440.0; - const double fMaxPixelY = aDstSizeTwip.Height() * mnMaxImageResolution / 1440.0; - - // check, if the bitmap DPI exceeds the maximum DPI (allow 4 pixel rounding tolerance) - if( ( ( fBmpPixelX > ( fMaxPixelX + 4 ) ) || - ( fBmpPixelY > ( fMaxPixelY + 4 ) ) ) && - ( fBmpPixelY > 0.0 ) && ( fMaxPixelY > 0.0 ) ) - { - // do scaling - Size aNewBmpSize; - const double fBmpWH = fBmpPixelX / fBmpPixelY; - const double fMaxWH = fMaxPixelX / fMaxPixelY; - - if( fBmpWH < fMaxWH ) - { - aNewBmpSize.Width() = FRound( fMaxPixelY * fBmpWH ); - aNewBmpSize.Height() = FRound( fMaxPixelY ); - } - else if( fBmpWH > 0.0 ) - { - aNewBmpSize.Width() = FRound( fMaxPixelX ); - aNewBmpSize.Height() = FRound( fMaxPixelX / fBmpWH); - } - if( aNewBmpSize.Width() && aNewBmpSize.Height() ) - aBitmapEx.Scale( aNewBmpSize ); - else - aBitmapEx.SetEmpty(); - } - } - - const Size aSizePixel( aBitmapEx.GetSizePixel() ); - if ( aSizePixel.Width() && aSizePixel.Height() ) - { - sal_Bool bUseJPGCompression = !mbUseLosslessCompression; - if ( ( aSizePixel.Width() < 32 ) || ( aSizePixel.Height() < 32 ) ) - bUseJPGCompression = sal_False; - - SvMemoryStream aStrm; - Bitmap aMask; - - bool bTrueColorJPG = true; - if ( bUseJPGCompression ) - { - sal_uInt32 nZippedFileSize; // sj: we will calculate the filesize of a zipped bitmap - { // to determine if jpeg compression is usefull - SvMemoryStream aTemp; - aTemp.SetCompressMode( aTemp.GetCompressMode() | COMPRESSMODE_ZBITMAP ); - aTemp.SetVersion( SOFFICE_FILEFORMAT_40 ); // sj: up from version 40 our bitmap stream operator - aTemp << aBitmapEx; // is capable of zlib stream compression - aTemp.Seek( STREAM_SEEK_TO_END ); - nZippedFileSize = aTemp.Tell(); - } - if ( aBitmapEx.IsTransparent() ) - { - if ( aBitmapEx.IsAlpha() ) - aMask = aBitmapEx.GetAlpha().GetBitmap(); - else - aMask = aBitmapEx.GetMask(); - } - GraphicFilter aGraphicFilter; - Graphic aGraphic( aBitmapEx.GetBitmap() ); - sal_uInt16 nFormatName = aGraphicFilter.GetExportFormatNumberForShortName( OUString( RTL_CONSTASCII_USTRINGPARAM( "JPG" ) ) ); - sal_Int32 nColorMode = 0; - - Sequence< PropertyValue > aFilterData( 2 ); - aFilterData[ 0 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ); - aFilterData[ 0 ].Value <<= mnQuality; - aFilterData[ 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) ); - aFilterData[ 1 ].Value <<= nColorMode; - - /*sal_uInt16 nError =*/ aGraphicFilter.ExportGraphic( aGraphic, String(), aStrm, nFormatName, &aFilterData ); - bTrueColorJPG = ((aGraphicFilter.GetExportGraphicHint() & GRFILTER_OUTHINT_GREY) == 0); - aStrm.Seek( STREAM_SEEK_TO_END ); - if ( aStrm.Tell() > nZippedFileSize ) - bUseJPGCompression = sal_False; - } - if ( bUseJPGCompression ) - rWriter.DrawJPGBitmap( aStrm, bTrueColorJPG, aSizePixel, Rectangle( aPoint, aSize ), aMask ); - else if ( aBitmapEx.IsTransparent() ) - rWriter.DrawBitmapEx( aPoint, aSize, aBitmapEx ); - else - rWriter.DrawBitmap( aPoint, aSize, aBitmapEx.GetBitmap() ); - } - } -} - diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx index 18c760b85675..71bee383133c 100644 --- a/filter/source/pdf/pdfexport.hxx +++ b/filter/source/pdf/pdfexport.hxx @@ -117,13 +117,6 @@ private: //<--- sal_Bool ImplExportPage( ::vcl::PDFWriter& rWriter, ::vcl::PDFExtOutDevData& rPDFExtOutDevData, const GDIMetaFile& rMtf ); - sal_Bool ImplWriteActions( ::vcl::PDFWriter& rWriter, ::vcl::PDFExtOutDevData* pPDFExtOutDevData, - const GDIMetaFile& rMtf, VirtualDevice& rDummyVDev ); - void ImplWriteGradient( ::vcl::PDFWriter& rWriter, const PolyPolygon& rPolyPoly, - const Gradient& rGradient, VirtualDevice& rDummyVDev ); - void ImplWriteBitmapEx( ::vcl::PDFWriter& rWriter, VirtualDevice& rDummyVDev, - const Point& rPoint, const Size& rSize, const BitmapEx& rBitmap ); - void ImplWriteWatermark( ::vcl::PDFWriter& rWriter, const Size& rPageSize ); public: diff --git a/filter/source/pdf/pdffilter.component b/filter/source/pdf/pdffilter.component new file mode 100644 index 000000000000..36766b61eb97 --- /dev/null +++ b/filter/source/pdf/pdffilter.component @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.PDF.PDFDialog"> + <service name="com.sun.star.document.PDFDialog"/> + </implementation> + <implementation name="com.sun.star.comp.PDF.PDFFilter"> + <service name="com.sun.star.document.PDFFilter"/> + </implementation> +</component> diff --git a/filter/source/pdf/pdfuno.cxx b/filter/source/pdf/pdfuno.cxx index 10c0f7df293d..78bfff4c89f7 100644 --- a/filter/source/pdf/pdfuno.cxx +++ b/filter/source/pdf/pdfuno.cxx @@ -53,41 +53,6 @@ extern "C" // ------------------------------------------------------------------------- - SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) - { - if (pRegistryKey) - { - try - { - Reference< XRegistryKey > xNewKey; - sal_Int32 nPos; - - xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( PDFFilter_getImplementationName() ); - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - const Sequence< OUString > & rSNL1 = PDFFilter_getSupportedServiceNames(); - const OUString * pArray1 = rSNL1.getConstArray(); - for ( nPos = rSNL1.getLength(); nPos--; ) - xNewKey->createKey( pArray1[nPos] ); - - xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( PDFDialog_getImplementationName() ); - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - const Sequence< OUString > & rSNL2 = PDFDialog_getSupportedServiceNames(); - const OUString * pArray2 = rSNL2.getConstArray(); - for ( nPos = rSNL2.getLength(); nPos--; ) - xNewKey->createKey( pArray2[nPos] ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; - } - - // ------------------------------------------------------------------------- - SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { OUString aImplName( OUString::createFromAscii( pImplName ) ); diff --git a/filter/source/placeware/exports.dxp b/filter/source/placeware/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/filter/source/placeware/exports.dxp +++ b/filter/source/placeware/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/filter/source/placeware/makefile.mk b/filter/source/placeware/makefile.mk index 3238193c52ae..e3bd32a9197f 100644 --- a/filter/source/placeware/makefile.mk +++ b/filter/source/placeware/makefile.mk @@ -65,3 +65,11 @@ DEF1NAME= $(SHL1TARGET) # --- Targets ---------------------------------- .INCLUDE : target.mk + +ALLTAR : $(MISC)/placeware.component + +$(MISC)/placeware.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + placeware.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt placeware.component diff --git a/filter/source/placeware/placeware.component b/filter/source/placeware/placeware.component new file mode 100644 index 000000000000..9a6ca703ef2d --- /dev/null +++ b/filter/source/placeware/placeware.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.Impress.PlaceWareExportFilter"> + <service name="com.sun.star.document.ExportFilter"/> + </implementation> +</component> diff --git a/filter/source/placeware/uno.cxx b/filter/source/placeware/uno.cxx index c11b4392a1b4..49a660b05241 100644 --- a/filter/source/placeware/uno.cxx +++ b/filter/source/placeware/uno.cxx @@ -59,32 +59,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } //================================================================================================== -sal_Bool SAL_CALL component_writeInfo( - void * /* pServiceManager */, void * pRegistryKey ) -{ - if (pRegistryKey) - { - try - { - Reference< XRegistryKey > xNewKey( - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( PlaceWareExportFilter_getImplementationName() ) ); - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - - const Sequence< OUString > & rSNL = PlaceWareExportFilter_getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; -} -//================================================================================================== void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) { diff --git a/filter/source/svg/makefile.mk b/filter/source/svg/makefile.mk index 12c1210c18c4..44bac23381f5 100644 --- a/filter/source/svg/makefile.mk +++ b/filter/source/svg/makefile.mk @@ -81,3 +81,11 @@ DEF1NAME=$(SHL1TARGET) # --- Targets ---------------------------------- .INCLUDE : target.mk + +ALLTAR : $(MISC)/svgfilter.component + +$(MISC)/svgfilter.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + svgfilter.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt svgfilter.component diff --git a/filter/source/svg/svgfilter.component b/filter/source/svg/svgfilter.component new file mode 100644 index 000000000000..82db624ff9e0 --- /dev/null +++ b/filter/source/svg/svgfilter.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.Draw.SVGFilter"> + <service name="com.sun.star.document.SVGFilter"/> + </implementation> +</component> diff --git a/filter/source/svg/svguno.cxx b/filter/source/svg/svguno.cxx index aa91889fc93f..f20bfb6a526d 100644 --- a/filter/source/svg/svguno.cxx +++ b/filter/source/svg/svguno.cxx @@ -51,32 +51,6 @@ extern "C" *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } //================================================================================================== - SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * /* pServiceManager */, void * pRegistryKey ) - { - if (pRegistryKey) - { - try - { - Reference< XRegistryKey > xNewKey( - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( SVGFilter_getImplementationName() ) ); - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - - const Sequence< OUString > & rSNL = SVGFilter_getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; - } - //================================================================================================== SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) { diff --git a/filter/source/t602/filterenv.cxx b/filter/source/t602/filterenv.cxx index f7fc319c27e3..d1e1a2536f8b 100644 --- a/filter/source/t602/filterenv.cxx +++ b/filter/source/t602/filterenv.cxx @@ -52,41 +52,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } //================================================================================================== -sal_Bool SAL_CALL component_writeInfo( - void * /* pServiceManager */, void * pRegistryKey ) -{ - if (pRegistryKey) - { - try - { - sal_Int32 nPos = 0; - Reference< XRegistryKey > xNewKey( - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( T602ImportFilter_getImplementationName() ) ); - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - - const Sequence< OUString > & rSNL = T602ImportFilter_getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); - - xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( T602ImportFilterDialog_getImplementationName() ); - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - - const Sequence< OUString > & rSNL2 = T602ImportFilterDialog_getSupportedServiceNames(); - pArray = rSNL2.getConstArray(); - for ( nPos = rSNL2.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; -} -//================================================================================================== void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) { diff --git a/filter/source/t602/makefile.mk b/filter/source/t602/makefile.mk index c65de1bc9b7c..141794b346b5 100644 --- a/filter/source/t602/makefile.mk +++ b/filter/source/t602/makefile.mk @@ -60,3 +60,11 @@ SHL1STDLIBS= \ # --- Targets ------------------------------------------------------ .INCLUDE : target.mk + +ALLTAR : $(MISC)/t602filter.component + +$(MISC)/t602filter.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + t602filter.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt t602filter.component diff --git a/filter/source/t602/t602filter.component b/filter/source/t602/t602filter.component new file mode 100644 index 000000000000..fe512bf483ca --- /dev/null +++ b/filter/source/t602/t602filter.component @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.Writer.T602ImportFilter"> + <service name="com.sun.star.document.ExtendedTypeDetection"/> + <service name="com.sun.star.document.ImportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.T602ImportFilterDialog"> + <service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/> + </implementation> +</component> diff --git a/filter/source/xmlfilteradaptor/genericfilter.cxx b/filter/source/xmlfilteradaptor/genericfilter.cxx index f91c7e4f296c..8af896b84938 100644 --- a/filter/source/xmlfilteradaptor/genericfilter.cxx +++ b/filter/source/xmlfilteradaptor/genericfilter.cxx @@ -82,58 +82,6 @@ void SAL_CALL component_getImplementationEnvironment( //================================================================================================== -sal_Bool SAL_CALL component_writeInfo( - - void * /* pServiceManager */, void * pRegistryKey ) - -{ - - if (pRegistryKey) - - { - - try - - { - - Reference< XRegistryKey > xNewKey( - - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( XmlFilterAdaptor_getImplementationName() ) ); - - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - - - - const Sequence< OUString > & rSNL = XmlFilterAdaptor_getSupportedServiceNames(); - - const OUString * pArray = rSNL.getConstArray(); - - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - - xNewKey->createKey( pArray[nPos] ); - - - - return sal_True; - - } - - catch (InvalidRegistryException &) - - { - - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - - } - - } - - return sal_False; - -} - -//================================================================================================== - void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) diff --git a/filter/source/xmlfilteradaptor/makefile.mk b/filter/source/xmlfilteradaptor/makefile.mk index b3d39f860388..0e3732c20885 100644 --- a/filter/source/xmlfilteradaptor/makefile.mk +++ b/filter/source/xmlfilteradaptor/makefile.mk @@ -60,3 +60,11 @@ SHL1STDLIBS= $(COMPHELPERLIB) \ .INCLUDE : target.mk + +ALLTAR : $(MISC)/xmlfa.component + +$(MISC)/xmlfa.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + xmlfa.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt xmlfa.component diff --git a/filter/source/xmlfilteradaptor/xmlfa.component b/filter/source/xmlfilteradaptor/xmlfa.component new file mode 100644 index 000000000000..d835782c2f38 --- /dev/null +++ b/filter/source/xmlfilteradaptor/xmlfa.component @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.Writer.XmlFilterAdaptor"> + <service name="com.sun.star.document.ExportFilter"/> + <service name="com.sun.star.document.ImportFilter"/> + </implementation> +</component> diff --git a/filter/source/xmlfilterdetect/fdcomp.cxx b/filter/source/xmlfilterdetect/fdcomp.cxx index 10820fc8f280..8f68f35cc0dc 100644 --- a/filter/source/xmlfilterdetect/fdcomp.cxx +++ b/filter/source/xmlfilterdetect/fdcomp.cxx @@ -82,58 +82,6 @@ void SAL_CALL component_getImplementationEnvironment( //================================================================================================== -sal_Bool SAL_CALL component_writeInfo( - - void * /* pServiceManager */, void * pRegistryKey ) - -{ - - if (pRegistryKey) - - { - - try - - { - - Reference< XRegistryKey > xNewKey( - - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( FilterDetect_getImplementationName() ) ); - - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - - - - const Sequence< OUString > & rSNL = FilterDetect_getSupportedServiceNames(); - - const OUString * pArray = rSNL.getConstArray(); - - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - - xNewKey->createKey( pArray[nPos] ); - - - - return sal_True; - - } - - catch (InvalidRegistryException &) - - { - - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - - } - - } - - return sal_False; - -} - -//================================================================================================== - void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) diff --git a/filter/source/xmlfilterdetect/makefile.mk b/filter/source/xmlfilterdetect/makefile.mk index d13c4af5f576..582b73950ef9 100644 --- a/filter/source/xmlfilterdetect/makefile.mk +++ b/filter/source/xmlfilterdetect/makefile.mk @@ -58,3 +58,11 @@ SHL1STDLIBS= $(UCBHELPERLIB) \ $(SALLIB) .INCLUDE : target.mk + +ALLTAR : $(MISC)/xmlfd.component + +$(MISC)/xmlfd.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + xmlfd.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt xmlfd.component diff --git a/filter/source/xmlfilterdetect/xmlfd.component b/filter/source/xmlfilterdetect/xmlfd.component new file mode 100644 index 000000000000..3796b0e1fb46 --- /dev/null +++ b/filter/source/xmlfilterdetect/xmlfd.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.filters.XMLFilterDetect"> + <service name="com.sun.star.document.ExtendedTypeDetection"/> + </implementation> +</component> diff --git a/filter/source/xsltdialog/exports.dxp b/filter/source/xsltdialog/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/filter/source/xsltdialog/exports.dxp +++ b/filter/source/xsltdialog/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/filter/source/xsltdialog/makefile.mk b/filter/source/xsltdialog/makefile.mk index 728a94bf0d36..c8b95594df4f 100644 --- a/filter/source/xsltdialog/makefile.mk +++ b/filter/source/xsltdialog/makefile.mk @@ -92,3 +92,11 @@ DEF1EXPORTFILE=exports.dxp # --- Targets ---------------------------------- .INCLUDE : target.mk + +ALLTAR : $(MISC)/xsltdlg.component + +$(MISC)/xsltdlg.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + xsltdlg.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt xsltdlg.component diff --git a/filter/source/xsltdialog/xmlfileview.cxx b/filter/source/xsltdialog/xmlfileview.cxx index a9cb18bed8d2..8bd0001dc198 100644 --- a/filter/source/xsltdialog/xmlfileview.cxx +++ b/filter/source/xsltdialog/xmlfileview.cxx @@ -55,6 +55,8 @@ #include "xmlfileview.hrc" #include "xmlfilterhelpids.hrc" +#include <deque> + using namespace rtl; using namespace osl; using namespace com::sun::star::lang; @@ -77,8 +79,7 @@ struct SwTextPortion svtools::ColorConfigEntry eType; }; -SV_DECL_VARARR(SwTextPortions, SwTextPortion,16,16) -SV_IMPL_VARARR(SwTextPortions, SwTextPortion); +typedef std::deque<SwTextPortion> SwTextPortions; class XMLErrorHandler : public ::cppu::WeakImplHelper1< XErrorHandler > { @@ -688,10 +689,10 @@ void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) const USHORT nStrLen = rSource.Len(); - USHORT nInsert = 0; // Anzahl der eingefuegten Portions - USHORT nActPos = 0; //Position, an der '<' gefunden wurde - USHORT nOffset = 0; //Offset von nActPos zur '<' - USHORT nPortStart = USHRT_MAX; // fuer die TextPortion + USHORT nInsert = 0; // Number of inserted Portions + USHORT nActPos = 0; // Position, at the '<' was found + USHORT nOffset = 0; // Offset of nActPos for '<' + USHORT nPortStart = USHRT_MAX; // For the TextPortion USHORT nPortEnd = 0; // SwTextPortion aText; while(nActPos < nStrLen) @@ -709,7 +710,8 @@ void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) aText.nStart += 1; aText.nEnd = nActPos - 1; aText.eType = svtools::HTMLUNKNOWN; - aPortionList.Insert(aText, nInsert++); + aPortionList.push_back( aText ); + nInsert++; } sal_Unicode cFollowFirst = rSource.GetChar((xub_StrLen)(nActPos + 1)); sal_Unicode cFollowNext = rSource.GetChar((xub_StrLen)(nActPos + 2)); @@ -801,7 +803,8 @@ void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) aText2.nStart = nPortStart + 1; aText2.nEnd = nPortEnd; aText2.eType = eFoundType; - aPortionList.Insert(aText2, nInsert++); + aPortionList.push_back( aText2 ); + nInsert++; eFoundType = svtools::HTMLUNKNOWN; } @@ -815,7 +818,8 @@ void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) aText.nStart = nPortEnd + 1; aText.nEnd = nActPos - 1; aText.eType = svtools::HTMLUNKNOWN; - aPortionList.Insert(aText, nInsert++); + aPortionList.push_back( aText ); + nInsert++; } } @@ -833,7 +837,7 @@ void XMLFileWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) SwTextPortions aPortionList; lcl_Highlight(rSource, aPortionList); - USHORT nCount = aPortionList.Count(); + size_t nCount = aPortionList.size(); if ( !nCount ) return; @@ -841,7 +845,7 @@ void XMLFileWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) if ( rLast.nStart > rLast.nEnd ) // Nur bis Bug von MD behoeben { nCount--; - aPortionList.Remove( nCount); + aPortionList.pop_back(); if ( !nCount ) return; } @@ -857,7 +861,7 @@ void XMLFileWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) // Wenn zwei gleiche Attribute hintereinander eingestellt werden, // optimiert das die TextEngine. USHORT nLastEnd = 0; - for ( USHORT i = 0; i < nCount; i++ ) + for ( size_t i = 0; i < nCount; i++ ) { SwTextPortion& r = aPortionList[i]; DBG_ASSERT( r.nLine == aPortionList[0].nLine, "doch mehrere Zeilen ?" ); @@ -877,7 +881,7 @@ void XMLFileWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) } svtools::ColorConfig aConfig; - for ( USHORT i = 0; i < aPortionList.Count(); i++ ) + for ( size_t i = 0; i < aPortionList.size(); i++ ) { SwTextPortion& r = aPortionList[i]; if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoeben diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx index c744a65fc274..e22ac2790955 100644 --- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx +++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx @@ -403,37 +403,7 @@ void SAL_CALL component_getImplementationEnvironment( { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//================================================================================================== - -void singlecomponent_writeInfo( Reference< XRegistryKey >& xNewKey, const Sequence< OUString > & rSNL ) -{ - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); -} - -sal_Bool SAL_CALL component_writeInfo( - void * /* pServiceManager */, void * pRegistryKey ) -{ - if (pRegistryKey) - { - try - { - Reference< XRegistryKey > xNewKey( - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( XMLFilterDialogComponent_getImplementationName() ) ); - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - singlecomponent_writeInfo( xNewKey, XMLFilterDialogComponent_getSupportedServiceNames() ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; -} //================================================================================================== void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) diff --git a/filter/source/xsltdialog/xmlfilterhelpids.hrc b/filter/source/xsltdialog/xmlfilterhelpids.hrc index 9c49d0537723..cced0609f5f4 100644 --- a/filter/source/xsltdialog/xmlfilterhelpids.hrc +++ b/filter/source/xsltdialog/xmlfilterhelpids.hrc @@ -27,62 +27,55 @@ #ifndef _XMLFILTERHELPIDS_HRC_ #define _XMLFILTERHELPIDS_HRC_ -#ifndef _FILTER_HRC -#include "filter.hrc" -#endif - -#define HID_XML_SOURCE_FILE_DIALOG (HID_FILTER_XSLT_START + 0) -#define HID_XML_SOURCE_FILE_VALIDATE (HID_FILTER_XSLT_START + 1) -#define HID_XML_FILTER_SETTINGS_DIALOG (HID_FILTER_XSLT_START + 2) -#define HID_XML_FILTER_LIST (HID_FILTER_XSLT_START + 3) -#define HID_XML_FILTER_NEW (HID_FILTER_XSLT_START + 4) -#define HID_XML_FILTER_EDIT (HID_FILTER_XSLT_START + 5) -#define HID_XML_FILTER_TEST (HID_FILTER_XSLT_START + 6) -#define HID_XML_FILTER_DELETE (HID_FILTER_XSLT_START + 7) -#define HID_XML_FILTER_SAVE (HID_FILTER_XSLT_START + 8) -#define HID_XML_FILTER_OPEN (HID_FILTER_XSLT_START + 9) -#define HID_XML_FILTER_CLOSE (HID_FILTER_XSLT_START + 10) - -#define HID_XML_FILTER_TABDIALOG (HID_FILTER_XSLT_START + 11) -#define HID_XML_FILTER_TABPAGE_BASIC (HID_FILTER_XSLT_START + 12) -#define HID_XML_FILTER_TABPAGE_XSLT (HID_FILTER_XSLT_START + 13) -#define HID_XML_FILTER_NAME (HID_FILTER_XSLT_START + 14) -#define HID_XML_FILTER_APPLICATION (HID_FILTER_XSLT_START + 15) -#define HID_XML_FILTER_INTERFACE_NAME (HID_FILTER_XSLT_START + 16) -#define HID_XML_FILTER_EXTENSION (HID_FILTER_XSLT_START + 17) -#define HID_XML_FILTER_DESCRIPTION (HID_FILTER_XSLT_START + 18) -#define HID_XML_FILTER_DOCTYPE (HID_FILTER_XSLT_START + 19) -#define HID_XML_FILTER_DTD (HID_FILTER_XSLT_START + 20) -#define HID_XML_FILTER_DTD_BROWSE (HID_FILTER_XSLT_START + 21) -#define HID_XML_FILTER_EXPORT_XSLT (HID_FILTER_XSLT_START + 22) -#define HID_XML_FILTER_EXPORT_XSLT_BROWSE (HID_FILTER_XSLT_START + 23) -#define HID_XML_FILTER_IMPORT_XSLT (HID_FILTER_XSLT_START + 24) -#define HID_XML_FILTER_IMPORT_XSLT_BROWSE (HID_FILTER_XSLT_START + 25) -#define HID_XML_FILTER_IMPORT_TEMPLATE (HID_FILTER_XSLT_START + 26) -#define HID_XML_FILTER_TEST_DIALOG (HID_FILTER_XSLT_START + 27) +#define HID_XML_SOURCE_FILE_DIALOG "FILTER_HID_XML_SOURCE_FILE_DIALOG" +#define HID_XML_SOURCE_FILE_VALIDATE "FILTER_HID_XML_SOURCE_FILE_VALIDATE" +#define HID_XML_FILTER_SETTINGS_DIALOG "FILTER_HID_XML_FILTER_SETTINGS_DIALOG" +#define HID_XML_FILTER_LIST "FILTER_HID_XML_FILTER_LIST" +#define HID_XML_FILTER_NEW "FILTER_HID_XML_FILTER_NEW" +#define HID_XML_FILTER_EDIT "FILTER_HID_XML_FILTER_EDIT" +#define HID_XML_FILTER_TEST "FILTER_HID_XML_FILTER_TEST" +#define HID_XML_FILTER_DELETE "FILTER_HID_XML_FILTER_DELETE" +#define HID_XML_FILTER_SAVE "FILTER_HID_XML_FILTER_SAVE" +#define HID_XML_FILTER_OPEN "FILTER_HID_XML_FILTER_OPEN" +#define HID_XML_FILTER_CLOSE "FILTER_HID_XML_FILTER_CLOSE" -#define HID_XML_FILTER_TEST_EXPORT_BROWSE (HID_FILTER_XSLT_START + 28) -#define HID_XML_FILTER_TEST_EXPORT_CURRENT (HID_FILTER_XSLT_START + 29) -#define HID_XML_FILTER_TEST_EXPORT_CURRENT_FILE (HID_FILTER_XSLT_START + 30) +#define HID_XML_FILTER_TABDIALOG "FILTER_HID_XML_FILTER_TABDIALOG" +#define HID_XML_FILTER_TABPAGE_BASIC "FILTER_HID_XML_FILTER_TABPAGE_BASIC" +#define HID_XML_FILTER_TABPAGE_XSLT "FILTER_HID_XML_FILTER_TABPAGE_XSLT" +#define HID_XML_FILTER_NAME "FILTER_HID_XML_FILTER_NAME" +#define HID_XML_FILTER_APPLICATION "FILTER_HID_XML_FILTER_APPLICATION" +#define HID_XML_FILTER_INTERFACE_NAME "FILTER_HID_XML_FILTER_INTERFACE_NAME" +#define HID_XML_FILTER_EXTENSION "FILTER_HID_XML_FILTER_EXTENSION" +#define HID_XML_FILTER_DESCRIPTION "FILTER_HID_XML_FILTER_DESCRIPTION" +#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_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" +#define HID_XML_FILTER_IMPORT_XSLT_BROWSE "FILTER_HID_XML_FILTER_IMPORT_XSLT_BROWSE" +#define HID_XML_FILTER_IMPORT_TEMPLATE "FILTER_HID_XML_FILTER_IMPORT_TEMPLATE" +#define HID_XML_FILTER_TEST_DIALOG "FILTER_HID_XML_FILTER_TEST_DIALOG" -#define HID_XML_FILTER_TEST_IMPORT_XSLT_FILE (HID_FILTER_XSLT_START + 31) -#define HID_XML_FILTER_TEST_IMPORT_TEMPLATE_FILE (HID_FILTER_XSLT_START + 32) -#define HID_XML_FILTER_TEST_IMPORT_DISPLAY_SOURCE (HID_FILTER_XSLT_START + 33) -#define HID_XML_FILTER_TEST_IMPORT_BROWSE (HID_FILTER_XSLT_START + 34) -#define HID_XML_FILTER_TEST_IMPORT_RECENT (HID_FILTER_XSLT_START + 35) -#define HID_XML_FILTER_TEST_IMPORT_RECENT_FILE (HID_FILTER_XSLT_START + 36) -#define HID_XML_FILTER_TEST_CLOSE (HID_FILTER_XSLT_START + 37) +#define HID_XML_FILTER_TEST_EXPORT_BROWSE "FILTER_HID_XML_FILTER_TEST_EXPORT_BROWSE" +#define HID_XML_FILTER_TEST_EXPORT_CURRENT "FILTER_HID_XML_FILTER_TEST_EXPORT_CURRENT" +#define HID_XML_FILTER_TEST_EXPORT_CURRENT_FILE "FILTER_HID_XML_FILTER_TEST_EXPORT_CURRENT_FILE" -#define HID_XML_FILTER_IMPORT_TEMPLATE_BROWSE (HID_FILTER_XSLT_START + 38) +#define HID_XML_FILTER_TEST_IMPORT_XSLT_FILE "FILTER_HID_XML_FILTER_TEST_IMPORT_XSLT_FILE" +#define HID_XML_FILTER_TEST_IMPORT_TEMPLATE_FILE "FILTER_HID_XML_FILTER_TEST_IMPORT_TEMPLATE_FILE" +#define HID_XML_FILTER_TEST_IMPORT_DISPLAY_SOURCE "FILTER_HID_XML_FILTER_TEST_IMPORT_DISPLAY_SOURCE" +#define HID_XML_FILTER_TEST_IMPORT_BROWSE "FILTER_HID_XML_FILTER_TEST_IMPORT_BROWSE" +#define HID_XML_FILTER_TEST_IMPORT_RECENT "FILTER_HID_XML_FILTER_TEST_IMPORT_RECENT" +#define HID_XML_FILTER_TEST_IMPORT_RECENT_FILE "FILTER_HID_XML_FILTER_TEST_IMPORT_RECENT_FILE" +#define HID_XML_FILTER_TEST_CLOSE "FILTER_HID_XML_FILTER_TEST_CLOSE" -#define HID_XML_FILTER_TEST_VALIDATE_OUPUT (HID_FILTER_XSLT_START + 39) -#define HID_XML_FILTER_OUTPUT_WINDOW (HID_FILTER_XSLT_START + 40) +#define HID_XML_FILTER_IMPORT_TEMPLATE_BROWSE "FILTER_HID_XML_FILTER_IMPORT_TEMPLATE_BROWSE" -#define HID_XML_FILTER_TEST_EXPORT_XSLT_FILE (HID_FILTER_XSLT_START + 41) +#define HID_XML_FILTER_TEST_VALIDATE_OUPUT "FILTER_HID_XML_FILTER_TEST_VALIDATE_OUPUT" +#define HID_XML_FILTER_OUTPUT_WINDOW "FILTER_HID_XML_FILTER_OUTPUT_WINDOW" -#define HID_XML_FILTER_TABPAGE_CTRL (HID_FILTER_XSLT_START + 42) +#define HID_XML_FILTER_TEST_EXPORT_XSLT_FILE "FILTER_HID_XML_FILTER_TEST_EXPORT_XSLT_FILE" -// last help id is HID_FILTER_XSLT_END ! -// #define HID_FILTER_XSLT_END (HID_FILTER_START + 99) +#define HID_XML_FILTER_TABPAGE_CTRL "FILTER_HID_XML_FILTER_TABPAGE_CTRL" #endif diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx index 5592c331713f..0a01310b3b40 100644 --- a/filter/source/xsltdialog/xmlfilterjar.cxx +++ b/filter/source/xsltdialog/xmlfilterjar.cxx @@ -101,6 +101,10 @@ static OUString encodeZipUri( const OUString& rURI ) static Reference< XInterface > addFolder( Reference< XInterface >& xRootFolder, Reference< XSingleServiceFactory >& xFactory, const OUString& rName ) throw( Exception ) { + if ( rName.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( ".." ) ) ) + || rName.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ) ) + throw lang::IllegalArgumentException(); + Sequence< Any > aArgs(1); aArgs[0] <<= (sal_Bool)sal_True; @@ -362,6 +366,10 @@ bool XMLFilterJarHelper::copyFile( Reference< XHierarchicalNameAccess > xIfc, OU { OUString szPackagePath( encodeZipUri( rURL.copy( sVndSunStarPackage.getLength() ) ) ); + if ( ::comphelper::OStorageHelper::PathHasSegment( szPackagePath, OUString( RTL_CONSTASCII_USTRINGPARAM( ".." ) ) ) + || ::comphelper::OStorageHelper::PathHasSegment( szPackagePath, OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ) ) + throw lang::IllegalArgumentException(); + if( xIfc->hasByHierarchicalName( szPackagePath ) ) { Reference< XActiveDataSink > xFileEntry; diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 46cab18f6c77..9334c892028e 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -1433,9 +1433,7 @@ XMLFilterListBox::XMLFilterListBox( SvxPathControl_Impl * pParent ) static long nTabs[] = {3, 0, nTabSize, 2*nTabSize }; Size aHeadSize( mpHeaderBar->GetSizePixel() ); - WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP; pParent->SetFocusControl( this ); - SetWindowBits( nBits ); // SetDoubleClickHdl( aLink ); // SetSelectHdl( LINK( this, SvxPathTabPage, PathSelect_Impl ) ); SetSelectionMode( MULTIPLE_SELECTION ); diff --git a/filter/source/xsltdialog/xsltdlg.component b/filter/source/xsltdialog/xsltdlg.component new file mode 100644 index 000000000000..086208f4f830 --- /dev/null +++ b/filter/source/xsltdialog/xsltdlg.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="XMLFilterDialogComponent"> + <service name="com.sun.star.comp.ui.XSLTFilterDialog"/> + </implementation> +</component> diff --git a/filter/source/xsltfilter/XSLTFilter.cxx b/filter/source/xsltfilter/XSLTFilter.cxx index 2ee532086ef5..cccad09bae2e 100644 --- a/filter/source/xsltfilter/XSLTFilter.cxx +++ b/filter/source/xsltfilter/XSLTFilter.cxx @@ -682,31 +682,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo(void * /* pServiceManager */, void * pRegistryKey ) -{ - if (pRegistryKey) - { - try - { - Reference< XRegistryKey > xNewKey( - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( - OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) ); - - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; -} - void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) { diff --git a/filter/source/xsltfilter/XSLTFilter.jar.component b/filter/source/xsltfilter/XSLTFilter.jar.component new file mode 100644 index 000000000000..d4ecd66f3b53 --- /dev/null +++ b/filter/source/xsltfilter/XSLTFilter.jar.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.Java2" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="XSLTransformer"> + <service name="com.sun.star.comp.JAXTHelper"/> + </implementation> +</component> diff --git a/filter/source/xsltfilter/XSLTransformer.java b/filter/source/xsltfilter/XSLTransformer.java index 4806c18b8161..315170ec7f98 100644 --- a/filter/source/xsltfilter/XSLTransformer.java +++ b/filter/source/xsltfilter/XSLTransformer.java @@ -81,9 +81,8 @@ import com.sun.star.lib.uno.adapter.XOutputStreamToOutputStreamAdapter; import net.sf.saxon.FeatureKeys; /** This outer class provides an inner class to implement the service - * description, a method to instantiate the - * component on demand (__getServiceFactory()), and a method to give - * information about the component (__writeRegistryServiceInfo()). + * description and a method to instantiate the + * component on demand (__getServiceFactory()). */ public class XSLTransformer implements XTypeProvider, XServiceName, XServiceInfo, XActiveDataSink, @@ -476,9 +475,4 @@ public class XSLTransformer } return xSingleServiceFactory; } - - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { - return FactoryHelper.writeRegistryServiceInfo(XSLTransformer.class.getName(), - _serviceName, regKey); - } } diff --git a/filter/source/xsltfilter/makefile.mk b/filter/source/xsltfilter/makefile.mk index a5e27135e17a..f96534df4e2d 100644 --- a/filter/source/xsltfilter/makefile.mk +++ b/filter/source/xsltfilter/makefile.mk @@ -83,3 +83,17 @@ $(JAVACLASSFILES) : $(CLASSDIR) $(CLASSDIR) : $(MKDIR) $(CLASSDIR) .ENDIF + +ALLTAR : $(MISC)/XSLTFilter.jar.component $(MISC)/xsltfilter.component + +$(MISC)/XSLTFilter.jar.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt XSLTFilter.jar.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_JAVA)$(JARTARGET)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt XSLTFilter.jar.component + +$(MISC)/xsltfilter.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + xsltfilter.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt xsltfilter.component diff --git a/filter/source/xsltfilter/xsltfilter.component b/filter/source/xsltfilter/xsltfilter.component new file mode 100644 index 000000000000..25a479794b29 --- /dev/null +++ b/filter/source/xsltfilter/xsltfilter.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.documentconversion.XSLTFilter"> + <service name="com.sun.star.documentconversion.XSLTFilter"/> + </implementation> +</component> diff --git a/filter/source/xsltvalidate/XSLTValidate.component b/filter/source/xsltvalidate/XSLTValidate.component new file mode 100644 index 000000000000..7d357be55119 --- /dev/null +++ b/filter/source/xsltvalidate/XSLTValidate.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.Java2" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="XSLTValidate$_XSLTValidate"> + <service name="com.sun.star.documentconversion.XSLTValidate"/> + </implementation> +</component> diff --git a/filter/source/xsltvalidate/XSLTValidate.java b/filter/source/xsltvalidate/XSLTValidate.java index 6dba438f4e47..591b7c6f354c 100644 --- a/filter/source/xsltvalidate/XSLTValidate.java +++ b/filter/source/xsltvalidate/XSLTValidate.java @@ -53,9 +53,8 @@ import com.sun.star.uno.AnyConverter; import com.sun.star.lib.uno.adapter.*; /** This outer class provides an inner class to implement the service - * description, a method to instantiate the - * component on demand (__getServiceFactory()), and a method to give - * information about the component (__writeRegistryServiceInfo()). + * description and a method to instantiate the + * component on demand (__getServiceFactory()). */ public class XSLTValidate { @@ -330,18 +329,4 @@ public class XSLTValidate { return xSingleServiceFactory; } - - /** - * Writes the service information into the given registry key. - * This method is called by the <code>JavaLoader</code> - * <p> - * @return returns true if the operation succeeded - * @param regKey the registryKey - * @see com.sun.star.comp.loader.JavaLoader - */ - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { - - return FactoryHelper.writeRegistryServiceInfo(_XSLTValidate.class.getName(), - _XSLTValidate.__serviceName, regKey); - } } diff --git a/filter/source/xsltvalidate/makefile.mk b/filter/source/xsltvalidate/makefile.mk index 5337d31a4bd7..1ceb740fcf6a 100644 --- a/filter/source/xsltvalidate/makefile.mk +++ b/filter/source/xsltvalidate/makefile.mk @@ -74,3 +74,11 @@ $(JARMANIFEST) : $(CLASSDIR) $(CLASSDIR) : $(MKDIR) $(CLASSDIR) + +ALLTAR : $(MISC)/XSLTValidate.component + +$(MISC)/XSLTValidate.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt XSLTValidate.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_JAVA)$(JARTARGET)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt XSLTValidate.component diff --git a/hwpfilter/prj/d.lst b/hwpfilter/prj/d.lst index 32763725af8b..0848b21f27ac 100644 --- a/hwpfilter/prj/d.lst +++ b/hwpfilter/prj/d.lst @@ -2,4 +2,4 @@ ..\%__SRC%\lib\ihwp*.lib %_DEST%\bin%_EXT%\ihwp*.lib ..\%__SRC%\lib\libhwp.so %_DEST%\lib%_EXT%\libhwp.so ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib - +..\%__SRC%\misc\hwp.component %_DEST%\xml%_EXT%\hwp.component diff --git a/hwpfilter/source/hwp.component b/hwpfilter/source/hwp.component new file mode 100644 index 000000000000..5280cfbbd46b --- /dev/null +++ b/hwpfilter/source/hwp.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.comp.hwpimport.HwpImportFilter"> + <service name="com.sun.star.document.ImportFilter"/> + </implementation> +</component> diff --git a/hwpfilter/source/hwpreader.hxx b/hwpfilter/source/hwpreader.hxx index c5fdb180f776..239a1ff225d6 100644 --- a/hwpfilter/source/hwpreader.hxx +++ b/hwpfilter/source/hwpreader.hxx @@ -345,30 +345,6 @@ extern "C" *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - - sal_Bool SAL_CALL component_writeInfo( - void * , void * pRegistryKey ) - { - if (pRegistryKey) - { - try - { - Reference< XRegistryKey > xKey( reinterpret_cast< XRegistryKey * >( pRegistryKey ) ); - - Reference< XRegistryKey > xNewKey = xKey->createKey( - OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ); - xNewKey->createKey( OUString::createFromAscii( SERVICE_NAME ) ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; - } - void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * ) { void * pRet = 0; diff --git a/hwpfilter/source/makefile.mk b/hwpfilter/source/makefile.mk index 98b00d0618d6..494b4a30d74d 100644 --- a/hwpfilter/source/makefile.mk +++ b/hwpfilter/source/makefile.mk @@ -1,6 +1,4 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +#************************************************************************* NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # Copyright 2000, 2010 Oracle and/or its affiliates. # @@ -95,3 +93,11 @@ DEF1NAME=$(SHL1TARGET) # --- Tagets ------------------------------------------------------- .INCLUDE : target.mk + +ALLTAR : $(MISC)/hwp.component + +$(MISC)/hwp.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + hwp.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt hwp.component diff --git a/oox/inc/oox/drawingml/fillproperties.hxx b/oox/inc/oox/drawingml/fillproperties.hxx index 42457e6f4dde..d62651ebdc20 100644 --- a/oox/inc/oox/drawingml/fillproperties.hxx +++ b/oox/inc/oox/drawingml/fillproperties.hxx @@ -117,6 +117,8 @@ struct BlipFillProperties OptValue< sal_Int32 > moBitmapMode; /// Bitmap tile or stretch. OptValue< ::com::sun::star::geometry::IntegerRectangle2D > moFillRect; /// Stretch fill offsets. + OptValue< ::com::sun::star::geometry::IntegerRectangle2D > + moClipRect; OptValue< sal_Int32 > moTileOffsetX; /// Width of bitmap tiles (EMUs). OptValue< sal_Int32 > moTileOffsetY; /// Height of bitmap tiles (EMUs). OptValue< sal_Int32 > moTileScaleX; /// Horizontal scaling of bitmap tiles (1/1000 percent). diff --git a/oox/inc/oox/helper/graphichelper.hxx b/oox/inc/oox/helper/graphichelper.hxx index 37002940cb17..1c112efcf923 100644 --- a/oox/inc/oox/helper/graphichelper.hxx +++ b/oox/inc/oox/helper/graphichelper.hxx @@ -148,6 +148,10 @@ public: @return The URL of the created and internally cached graphic object. */ ::rtl::OUString importEmbeddedGraphicObject( const ::rtl::OUString& rStreamName ) const; + /** calculates the orignal size of a graphic which is necessary to be able to calculate cropping values + @return The original Graphic size in 100thmm */ + ::com::sun::star::awt::Size getOriginalSize( const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic ) const; + // ------------------------------------------------------------------------ private: typedef ::std::map< sal_Int32, sal_Int32 > SystemPalette; diff --git a/oox/inc/oox/ole/vbahelper.hxx b/oox/inc/oox/ole/vbahelper.hxx index 76dc1c736025..c1e7297d0c5b 100755..100644 --- a/oox/inc/oox/ole/vbahelper.hxx +++ b/oox/inc/oox/ole/vbahelper.hxx @@ -30,11 +30,6 @@ #include "oox/helper/binarystreambase.hxx" -namespace com { namespace sun { namespace star { - namespace container { class XNameContainer; } - namespace document { class XEventsSupplier; } -} } } - namespace oox { class BinaryInputStream; } namespace oox { @@ -102,124 +97,6 @@ public: ::rtl::OUString& rValue, const ::rtl::OUString& rKeyValue ); - /** Removes whitespace characters from the beginning of the passed string. - - @param rCodeLine (in/out parameter) The string to be modified. - - @return True = at least one whitespace character found and removed - from rCodeLine. False = rCodeLine is empty or does not start with - a whitespace character. - */ - static bool eatWhitespace( ::rtl::OUString& rCodeLine ); - - /** Removes the passed keyword from the beginning of the passed string. - - @param rCodeLine (in/out parameter) The string to be modified. - - @param rKeyword The keyword to be removed from the beginning of the - rCodeLine string. - - @return True = rCodeLine starts with the passed keyword (case - insensitive), and is followed by whitespace characters, or it ends - right after the keyword. The keyword and the following whitespace - characters have been removed from rCodeLine. False = rCodeLine is - empty or does not start with the specified keyword, or the keyword - is not followed by whitespace characters. - */ - static bool eatKeyword( ::rtl::OUString& rCodeLine, const ::rtl::OUString& rKeyword ); - - /** Returns the VBA source code of the specified module, or an empty - string, if the module does not exist. - - @param rxBasicLib The container for all VBA code modules. - @param rModuleName The name of the VBA code module. - */ - static ::rtl::OUString getSourceCode( - const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib, - const ::rtl::OUString& rModuleName ); - - /** Checks, if a macro with the specified name exists in the passed VBA - source code. - - @param rSourceCode The VBA source code. - @param rMacroName The name of the macro. - */ - static bool hasMacro( - const ::rtl::OUString& rSourceCode, - const ::rtl::OUString& rMacroName ); - - /** Checks, if a macro with the specified name exists in the specified - module. - - @param rxBasicLib The container for all VBA code modules. - @param rModuleName The name of the VBA module to check for the macro. - @param rMacroName The name of the macro. - */ - static bool hasMacro( - const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib, - const ::rtl::OUString& rModuleName, - const ::rtl::OUString& rMacroName ); - - /** Tries to insert a VBA macro into the specified code module. - - @descr If the specified macro does not exist, it will be generated as - following, using the passed parameters. If the parameter rMacroType - is left empty, a sub procedure macro will be generated: - - Private Sub <rMacroName> ( <rMacroArgs> ) - <rMacroCode> - End Sub - - If the parameter rMacroType is not empty, a function macro - will be generated. Note that the parameter rMacroCode has to - provide the code that returns the function value. - - Private Function <rMacroName> ( <rMacroArgs> ) As <rMacroType> - <rMacroCode> - End Function - - The source code in rMacroCode may contain a special placeholder - $MACRO that will be replaced by the macro name passed in rMacroName - before the macro will be inserted into the module. - - @param rModuleName The name of the VBA module to be used. - @param rMacroName The name of the VBA macro to be inserted. - @param rMacroArgs The argument list of the VBA macro. - @param rMacroType Macro return type (empty for sub procedure). - @param rMacroCode The VBA source code for the macro. - - @return True, if the specified VBA macro has been inserted. False, if - there already exists a macro with the specified name, or if any - error has occurred, for example, Office configuration forbids to - generate executable VBA code or the specified module does not - exist. - */ - static bool insertMacro( - const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib, - const ::rtl::OUString& rModuleName, - const ::rtl::OUString& rMacroName, - const ::rtl::OUString& rMacroArgs, - const ::rtl::OUString& rMacroType, - const ::rtl::OUString& rMacroCode ); - - /** Tries to attach a VBA macro to an event of the passed events supplier. - - @descr The function checks if the specified macro exists and attaches - it to the event of the passed events supplier. - - @param rxEventsSupp The events supplier for the event to be attached. - @param rEventName The event name used in the office API. - @param rLibraryName The name of the Basic library containing the macro. - @param rModuleName The name of the VBA module containing the macro. - @param rMacroName The name of the VBA macro to attach to the event. - */ - static bool attachMacroToEvent( - const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventsSupplier >& rxEventsSupp, - const ::rtl::OUString& rEventName, - const ::rtl::OUString& rLibraryName, - const ::rtl::OUString& rModuleName, - const ::rtl::OUString& rMacroName ); - private: VbaHelper(); ~VbaHelper(); diff --git a/oox/inc/oox/ole/vbaproject.hxx b/oox/inc/oox/ole/vbaproject.hxx index 0422ccbd0cf8..1d2fca29dbab 100755..100644 --- a/oox/inc/oox/ole/vbaproject.hxx +++ b/oox/inc/oox/ole/vbaproject.hxx @@ -97,157 +97,6 @@ public: /** Returns true, if the document contains the specified dialog. */ bool hasDialog( const ::rtl::OUString& rDialogName ) const; - // Insert VBA code modules and VBA macros into modules -------------------- - - /** Tries to insert a VBA macro into the specified code module. - - @descr If the specified macro does not exist, it will be generated as - following, using the passed parameters. If the parameter rMacroType - is left empty, a sub procedure macro will be generated: - - Private Sub <rMacroName> ( <rMacroArgs> ) - <rMacroCode> - End Sub - - If the parameter rMacroType is not empty, a function macro - will be generated. Note that the parameter rMacroCode has to - provide the code that returns the function value. - - Private Function <rMacroName> ( <rMacroArgs> ) As <rMacroType> - <rMacroCode> - End Function - - The source code in rMacroCode may contain a special placeholder - $MACRO that will be replaced by the macro name passed in rMacroName - before the macro will be inserted into the module. - - @param rModuleName The name of the VBA module to be used. - @param rMacroName The name of the VBA macro to be inserted. - @param rMacroArgs The argument list of the VBA macro. - @param rMacroType Macro return type (empty for sub procedure). - @param rMacroCode The VBA source code for the macro. - - @return True, if the specified VBA macro has been inserted. False, if - there already exists a macro with the specified name, or if any - error has occurred, for example, Office configuration forbids to - generate executable VBA code or the specified module does not - exist. - */ - bool insertMacro( - const ::rtl::OUString& rModuleName, - const ::rtl::OUString& rMacroName, - const ::rtl::OUString& rMacroArgs, - const ::rtl::OUString& rMacroType, - const ::rtl::OUString& rMacroCode ); - - // Attach VBA macros to generic or document events ------------------------ - - /** Tries to attach the specified VBA macro to an event directly. - - @descr The function checks if the specified macro exists and attaches - it to the event of the passed events supplier. - - @param rxEventsSupp The events supplier for the event to be attached. - @param rEventName The event name used in the office API. - @param rModuleName The name of the VBA module containing the macro. - @param rMacroName The name of the VBA macro to attach to the event. - - @return True, if the specified VBA macro exists and could be attached - to the specified event. - */ - bool attachMacroToEvent( - const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventsSupplier >& rxEventsSupp, - const ::rtl::OUString& rEventName, - const ::rtl::OUString& rModuleName, - const ::rtl::OUString& rMacroName ); - - /** Tries to attach the specified VBA macro to a document event directly. - - @descr The function checks if the specified macro exists and attaches - it to the document event. - - @param rEventName The document event name used in the office API. - @param rModuleName The name of the VBA module containing the macro. - @param rMacroName The name of the VBA macro to attach to the event. - - @return True, if the specified VBA macro exists and could be attached - to the specified document event. - */ - bool attachMacroToDocumentEvent( - const ::rtl::OUString& rEventName, - const ::rtl::OUString& rModuleName, - const ::rtl::OUString& rMacroName ); - - /** Tries to attach the specified VBA macro to an event via a generated - proxy macro that implements necessary conversion between VBA and UNO. - - @descr The function checks if the specified VBA macro exists, then it - tries to generate a proxy macro using the parameters passed to this - function, appends it to the code module, and attaches it to the - event. - - The proxy macro will execute the code specified in the rProxyCode - parameter. This code may contain special placeholders that will be - replaced before the proxy macro will be inserted into the module: - - $MACRO will be replaced by the original VBA macro name passed - in the rMacroName parameter. - - $PROXY will be replaced by the name of the proxy macro - generated by this function. - - @param rxEventsSupp The events supplier for the event to be attached. - @param rEventName The event name used in the office API. - @param rModuleName The name of the VBA module containing the macro. - @param rMacroName The name of the VBA macro to attach to the event. - @param rProxyArgs The argument list of the generated proxy macro. - @param rProxyType Proxy macro return type (empty for procedure). - @param rProxyCode Proxy macro source code. - - @return True, if the specified VBA macro exists and could be attached - to the specified event. - */ - bool attachMacroToEvent( - const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventsSupplier >& rxEventsSupp, - const ::rtl::OUString& rEventName, - const ::rtl::OUString& rModuleName, - const ::rtl::OUString& rMacroName, - const ::rtl::OUString& rProxyArgs, - const ::rtl::OUString& rProxyType, - const ::rtl::OUString& rProxyCode ); - - /** Tries to attach the specified VBA macro to a document event via a - proxy macro that implements necessary conversion between VBA and UNO. - - @descr The function checks if the specified VBA macro exists, then it - tries to generate a proxy macro using the parameters passed to this - function, appends it to the code module, and attaches it to the - document event. - - The proxy macro will execute the code specified in the rProxyCode - parameter. This code may contain special placeholders that will be - replaced before the proxy macro will be inserted into the module: - - $MACRO will be replaced by the original VBA macro name passed - in the rMacroName parameter. - - $PROXY will be replaced by the name of the proxy macro - generated by this function. - - @param rEventName The document event name used in the office API. - @param rModuleName The name of the VBA module containing the macro. - @param rMacroName The name of the VBA macro to attach to the event. - @param rProxyArgs The argument list of the generated proxy macro. - @param rProxyType Proxy macro return type (empty for procedure). - @param rProxyCode Proxy macro source code. - - @return True, if the specified VBA macro exists and could be attached - to the specified event. - */ - bool attachMacroToDocumentEvent( - const ::rtl::OUString& rEventName, - const ::rtl::OUString& rModuleName, - const ::rtl::OUString& rMacroName, - const ::rtl::OUString& rProxyArgs, - const ::rtl::OUString& rProxyType, - const ::rtl::OUString& rProxyCode ); - private: VbaProject( const VbaProject& ); VbaProject& operator=( const VbaProject& ); diff --git a/oox/inc/oox/ppt/slidepersist.hxx b/oox/inc/oox/ppt/slidepersist.hxx index 31156a56ee84..bcb0c5803d61 100644 --- a/oox/inc/oox/ppt/slidepersist.hxx +++ b/oox/inc/oox/ppt/slidepersist.hxx @@ -91,6 +91,7 @@ public: void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr pFillPropertiesPtr ){ mpBackgroundPropertiesPtr = pFillPropertiesPtr; } oox::drawingml::FillPropertiesPtr getBackgroundProperties() const { return mpBackgroundPropertiesPtr; } + oox::drawingml::Color& getBackgroundColorRef() { return maBackgroundColorRef; } sal_Bool isMasterPage() const { return mbMaster; } sal_Bool isNotesPage() const { return mbNotes; } @@ -130,6 +131,7 @@ private: SlidePersistPtr mpMasterPagePtr; oox::drawingml::ShapePtr maShapesPtr; + oox::drawingml::Color maBackgroundColorRef; oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr; ::std::list< boost::shared_ptr< TimeNode > > maTimeNodeList; diff --git a/oox/inc/oox/xls/excelvbaproject.hxx b/oox/inc/oox/xls/excelvbaproject.hxx deleted file mode 100755 index 6a517d13cd88..000000000000 --- a/oox/inc/oox/xls/excelvbaproject.hxx +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef OOX_XLS_EXCELVBAPROJECT_HXX -#define OOX_XLS_EXCELVBAPROJECT_HXX - -#include "oox/ole/vbaproject.hxx" -#include "oox/dllapi.h" - -namespace com { namespace sun { namespace star { - namespace sheet { class XSpreadsheetDocument; } -} } } - -namespace oox { -namespace xls { - -// ============================================================================ - -/** Special implementation of the VBA project for the Excel filters. */ -class OOX_DLLPUBLIC VbaProject : public ::oox::ole::VbaProject -{ -public: - explicit VbaProject( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory, - const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument >& rxDocument ); - - /** Attaches all document and sheet events to existing VBA macros. */ - void attachToEvents(); - -private: - /** Attaches VBA macros to all supported document events. */ - void attachToDocumentEvents( const ::rtl::OUString& rCodeName ); - - /** Attaches VBA macros to all supported sheet events. */ - void attachToSheetEvents( - const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventsSupplier >& rxEventsSupp, - const ::rtl::OUString& rCodeName ); - -private: - ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument > - mxDocument; -}; - -// ============================================================================ - -} // namespace xls -} // namespace oox - -#endif diff --git a/oox/prj/d.lst b/oox/prj/d.lst index 482a270926a3..ff13b324d65c 100644 --- a/oox/prj/d.lst +++ b/oox/prj/d.lst @@ -36,8 +36,8 @@ mkdir: %_DEST%\inc%_EXT%\oox\xls ..\inc\oox\ole\vbaproject.hxx %_DEST%\inc%_EXT%\oox\ole\vbaproject.hxx ..\inc\oox\vml\vmldrawing.hxx %_DEST%\inc%_EXT%\oox\vml\vmldrawing.hxx ..\inc\oox\vml\vmlshape.hxx %_DEST%\inc%_EXT%\oox\vml\vmlshape.hxx -..\inc\oox\xls\excelvbaproject.hxx %_DEST%\inc%_EXT%\oox\xls\excelvbaproject.hxx dos: sh -c "if test %OS% = MACOSX; then create-bundle %_DEST%\lib%_EXT%\*.dylib; fi" ..\xml\components.xml %_DEST%\xml%_EXT%\components.xml +..\%__SRC%\misc\oox.component %_DEST%\xml%_EXT%\oox.component diff --git a/oox/source/core/facreg.cxx b/oox/source/core/facreg.cxx index de6212984093..ed54ae81e7e5 100644 --- a/oox/source/core/facreg.cxx +++ b/oox/source/core/facreg.cxx @@ -77,45 +77,6 @@ OOX_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sal_Ch *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -void SAL_CALL writeInfo( registry::XRegistryKey * pRegistryKey, const OUString& rImplementationName, const uno::Sequence< OUString >& rServices ) -{ - uno::Reference< registry::XRegistryKey > xNewKey( - pRegistryKey->createKey( - OUString( sal_Unicode( '/' ) ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ) ); - - for( sal_Int32 i = 0; i < rServices.getLength(); i++ ) - xNewKey->createKey( rServices.getConstArray()[i]); -} - -#define WRITEINFO(className)\ - writeInfo( pKey, className##_getImplementationName(), className##_getSupportedServiceNames() ) - -OOX_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void * , void * pRegistryKey ) -{ - if( pRegistryKey ) - { - try - { - registry::XRegistryKey *pKey = reinterpret_cast< registry::XRegistryKey * >( pRegistryKey ); - - WRITEINFO( ::oox::core::FilterDetect ); - WRITEINFO( ::oox::ppt::PowerPointImport ); - WRITEINFO( ::oox::xls::BiffDetector ); - WRITEINFO( ::oox::xls::ExcelFilter ); - WRITEINFO( ::oox::xls::ExcelBiffFilter ); - WRITEINFO( ::oox::shape::ShapeContextHandler ); - WRITEINFO( ::oox::shape::FastTokenHandlerService ); - WRITEINFO( ::oox::docprop::OOXMLDocPropImportImpl ); - WRITEINFO( ::oox::xls::OOXMLFormulaParser ); - } - catch (registry::InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_True; -} - #define SINGLEFACTORY(classname)\ if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\ {\ diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index fb9e43c732de..9b7b00988dd0 100755..100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -74,8 +74,18 @@ namespace core { namespace { +struct UrlPool +{ + ::osl::Mutex maMutex; + ::std::set< OUString > maUrls; +}; + +struct StaticUrlPool : public ::rtl::Static< UrlPool, StaticUrlPool > {}; + +// ---------------------------------------------------------------------------- + /** This guard prevents recursive loading/saving of the same document. */ -class DocumentOpenedGuard : public ::osl::Mutex +class DocumentOpenedGuard { public: explicit DocumentOpenedGuard( const OUString& rUrl ); @@ -87,31 +97,28 @@ private: DocumentOpenedGuard( const DocumentOpenedGuard& ); DocumentOpenedGuard& operator=( const DocumentOpenedGuard& ); - typedef ::std::set< OUString > UrlSet; - struct UrlPool : public ::rtl::Static< UrlSet, UrlPool > {}; - - UrlSet& mrUrls; OUString maUrl; bool mbValid; }; -DocumentOpenedGuard::DocumentOpenedGuard( const OUString& rUrl ) : - mrUrls( UrlPool::get() ) +DocumentOpenedGuard::DocumentOpenedGuard( const OUString& rUrl ) { - ::osl::MutexGuard aGuard( *this ); - mbValid = (rUrl.getLength() == 0) || (mrUrls.count( rUrl ) == 0); + UrlPool& rUrlPool = StaticUrlPool::get(); + ::osl::MutexGuard aGuard( rUrlPool.maMutex ); + mbValid = (rUrl.getLength() == 0) || (rUrlPool.maUrls.count( rUrl ) == 0); if( mbValid && (rUrl.getLength() > 0) ) { - mrUrls.insert( rUrl ); + rUrlPool.maUrls.insert( rUrl ); maUrl = rUrl; } } DocumentOpenedGuard::~DocumentOpenedGuard() { - ::osl::MutexGuard aGuard( *this ); + UrlPool& rUrlPool = StaticUrlPool::get(); + ::osl::MutexGuard aGuard( rUrlPool.maMutex ); if( maUrl.getLength() > 0 ) - mrUrls.erase( maUrl ); + rUrlPool.maUrls.erase( maUrl ); } } // namespace @@ -563,4 +570,3 @@ GraphicHelper* FilterBase::implCreateGraphicHelper() const } // namespace core } // namespace oox - diff --git a/oox/source/drawingml/chart/titlecontext.cxx b/oox/source/drawingml/chart/titlecontext.cxx index 963ccdad595a..5ff71109b710 100644 --- a/oox/source/drawingml/chart/titlecontext.cxx +++ b/oox/source/drawingml/chart/titlecontext.cxx @@ -68,7 +68,7 @@ ContextHandlerRef TextContext::onCreateContext( sal_Int32 nElement, const Attrib } break; } - return false; + return 0; } void TextContext::onEndElement( const OUString& rChars ) diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 168055935104..08d001f09a62 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/awt/Gradient.hpp> +#include <com/sun/star/text/GraphicCrop.hpp> #include <com/sun/star/awt/Size.hpp> #include <com/sun/star/drawing/BitmapMode.hpp> #include <com/sun/star/drawing/ColorMode.hpp> @@ -435,6 +436,26 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe OUString aGraphicUrl = rGraphicHelper.createGraphicObject( xGraphic ); if( aGraphicUrl.getLength() > 0 ) rPropMap[ PROP_GraphicURL ] <<= aGraphicUrl; + + // cropping + if ( maBlipProps.moClipRect.has() ) + { + geometry::IntegerRectangle2D oClipRect( maBlipProps.moClipRect.get() ); + awt::Size aOriginalSize( rGraphicHelper.getOriginalSize( xGraphic ) ); + if ( aOriginalSize.Width && aOriginalSize.Height ) + { + text::GraphicCrop aGraphCrop( 0, 0, 0, 0 ); + if ( oClipRect.X1 ) + aGraphCrop.Left = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Width ) * oClipRect.X1 ) / 100000 ); + if ( oClipRect.Y1 ) + aGraphCrop.Top = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Height ) * oClipRect.Y1 ) / 100000 ); + if ( oClipRect.X2 ) + aGraphCrop.Right = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Width ) * oClipRect.X2 ) / 100000 ); + if ( oClipRect.Y2 ) + aGraphCrop.Bottom = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Height ) * oClipRect.Y2 ) / 100000 ); + rPropMap[ PROP_GraphicCrop ] <<= aGraphCrop; + } + } } // color effect diff --git a/oox/source/drawingml/fillpropertiesgroupcontext.cxx b/oox/source/drawingml/fillpropertiesgroupcontext.cxx index b9d7fa7e1142..cb2037294786 100644 --- a/oox/source/drawingml/fillpropertiesgroupcontext.cxx +++ b/oox/source/drawingml/fillpropertiesgroupcontext.cxx @@ -225,7 +225,15 @@ Reference< XFastContextHandler > BlipFillContext::createFastChildContext( return new BlipContext( *this, rxAttribs, mrBlipProps ); case A_TOKEN( srcRect ): - // TODO + { + rtl::OUString aDefault( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "0" ) ) ); + ::com::sun::star::geometry::IntegerRectangle2D aClipRect; + aClipRect.X1 = GetPercent( aAttribs.getString( XML_l, aDefault ) ); + aClipRect.Y1 = GetPercent( aAttribs.getString( XML_t, aDefault ) ); + aClipRect.X2 = GetPercent( aAttribs.getString( XML_r, aDefault ) ); + aClipRect.Y2 = GetPercent( aAttribs.getString( XML_b, aDefault ) ); + mrBlipProps.moClipRect = aClipRect; + } break; case A_TOKEN( tile ): diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx index 455778f939f7..ae664cf86668 100644 --- a/oox/source/helper/graphichelper.cxx +++ b/oox/source/helper/graphichelper.cxx @@ -38,6 +38,7 @@ #include <comphelper/seqstream.hxx> #include "tokens.hxx" #include "oox/helper/containerhelper.hxx" +#include <com/sun/star/beans/XPropertySet.hpp> using ::rtl::OUString; using ::com::sun::star::awt::DeviceInfo; @@ -52,6 +53,7 @@ using ::com::sun::star::graphic::GraphicObject; using ::com::sun::star::graphic::XGraphic; using ::com::sun::star::graphic::XGraphicObject; using ::com::sun::star::graphic::XGraphicProvider; +using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::io::XInputStream; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::uno::Exception; @@ -352,6 +354,29 @@ OUString GraphicHelper::importEmbeddedGraphicObject( const OUString& rStreamName return xGraphic.is() ? createGraphicObject( xGraphic ) : OUString(); } +Size GraphicHelper::getOriginalSize( const Reference< XGraphic >& xGraphic ) const +{ + Size aSize100thMM( 0, 0 ); + Reference< XPropertySet > xGraphicPropertySet( xGraphic, UNO_QUERY_THROW ); + if ( xGraphicPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size100thMM" ) ) ) >>= aSize100thMM ) + { + if ( !aSize100thMM.Width && !aSize100thMM.Height ) + { // MAPMODE_PIXEL USED :-( + Size aSourceSizePixel( 0, 0 ); + if ( xGraphicPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SizePixel" ) ) ) >>= aSourceSizePixel ) + { + const DeviceInfo& rDeviceInfo = getDeviceInfo(); + if ( rDeviceInfo.PixelPerMeterX && rDeviceInfo.PixelPerMeterY ) + { + aSize100thMM.Width = static_cast< sal_Int32 >( ( aSourceSizePixel.Width * 100000.0 ) / rDeviceInfo.PixelPerMeterX ); + aSize100thMM.Height = static_cast< sal_Int32 >( ( aSourceSizePixel.Height * 100000.0 ) / rDeviceInfo.PixelPerMeterY ); + } + } + } + } + return aSize100thMM; +} + // ============================================================================ } // namespace oox diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx index 6ea28f424a83..2a36cb4ff3ca 100755..100644 --- a/oox/source/ole/vbacontrol.cxx +++ b/oox/source/ole/vbacontrol.cxx @@ -722,6 +722,30 @@ OUString lclGetQuotedString( const OUString& rCodeLine ) return aBuffer.makeStringAndClear(); } +bool lclEatWhitespace( OUString& rCodeLine ) +{ + sal_Int32 nIndex = 0; + while( (nIndex < rCodeLine.getLength()) && ((rCodeLine[ nIndex ] == ' ') || (rCodeLine[ nIndex ] == '\t')) ) + ++nIndex; + if( nIndex > 0 ) + { + rCodeLine = rCodeLine.copy( nIndex ); + return true; + } + return false; +} + +bool lclEatKeyword( OUString& rCodeLine, const OUString& rKeyword ) +{ + if( rCodeLine.matchIgnoreAsciiCase( rKeyword ) ) + { + rCodeLine = rCodeLine.copy( rKeyword.getLength() ); + // success, if code line ends after keyword, or if whitespace follows + return (rCodeLine.getLength() == 0) || lclEatWhitespace( rCodeLine ); + } + return false; +} + } // namespace // ---------------------------------------------------------------------------- @@ -755,10 +779,10 @@ void VbaUserForm::importForm( const Reference< XNameContainer >& rxDialogLib, while( !bBeginFound && !aFrameTextStrm.isEof() ) { aLine = aFrameTextStrm.readLine().trim(); - bBeginFound = VbaHelper::eatKeyword( aLine, aBegin ); + bBeginFound = lclEatKeyword( aLine, aBegin ); } // check for the specific GUID that represents VBA forms - if( !bBeginFound || !VbaHelper::eatKeyword( aLine, CREATE_OUSTRING( "{C62A69F0-16DC-11CE-9E98-00AA00574A4F}" ) ) ) + if( !bBeginFound || !lclEatKeyword( aLine, CREATE_OUSTRING( "{C62A69F0-16DC-11CE-9E98-00AA00574A4F}" ) ) ) return; // remaining line is the form name diff --git a/oox/source/ole/vbahelper.cxx b/oox/source/ole/vbahelper.cxx index 7293e357e746..3bf72d30bfa5 100755..100644 --- a/oox/source/ole/vbahelper.cxx +++ b/oox/source/ole/vbahelper.cxx @@ -27,27 +27,15 @@ #include "oox/ole/vbahelper.hxx" #include <rtl/ustrbuf.hxx> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/container/XNameContainer.hpp> -#include <com/sun/star/document/XEventsSupplier.hpp> -#include <comphelper/string.hxx> #include "oox/helper/binaryinputstream.hxx" -using ::rtl::OUString; -using ::rtl::OUStringBuffer; -using ::com::sun::star::beans::PropertyValue; -using ::com::sun::star::container::XNameContainer; -using ::com::sun::star::container::XNameReplace; -using ::com::sun::star::document::XEventsSupplier; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_SET_THROW; - namespace oox { namespace ole { +using ::rtl::OUString; +using ::rtl::OUStringBuffer; +using namespace ::com::sun::star::uno; + // ============================================================================ /*static*/ OUString VbaHelper::getBasicScriptUrl( @@ -91,157 +79,6 @@ namespace ole { return false; } -/*static*/ bool VbaHelper::eatWhitespace( OUString& rCodeLine ) -{ - sal_Int32 nIndex = 0; - while( (nIndex < rCodeLine.getLength()) && ((rCodeLine[ nIndex ] == ' ') || (rCodeLine[ nIndex ] == '\t')) ) - ++nIndex; - if( nIndex > 0 ) - { - rCodeLine = rCodeLine.copy( nIndex ); - return true; - } - return false; -} - -/*static*/ bool VbaHelper::eatKeyword( OUString& rCodeLine, const OUString& rKeyword ) -{ - if( rCodeLine.matchIgnoreAsciiCase( rKeyword ) ) - { - rCodeLine = rCodeLine.copy( rKeyword.getLength() ); - // success, if code line ends after keyword, or if whitespace follows - return (rCodeLine.getLength() == 0) || eatWhitespace( rCodeLine ); - } - return false; -} - -/*static*/ OUString VbaHelper::getSourceCode( const Reference< XNameContainer >& rxBasicLib, const OUString& rModuleName ) -{ - OUString aSourceCode; - if( rxBasicLib.is() ) try - { - rxBasicLib->getByName( rModuleName ) >>= aSourceCode; - } - catch( Exception& ) - { - } - return aSourceCode; -} - -namespace { - -bool lclGetLine( OUString& rCodeLine, sal_Int32& rnIndex, const OUString& rSourceCode ) -{ - if( rnIndex < rSourceCode.getLength() ) - { - sal_Int32 nPosLF = rSourceCode.indexOf( '\n', rnIndex ); - if( nPosLF >= rnIndex ) - { - rCodeLine = rSourceCode.copy( rnIndex, nPosLF - rnIndex ).trim(); - rnIndex = nPosLF + 1; - return true; - } - } - return false; -} - -} // namespace - -/*static*/ bool VbaHelper::hasMacro( const OUString& rSourceCode, const OUString& rMacroName ) -{ - // scan all text lines for '[Public|Private] [Static] Sub <macroname> (...)' - const OUString aPublic = CREATE_OUSTRING( "Public" ); - const OUString aPrivate = CREATE_OUSTRING( "Private" ); - const OUString aStatic = CREATE_OUSTRING( "Static" ); - const OUString aSub = CREATE_OUSTRING( "Sub" ); - - OUString aCodeLine; - sal_Int32 nIndex = 0; - while( lclGetLine( aCodeLine, nIndex, rSourceCode ) ) - { - // eat optional 'Private' or 'Public', but do not accept both keywords in a row (therefore the ||) - eatKeyword( aCodeLine, aPublic ) || eatKeyword( aCodeLine, aPrivate ); - // eat optional 'Static' - eatKeyword( aCodeLine, aStatic ); - // eat 'Sub' keyword, check if macro name follows - if( eatKeyword( aCodeLine, aSub ) && aCodeLine.matchIgnoreAsciiCase( rMacroName ) ) - { - // eat macro name and following whitespace - aCodeLine = aCodeLine.copy( rMacroName.getLength() ); - eatWhitespace( aCodeLine ); - // opening bracket must follow the macro name - if( (aCodeLine.getLength() >= 2) && (aCodeLine[ 0 ] == '(') ) - return true; - } - } - return false; -} - -/*static*/ bool VbaHelper::hasMacro( const Reference< XNameContainer >& rxBasicLib, - const OUString& rModuleName, const OUString& rMacroName ) -{ - return hasMacro( getSourceCode( rxBasicLib, rModuleName ), rMacroName ); -} - -/*static*/ bool VbaHelper::insertMacro( const Reference< XNameContainer >& rxBasicLib, const OUString& rModuleName, - const OUString& rMacroName, const OUString& rMacroArgs, const OUString& rMacroType, const OUString& rMacroCode ) -{ - if( rxBasicLib.is() ) try - { - // receive module source code and check that the specified macro does not exist - OUString aSourceCode = getSourceCode( rxBasicLib, rModuleName ); - if( !hasMacro( aSourceCode, rMacroName ) ) - { - bool bFunction = rMacroType.getLength() > 0; - const sal_Char* pcSubFunc = bFunction ? "Function" : "Sub"; - OUStringBuffer aBuffer( aSourceCode ); - // generate the source code for the new macro - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\nPrivate " ) ). - appendAscii( pcSubFunc ).append( sal_Unicode( ' ' ) ). - append( rMacroName ).append( sal_Unicode( '(' ) ); - if( rMacroArgs.getLength() > 0 ) - aBuffer.append( sal_Unicode( ' ' ) ).append( rMacroArgs ).append( sal_Unicode( ' ' ) ); - aBuffer.append( sal_Unicode( ')' ) ); - if( bFunction ) - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( " As " ) ).append( rMacroType ); - aBuffer.append( sal_Unicode( '\n' ) ); - // replace all $MACRO placeholders with macro name - if( rMacroCode.getLength() > 0 ) - { - OUString aMacroCode = ::comphelper::string::searchAndReplaceAsciiL( rMacroCode, RTL_CONSTASCII_STRINGPARAM( "$MACRO" ), rMacroName ); - aBuffer.append( aMacroCode ).append( sal_Unicode( '\n' ) ); - } - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "End " ) ).appendAscii( pcSubFunc ).append( sal_Unicode( '\n' ) ); - rxBasicLib->replaceByName( rModuleName, Any( aBuffer.makeStringAndClear() ) ); - return true; - } - } - catch( Exception& ) - { - } - return false; -} - -/*static*/ bool VbaHelper::attachMacroToEvent( const Reference< XEventsSupplier >& rxEventsSupp, - const OUString& rEventName, const OUString& rLibraryName, const OUString& rModuleName, const OUString& rMacroName ) -{ - if( rxEventsSupp.is() ) try - { - Reference< XNameReplace > xEvents( rxEventsSupp->getEvents(), UNO_SET_THROW ); - Sequence< PropertyValue > aEvent( 2 ); - aEvent[ 0 ].Name = CREATE_OUSTRING( "EventType" ); - aEvent[ 0 ].Value <<= CREATE_OUSTRING( "Script" ); - aEvent[ 1 ].Name = CREATE_OUSTRING( "Script" ); - aEvent[ 1 ].Value <<= getBasicScriptUrl( rLibraryName, rModuleName, rMacroName ); - xEvents->replaceByName( rEventName, Any( aEvent ) ); - return true; - } - catch( Exception& ) - { - } - return false; -} - // ============================================================================ } // namespace ole diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx index e9388e54215a..9886f2cc5968 100755..100644 --- a/oox/source/ole/vbamodule.cxx +++ b/oox/source/ole/vbamodule.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/script/ModuleInfo.hpp> #include <com/sun/star/script/ModuleType.hpp> -#include <com/sun/star/script/XVBAModuleInfo.hpp> +#include <com/sun/star/script/vba/XVBAModuleInfo.hpp> #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/storagebase.hxx" #include "oox/helper/textinputstream.hxx" @@ -38,18 +38,12 @@ using ::rtl::OUString; using ::rtl::OUStringBuffer; -using ::com::sun::star::container::XNameAccess; -using ::com::sun::star::container::XNameContainer; -using ::com::sun::star::frame::XModel; -using ::com::sun::star::script::ModuleInfo; -using ::com::sun::star::script::XVBAModuleInfo; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; - -namespace ApiModuleType = ::com::sun::star::script::ModuleType; + +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::script; +using namespace ::com::sun::star::script::vba; +using namespace ::com::sun::star::uno; namespace oox { namespace ole { @@ -60,7 +54,7 @@ VbaModule::VbaModule( const Reference< XModel >& rxDocModel, const OUString& rNa mxDocModel( rxDocModel ), maName( rName ), meTextEnc( eTextEnc ), - mnType( ApiModuleType::UNKNOWN ), + mnType( ModuleType::UNKNOWN ), mnOffset( SAL_MAX_UINT32 ), mbReadOnly( false ), mbPrivate( false ), @@ -107,13 +101,13 @@ void VbaModule::importDirRecords( BinaryInputStream& rDirStrm ) break; case VBA_ID_MODULETYPEPROCEDURAL: OOX_ENSURE_RECORDSIZE( nRecSize == 0 ); - OSL_ENSURE( mnType == ApiModuleType::UNKNOWN, "VbaModule::importDirRecords - multiple module type records" ); - mnType = ApiModuleType::NORMAL; + OSL_ENSURE( mnType == ModuleType::UNKNOWN, "VbaModule::importDirRecords - multiple module type records" ); + mnType = ModuleType::NORMAL; break; case VBA_ID_MODULETYPEDOCUMENT: OOX_ENSURE_RECORDSIZE( nRecSize == 0 ); - OSL_ENSURE( mnType == ApiModuleType::UNKNOWN, "VbaModule::importDirRecords - multiple module type records" ); - mnType = ApiModuleType::DOCUMENT; + OSL_ENSURE( mnType == ModuleType::UNKNOWN, "VbaModule::importDirRecords - multiple module type records" ); + mnType = ModuleType::DOCUMENT; break; case VBA_ID_MODULEREADONLY: OOX_ENSURE_RECORDSIZE( nRecSize == 0 ); @@ -130,7 +124,7 @@ void VbaModule::importDirRecords( BinaryInputStream& rDirStrm ) } OSL_ENSURE( maName.getLength() > 0, "VbaModule::importDirRecords - missing module name" ); OSL_ENSURE( maStreamName.getLength() > 0, "VbaModule::importDirRecords - missing module stream name" ); - OSL_ENSURE( mnType != ApiModuleType::UNKNOWN, "VbaModule::importDirRecords - missing module type" ); + OSL_ENSURE( mnType != ModuleType::UNKNOWN, "VbaModule::importDirRecords - missing module type" ); OSL_ENSURE( mnOffset < SAL_MAX_UINT32, "VbaModule::importDirRecords - missing module stream offset" ); } @@ -155,18 +149,18 @@ void VbaModule::importSourceCode( StorageBase& rVbaStrg, aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Rem Attribute VBA_ModuleType=" ) ); switch( mnType ) { - case ApiModuleType::NORMAL: + case ModuleType::NORMAL: aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VBAModule" ) ); break; - case ApiModuleType::CLASS: + case ModuleType::CLASS: aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VBAClassModule" ) ); break; - case ApiModuleType::FORM: + case ModuleType::FORM: aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VBAFormModule" ) ); // hack from old filter, document Basic should know the XModel, but it doesn't aModuleInfo.ModuleObject.set( mxDocModel, UNO_QUERY ); break; - case ApiModuleType::DOCUMENT: + case ModuleType::DOCUMENT: aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VBADocumentModule" ) ); // get the VBA object associated to the document module if( rxDocObjectNA.is() ) try @@ -184,7 +178,7 @@ void VbaModule::importSourceCode( StorageBase& rVbaStrg, if( mbExecutable ) { aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Option VBASupport 1\n" ) ); - if( mnType == ApiModuleType::CLASS ) + if( mnType == ModuleType::CLASS ) aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Option ClassModule\n" ) ); } else diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index a370fb3d168e..deff066a5ed5 100755..100644 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -26,14 +26,13 @@ ************************************************************************/ #include "oox/ole/vbaproject.hxx" -#include <com/sun/star/document/XEventsSupplier.hpp> #include <com/sun/star/document/XStorageBasedDocument.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/script/ModuleType.hpp> #include <com/sun/star/script/XLibraryContainer.hpp> -#include <com/sun/star/script/XVBACompat.hpp> +#include <com/sun/star/script/vba/XVBACompatibility.hpp> #include <rtl/tencinfo.h> #include <rtl/ustrbuf.h> #include <comphelper/configurationhelper.hxx> @@ -52,27 +51,17 @@ using ::rtl::OUString; using ::rtl::OUStringBuffer; -using ::com::sun::star::container::XNameAccess; -using ::com::sun::star::container::XNameContainer; -using ::com::sun::star::document::XEventsSupplier; -using ::com::sun::star::document::XStorageBasedDocument; -using ::com::sun::star::embed::XStorage; -using ::com::sun::star::embed::XTransactedObject; -using ::com::sun::star::frame::XModel; -using ::com::sun::star::io::XStream; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::script::XLibraryContainer; -using ::com::sun::star::script::XVBACompat; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; -using ::com::sun::star::uno::XInterface; using ::comphelper::ConfigurationHelper; -namespace ApiModuleType = ::com::sun::star::script::ModuleType; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::document; +using namespace ::com::sun::star::embed; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::script; +using namespace ::com::sun::star::script::vba; +using namespace ::com::sun::star::uno; namespace oox { namespace ole { @@ -184,70 +173,6 @@ bool VbaProject::hasDialog( const OUString& rDialogName ) const return mxDialogLib.is() && mxDialogLib->hasByName( rDialogName ); } -// Insert VBA code modules and VBA macros into modules ------------------------ - -bool VbaProject::insertMacro( const OUString& rModuleName, - const OUString& rMacroName, const OUString& rMacroArgs, - const OUString& rMacroType, const OUString& rMacroCode ) -{ - return - // do nothing if macros are imported as comments - isImportVbaExecutable() && - // try to insert the macro (will check that the macro does not exist yet) - VbaHelper::insertMacro( mxBasicLib, rModuleName, rMacroName, rMacroArgs, rMacroType, rMacroCode ); -} - -// Attach VBA macros to generic or document events ---------------------------- - -bool VbaProject::attachMacroToEvent( const Reference< XEventsSupplier >& rxEventsSupp, - const OUString& rEventName, const OUString& rModuleName, const OUString& rMacroName ) -{ - return - // do not attach if macros are imported as comments - isImportVbaExecutable() && - // check that the specified macro exists in the module - VbaHelper::hasMacro( mxBasicLib, rModuleName, rMacroName ) && - // attach the macro to the events supplier - VbaHelper::attachMacroToEvent( rxEventsSupp, rEventName, maLibName, rModuleName, rMacroName ); -} - -bool VbaProject::attachMacroToDocumentEvent( const OUString& rEventName, - const OUString& rModuleName, const OUString& rMacroName ) -{ - Reference< XEventsSupplier > xEventsSupp( mxDocModel, UNO_QUERY ); - return attachMacroToEvent( xEventsSupp, rEventName, rModuleName, rMacroName ); -} - -bool VbaProject::attachMacroToEvent( const Reference< XEventsSupplier >& rxEventsSupp, - const OUString& rEventName, const OUString& rModuleName, const OUString& rMacroName, - const OUString& rProxyArgs, const OUString& rProxyType, const OUString& rProxyCode ) -{ - // receive module source code, and check that the specified macro exists in the module - OUString aSourceCode = VbaHelper::getSourceCode( mxBasicLib, rModuleName ); - if( isImportVbaExecutable() && VbaHelper::hasMacro( aSourceCode, rMacroName ) ) - { - // create the name of the proxy macro, and the macro source code - OUString aProxyName = OUStringBuffer( rMacroName ).append( sal_Unicode( '_' ) ). - append( rEventName ).appendAscii( "_Proxy" ).makeStringAndClear(); - // replace $MACRO and $PROXY placeholders in proxy source code - OUString aProxyCode = ::comphelper::string::searchAndReplaceAsciiL( rProxyCode, RTL_CONSTASCII_STRINGPARAM( "$MACRO" ), rMacroName ); - aProxyCode = ::comphelper::string::searchAndReplaceAsciiL( aProxyCode, RTL_CONSTASCII_STRINGPARAM( "$PROXY" ), aProxyName ); - // insert the new macro into the code module and attach it to the event - return - VbaHelper::insertMacro( mxBasicLib, rModuleName, aProxyName, rProxyArgs, rProxyType, aProxyCode ) && - VbaHelper::attachMacroToEvent( rxEventsSupp, rEventName, maLibName, rModuleName, aProxyName ); - } - return false; -} - -bool VbaProject::attachMacroToDocumentEvent( - const OUString& rEventName, const OUString& rModuleName, const OUString& rMacroName, - const OUString& rProxyArgs, const OUString& rProxyType, const OUString& rProxyCode ) -{ - Reference< XEventsSupplier > xEventsSupp( mxDocModel, UNO_QUERY ); - return attachMacroToEvent( xEventsSupp, rEventName, rModuleName, rMacroName, rProxyArgs, rProxyType, rProxyCode ); -} - // private -------------------------------------------------------------------- Reference< XLibraryContainer > VbaProject::getLibraryContainer( sal_Int32 nPropId ) @@ -394,23 +319,23 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap bExitLoop = (nLineLen >= 2) && (aLine[ 0 ] == '[') && (aLine[ nLineLen - 1 ] == ']'); if( !bExitLoop && VbaHelper::extractKeyValue( aKey, aValue, aLine ) ) { - sal_Int32 nType = ApiModuleType::UNKNOWN; + sal_Int32 nType = ModuleType::UNKNOWN; if( aKey.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "Document" ) ) ) { - nType = ApiModuleType::DOCUMENT; + nType = ModuleType::DOCUMENT; // strip automation server version from module names sal_Int32 nSlashPos = aValue.indexOf( '/' ); if( nSlashPos >= 0 ) aValue = aValue.copy( 0, nSlashPos ); } else if( aKey.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "Module" ) ) ) - nType = ApiModuleType::NORMAL; + nType = ModuleType::NORMAL; else if( aKey.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "Class" ) ) ) - nType = ApiModuleType::CLASS; + nType = ModuleType::CLASS; else if( aKey.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "BaseClass" ) ) ) - nType = ApiModuleType::FORM; + nType = ModuleType::FORM; - if( (nType != ApiModuleType::UNKNOWN) && (aValue.getLength() > 0) ) + if( (nType != ModuleType::UNKNOWN) && (aValue.getLength() > 0) ) { OSL_ENSURE( aModules.has( aValue ), "VbaProject::importVba - module not found" ); if( VbaModule* pModule = aModules.get( aValue ).get() ) @@ -426,13 +351,23 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap specified. */ if( !aModules.empty() ) try { - // get the basic library + // get the model factory and the basic library + Reference< XMultiServiceFactory > xModelFactory( mxDocModel, UNO_QUERY_THROW ); Reference< XNameContainer > xBasicLib( createBasicLibrary(), UNO_SET_THROW ); // set library container to VBA compatibility mode try { - Reference< XVBACompat >( getLibraryContainer( PROP_BasicLibraries ), UNO_QUERY_THROW )->setVBACompatModeOn( sal_True ); + Reference< XVBACompatibility >( getLibraryContainer( PROP_BasicLibraries ), UNO_QUERY_THROW )->setVBACompatibilityMode( sal_True ); + } + catch( Exception& ) + { + } + + // create the VBAGlobals object, the model will store it in the Basic manager + try + { + xModelFactory->createInstance( CREATE_OUSTRING( "ooo.vba.VBAGlobals" ) ); } catch( Exception& ) { @@ -442,7 +377,6 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap Reference< XNameAccess > xDocObjectNA; try { - Reference< XMultiServiceFactory > xModelFactory( mxDocModel, UNO_QUERY_THROW ); xDocObjectNA.set( xModelFactory->createInstance( CREATE_OUSTRING( "ooo.vba.VBAObjectModuleObjectProvider" ) ), UNO_QUERY ); } catch( Exception& ) @@ -475,7 +409,7 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap { // resolve module name from storage name (which equals the module stream name) VbaModule* pModule = aModulesByStrm.get( *aIt ).get(); - OSL_ENSURE( pModule && (pModule->getType() == ApiModuleType::FORM), + OSL_ENSURE( pModule && (pModule->getType() == ModuleType::FORM), "VbaProject::importVba - form substorage without form module" ); OUString aModuleName; if( pModule ) diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx index 69f32e01e7eb..7e77f5a54938 100644 --- a/oox/source/ppt/slidefragmenthandler.cxx +++ b/oox/source/ppt/slidefragmenthandler.cxx @@ -145,7 +145,14 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr ); } break; + case NMSP_PPT|XML_bgRef: // a:CT_StyleMatrixReference + { + FillPropertiesPtr pFillPropertiesPtr( new FillProperties( + *mpSlidePersistPtr->getTheme()->getFillStyle( xAttribs->getOptionalValue( XML_idx ).toInt32() ) ) ); + xRet.set( new ColorContext( *this, mpSlidePersistPtr->getBackgroundColorRef() ) ); + mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr ); + } break; case NMSP_PPT|XML_clrMap: // CT_ColorMapping diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index ce99ffc49f19..8555ba371b77 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -173,12 +173,17 @@ void SlidePersist::createBackground( const XmlFilterBase& rFilterBase ) { try { + sal_Int32 nPhClr = API_RGB_TRANSPARENT; + if ( maBackgroundColorRef.isUsed() ) + nPhClr = maBackgroundColorRef.getColor( rFilterBase.getGraphicHelper() ); + PropertyMap aPropMap; static const rtl::OUString sBackground( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ); uno::Reference< beans::XPropertySet > xPagePropSet( mxPage, uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xPropertySet( aPropMap.makePropertySet() ); PropertySet aPropSet( xPropertySet ); - mpBackgroundPropertiesPtr->pushToPropSet( aPropSet, rFilterBase.getModelObjectHelper(), rFilterBase.getGraphicHelper() ); + mpBackgroundPropertiesPtr->pushToPropSet( aPropSet, rFilterBase.getModelObjectHelper(), + rFilterBase.getGraphicHelper(), oox::drawingml::FillProperties::DEFAULT_IDS, 0, nPhClr ); xPagePropSet->setPropertyValue( sBackground, Any( xPropertySet ) ); } catch( Exception ) diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index da1aeb2ed265..ba51c3577a8e 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -166,6 +166,7 @@ Geometry3D GradientName Graphic GraphicColorMode +GraphicCrop GraphicSize GraphicURL GridColor diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index ec7da1d4d900..08115d4f8d25 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -170,7 +170,7 @@ ShapeContextBase::ShapeContextBase( ContextHandler2Helper& rParent ) : case VML_TOKEN( image ): return new ShapeContext( rParent, rAttribs, rShapes.createShape< ComplexShape >() ); } - return false; + return 0; } // ============================================================================ diff --git a/oox/source/xls/defnamesbuffer.cxx b/oox/source/xls/defnamesbuffer.cxx index 69214034fee7..a02375e2b869 100644 --- a/oox/source/xls/defnamesbuffer.cxx +++ b/oox/source/xls/defnamesbuffer.cxx @@ -486,8 +486,9 @@ void DefinedName::importDefinedName( BiffInputStream& rStrm, sal_Int16 nCalcShee void DefinedName::createNameObject() { - // do not create hidden names and names for (macro) functions - if( maModel.mbHidden || maModel.mbFunction ) + // do not create names for (macro) functions + // #163146# do not ignore hidden names (may be regular names created by VBA scripts) + if( /*maModel.mbHidden ||*/ maModel.mbFunction ) return; // convert original name to final Calc name @@ -498,10 +499,13 @@ void DefinedName::createNameObject() else maCalcName = maModel.maName; //! TODO convert to valid name + // #163146# do not rename sheet-local names by default, this breaks VBA scripts +#if 0 // append sheet index for local names in multi-sheet documents if( isWorkbookFile() && !isGlobalName() ) maCalcName = OUStringBuffer( maCalcName ).append( sal_Unicode( '_' ) ). append( static_cast< sal_Int32 >( mnCalcSheet + 1 ) ).makeStringAndClear(); +#endif // special flags for this name sal_Int32 nNameFlags = 0; diff --git a/oox/source/xls/excelfilter.cxx b/oox/source/xls/excelfilter.cxx index 71475790851f..5affbfff44a7 100644 --- a/oox/source/xls/excelfilter.cxx +++ b/oox/source/xls/excelfilter.cxx @@ -115,19 +115,18 @@ ExcelFilter::~ExcelFilter() bool ExcelFilter::importDocument() throw() { - /* to activate the XLSX/XLSB dumper, define the environment variable - OOO_XLSBDUMPER and insert the full path to the file - file:///<path-to-oox-module>/source/dump/xlsbdumper.ini. */ + /* To activate the XLSX/XLSB dumper, insert the full path to the file + file:///<path-to-oox-module>/source/dump/xlsbdumper.ini + into the environment variable OOO_XLSBDUMPER and start the office with + this variable (nonpro only). */ OOX_DUMP_FILE( ::oox::dump::xlsb::Dumper ); - bool bRet = false; OUString aWorkbookPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "officeDocument" ) ); - if( aWorkbookPath.getLength() > 0 ) - { - WorkbookHelperRoot aHelper( *this ); - bRet = aHelper.isValid() && importFragment( new OoxWorkbookFragment( aHelper, aWorkbookPath ) ); - } - return bRet; + if( aWorkbookPath.getLength() == 0 ) + return false; + + WorkbookHelperRoot aHelper( *this ); + return aHelper.isValid() && importFragment( new OoxWorkbookFragment( aHelper, aWorkbookPath ) ); } bool ExcelFilter::exportDocument() throw() @@ -198,31 +197,30 @@ ExcelBiffFilter::~ExcelBiffFilter() bool ExcelBiffFilter::importDocument() throw() { - /* to activate the BIFF dumper, define the environment variable - OOO_BIFFDUMPER and insert the full path to the file - file:///<path-to-oox-module>/source/dump/biffdumper.ini. */ + /* To activate the BIFF dumper, insert the full path to the file + file:///<path-to-oox-module>/source/dump/biffdumper.ini + into the environment variable OOO_BIFFDUMPER and start the office with + this variable (nonpro only). */ OOX_DUMP_FILE( ::oox::dump::biff::Dumper ); /* The boolean argument "UseBiffFilter" passed through XInitialisation - decides whether to use the BIFF file dumper implemented in this filter - only (false or missing), or to import/export the document (true). */ + decides whether to import/export the document with this filter (true), + or to only use the BIFF file dumper implemented in this filter (false + or missing) */ Any aUseBiffFilter = getArgument( CREATE_OUSTRING( "UseBiffFilter" ) ); bool bUseBiffFilter = false; if( !(aUseBiffFilter >>= bUseBiffFilter) || !bUseBiffFilter ) return true; - bool bRet = false; - // detect BIFF version and workbook stream name OUString aWorkbookName; BiffType eBiff = BiffDetector::detectStorageBiffVersion( aWorkbookName, getStorage() ); OSL_ENSURE( eBiff != BIFF_UNKNOWN, "ExcelBiffFilter::ExcelBiffFilter - invalid file format" ); - if( eBiff != BIFF_UNKNOWN ) - { - WorkbookHelperRoot aHelper( *this, eBiff ); - bRet = aHelper.isValid() && BiffWorkbookFragment( aHelper, aWorkbookName ).importFragment(); - } - return bRet; + if( eBiff == BIFF_UNKNOWN ) + return false; + + WorkbookHelperRoot aHelper( *this, eBiff ); + return aHelper.isValid() && BiffWorkbookFragment( aHelper, aWorkbookName ).importFragment(); } bool ExcelBiffFilter::exportDocument() throw() @@ -244,4 +242,3 @@ OUString ExcelBiffFilter::implGetImplementationName() const } // namespace xls } // namespace oox - diff --git a/oox/source/xls/excelvbaproject.cxx b/oox/source/xls/excelvbaproject.cxx deleted file mode 100755 index fc3caf7e59aa..000000000000 --- a/oox/source/xls/excelvbaproject.cxx +++ /dev/null @@ -1,214 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "oox/xls/excelvbaproject.hxx" -#include <com/sun/star/container/XEnumeration.hpp> -#include <com/sun/star/container/XEnumerationAccess.hpp> -#include <com/sun/star/document/XEventsSupplier.hpp> -#include <com/sun/star/frame/XModel.hpp> -#include <com/sun/star/sheet/XSpreadsheetDocument.hpp> -#include "properties.hxx" -#include "oox/helper/helper.hxx" -#include "oox/helper/propertyset.hxx" - -using ::rtl::OUString; -using ::com::sun::star::container::XEnumeration; -using ::com::sun::star::container::XEnumerationAccess; -using ::com::sun::star::document::XEventsSupplier; -using ::com::sun::star::frame::XModel; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::sheet::XSpreadsheetDocument; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::UNO_SET_THROW; - -namespace oox { -namespace xls { - -// ============================================================================ - -VbaProject::VbaProject( const Reference< XMultiServiceFactory >& rxGlobalFactory, const Reference< XSpreadsheetDocument >& rxDocument ) : - ::oox::ole::VbaProject( rxGlobalFactory, Reference< XModel >( rxDocument, UNO_QUERY ), CREATE_OUSTRING( "Calc" ) ), - mxDocument( rxDocument ) -{ -} - -void VbaProject::attachToEvents() -{ - // do nothing is code is not executable - if( !isImportVbaExecutable() ) - return; - - // document events - PropertySet aDocProp( mxDocument ); - OUString aCodeName; - aDocProp.getProperty( aCodeName, PROP_CodeName ); - attachToDocumentEvents( aCodeName ); - - // sheet events - if( mxDocument.is() ) try - { - Reference< XEnumerationAccess > xSheetsEA( mxDocument->getSheets(), UNO_QUERY_THROW ); - Reference< XEnumeration > xSheetsEnum( xSheetsEA->createEnumeration(), UNO_SET_THROW ); - // own try/catch for every sheet - while( xSheetsEnum->hasMoreElements() ) try - { - // TODO: once we have chart sheets we need a switch/case on sheet type - Reference< XEventsSupplier > xEventsSupp( xSheetsEnum->nextElement(), UNO_QUERY_THROW ); - PropertySet aSheetProp( xEventsSupp ); - aSheetProp.getProperty( aCodeName, PROP_CodeName ); - attachToSheetEvents( xEventsSupp, aCodeName ); - } - catch( Exception& ) - { - } - } - catch( Exception& ) - { - } -} - -// private -------------------------------------------------------------------- - -void VbaProject::attachToDocumentEvents( const OUString& rCodeName ) -{ - if( (rCodeName.getLength() == 0) || !hasModule( rCodeName ) ) - return; - - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnLoad" ), rCodeName, CREATE_OUSTRING( "Workbook_Open" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnFocus" ), rCodeName, CREATE_OUSTRING( "Workbook_Activate" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnUnfocus" ), rCodeName, CREATE_OUSTRING( "Workbook_Deactivate" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnSave" ), rCodeName, CREATE_OUSTRING( "Workbook_BeforeSave" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO False, False" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnSaveAs" ), rCodeName, CREATE_OUSTRING( "Workbook_BeforeSave" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO True, False" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnSaveDone" ), rCodeName, CREATE_OUSTRING( "Workbook_AfterSave" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO True" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnSaveAsDone" ), rCodeName, CREATE_OUSTRING( "Workbook_AfterSave" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO True" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnSaveFailed" ), rCodeName, CREATE_OUSTRING( "Workbook_AfterSave" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO False" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnSaveAsFailed" ), rCodeName, CREATE_OUSTRING( "Workbook_AfterSave" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO False" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnPrint" ), rCodeName, CREATE_OUSTRING( "Workbook_BeforePrint" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO False" ) ); - attachMacroToDocumentEvent( CREATE_OUSTRING( "OnPrepareUnload" ), rCodeName, CREATE_OUSTRING( "Workbook_BeforeClose" ), OUString(), OUString(), CREATE_OUSTRING( "\t$MACRO False" ) ); -} - -void VbaProject::attachToSheetEvents( const Reference< XEventsSupplier >& rxEventsSupp, const OUString& rCodeName ) -{ - if( !rxEventsSupp.is() || (rCodeName.getLength() == 0) || !hasModule( rCodeName ) ) - return; - - // attach macros to simple sheet events directly - attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnFocus" ), rCodeName, CREATE_OUSTRING( "Worksheet_Activate" ) ); - attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnUnfocus" ), rCodeName, CREATE_OUSTRING( "Worksheet_Deactivate" ) ); - attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnCalculate" ), rCodeName, CREATE_OUSTRING( "Worksheet_Calculate" ) ); - - /* Attach macros to complex sheet events. The events pass a cell range or - a collection of cell ranges depending on the event type and sheet - selection. The generated proxy macros need to convert these UNO renges - to VBA compatible ranges. - */ - -#define VBA_MACRONAME_RANGECONV "Local_GetVbaRangeFromUnoRange" -#define VBA_MACRONAME_TARGETCONV "Local_GetVbaTargetFromUnoTarget" - - /* If this variable turns to true, the macros that convert UNO cell ranges - to VBA Range objects have to be inserted. - */ - bool bNeedsTargetHelper = false; - - /* Insert the proxy macros attached to sheet events that notify something - has changed (changed selection and changed cell contents). These events - cannot be cancelled. The proxy macro converts the passed UNO cell range - or collection of cell ranges to a VBA Range object, and calls the VBA - event handler. - */ - OUString aChangeProxyArgs = CREATE_OUSTRING( "ByVal unoTarget As Object" ); - OUString aChangeProxyCode = CREATE_OUSTRING( - "\tDim vbaTarget As Range : Set vbaTarget = " VBA_MACRONAME_TARGETCONV "( unoTarget )\n" - "\tIf Not vbaTarget Is Nothing Then $MACRO vbaTarget" ); - bNeedsTargetHelper |= attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnChange" ), rCodeName, CREATE_OUSTRING( "Worksheet_Change" ), aChangeProxyArgs, OUString(), aChangeProxyCode ); - bNeedsTargetHelper |= attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnSelect" ), rCodeName, CREATE_OUSTRING( "Worksheet_SelectionChange" ), aChangeProxyArgs, OUString(), aChangeProxyCode ); - - /* Insert the proxy macros attached to sheet events that notify an ongoing - mouse click event (double click and right click). These events can be - cancelled by returning false (in VBA: as a Boolean output parameter, in - UNO: as return value of the Basic function). The proxy macro converts - the passed UNO cell range or collection of cell ranges to a VBA Range - object, calls the VBA event handler, and returns the Boolean value - provided by the VBA event handler. - */ - OUString aClickProxyArgs = CREATE_OUSTRING( "ByVal unoTarget As Object" ); - OUString aClickProxyRetT = CREATE_OUSTRING( "Boolean" ); - OUString aClickProxyCode = CREATE_OUSTRING( - "\tDim Cancel As Boolean : Cancel = False\n" - "\tDim vbaTarget As Range : Set vbaTarget = " VBA_MACRONAME_TARGETCONV "( unoTarget )\n" - "\tIf Not vbaTarget Is Nothing Then $MACRO vbaTarget, Cancel\n" - "\t$PROXY = Cancel" ); - bNeedsTargetHelper |= attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnDoubleClick" ), rCodeName, CREATE_OUSTRING( "Worksheet_BeforeDoubleClick" ), aClickProxyArgs, aClickProxyRetT, aClickProxyCode ); - bNeedsTargetHelper |= attachMacroToEvent( rxEventsSupp, CREATE_OUSTRING( "OnRightClick" ), rCodeName, CREATE_OUSTRING( "Worksheet_BeforeRightClick" ), aClickProxyArgs, aClickProxyRetT, aClickProxyCode ); - - if( bNeedsTargetHelper ) - { - /* Generate a helper function that converts a - com.sun.star.sheet.SheetCellRange object to a VBA Range object. - */ - OUString aRangeConvName = CREATE_OUSTRING( VBA_MACRONAME_RANGECONV ); - OUString aRangeConvArgs = CREATE_OUSTRING( "ByVal unoRange As com.sun.star.sheet.SheetCellRange" ); - OUString aRangeConvRetT = CREATE_OUSTRING( "Range" ); - OUString aRangeConvCode = CREATE_OUSTRING( - "\tDim unoAddress As com.sun.star.table.CellRangeAddress : Set unoAddress = unoRange.RangeAddress\n" - "\tDim vbaSheet As Worksheet : Set vbaSheet = Application.ThisWorkbook.Sheets( unoAddress.Sheet + 1 )\n" - "\tSet $MACRO = vbaSheet.Range( vbaSheet.Cells( unoAddress.StartRow + 1, unoAddress.StartColumn + 1 ), vbaSheet.Cells( unoAddress.EndRow + 1, unoAddress.EndColumn + 1 ) )" ); - insertMacro( rCodeName, aRangeConvName, aRangeConvArgs, aRangeConvRetT, aRangeConvCode ); - - /* Generate a helper function that converts a generic range selection - object (com.sun.star.sheet.SheetCellRange or - com.sun.star.sheet.SheetCellRanges) to a VBA Range object. - */ - OUString aTargetConvName = CREATE_OUSTRING( VBA_MACRONAME_TARGETCONV ); - OUString aTargetConvArgs = CREATE_OUSTRING( "ByVal unoTarget As Object" ); - OUString aTargetConvRetT = CREATE_OUSTRING( "Range" ); - OUString aTargetConvCode = CREATE_OUSTRING( - "\tDim vbaTarget As Range\n" - "\tIf unoTarget.supportsService( \"com.sun.star.sheet.SheetCellRange\" ) Then\n" - "\t\tSet vbaTarget = " VBA_MACRONAME_RANGECONV "( unoTarget )\n" - "\tElseIf unoTarget.supportsService( \"com.sun.star.sheet.SheetCellRanges\" ) Then\n" - "\t\tDim unoRangeEnum As Object : Set unoRangeEnum = unoTarget.createEnumeration\n" - "\t\tIf unoRangeEnum.hasMoreElements Then Set vbaTarget = " VBA_MACRONAME_RANGECONV "( unoRangeEnum.nextElement )\n" - "\t\tWhile unoRangeEnum.hasMoreElements\n" - "\t\t\tSet vbaTarget = Application.Union( vbaTarget, " VBA_MACRONAME_RANGECONV "( unoRangeEnum.nextElement ) )\n" - "\t\tWend\n" - "\tEnd If\n" - "\tSet $MACRO = vbaTarget" ); - insertMacro( rCodeName, aTargetConvName, aTargetConvArgs, aTargetConvRetT, aTargetConvCode ); - } -#undef VBA_MACRONAME_RANGECONV -#undef VBA_MACRONAME_TARGETCONV -} - -// ============================================================================ - -} // namespace xls -} // namespace oox diff --git a/oox/source/xls/externallinkfragment.cxx b/oox/source/xls/externallinkfragment.cxx index 15aaf8bc5412..e1bff95ff724 100644 --- a/oox/source/xls/externallinkfragment.cxx +++ b/oox/source/xls/externallinkfragment.cxx @@ -255,7 +255,7 @@ ContextHandlerRef OoxExternalLinkFragment::onCreateContext( sal_Int32 nElement, if( nElement == XLS_TOKEN( oleItem ) ) mxExtName = mrExtLink.importOleItem( rAttribs ); break; } - return false; + return 0; } void OoxExternalLinkFragment::onEndElement( const OUString& rChars ) diff --git a/oox/source/xls/makefile.mk b/oox/source/xls/makefile.mk index b5ede953bbfe..cdb2e18c262d 100644 --- a/oox/source/xls/makefile.mk +++ b/oox/source/xls/makefile.mk @@ -59,7 +59,6 @@ SLOFILES = \ $(SLO)$/excelchartconverter.obj \ $(SLO)$/excelfilter.obj \ $(SLO)$/excelhandlers.obj \ - $(SLO)$/excelvbaproject.obj \ $(SLO)$/externallinkbuffer.obj \ $(SLO)$/externallinkfragment.obj \ $(SLO)$/formulabase.obj \ diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx index afeed95accca..5684fbd8ae75 100644 --- a/oox/source/xls/workbookhelper.cxx +++ b/oox/source/xls/workbookhelper.cxx @@ -43,6 +43,7 @@ #include "properties.hxx" #include "oox/helper/progressbar.hxx" #include "oox/helper/propertyset.hxx" +#include "oox/ole/vbaproject.hxx" #include "oox/drawingml/theme.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/biffinputstream.hxx" @@ -50,7 +51,6 @@ #include "oox/xls/defnamesbuffer.hxx" #include "oox/xls/excelchartconverter.hxx" #include "oox/xls/excelfilter.hxx" -#include "oox/xls/excelvbaproject.hxx" #include "oox/xls/externallinkbuffer.hxx" #include "oox/xls/formulaparser.hxx" #include "oox/xls/pagesettings.hxx" @@ -687,14 +687,12 @@ void WorkbookHelper::finalizeWorkbookImport() aDefPageStyle.setProperty< sal_Int16 >( PROP_FirstPageNumber, 0 ); /* Import the VBA project (after finalizing workbook settings which - contains the workbook code name), and attach VBA macros to document and - sheet events. */ + contains the workbook code name). */ StorageRef xVbaPrjStrg = mrBookData.getVbaProjectStorage(); if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() ) { - VbaProject aVbaProject( getGlobalFactory(), getDocument() ); + ::oox::ole::VbaProject aVbaProject( getGlobalFactory(), getBaseFilter().getModel(), CREATE_OUSTRING( "Calc" ) ); aVbaProject.importVbaProject( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() ); - aVbaProject.attachToEvents(); } } diff --git a/oox/util/makefile.mk b/oox/util/makefile.mk index 8bbf8a3650f2..329ced792164 100644 --- a/oox/util/makefile.mk +++ b/oox/util/makefile.mk @@ -94,3 +94,11 @@ DEFLIB1NAME =$(TARGET) .ENDIF # L10N_framework .INCLUDE : target.mk + +ALLTAR : $(MISC)/oox.component + +$(MISC)/oox.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + oox.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt oox.component diff --git a/oox/util/oox.component b/oox/util/oox.component new file mode 100644 index 000000000000..686ee6f1728e --- /dev/null +++ b/oox/util/oox.component @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.Impress.oox.PowerPointImport"> + <service name="com.sun.star.comp.ooxpptx"/> + </implementation> + <implementation name="com.sun.star.comp.oox.BiffDetector"> + <service name="com.sun.star.frame.ExtendedTypeDetection"/> + </implementation> + <implementation name="com.sun.star.comp.oox.ExcelBiffFilter"> + <service name="com.sun.star.comp.oox.ExcelBiffFilter"/> + </implementation> + <implementation name="com.sun.star.comp.oox.ExcelFilter"> + <service name="com.sun.star.comp.oox.ExcelFilter"/> + </implementation> + <implementation name="com.sun.star.comp.oox.FastTokenHandlerService"> + <service name="com.sun.star.xml.sax.FastTokenHandler"/> + </implementation> + <implementation name="com.sun.star.comp.oox.FormatDetector"> + <service name="com.sun.star.frame.ExtendedTypeDetection"/> + </implementation> + <implementation name="com.sun.star.comp.oox.OOXMLFormulaParser"> + <service name="com.sun.star.sheet.FilterFormulaParser"/> + </implementation> + <implementation name="com.sun.star.comp.oox.ShapeContextHandler"> + <service name="com.sun.star.xml.sax.FastShapeContextHandler"/> + </implementation> + <implementation name="com.sun.star.comp.oox.docprop.OOXMLDocumentPropertiesImporter"> + <service name="com.sun.star.document.OOXMLDocumentPropertiesImporter"/> + </implementation> +</component> diff --git a/unoxml/prj/build.lst b/unoxml/prj/build.lst index cc54f6d3ad28..1a6b330c2c6b 100644 --- a/unoxml/prj/build.lst +++ b/unoxml/prj/build.lst @@ -4,3 +4,5 @@ ux unoxml\source\xpath nmake - all ux_xpath ux_dom NULL ux unoxml\source\events nmake - all ux_events ux_dom NULL ux unoxml\source\service nmake - all ux_service ux_dom ux_xpath ux_events NULL ux unoxml\source\rdf nmake - all ux_librdf NULL + +ux unoxml\qa\complex\unoxml nmake - all ux_complex ux_librdf NULL diff --git a/unoxml/prj/d.lst b/unoxml/prj/d.lst index e2bf5df03b34..4fcedbdba7a2 100644 --- a/unoxml/prj/d.lst +++ b/unoxml/prj/d.lst @@ -1,3 +1,5 @@ ..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%\lib*.so ..\%__SRC%\lib\lib*.dylib %_DEST%\lib%_EXT%\lib*.dylib ..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll +..\%__SRC%\misc\unordf.component %_DEST%\xml%_EXT%\unordf.component +..\%__SRC%\misc\unoxml.component %_DEST%\xml%_EXT%\unoxml.component diff --git a/unoxml/qa/complex/tests.sce b/unoxml/qa/complex/tests.sce deleted file mode 100644 index 20596551f156..000000000000 --- a/unoxml/qa/complex/tests.sce +++ /dev/null @@ -1 +0,0 @@ --o complex.unoxml.RDFRepositoryTest diff --git a/unoxml/qa/complex/RDFRepositoryTest.java b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java index f3f9cbd8ae41..d047ef77440e 100644 --- a/unoxml/qa/complex/RDFRepositoryTest.java +++ b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java @@ -27,21 +27,16 @@ package complex.unoxml; -import complexlib.ComplexTestCase; import helper.StreamSimulator; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; -import com.sun.star.uno.Any; import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.lang.XInitialization; -import com.sun.star.lang.XEventListener; import com.sun.star.lang.XServiceInfo; import com.sun.star.lang.IllegalArgumentException; import com.sun.star.lang.WrappedTargetException; import com.sun.star.lang.WrappedTargetRuntimeException; import com.sun.star.beans.XPropertySet; -import com.sun.star.beans.PropertyValue; import com.sun.star.beans.Pair; import com.sun.star.beans.StringPair; import com.sun.star.container.XEnumeration; @@ -52,6 +47,15 @@ import com.sun.star.io.XOutputStream; import com.sun.star.text.XTextRange; import com.sun.star.text.XText; import com.sun.star.rdf.*; +import lib.TestParameters; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; /** * Test case for service com.sun.star.rdf.Repository @@ -60,7 +64,7 @@ import com.sun.star.rdf.*; * * @author mst */ -public class RDFRepositoryTest extends ComplexTestCase +public class RDFRepositoryTest { XComponentContext xContext; String tempDir; @@ -80,112 +84,113 @@ public class RDFRepositoryTest extends ComplexTestCase XLiteral littype; String rdfs = "http://www.w3.org/2000/01/rdf-schema#"; - public String[] getTestMethodNames () - { - return new String[] { "check", "checkSPARQL", "checkRDFa" }; - } + /** + * The test parameters + */ + private static TestParameters param = null; + +// public String[] getTestMethodNames () +// { +// return new String[] { "check", "checkSPARQL", "checkRDFa" }; +// } - public void before() + @Before public void before() { try { - XMultiServiceFactory xMSF = (XMultiServiceFactory) param.getMSF(); - assure("could not create MultiServiceFactory.", xMSF != null); - XPropertySet xPropertySet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xMSF); + XMultiServiceFactory xMSF = getMSF(); + param = new TestParameters(); + param.put("ServiceFactory", xMSF); + + assertNotNull("could not create MultiServiceFactory.", xMSF); + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xMSF); Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext"); - xContext = (XComponentContext) - UnoRuntime.queryInterface(XComponentContext.class, defaultCtx); - assure("could not get component context.", xContext != null); + xContext = UnoRuntime.queryInterface(XComponentContext.class, defaultCtx); + assertNotNull("could not get component context.", xContext); tempDir = util.utils.getOfficeTemp/*Dir*/(xMSF); - log.println("tempdir: " + tempDir); + System.out.println("tempdir: " + tempDir); foo = URI.create(xContext, "uri:foo"); - assure("foo", null != foo); + assertNotNull("foo", foo); bar = URI.create(xContext, "uri:bar"); - assure("bar", null != bar); + assertNotNull("bar", bar); baz = URI.create(xContext, "uri:baz"); - assure("baz", null != baz); + assertNotNull("baz", baz); uint = URI.create(xContext, "uri:int"); - assure("uint", null != uint); + assertNotNull("uint", uint); blank = BlankNode.create(xContext, "_:uno"); - assure("blank", null != blank); + assertNotNull("blank", blank); lit = Literal.create(xContext, "i am the literal"); - assure("lit", null != lit); + assertNotNull("lit", lit); litlang = Literal.createWithLanguage(xContext, "i am the literal", "en"); - assure("litlang", null != litlang); + assertNotNull("litlang", litlang); littype = Literal.createWithType(xContext, "42", uint); - assure("littype", null != littype); + assertNotNull("littype", littype); rdfslabel = URI.create(xContext, rdfs + "label"); - assure("rdfslabel", null != rdfslabel); + assertNotNull("rdfslabel", rdfslabel); manifest = URI.create(xContext, "manifest:manifest"); //FIXME - assure("manifest", null != manifest); + assertNotNull("manifest", manifest); uuid = URI.create(xContext, "urn:uuid:224ab023-77b8-4396-a75a-8cecd85b81e3"); - assure("uuid", null != uuid); + assertNotNull("uuid", uuid); base = URI.create(xContext, "base-uri:"); //FIXME - assure("base", null != base); + assertNotNull("base", base); } catch (Exception e) { report(e); } + //FIXME: ? +// xRep = Repository.create(xContext); + System.out.println("Creating service Repository..."); + xRep = UnoRuntime.queryInterface(XDocumentRepository.class, Repository.create(xContext)); + assertNotNull("null", xRep); + System.out.println("...done"); } - public void after() + @After public void after() { xRep = null; } - public void check() + @Test public void check() { try { - - log.println("Creating service Repository..."); - - //FIXME: ? -// xRep = Repository.create(xContext); - xRep = (XDocumentRepository) UnoRuntime.queryInterface( - XDocumentRepository.class, Repository.create(xContext)); - assure("null", null != xRep); - - log.println("...done"); - - log.println("Checking that new repository is really empty..."); - assure("empty: graphs", 0 == xRep.getGraphNames().length); + System.out.println("Checking that new repository is really empty..."); + assertTrue("empty: graphs", 0 == xRep.getGraphNames().length); XEnumeration stmts; stmts = xRep.getStatements(null, null, null); - assure("empty: stmts", !stmts.hasMoreElements()); + assertTrue("empty: stmts", !stmts.hasMoreElements()); - log.println("...done"); + System.out.println("...done"); - log.println("Checking graph creation..."); + System.out.println("Checking graph creation..."); XNamedGraph xFooGraph = xRep.createGraph(foo); - assure("foo graph", null != xFooGraph); + assertNotNull("foo graph", xFooGraph); try { xRep.createGraph(foo); - assure("creating duplicate graph was allowed", false); + assertFalse("creating duplicate graph was allowed", false); } catch (ElementExistException e) { // ignore } try { xRep.createGraph(null); - assure("invalid graph name was allowed", false); + assertFalse("invalid graph name was allowed", false); } catch (IllegalArgumentException e) { // ignore } XURI[] names = xRep.getGraphNames(); - assure("no foo graph in getGraphNames", + assertTrue("no foo graph in getGraphNames", 1 == names.length && eq(names[0], foo)); - assure("no foo graph", null != xRep.getGraph(foo)); + assertNotNull("no foo graph", xRep.getGraph(foo)); stmts = xFooGraph.getStatements(null, null, null); - assure("stmts in foo graph", !stmts.hasMoreElements()); + assertTrue("stmts in foo graph", !stmts.hasMoreElements()); XOutputStream xFooOut = new StreamSimulator(tempDir + "empty.rdf", false, param); @@ -195,94 +200,94 @@ public class RDFRepositoryTest extends ComplexTestCase XInputStream xFooIn = new StreamSimulator(tempDir + "empty.rdf", true, param); xRep.importGraph(FileFormat.RDF_XML, xFooIn, bar, base); - assure("no bar graph", null != xRep.getGraph(bar)); + assertNotNull("no bar graph", xRep.getGraph(bar)); - log.println("...done"); + System.out.println("...done"); - log.println("Checking graph manipulation..."); + System.out.println("Checking graph manipulation..."); XEnumeration xFooEnum; Statement xFoo_FooBarBaz = new Statement(foo, bar, baz, foo); xFooGraph.addStatement(foo, bar, baz); xFooEnum = xFooGraph.getStatements(null, null, null); - assure("addStatement(foo,bar,baz)", + assertTrue("addStatement(foo,bar,baz)", eq(xFooEnum, new Statement[] { xFoo_FooBarBaz })); Statement xFoo_FooBarBlank = new Statement(foo, bar, blank, foo); xFooGraph.addStatement(foo, bar, blank); xFooEnum = xFooGraph.getStatements(null, null, null); - assure("addStatement(foo,bar,blank)", + assertTrue("addStatement(foo,bar,blank)", eq(xFooEnum, new Statement[] { xFoo_FooBarBaz, xFoo_FooBarBlank })); xFooEnum = xRep.getStatements(null, null, null); - assure("addStatement(foo,bar,blank) (global)", + assertTrue("addStatement(foo,bar,blank) (global)", eq(xFooEnum, new Statement[] { xFoo_FooBarBaz, xFoo_FooBarBlank })); Statement xFoo_BazBarLit = new Statement(baz, bar, lit, foo); xFooGraph.addStatement(baz, bar, lit); xFooEnum = xFooGraph.getStatements(null, null, null); - assure("addStatement(baz,bar,lit)", + assertTrue("addStatement(baz,bar,lit)", eq(xFooEnum, new Statement[] { xFoo_FooBarBaz, xFoo_FooBarBlank, xFoo_BazBarLit })); xFooEnum = xFooGraph.getStatements(baz, bar, null); - assure("addStatement(baz,bar,lit) (baz,bar)", + assertTrue("addStatement(baz,bar,lit) (baz,bar)", eq(xFooEnum, new Statement[] { xFoo_BazBarLit })); Statement xFoo_BazBarLitlang = new Statement(baz, bar, litlang, foo); xFooGraph.addStatement(baz, bar, litlang); xFooEnum = xFooGraph.getStatements(null, null, null); - assure("addStatement(baz,bar,litlang)", + assertTrue("addStatement(baz,bar,litlang)", eq(xFooEnum, new Statement[] { xFoo_FooBarBaz, xFoo_FooBarBlank, xFoo_BazBarLit, xFoo_BazBarLitlang })); xFooEnum = xFooGraph.getStatements(null, null, baz); - assure("addStatement(baz,bar,litlang) (baz)", + assertTrue("addStatement(baz,bar,litlang) (baz)", eq(xFooEnum, new Statement[] { xFoo_FooBarBaz })); Statement xFoo_BazBarLittype = new Statement(baz, bar, littype, foo); xFooGraph.addStatement(baz, bar, littype); xFooEnum = xFooGraph.getStatements(null, null, null); - assure("addStatement(baz,bar,littype)", + assertTrue("addStatement(baz,bar,littype)", eq(xFooEnum, new Statement[] { xFoo_FooBarBaz, xFoo_FooBarBlank, xFoo_BazBarLit, xFoo_BazBarLitlang, xFoo_BazBarLittype })); xFooGraph.removeStatements(baz, bar, litlang); xFooEnum = xFooGraph.getStatements(null, null, null); - assure("removeStatement(baz,bar,litlang)", + assertTrue("removeStatement(baz,bar,litlang)", eq(xFooEnum, new Statement[] { xFoo_FooBarBaz, xFoo_FooBarBlank, xFoo_BazBarLit, xFoo_BazBarLittype })); xFooGraph.removeStatements(foo, bar, null); xFooEnum = xFooGraph.getStatements(null, null, null); - assure("removeStatement(foo,bar,null)", + assertTrue("removeStatement(foo,bar,null)", eq(xFooEnum, new Statement[] { xFoo_BazBarLit, xFoo_BazBarLittype })); xFooGraph.addStatement(foo, bar, baz); xFooEnum = xFooGraph.getStatements(null, null, null); - assure("addStatement(foo,bar,baz) (re-add)", + assertTrue("addStatement(foo,bar,baz) (re-add)", eq(xFooEnum, new Statement[] { xFoo_FooBarBaz, xFoo_BazBarLit, xFoo_BazBarLittype })); xFooGraph.addStatement(foo, bar, baz); xFooEnum = xFooGraph.getStatements(null, null, null); - assure("addStatement(foo,bar,baz) (duplicate)", + assertTrue("addStatement(foo,bar,baz) (duplicate)", eq(xFooEnum, new Statement[] { xFoo_FooBarBaz, xFoo_BazBarLit, xFoo_BazBarLittype })); xFooGraph.addStatement(xFooGraph, bar, baz); xFooEnum = xFooGraph.getStatements(null, null, null); - assure("addStatement(foo,bar,baz) (triplicate, as graph)", + assertTrue("addStatement(foo,bar,baz) (triplicate, as graph)", eq(xFooEnum, new Statement[] { xFoo_FooBarBaz, xFoo_BazBarLit, xFoo_BazBarLittype })); - log.println("...done"); + System.out.println("...done"); - log.println("Checking graph import/export..."); + System.out.println("Checking graph import/export..."); xFooOut = new StreamSimulator(tempDir + "foo.rdf", false, param); xRep.exportGraph(FileFormat.RDF_XML, xFooOut, foo, base); @@ -291,7 +296,7 @@ public class RDFRepositoryTest extends ComplexTestCase xFooIn = new StreamSimulator(tempDir + "foo.rdf", true, param); try { xRep.importGraph(FileFormat.RDF_XML, xFooIn, bar, base); - assure("importing existing graph did not fail", false); + assertFalse("importing existing graph did not fail", false); } catch (ElementExistException e) { // ignore } @@ -299,77 +304,77 @@ public class RDFRepositoryTest extends ComplexTestCase xFooIn = new StreamSimulator(tempDir + "foo.rdf", true, param); xRep.importGraph(FileFormat.RDF_XML, xFooIn, baz, base); XNamedGraph xBazGraph = xRep.getGraph(baz); - assure("no baz graph", null != xBazGraph); + assertNotNull("no baz graph", xBazGraph); Statement xBaz_FooBarBaz = new Statement(foo, bar, baz, baz); Statement xBaz_BazBarLit = new Statement(baz, bar, lit, baz); Statement xBaz_BazBarLittype = new Statement(baz, bar, littype, baz); XEnumeration xBazEnum = xBazGraph.getStatements(null, null, null); - assure("importing exported graph", + assertTrue("importing exported graph", eq(xBazEnum, new Statement[] { xBaz_FooBarBaz, xBaz_BazBarLit, xBaz_BazBarLittype })); - log.println("...done"); + System.out.println("...done"); - log.println("Checking graph deletion..."); + System.out.println("Checking graph deletion..."); xFooGraph.clear(); xFooEnum = xFooGraph.getStatements(null, null, null); - assure("clear", eq(xFooEnum, new Statement[] { })); + assertTrue("clear", eq(xFooEnum, new Statement[] { })); xRep.destroyGraph(baz); - assure("baz graph zombie", null == xRep.getGraph(baz)); + assertNull("baz graph zombie", xRep.getGraph(baz)); try { xBazGraph.clear(); - assure("deleted graph not invalid (clear)", false); + assertFalse("deleted graph not invalid (clear)", false); } catch (NoSuchElementException e) { // ignore } try { xBazGraph.addStatement(foo, foo, foo); - assure("deleted graph not invalid (add)", false); + assertFalse("deleted graph not invalid (add)", false); } catch (NoSuchElementException e) { // ignore } try { xBazGraph.removeStatements(null, null, null); - assure("deleted graph not invalid (remove)", false); + assertFalse("deleted graph not invalid (remove)", false); } catch (NoSuchElementException e) { // ignore } try { xBazGraph.getStatements(null, null, null); - assure("deleted graph not invalid (get)", false); + assertFalse("deleted graph not invalid (get)", false); } catch (NoSuchElementException e) { // ignore } - log.println("...done"); + System.out.println("...done"); } catch (Exception e) { report(e); } } - public void checkSPARQL() + @Test public void checkSPARQL() { try { - log.println("Checking SPARQL queries..."); + System.out.println("Checking SPARQL queries..."); - XInputStream xIn = new StreamSimulator( - util.utils.getFullTestDocName("example.rdf"), true, param); + XInputStream xIn = new StreamSimulator(TestDocument.getUrl("example.rdf"), true, param); + // util.utils.getFullTestDocName("example.rdf"), true, param); xRep.importGraph(FileFormat.RDF_XML, xIn, manifest, base); String query; query = "SELECT ?p WHERE { ?p rdf:type pkg:Package . }"; XQuerySelectResult result = xRep.querySelect(mkNss() + query); - assure("query: package-id\n" + query, + assertTrue("query: package-id\n" + query, eq(result, new String[] { "p" }, new XNode[][] { { uuid } })); @@ -377,7 +382,7 @@ public class RDFRepositoryTest extends ComplexTestCase "> WHERE { ?pkg rdf:type pkg:Package . ?pkg pkg:hasPart ?part ." + " ?part pkg:path ?path . ?part rdf:type odf:ContentFile. }"; result = xRep.querySelect(mkNss() + query); - assure("query: contentfile", + assertTrue("query: contentfile", eq(result, new String[] { "part", "path" }, new XNode[][] { { BlankNode.create(xContext, "whatever"), Literal.create(xContext, "content.xml") } })); @@ -386,7 +391,7 @@ public class RDFRepositoryTest extends ComplexTestCase + "?pkg rdf:type pkg:Package . ?pkg pkg:hasPart ?part . " + "?part pkg:path ?path . ?part rdf:type odf:ContentFile. }"; result = xRep.querySelect(mkNss() + query); - assure("query: contentfile\n" + query, + assertTrue("query: contentfile\n" + query, eq(result, new String[] { "pkg", "path" }, new XNode[][] { { uuid , Literal.create(xContext, "content.xml") } })); @@ -395,7 +400,7 @@ public class RDFRepositoryTest extends ComplexTestCase + "?pkg rdf:type pkg:Package . ?pkg pkg:hasPart ?part . " + "?part pkg:path ?path . ?part rdf:type odf:StylesFile. }"; result = xRep.querySelect(mkNss() + query); - assure("query: stylesfile\n" + query, + assertTrue("query: stylesfile\n" + query, eq(result, new String[] { "part", "path" }, new XNode[][] { })); @@ -403,7 +408,7 @@ public class RDFRepositoryTest extends ComplexTestCase + "?pkg rdf:type pkg:Package . ?pkg pkg:hasPart ?part . " + "?part pkg:path ?path . ?part rdf:type odf:MetadataFile. }"; result = xRep.querySelect(mkNss() + query); - assure("query: metadatafile\n" + query, + assertTrue("query: metadatafile\n" + query, eq(result, new String[] { "part", "path" }, new XNode[][] { { URI.create(xContext, "http://hospital-employee/doctor"), @@ -424,9 +429,9 @@ public class RDFRepositoryTest extends ComplexTestCase + " pkg:idref ?idref . " + " FILTER (?type = odf:ContentFile || ?type = odf:StylesFile)" + " }"; -//log.println(query); +//System.out.println(query); result = xRep.querySelect(mkNss() + query); - assure("query: example-element-2\n" + query, + assertTrue("query: example-element-2\n" + query, eq(result, new String[] { "path", "idref" }, new XNode[][] { { Literal.create(xContext, "content.xml"), @@ -438,24 +443,24 @@ public class RDFRepositoryTest extends ComplexTestCase lit.getStringValue() + "\" } FROM <" + toS(manifest) + "> WHERE { ?pkg rdf:type pkg:Package . } "; XEnumeration xResultEnum = xRep.queryConstruct(mkNss() + query); - assure("query: construct\n" + query, + assertTrue("query: construct\n" + query, eq(xResultEnum, new Statement[] { x_PkgFooLit })); query = "ASK { ?pkg rdf:type pkg:Package . }"; boolean bResult = xRep.queryAsk(mkNss() + query); - assure("query: ask\n" + query, bResult); + assertTrue("query: ask\n" + query, bResult); - log.println("...done"); + System.out.println("...done"); } catch (Exception e) { report(e); } } - public void checkRDFa() + @Test public void checkRDFa() { try { - log.println("Checking RDFa gunk..."); + System.out.println("Checking RDFa gunk..."); String content = "behold, for i am the content."; XTextRange xTR = new TestRange(content); @@ -463,19 +468,19 @@ public class RDFRepositoryTest extends ComplexTestCase Pair<Statement[], Boolean> result = xRep.getStatementRDFa((XMetadatable)xTR); - assure("RDFa: get: not empty (initial)", + assertTrue("RDFa: get: not empty (initial)", 0 == result.First.length); try { xRep.setStatementRDFa(foo, new XURI[] {}, xM, "", null); - assure("RDFa: set: no predicate", false); + assertFalse("RDFa: set: no predicate", false); } catch (IllegalArgumentException e) { // ignore } try { xRep.setStatementRDFa(foo, new XURI[] {bar}, null, "", null); - assure("RDFa: set: null", false); + assertFalse("RDFa: set: null", false); } catch (IllegalArgumentException e) { // ignore } @@ -485,16 +490,16 @@ public class RDFRepositoryTest extends ComplexTestCase xRep.setStatementRDFa(foo, new XURI[] { bar }, xM, "", null); result = xRep.getStatementRDFa((XMetadatable)xTR); - assure("RDFa: get: without content", + assertTrue("RDFa: get: without content", !result.Second && (1 == result.First.length) - && eq((Statement)result.First[0], x_FooBarTRLit)); + && eq(result.First[0], x_FooBarTRLit)); //FIXME: do this? xTR.setString(lit.getStringValue()); /* Statement xFooBarLit = new Statement(foo, bar, lit, null); result = xRep.getStatementRDFa((XMetadatable)xTR); - assure("RDFa: get: change", + assertTrue("RDFa: get: change", eq((Statement)result.First, xFooBarLit) && null == result.Second); */ @@ -502,17 +507,17 @@ public class RDFRepositoryTest extends ComplexTestCase xRep.setStatementRDFa(foo, new XURI[] { bar }, xM, "42", uint); result = xRep.getStatementRDFa((XMetadatable)xTR); - assure("RDFa: get: with content", + assertTrue("RDFa: get: with content", result.Second && (1 == result.First.length) && - eq((Statement)result.First[0], x_FooBarLittype)); + eq(result.First[0], x_FooBarLittype)); //FIXME: do this? xTR.setString(content); /* Statement xFooLabelTRLit = new Statement(foo, rdfslabel, trlit, null); result = xRep.getStatementRDFa((XMetadatable)xTR); - assure("RDFa: get: change (label)", + assertTrue("RDFa: get: change (label)", eq((Statement)result.First, xFooBarLittype) && eq((Statement)result.Second, xFooLabelTRLit)); */ @@ -520,7 +525,7 @@ public class RDFRepositoryTest extends ComplexTestCase xRep.removeStatementRDFa((XMetadatable)xTR); result = xRep.getStatementRDFa((XMetadatable)xTR); - assure("RDFa: get: not empty (removed)", + assertTrue("RDFa: get: not empty (removed)", 0 == result.First.length); xRep.setStatementRDFa(foo, new XURI[] { foo, bar, baz }, xM, @@ -529,7 +534,7 @@ public class RDFRepositoryTest extends ComplexTestCase Statement x_FooFooTRLit = new Statement(foo, foo, trlit, null); Statement x_FooBazTRLit = new Statement(foo, baz, trlit, null); result = xRep.getStatementRDFa((XMetadatable) xTR); - assure("RDFa: get: without content (multiple predicates, reinsert)", + assertTrue("RDFa: get: without content (multiple predicates, reinsert)", !result.Second && eq(result.First, new Statement[] { x_FooFooTRLit, x_FooBarTRLit, x_FooBazTRLit })); @@ -537,10 +542,10 @@ public class RDFRepositoryTest extends ComplexTestCase xRep.removeStatementRDFa((XMetadatable)xTR); result = xRep.getStatementRDFa((XMetadatable) xTR); - assure("RDFa: get: not empty (re-removed)", + assertTrue("RDFa: get: not empty (re-removed)", 0 == result.First.length); - log.println("...done"); + System.out.println("...done"); } catch (Exception e) { report(e); @@ -553,36 +558,38 @@ public class RDFRepositoryTest extends ComplexTestCase { if (e instanceof WrappedTargetException) { - log.println("Cause:"); + System.out.println("Cause:"); Exception cause = (Exception) (((WrappedTargetException)e).TargetException); - log.println(cause.toString()); + System.out.println(cause.toString()); report2(cause); } else if (e instanceof WrappedTargetRuntimeException) { - log.println("Cause:"); + System.out.println("Cause:"); Exception cause = (Exception) (((WrappedTargetRuntimeException)e).TargetException); - log.println(cause.toString()); + System.out.println(cause.toString()); report2(cause); } } public void report(Exception e) { - log.println("Exception occurred:"); - e.printStackTrace((java.io.PrintWriter) log); + System.out.println("Exception occurred:"); + e.printStackTrace(); report2(e); - failed(); + fail(); } public static String toS(XNode n) { - if (null == n) return "< null >"; + if (null == n) + { + return "< null >"; + } return n.getStringValue(); } static boolean isBlank(XNode i_node) { - XBlankNode blank = (XBlankNode) UnoRuntime.queryInterface( - XBlankNode.class, i_node); + XBlankNode blank = UnoRuntime.queryInterface(XBlankNode.class, i_node); return blank != null; } @@ -615,7 +622,7 @@ public class RDFRepositoryTest extends ComplexTestCase java.util.Collection c = new java.util.Vector(); while (i_Enum.hasMoreElements()) { Statement s = (Statement) i_Enum.nextElement(); -//log.println("toSeq: " + s.getSubject().getStringValue() + " " + s.getPredicate().getStringValue() + " " + s.getObject().getStringValue() + "."); +//System.out.println("toSeq: " + s.getSubject().getStringValue() + " " + s.getPredicate().getStringValue() + " " + s.getObject().getStringValue() + "."); c.add(s); } // return (Statement[]) c.toArray(); @@ -650,7 +657,10 @@ public class RDFRepositoryTest extends ComplexTestCase { XNode[] left = (XNode[]) i_Left; XNode[] right = (XNode[]) i_Right; - if (left.length != right.length) throw new RuntimeException(); + if (left.length != right.length) + { + throw new RuntimeException(); + } for (int i = 0; i < left.length; ++i) { int eq = (left[i].getStringValue().compareTo( right[i].getStringValue())); @@ -667,10 +677,22 @@ public class RDFRepositoryTest extends ComplexTestCase int eq; Statement left = (Statement) i_Left; Statement right = (Statement) i_Right; - if ((eq = cmp(left.Graph, right.Graph )) != 0) return eq; - if ((eq = cmp(left.Subject, right.Subject )) != 0) return eq; - if ((eq = cmp(left.Predicate, right.Predicate)) != 0) return eq; - if ((eq = cmp(left.Object, right.Object )) != 0) return eq; + if ((eq = cmp(left.Graph, right.Graph )) != 0) + { + return eq; + } + if ((eq = cmp(left.Subject, right.Subject )) != 0) + { + return eq; + } + if ((eq = cmp(left.Predicate, right.Predicate)) != 0) + { + return eq; + } + if ((eq = cmp(left.Object, right.Object )) != 0) + { + return eq; + } return 0; } @@ -693,23 +715,23 @@ public class RDFRepositoryTest extends ComplexTestCase XURI lG = i_Left.Graph; XURI rG = i_Right.Graph; if (!eq(lG, rG)) { - log.println("Graphs differ: " + toS(lG) + " != " + toS(rG)); + System.out.println("Graphs differ: " + toS(lG) + " != " + toS(rG)); return false; } if (!eq(i_Left.Subject, i_Right.Subject)) { - log.println("Subjects differ: " + + System.out.println("Subjects differ: " + i_Left.Subject.getStringValue() + " != " + i_Right.Subject.getStringValue()); return false; } if (!eq(i_Left.Predicate, i_Right.Predicate)) { - log.println("Predicates differ: " + + System.out.println("Predicates differ: " + i_Left.Predicate.getStringValue() + " != " + i_Right.Predicate.getStringValue()); return false; } if (!eq(i_Left.Object, i_Right.Object)) { - log.println("Objects differ: " + + System.out.println("Objects differ: " + i_Left.Object.getStringValue() + " != " + i_Right.Object.getStringValue()); return false; @@ -720,7 +742,7 @@ public class RDFRepositoryTest extends ComplexTestCase static boolean eq(Statement[] i_Result, Statement[] i_Expected) { if (i_Result.length != i_Expected.length) { - log.println("eq: different lengths: " + i_Result.length + " " + + System.out.println("eq: different lengths: " + i_Result.length + " " + i_Expected.length); return false; } @@ -729,7 +751,10 @@ public class RDFRepositoryTest extends ComplexTestCase java.util.Arrays.sort(i_Result, new StmtComp()); java.util.Arrays.sort(expected, new StmtComp()); for (int i = 0; i < expected.length; ++i) { - if (!eq(i_Result[i], expected[i])) return false; + if (!eq(i_Result[i], expected[i])) + { + return false; + } } return true; } @@ -760,11 +785,11 @@ public class RDFRepositoryTest extends ComplexTestCase XEnumeration iter = (XEnumeration) i_Result; XNode[][] bindings = toSeqs(iter); if (vars.length != i_Vars.length) { - log.println("var lengths differ"); + System.out.println("var lengths differ"); return false; } if (bindings.length != i_Bindings.length) { - log.println("binding lengths differ: " + i_Bindings.length + + System.out.println("binding lengths differ: " + i_Bindings.length + " vs " + bindings.length ); return false; } @@ -772,16 +797,16 @@ public class RDFRepositoryTest extends ComplexTestCase java.util.Arrays.sort(i_Bindings, new BindingComp()); for (int i = 0; i < i_Bindings.length; ++i) { if (i_Bindings[i].length != i_Vars.length) { - log.println("TEST ERROR!"); + System.out.println("TEST ERROR!"); throw new Exception(); } if (bindings[i].length != i_Vars.length) { - log.println("binding length and var length differ"); + System.out.println("binding length and var length differ"); return false; } for (int j = 0; j < i_Vars.length; ++j) { if (!eq(bindings[i][j], i_Bindings[i][j])) { - log.println("bindings differ: " + + System.out.println("bindings differ: " + toS(bindings[i][j]) + " != " + toS(i_Bindings[i][j])); return false; } @@ -789,7 +814,7 @@ public class RDFRepositoryTest extends ComplexTestCase } for (int i = 0; i < i_Vars.length; ++i) { if (!vars[i].equals(i_Vars[i])) { - log.println("variable names differ: " + + System.out.println("variable names differ: " + vars[i] + " != " + i_Vars[i]); return false; } @@ -828,7 +853,7 @@ public class RDFRepositoryTest extends ComplexTestCase { return new StringPair(m_Stream, m_XmlId); } public void setMetadataReference(StringPair i_Ref) throws IllegalArgumentException - { m_Stream = (String)i_Ref.First; m_XmlId = (String)i_Ref.Second; } + { m_Stream = i_Ref.First; m_XmlId = i_Ref.Second; } public void ensureMetadataReference() { m_Stream = "content.xml"; m_XmlId = "42"; } @@ -843,5 +868,26 @@ public class RDFRepositoryTest extends ComplexTestCase public String getString() { return m_Text; } public void setString(String i_Str) { m_Text = i_Str; } } + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); } diff --git a/unoxml/qa/complex/unoxml/TestDocument.java b/unoxml/qa/complex/unoxml/TestDocument.java new file mode 100644 index 000000000000..bce9510e4d94 --- /dev/null +++ b/unoxml/qa/complex/unoxml/TestDocument.java @@ -0,0 +1,39 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +package complex.unoxml; + +import java.io.File; +import org.openoffice.test.OfficeFileUrl; + +final class TestDocument { + public static String getUrl(String name) { + return OfficeFileUrl.getAbsolute(new File("testdocuments", name)); + } + + private TestDocument() {} +} diff --git a/unoxml/qa/complex/makefile.mk b/unoxml/qa/complex/unoxml/makefile.mk index c74cbcb80dcf..136d23a9a232 100644 --- a/unoxml/qa/complex/makefile.mk +++ b/unoxml/qa/complex/unoxml/makefile.mk @@ -25,35 +25,35 @@ # #***********************************************************************/ -PRJ = ..$/.. -TARGET = unoxml_test -PRJNAME = $(TARGET) -PACKAGE = complex$/unoxml +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- +PRJ = ../../.. +PRJNAME = unoxml +TARGET = qa_complex_unoxml -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = RDFRepositoryTest.java \ +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/unoxml +JAVATESTFILES = \ + RDFRepositoryTest.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +JAVAFILES = $(JAVATESTFILES) \ + TestDocument.java -#----- make a jar from compiled files ------------------------------ +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -MAXLINELENGTH = 100000 +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y +.END -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE - -# --- Targets ------------------------------------------------------ +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -.INCLUDE : target.mk +ALLTAR : javatest +.END -run: - +java -cp $(CLASSPATH) org.openoffice.Runner -TestBase java_complex -sce tests.sce -tdoc $(PWD)$/testdocuments diff --git a/unoxml/qa/complex/testdocuments/example.rdf b/unoxml/qa/complex/unoxml/testdocuments/example.rdf index 07ef7f07b6fd..07ef7f07b6fd 100644 --- a/unoxml/qa/complex/testdocuments/example.rdf +++ b/unoxml/qa/complex/unoxml/testdocuments/example.rdf diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 656aa1cbef6c..fcd43832adf0 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -53,50 +53,12 @@ namespace DOM { - void CDocument::addnode(xmlNodePtr aNode) - { - if (aNode != (xmlNodePtr)m_aDocPtr) - { - Reference< XNode >* nref = new Reference< XNode >(CNode::get(aNode)); - m_aNodeRefList.push_back(nref); - } - } - CDocument::~CDocument() { - Reference< XNode >* pRef; - nodereflist_t::const_iterator r = m_aNodeRefList.begin(); - while (r!=m_aNodeRefList.end()) - { - pRef = *r; - delete pRef; - r++; - } - - // get rid of leftover instances, if anybody still holds a - // reference to one of these, it will be invalid! - /* - CNode* aNode = 0; - nodelist_t::const_iterator i = m_aNodeList.begin(); - while (i!=m_aNodeList.end()) - { - aNode = CNode::get(*i, sal_False); - if (aNode != 0) - { - // CNode::remove(*i); - // delete will remove - delete aNode; - } - i++; - } - */ - xmlFreeDoc(m_aDocPtr); - } CDocument::CDocument(xmlDocPtr aDocPtr): - m_aNodeRefList(), m_aDocPtr(aDocPtr), m_streamListeners() { diff --git a/unoxml/source/dom/document.hxx b/unoxml/source/dom/document.hxx index b653619031a1..3fe593ff2b24 100644 --- a/unoxml/source/dom/document.hxx +++ b/unoxml/source/dom/document.hxx @@ -72,12 +72,9 @@ namespace DOM XActiveDataControl, XActiveDataSource, XSAXSerializable, XFastSAXSerializable> { friend class CNode; - typedef std::list< Reference< XNode >* > nodereflist_t; typedef set< Reference< XStreamListener > > listenerlist_t; private: - nodereflist_t m_aNodeRefList; - xmlDocPtr m_aDocPtr; // datacontrol/source state @@ -87,8 +84,6 @@ namespace DOM protected: CDocument(xmlDocPtr aDocPtr); - void addnode(xmlNodePtr aNode); - public: virtual ~CDocument(); diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index 2a03896502a9..d4b317b425b3 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -43,13 +43,19 @@ #include "attr.hxx" #include <com/sun/star/xml/sax/FastToken.hpp> - +#include "rtl/instance.hxx" +#include "osl/mutex.hxx" #include "../events/eventdispatcher.hxx" #include "../events/mutationevent.hxx" #include <boost/bind.hpp> #include <algorithm> +namespace { +//see CNode::remove + struct NodeMutex: public ::rtl::Static<osl::Mutex, NodeMutex> {}; +} + namespace DOM { void pushContext(Context& io_rContext) @@ -131,6 +137,18 @@ namespace DOM void CNode::remove(const xmlNodePtr aNode) { + //Using the guard here protects against races when at the same time + //CNode::get() is called. This fix helps in many cases but is still + //incorrect. remove is called from ~CNode. That is, while the object + //is being destructed it can still be obtained by calling CNode::get(). + //Another bug currently prevents the correct destruction of CNodes. So + //the destructor is rarely called. + // + //Doing this right would probably mean to store WeakReferences in the + //map and also guard oder functions. To keep the risk at a minimum + //we keep this imperfect fix for the upcoming release and fix it later + //properly (http://qa.openoffice.org/issues/show_bug.cgi?id=113682) + ::osl::MutexGuard guard(NodeMutex::get()); nodemap_t::iterator i = CNode::theNodeMap.find(aNode); if (i != CNode::theNodeMap.end()) { @@ -145,7 +163,8 @@ namespace DOM CNode* pNode = 0; if (aNode == NULL) return 0; - + //see CNode::remove + ::osl::MutexGuard guard(NodeMutex::get()); //check whether there is already an instance for this node nodemap_t::const_iterator i = CNode::theNodeMap.find(aNode); if (i != CNode::theNodeMap.end()) @@ -209,7 +228,7 @@ namespace DOM // m_aNodeType = NodeType::NOTATION_NODE; pNode = static_cast< CNode* >(new CAttr((xmlAttrPtr)aNode)); break; - // unsopported node types + // unsupported node types case XML_HTML_DOCUMENT_NODE: case XML_ELEMENT_DECL: case XML_ATTRIBUTE_DECL: @@ -219,18 +238,10 @@ namespace DOM pNode = 0; break; } - } - if ( pNode != 0 ) - { - if(CNode::theNodeMap.insert(nodemap_t::value_type(aNode, pNode)).second) + + if ( pNode != 0 ) { - // insertion done, register node with document - xmlDocPtr doc = aNode->doc; - if( doc != NULL) - { - CDocument* pDoc = static_cast< CDocument* >(CNode::get((xmlNodePtr)doc)); - pDoc->addnode(aNode); - } else + if(!CNode::theNodeMap.insert(nodemap_t::value_type(aNode, pNode)).second) { // if insertion failed, delete the new instance and return null delete pNode; diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index a7e50e7e232d..83de4df8050f 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -39,7 +39,10 @@ #include <boost/shared_array.hpp> #include <boost/bind.hpp> -#include <librdf.h> +#include <libxslt/security.h> + +// #i114999# do not include librdf.h, it is broken in redland 1.0.11 +#include <redland.h> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XInitialization.hpp> @@ -64,19 +67,6 @@ #include <comphelper/stlunosequence.hxx> #include <comphelper/sequenceasvector.hxx> #include <comphelper/makesequence.hxx> -#include <librdf.h> -#include <libxslt/security.h> - -#include <boost/utility.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/shared_array.hpp> -#include <boost/bind.hpp> - -#include <map> -#include <functional> -#include <algorithm> - -#include <string.h> /** diff --git a/unoxml/source/rdf/librdf_services.cxx b/unoxml/source/rdf/librdf_services.cxx index 03949934560d..08e776d214fe 100644 --- a/unoxml/source/rdf/librdf_services.cxx +++ b/unoxml/source/rdf/librdf_services.cxx @@ -72,12 +72,5 @@ extern "C" void * SAL_CALL component_getFactory( implName, serviceManager, registryKey, entries); } -extern "C" sal_Bool SAL_CALL component_writeInfo( - void * serviceManager, void * registryKey) -{ - return ::cppu::component_writeInfoHelper(serviceManager, registryKey, - entries); -} - } // extern "C" diff --git a/unoxml/source/rdf/makefile.mk b/unoxml/source/rdf/makefile.mk index 3f6d7f445297..1dbcffb8b6ac 100644 --- a/unoxml/source/rdf/makefile.mk +++ b/unoxml/source/rdf/makefile.mk @@ -82,3 +82,11 @@ SHL1STDLIBS= \ .INCLUDE : target.mk + +ALLTAR : $(MISC)/unordf.component + +$(MISC)/unordf.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + unordf.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt unordf.component diff --git a/unoxml/source/rdf/unordf.component b/unoxml/source/rdf/unordf.component new file mode 100644 index 000000000000..a828e7b05d47 --- /dev/null +++ b/unoxml/source/rdf/unordf.component @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="CBlankNode"> + <service name="com.sun.star.rdf.BlankNode"/> + </implementation> + <implementation name="CLiteral"> + <service name="com.sun.star.rdf.Literal"/> + </implementation> + <implementation name="CURI"> + <service name="com.sun.star.rdf.URI"/> + </implementation> + <implementation name="librdf_Repository"> + <service name="com.sun.star.rdf.Repository"/> + </implementation> +</component> diff --git a/unoxml/source/service/makefile.mk b/unoxml/source/service/makefile.mk index 93aec0746323..5fbe62f67ec4 100644 --- a/unoxml/source/service/makefile.mk +++ b/unoxml/source/service/makefile.mk @@ -76,3 +76,11 @@ SHL1STDLIBS= \ .INCLUDE : target.mk + +ALLTAR : $(MISC)/unoxml.component + +$(MISC)/unoxml.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + unoxml.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt unoxml.component diff --git a/unoxml/source/service/services.cxx b/unoxml/source/service/services.cxx index 218015852c83..6b1a2f6f0979 100644 --- a/unoxml/source/service/services.cxx +++ b/unoxml/source/service/services.cxx @@ -60,44 +60,6 @@ component_getImplementationEnvironment(const sal_Char **ppEnvironmentTypeName, u *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; } -sal_Bool SAL_CALL -component_writeInfo(void * /*pServiceManager*/, void* pRegistryKey ) -{ - Reference< XRegistryKey > xKey(reinterpret_cast< XRegistryKey* >(pRegistryKey)); - Reference< XRegistryKey > xNewKey; - OUString aImpl; - - // register DOM service - aImpl = OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += CDocumentBuilder::_getImplementationName(); - aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey(aImpl); - xNewKey->createKey(CDocumentBuilder::_getSupportedServiceNames()[0]); - - // register DOM service - aImpl = OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += CSAXDocumentBuilder::_getImplementationName(); - aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey(aImpl); - xNewKey->createKey(CSAXDocumentBuilder::_getSupportedServiceNames()[0]); - - // register XPath service - aImpl = OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += CXPathAPI::_getImplementationName(); - aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey(aImpl); - xNewKey->createKey(CXPathAPI::_getSupportedServiceNames()[0]); - - // register EventTest service - aImpl = OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += CTestListener::_getImplementationName(); - aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey(aImpl); - xNewKey->createKey(CTestListener::_getSupportedServiceNames()[0]); - - return sal_True; -} - void* SAL_CALL component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, void * /*pRegistryKey*/) { diff --git a/unoxml/source/service/unoxml.component b/unoxml/source/service/unoxml.component new file mode 100644 index 000000000000..d8c907e6475b --- /dev/null +++ b/unoxml/source/service/unoxml.component @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.xml.dom.DocumentBuilder"> + <service name="com.sun.star.xml.dom.DocumentBuilder"/> + </implementation> + <implementation name="com.sun.star.comp.xml.dom.SAXDocumentBuilder"> + <service name="com.sun.star.xml.dom.SAXDocumentBuilder"/> + </implementation> + <implementation name="com.sun.star.comp.xml.dom.events.TestListener"> + <service name="com.sun.star.comp.xml.dom.events.TestListener"/> + </implementation> + <implementation name="com.sun.star.comp.xml.xpath.XPathAPI"> + <service name="com.sun.star.xml.xpath.XPathAPI"/> + </implementation> +</component> diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index 80666d9e2031..f40082e25e9b 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -352,7 +352,7 @@ namespace XPath throw XPathException(); } xmlXPathFreeContext(xpathCtx); - Reference< XXPathObject > aObj(new CXPathObject(xpathObj)); + Reference< XXPathObject > aObj(new CXPathObject(xpathObj, contextNode)); return aObj; } diff --git a/unoxml/source/xpath/xpathapi.hxx b/unoxml/source/xpath/xpathapi.hxx index fdfff24353cc..048fafaae8e9 100644 --- a/unoxml/source/xpath/xpathapi.hxx +++ b/unoxml/source/xpath/xpathapi.hxx @@ -69,7 +69,7 @@ namespace XPath private: nsmap_t m_nsmap; - const Reference < XMultiServiceFactory >& m_aFactory; + const Reference< XMultiServiceFactory > m_aFactory; extensions_t m_extensions; public: diff --git a/unoxml/source/xpath/xpathobject.cxx b/unoxml/source/xpath/xpathobject.cxx index 083d19080c4b..757de0c5aac4 100644 --- a/unoxml/source/xpath/xpathobject.cxx +++ b/unoxml/source/xpath/xpathobject.cxx @@ -31,8 +31,8 @@ namespace XPath { - CXPathObject::CXPathObject(xmlXPathObjectPtr xpathObj) - : m_pXPathObj(xpathObj, xmlXPathFreeObject) + CXPathObject::CXPathObject(xmlXPathObjectPtr xpathObj, const Reference< XNode >& contextNode) + : m_pXPathObj(xpathObj, xmlXPathFreeObject), m_xContextNode(contextNode) { switch (m_pXPathObj->type) { diff --git a/unoxml/source/xpath/xpathobject.hxx b/unoxml/source/xpath/xpathobject.hxx index 8e256bc8a994..348fae8e21e6 100644 --- a/unoxml/source/xpath/xpathobject.hxx +++ b/unoxml/source/xpath/xpathobject.hxx @@ -52,10 +52,11 @@ namespace XPath { private: boost::shared_ptr<xmlXPathObject> m_pXPathObj; + const Reference< XNode > m_xContextNode; XPathObjectType m_xPathObjectType; public: - CXPathObject(xmlXPathObjectPtr xpathObj); + CXPathObject(xmlXPathObjectPtr xpathObj, const Reference< XNode >& contextNode); /** get object type diff --git a/writerfilter/prj/d.lst b/writerfilter/prj/d.lst index f941f4266035..1d09ecf9ad2b 100644 --- a/writerfilter/prj/d.lst +++ b/writerfilter/prj/d.lst @@ -2,6 +2,7 @@ ..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll ..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\*.so ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib +..\%__SRC%\misc\writerfilter.component %_DEST%\xml%_EXT%\writerfilter.component mkdir: %_DEST%\inc%_EXT%\writerfilter\doctok ..\%__SRC%\inc\doctok\sprmids.hxx %_DEST%\inc%_EXT%\writerfilter\doctok\sprmids.hxx diff --git a/writerfilter/qa/cppunittests/doctok/makefile.mk b/writerfilter/qa/cppunittests/doctok/makefile.mk index 298bb4da906b..e7de9f8b4446 100644 --- a/writerfilter/qa/cppunittests/doctok/makefile.mk +++ b/writerfilter/qa/cppunittests/doctok/makefile.mk @@ -28,8 +28,6 @@ PRJ=..$/..$/.. PRJNAME=writerfilter TARGET=test-doctok -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/writerfilter/qa/cppunittests/qname/makefile.mk b/writerfilter/qa/cppunittests/qname/makefile.mk index c2e989d91beb..2f51eb3844c7 100644 --- a/writerfilter/qa/cppunittests/qname/makefile.mk +++ b/writerfilter/qa/cppunittests/qname/makefile.mk @@ -28,8 +28,6 @@ PRJ=..$/..$/.. PRJNAME=writerfilter TARGET=test-qname -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/writerfilter/qa/cppunittests/sl/makefile.mk b/writerfilter/qa/cppunittests/sl/makefile.mk index b7a943e376e9..fa7cafc1dd00 100644 --- a/writerfilter/qa/cppunittests/sl/makefile.mk +++ b/writerfilter/qa/cppunittests/sl/makefile.mk @@ -28,8 +28,6 @@ PRJ=..$/..$/.. PRJNAME=writerfilter TARGET=test-od_sl -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/writerfilter/qa/cppunittests/xxml/makefile.mk b/writerfilter/qa/cppunittests/xxml/makefile.mk index 32d0febc1c85..7f0d3f9731b4 100644 --- a/writerfilter/qa/cppunittests/xxml/makefile.mk +++ b/writerfilter/qa/cppunittests/xxml/makefile.mk @@ -28,8 +28,6 @@ PRJ=..$/..$/.. PRJNAME=writerfilter TARGET=test-xxml -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/writerfilter/source/dmapper/BorderHandler.cxx b/writerfilter/source/dmapper/BorderHandler.cxx index 218a2bebb3bf..67f8e65bafb6 100644 --- a/writerfilter/source/dmapper/BorderHandler.cxx +++ b/writerfilter/source/dmapper/BorderHandler.cxx @@ -52,6 +52,9 @@ m_nLineColor(0), m_nLineDistance(0), m_bOOXML( bOOXML ) { + const int nBorderCount(BORDER_COUNT); + std::fill_n(m_aFilledLines, nBorderCount, false); + std::fill_n(m_aBorderLines, nBorderCount, table::BorderLine()); } /*-- 24.04.2007 09:06:35--------------------------------------------------- diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 7364ec3eaaff..fb36455fcd97 100755..100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -126,8 +126,8 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon LoggedProperties(dmapper_logger, "DomainMapper"), LoggedTable(dmapper_logger, "DomainMapper"), LoggedStream(dmapper_logger, "DomainMapper"), -m_pImpl( new DomainMapper_Impl( *this, xContext, xModel, eDocumentType )), -mnBackgroundColor(0), mbIsHighlightSet(false) + m_pImpl( new DomainMapper_Impl( *this, xContext, xModel, eDocumentType )), + mnBackgroundColor(0), mbIsHighlightSet(false) { // #i24363# tab stops relative to indent m_pImpl->SetDocumentSettingsProperty( @@ -4232,7 +4232,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType -----------------------------------------------------------------------*/ void DomainMapper::lcl_entry(int /*pos*/, - writerfilter::Reference<Properties>::Pointer_t ref) + writerfilter::Reference<Properties>::Pointer_t ref) { ref->resolve(*this); } @@ -4369,6 +4369,12 @@ void DomainMapper::lcl_text(const sal_uInt8 * data_, size_t len) { //TODO: Determine the right text encoding (FIB?) ::rtl::OUString sText( (const sal_Char*) data_, len, RTL_TEXTENCODING_MS_1252 ); +#ifdef DEBUG_DOMAINMAPPER + dmapper_logger->startElement("text"); + dmapper_logger->chars(sText); + dmapper_logger->endElement("text"); +#endif + try { if(len == 1) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 145e19412a75..145e19412a75 100755..100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx diff --git a/writerfilter/source/dmapper/FontTable.cxx b/writerfilter/source/dmapper/FontTable.cxx index 63e7057bccd7..fd6f15660557 100644 --- a/writerfilter/source/dmapper/FontTable.cxx +++ b/writerfilter/source/dmapper/FontTable.cxx @@ -41,7 +41,7 @@ namespace dmapper struct FontTable_Impl { - std::vector< FontEntry > aFontEntries; + std::vector< FontEntry::Pointer_t > aFontEntries; FontEntry::Pointer_t pCurrentEntry; FontTable_Impl() {} }; @@ -573,7 +573,7 @@ void FontTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Poin m_pImpl->pCurrentEntry.reset(new FontEntry); ref->resolve(*this); //append it to the table - m_pImpl->aFontEntries.push_back( *m_pImpl->pCurrentEntry ); + m_pImpl->aFontEntries.push_back( m_pImpl->pCurrentEntry ); m_pImpl->pCurrentEntry.reset(); } /*-- 19.06.2006 12:04:34--------------------------------------------------- @@ -662,12 +662,9 @@ void FontTable::lcl_endShape( ) -----------------------------------------------------------------------*/ const FontEntry::Pointer_t FontTable::getFontEntry(sal_uInt32 nIndex) { - FontEntry::Pointer_t pRet; - if(m_pImpl->aFontEntries.size() > nIndex) - { - pRet.reset(&m_pImpl->aFontEntries[nIndex]); - } - return pRet; + return (m_pImpl->aFontEntries.size() > nIndex) + ? m_pImpl->aFontEntries[nIndex] + : FontEntry::Pointer_t(); } /*-- 21.06.2006 11:21:38--------------------------------------------------- diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx index 505b1af1680a..76ef4c7257ff 100644 --- a/writerfilter/source/dmapper/GraphicHelpers.cxx +++ b/writerfilter/source/dmapper/GraphicHelpers.cxx @@ -8,7 +8,7 @@ #include <com/sun/star/text/RelOrientation.hpp> #include <com/sun/star/text/WrapTextMode.hpp> -#include "dmapperloggers.hxx" +#include "dmapperLoggers.hxx" #include <iostream> using namespace std; diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx index 30192ff12ee3..33107e7356d3 100644 --- a/writerfilter/source/dmapper/PropertyIds.hxx +++ b/writerfilter/source/dmapper/PropertyIds.hxx @@ -32,261 +32,261 @@ namespace rtl{ class OUString;} namespace writerfilter { namespace dmapper{ enum PropertyIds -{ + { PROP_ID_START = 1 - /* 1*/ ,PROP_CHAR_WEIGHT = PROP_ID_START - /* 2*/ ,PROP_CHAR_POSTURE - /* 3*/ ,PROP_CHAR_STRIKEOUT - /* 4*/ ,PROP_CHAR_CONTOURED - /* 5*/ ,PROP_CHAR_SHADOWED - /* 6*/ ,PROP_CHAR_CASE_MAP - /* 7*/ ,PROP_CHAR_COLOR - /* 8*/ ,PROP_CHAR_RELIEF - /* 9*/ ,PROP_CHAR_UNDERLINE - /*10*/ ,PROP_CHAR_WORD_MODE - /*11*/ ,PROP_CHAR_ESCAPEMENT - /*12*/ ,PROP_CHAR_ESCAPEMENT_HEIGHT - /*13*/ ,PROP_CHAR_HEIGHT - /*14*/ ,PROP_CHAR_HEIGHT_COMPLEX - /*15*/ ,PROP_CHAR_LOCALE - /*16*/ ,PROP_CHAR_LOCALE_ASIAN - /*17*/ ,PROP_CHAR_WEIGHT_COMPLEX - /*18*/ ,PROP_CHAR_POSTURE_COMPLEX - /*19*/ ,PROP_CHAR_AUTO_KERNING - /*20*/ ,PROP_CHAR_CHAR_KERNING - /*21*/ ,PROP_CHAR_SCALE_WIDTH - /*22*/ ,PROP_CHAR_LOCALE_COMPLEX - /*23*/ ,PROP_CHAR_UNDERLINE_COLOR -/*24*/ , PROP_CHAR_UNDERLINE_HAS_COLOR -/*25*/ , PROP_CHAR_FONT_NAME -/*26*/ , PROP_CHAR_FONT_STYLE -/*27*/ , PROP_CHAR_FONT_FAMILY -/*28*/ , PROP_CHAR_FONT_CHAR_SET -/*29*/ , PROP_CHAR_FONT_PITCH -/*30*/ , PROP_CHAR_FONT_NAME_ASIAN -/*31*/ , PROP_CHAR_HEIGHT_ASIAN -/*32*/ , PROP_CHAR_FONT_STYLE_ASIAN -/*33*/ , PROP_CHAR_FONT_FAMILY_ASIAN -/*34*/ , PROP_CHAR_FONT_CHAR_SET_ASIAN -/*35*/ , PROP_CHAR_FONT_PITCH_ASIAN -/*36*/ , PROP_CHAR_FONT_NAME_COMPLEX -/*37*/ , PROP_CHAR_FONT_STYLE_COMPLEX -/*38*/ , PROP_CHAR_FONT_FAMILY_COMPLEX -/*39*/ , PROP_CHAR_FONT_CHAR_SET_COMPLEX -/*40*/ , PROP_CHAR_FONT_PITCH_COMPLEX -/*41*/ , PROP_CHAR_HIDDEN -/*42*/ , PROP_CHAR_WEIGHT_ASIAN -/*43*/ , PROP_CHAR_POSTURE_ASIAN -/*44*/ , PROP_PARA_STYLE_NAME -/*45*/ , PROP_CHAR_STYLE_NAME -/*46*/ , PROP_PARA_ADJUST -/*47*/ , PROP_PARA_LAST_LINE_ADJUST -/*48*/ , PROP_PARA_RIGHT_MARGIN -/*49*/ , PROP_PARA_LEFT_MARGIN -/*50*/ , PROP_PARA_FIRST_LINE_INDENT -/*51*/ , PROP_PARA_KEEP_TOGETHER -/*52*/ , PROP_PARA_TOP_MARGIN -/*53*/ , PROP_PARA_BOTTOM_MARGIN -/*54*/ , PROP_PARA_IS_HYPHENATION -/*55*/ , PROP_PARA_LINE_NUMBER_COUNT -/*56*/ , PROP_PARA_IS_HANGING_PUNCTUATION -/*57*/ , PROP_PARA_LINE_SPACING -/*58*/ , PROP_PARA_TAB_STOPS -/*59*/ , PROP_PARA_WIDOWS -/*60*/ , PROP_PARA_ORPHANS -/*61*/ , PROP_PARA_LINE_NUMBER_START_VALUE -/*62*/ , PROP_NUMBERING_LEVEL -/*63*/ , PROP_NUMBERING_RULES -/*64*/ , PROP_NUMBERING_TYPE -/*65*/ , PROP_START_WITH -/*66*/ , PROP_ADJUST -/*67*/ , PROP_PARENT_NUMBERING -/*68*/ , PROP_LEFT_MARGIN -/*69*/ , PROP_RIGHT_MARGIN -/*70*/ , PROP_TOP_MARGIN -/*71*/ , PROP_BOTTOM_MARGIN -/*72*/ , PROP_FIRST_LINE_OFFSET -/*73*/ , PROP_LEFT_BORDER -/*74*/ , PROP_RIGHT_BORDER -/*75*/ , PROP_TOP_BORDER -/*76*/ , PROP_BOTTOM_BORDER -/*77*/ , PROP_TABLE_BORDER -/*78*/ , PROP_LEFT_BORDER_DISTANCE -/*79*/ , PROP_RIGHT_BORDER_DISTANCE -/*80*/ , PROP_TOP_BORDER_DISTANCE -/*81*/ , PROP_BOTTOM_BORDER_DISTANCE -/*82*/ , PROP_CURRENT_PRESENTATION -/*83*/ , PROP_IS_FIXED -/*84*/ , PROP_SUB_TYPE -/*85*/ , PROP_FILE_FORMAT -/*86*/ , PROP_HYPER_LINK_U_R_L -/*87*/ , PROP_NUMBER_FORMAT -/*88*/ , PROP_NAME -/*89*/ , PROP_IS_INPUT -/*90*/ , PROP_HINT -/*91*/ , PROP_FULL_NAME -/*92*/ , PROP_KEYWORDS -/*93*/ , PROP_DESCRIPTION -/*94*/ , PROP_MACRO_NAME -/*95*/ , PROP_SUBJECT -/*96*/ , PROP_USER_DATA_TYPE -/*97*/ , PROP_TITLE -/*98*/ , PROP_CONTENT -/*99*/ , PROP_DATA_COLUMN_NAME -/*100*/, PROP_INPUT_STREAM -/*101*/, PROP_GRAPHIC -/*102*/, PROP_ANCHOR_TYPE -/*103*/ ,PROP_SIZE -/*104*/ ,PROP_HORI_ORIENT -/*105*/ ,PROP_HORI_ORIENT_POSITION -/*106*/ ,PROP_HORI_ORIENT_RELATION -/*107*/ ,PROP_VERT_ORIENT -/*108*/ ,PROP_VERT_ORIENT_POSITION -/*109*/ ,PROP_VERT_ORIENT_RELATION -/*110*/ ,PROP_GRAPHIC_CROP -/*111*/ ,PROP_SIZE100th_M_M -/*112*/ ,PROP_SIZE_PIXEL -/*113*/ ,PROP_SURROUND -/*114*/ ,PROP_SURROUND_CONTOUR -/*115*/ ,PROP_ADJUST_CONTRAST -/*116*/ ,PROP_ADJUST_LUMINANCE -/*117*/ ,PROP_GRAPHIC_COLOR_MODE -/*118*/ ,PROP_GAMMA -/*119*/ ,PROP_HORI_MIRRORED_ON_EVEN_PAGES -/*120*/ ,PROP_HORI_MIRRORED_ON_ODD_PAGES -/*121*/ ,PROP_VERT_MIRRORED -/*122*/ ,PROP_CONTOUR_OUTSIDE -/*123*/ ,PROP_CONTOUR_POLY_POLYGON -/*124*/ ,PROP_PAGE_TOGGLE -/*125*/ ,PROP_BACK_COLOR -/*126*/ ,PROP_ALTERNATIVE_TEXT -/*127*/ ,PROP_HEADER_TEXT_LEFT -/*128*/ ,PROP_HEADER_TEXT -/*129*/ ,PROP_HEADER_IS_SHARED -/*130*/ ,PROP_HEADER_IS_ON -/*131*/ ,PROP_FOOTER_TEXT_LEFT -/*132*/ ,PROP_FOOTER_TEXT -/*133*/ ,PROP_FOOTER_IS_SHARED -/*134*/ ,PROP_FOOTER_IS_ON -/*135*/ ,PROP_WIDTH -/*136*/ ,PROP_HEIGHT -/*137*/ ,PROP_SEPARATOR_LINE_IS_ON -/*138*/ ,PROP_TEXT_COLUMNS -/*139*/ ,PROP_AUTOMATIC_DISTANCE -/*140*/ ,PROP_IS_LANDSCAPE -/*141*/ ,PROP_PRINTER_PAPER_TRAY_INDEX -/*142*/ ,PROP_FIRST_PAGE -/*143*/ ,PROP_DEFAULT -/*144*/ ,PROP_PAGE_DESC_NAME -/*145*/ ,PROP_PAGE_NUMBER_OFFSET -/*146*/ ,PROP_BREAK_TYPE -/*147*/ ,PROP_FOOTER_IS_DYNAMIC_HEIGHT -/*148*/ ,PROP_FOOTER_DYNAMIC_SPACING -/*149*/ ,PROP_FOOTER_HEIGHT -/*150*/ ,PROP_FOOTER_BODY_DISTANCE -/*151*/ ,PROP_HEADER_IS_DYNAMIC_HEIGHT -/*152*/ ,PROP_HEADER_DYNAMIC_SPACING -/*153*/ ,PROP_HEADER_HEIGHT -/*154*/ ,PROP_HEADER_BODY_DISTANCE -/*155*/ ,PROP_WRITING_MODE -/*156*/ ,PROP_GRID_MODE -/*157*/ ,PROP_GRID_DISPLAY -/*158*/ ,PROP_GRID_PRINT -/*159*/ ,PROP_ADD_EXTERNAL_LEADING -/*160*/ ,PROP_GRID_LINES -/*161*/ ,PROP_GRID_BASE_HEIGHT -/*162*/ ,PROP_GRID_RUBY_HEIGHT -/*163*/ ,PROP_IS_ON -/*164*/ ,PROP_RESTART_AT_EACH_PAGE -/*165*/ ,PROP_COUNT_EMPTY_LINES -/*166*/ ,PROP_COUNT_LINES_IN_FRAMES -/*167*/ ,PROP_INTERVAL -/*168*/ ,PROP_DISTANCE -/*169*/ ,PROP_NUMBER_POSITION -/*170*/ ,PROP_LEVEL -/*171*/ ,PROP_LEVEL_PARAGRAPH_STYLES -/*172*/ ,PROP_LEVEL_FORMAT -/*173*/ ,PROP_TOKEN_TYPE -/*174*/ ,PROP_TOKEN_HYPERLINK_START -/*175*/ ,PROP_TOKEN_HYPERLINK_END -/*176*/ ,PROP_TOKEN_CHAPTER_INFO -/*177*/ ,PROP_CHAPTER_FORMAT -/*178*/ ,PROP_TOKEN_TEXT -/*179*/ ,PROP_TEXT -/*180*/ ,PROP_CREATE_FROM_OUTLINE -/*181*/ ,PROP_CREATE_FROM_MARKS -/*182*/ ,PROP_STANDARD -/*183*/ ,PROP_CHAR_BACK_COLOR -/*184*/ ,PROP_CHAR_EMPHASIS -/*185*/ ,PROP_CHAR_COMBINE_IS_ON -/*186*/ ,PROP_CHAR_COMBINE_PREFIX -/*187*/ ,PROP_CHAR_COMBINE_SUFFIX -/*188*/ ,PROP_CHAR_ROTATION -/*189*/ ,PROP_CHAR_ROTATION_IS_FIT_TO_LINE -/*190*/ ,PROP_CHAR_FLASH -/*191*/ ,PROP_IS_SPLIT_ALLOWED -/*192*/ ,META_PROP_VERTICAL_BORDER -/*193*/ ,META_PROP_HORIZONTAL_BORDER -/*194*/ ,PROP_HEADER_ROW_COUNT -/*195*/ ,PROP_IS_AUTO_HEIGHT -/*196*/ ,PROP_SIZE_TYPE -/*197*/ ,PROP_TABLE_COLUMN_SEPARATORS -/*198*/ ,META_PROP_TABLE_STYLE_NAME -/*199*/ ,PROP_REDLINE_AUTHOR -/*200*/ ,PROP_REDLINE_DATE_TIME -/*201*/ ,PROP_REDLINE_COMMENT -/*202*/ ,PROP_REDLINE_TYPE -/*203*/ ,PROP_REDLINE_SUCCESSOR_DATA -/*204*/ ,PROP_REDLINE_IDENTIFIER -/*205*/ ,PROP_SIZE_PROTECTED -/*206*/ ,PROP_POSITION_PROTECTED -/*207*/ ,PROP_OPAQUE -/*208*/ ,PROP_VERTICAL_MERGE -/*209*/ ,PROP_BULLET_CHAR -/*210*/ ,PROP_BULLET_FONT_NAME -/*211*/ ,PROP_PARA_BACK_COLOR -/*212*/ ,PROP_TABS_RELATIVE_TO_INDENT -/*213*/ ,PROP_PREFIX -/*214*/ ,PROP_SUFFIX -/*215*/ ,PROP_CREATE_FROM_LEVEL_PARAGRAPH_STYLES -/*216*/ ,PROP_DROP_CAP_FORMAT -/*217*/ , PROP_REFERENCE_FIELD_PART -/*218*/ ,PROP_SOURCE_NAME -/*219*/ ,PROP_REFERENCE_FIELD_SOURCE -/*220*/ ,PROP_WIDTH_TYPE -/*221*/ ,PROP_TEXT_RANGE -/*222*/ ,PROP_SERVICE_CHAR_STYLE -/*223*/ ,PROP_SERVICE_PARA_STYLE -/*224*/ ,PROP_CHARACTER_STYLES -/*225*/ ,PROP_PARAGRAPH_STYLES -/*226*/ ,PROP_TABLE_BORDER_DISTANCES -/*227*/ ,META_PROP_CELL_MAR_TOP -/*228*/ ,META_PROP_CELL_MAR_BOTTOM -/*229*/ ,META_PROP_CELL_MAR_LEFT -/*230*/ ,META_PROP_CELL_MAR_RIGHT -/*231*/ ,PROP_START_AT -/*232*/ ,PROP_ADD_PARA_TABLE_SPACING -/*233*/ ,PROP_CHAR_PROP_HEIGHT -/*234*/ ,PROP_CHAR_PROP_HEIGHT_ASIAN -/*235*/ ,PROP_CHAR_PROP_HEIGHT_COMPLEX -/*236*/ ,PROP_FORMAT -/*237*/ ,PROP_INSERT -/*238*/ ,PROP_DELETE -/*239*/ ,PROP_STREAM_NAME -/*240*/ ,PROP_BITMAP -/*241*/ ,PROP_IS_DATE -/*242*/ ,PROP_TAB_STOP_DISTANCE -/*243*/ ,PROP_CNF_STYLE -/*244*/ ,PROP_INDENT_AT -/*245*/ ,PROP_FIRST_LINE_INDENT -/*246*/ ,PROP_NUMBERING_STYLE_NAME -/*247*/ ,PROP_LISTTAB_STOP_POSITION -/*248*/ ,PROP_POSITION_AND_SPACE_MODE -/*249*/ ,PROP_PARA_SPLIT -/*250*/ ,PROP_HELP -/*251*/ ,PROP_OUTLINE_LEVEL -/*252*/ ,PROP_HEADING_STYLE_NAME -}; + ,META_PROP_CELL_MAR_BOTTOM = PROP_ID_START + ,META_PROP_CELL_MAR_LEFT + ,META_PROP_CELL_MAR_RIGHT + ,META_PROP_CELL_MAR_TOP + ,META_PROP_HORIZONTAL_BORDER + ,META_PROP_TABLE_STYLE_NAME + ,META_PROP_VERTICAL_BORDER + ,PROP_ADD_EXTERNAL_LEADING + ,PROP_ADD_PARA_TABLE_SPACING + ,PROP_ADJUST + ,PROP_ADJUST_CONTRAST + ,PROP_ADJUST_LUMINANCE + ,PROP_ALTERNATIVE_TEXT + ,PROP_ANCHOR_TYPE + ,PROP_AUTOMATIC_DISTANCE + ,PROP_BACK_COLOR + ,PROP_BITMAP + ,PROP_BOTTOM_BORDER + ,PROP_BOTTOM_BORDER_DISTANCE + ,PROP_BOTTOM_MARGIN + ,PROP_BREAK_TYPE + ,PROP_BULLET_CHAR + ,PROP_BULLET_FONT_NAME + ,PROP_CHAPTER_FORMAT + ,PROP_CHARACTER_STYLES + ,PROP_CHAR_AUTO_KERNING + ,PROP_CHAR_BACK_COLOR + ,PROP_CHAR_CASE_MAP + ,PROP_CHAR_CHAR_KERNING + ,PROP_CHAR_COLOR + ,PROP_CHAR_COMBINE_IS_ON + ,PROP_CHAR_COMBINE_PREFIX + ,PROP_CHAR_COMBINE_SUFFIX + ,PROP_CHAR_CONTOURED + ,PROP_CHAR_EMPHASIS + ,PROP_CHAR_ESCAPEMENT + ,PROP_CHAR_ESCAPEMENT_HEIGHT + ,PROP_CHAR_FLASH + ,PROP_CHAR_FONT_CHAR_SET + ,PROP_CHAR_FONT_CHAR_SET_ASIAN + ,PROP_CHAR_FONT_CHAR_SET_COMPLEX + ,PROP_CHAR_FONT_FAMILY + ,PROP_CHAR_FONT_FAMILY_ASIAN + ,PROP_CHAR_FONT_FAMILY_COMPLEX + ,PROP_CHAR_FONT_NAME + ,PROP_CHAR_FONT_NAME_ASIAN + ,PROP_CHAR_FONT_NAME_COMPLEX + ,PROP_CHAR_FONT_PITCH + ,PROP_CHAR_FONT_PITCH_ASIAN + ,PROP_CHAR_FONT_PITCH_COMPLEX + ,PROP_CHAR_FONT_STYLE + ,PROP_CHAR_FONT_STYLE_ASIAN + ,PROP_CHAR_FONT_STYLE_COMPLEX + ,PROP_CHAR_HEIGHT + ,PROP_CHAR_HEIGHT_ASIAN + ,PROP_CHAR_HEIGHT_COMPLEX + ,PROP_CHAR_HIDDEN + ,PROP_CHAR_LOCALE + ,PROP_CHAR_LOCALE_ASIAN + ,PROP_CHAR_LOCALE_COMPLEX + ,PROP_CHAR_POSTURE + ,PROP_CHAR_POSTURE_ASIAN + ,PROP_CHAR_POSTURE_COMPLEX + ,PROP_CHAR_PROP_HEIGHT + ,PROP_CHAR_PROP_HEIGHT_ASIAN + ,PROP_CHAR_PROP_HEIGHT_COMPLEX + ,PROP_CHAR_RELIEF + ,PROP_CHAR_ROTATION + ,PROP_CHAR_ROTATION_IS_FIT_TO_LINE + ,PROP_CHAR_SCALE_WIDTH + ,PROP_CHAR_SHADOWED + ,PROP_CHAR_STRIKEOUT + ,PROP_CHAR_STYLE_NAME + ,PROP_CHAR_UNDERLINE + ,PROP_CHAR_UNDERLINE_COLOR + ,PROP_CHAR_UNDERLINE_HAS_COLOR + ,PROP_CHAR_WEIGHT + ,PROP_CHAR_WEIGHT_ASIAN + ,PROP_CHAR_WEIGHT_COMPLEX + ,PROP_CHAR_WORD_MODE + ,PROP_CNF_STYLE + ,PROP_CONTENT + ,PROP_CONTOUR_OUTSIDE + ,PROP_CONTOUR_POLY_POLYGON + ,PROP_COUNT_EMPTY_LINES + ,PROP_COUNT_LINES_IN_FRAMES + ,PROP_CREATE_FROM_LEVEL_PARAGRAPH_STYLES + ,PROP_CREATE_FROM_MARKS + ,PROP_CREATE_FROM_OUTLINE + ,PROP_CURRENT_PRESENTATION + ,PROP_DATA_COLUMN_NAME + ,PROP_DEFAULT + ,PROP_DELETE + ,PROP_DESCRIPTION + ,PROP_DISTANCE + ,PROP_DROP_CAP_FORMAT + ,PROP_FILE_FORMAT + ,PROP_FIRST_LINE_INDENT + ,PROP_FIRST_LINE_OFFSET + ,PROP_FIRST_PAGE + ,PROP_FOOTER_BODY_DISTANCE + ,PROP_FOOTER_DYNAMIC_SPACING + ,PROP_FOOTER_HEIGHT + ,PROP_FOOTER_IS_DYNAMIC_HEIGHT + ,PROP_FOOTER_IS_ON + ,PROP_FOOTER_IS_SHARED + ,PROP_FOOTER_TEXT + ,PROP_FOOTER_TEXT_LEFT + ,PROP_FORMAT + ,PROP_FULL_NAME + ,PROP_GAMMA + ,PROP_GRAPHIC + ,PROP_GRAPHIC_COLOR_MODE + ,PROP_GRAPHIC_CROP + ,PROP_GRID_BASE_HEIGHT + ,PROP_GRID_DISPLAY + ,PROP_GRID_LINES + ,PROP_GRID_MODE + ,PROP_GRID_PRINT + ,PROP_GRID_RUBY_HEIGHT + ,PROP_HEADER_BODY_DISTANCE + ,PROP_HEADER_DYNAMIC_SPACING + ,PROP_HEADER_HEIGHT + ,PROP_HEADER_IS_DYNAMIC_HEIGHT + ,PROP_HEADER_IS_ON + ,PROP_HEADER_IS_SHARED + ,PROP_HEADER_ROW_COUNT + ,PROP_HEADER_TEXT + ,PROP_HEADER_TEXT_LEFT + ,PROP_HEADING_STYLE_NAME + ,PROP_HEIGHT + ,PROP_HELP + ,PROP_HINT + ,PROP_HORI_MIRRORED_ON_EVEN_PAGES + ,PROP_HORI_MIRRORED_ON_ODD_PAGES + ,PROP_HORI_ORIENT + ,PROP_HORI_ORIENT_POSITION + ,PROP_HORI_ORIENT_RELATION + ,PROP_HYPER_LINK_U_R_L + ,PROP_INDENT_AT + ,PROP_INPUT_STREAM + ,PROP_INSERT + ,PROP_INTERVAL + ,PROP_IS_AUTO_HEIGHT + ,PROP_IS_DATE + ,PROP_IS_FIXED + ,PROP_IS_INPUT + ,PROP_IS_LANDSCAPE + ,PROP_IS_ON + ,PROP_IS_SPLIT_ALLOWED + ,PROP_KEYWORDS + ,PROP_LEFT_BORDER + ,PROP_LEFT_BORDER_DISTANCE + ,PROP_LEFT_MARGIN + ,PROP_LEVEL + ,PROP_LEVEL_FORMAT + ,PROP_LEVEL_PARAGRAPH_STYLES + ,PROP_LISTTAB_STOP_POSITION + ,PROP_MACRO_NAME + ,PROP_NAME + ,PROP_NUMBERING_LEVEL + ,PROP_NUMBERING_RULES + ,PROP_NUMBERING_STYLE_NAME + ,PROP_NUMBERING_TYPE + ,PROP_NUMBER_FORMAT + ,PROP_NUMBER_POSITION + ,PROP_OPAQUE + ,PROP_OUTLINE_LEVEL + ,PROP_PAGE_DESC_NAME + ,PROP_PAGE_NUMBER_OFFSET + ,PROP_PAGE_TOGGLE + ,PROP_PARAGRAPH_STYLES + ,PROP_PARA_ADJUST + ,PROP_PARA_BACK_COLOR + ,PROP_PARA_BOTTOM_MARGIN + ,PROP_PARA_FIRST_LINE_INDENT + ,PROP_PARA_IS_HANGING_PUNCTUATION + ,PROP_PARA_IS_HYPHENATION + ,PROP_PARA_KEEP_TOGETHER + ,PROP_PARA_LAST_LINE_ADJUST + ,PROP_PARA_LEFT_MARGIN + ,PROP_PARA_LINE_NUMBER_COUNT + ,PROP_PARA_LINE_NUMBER_START_VALUE + ,PROP_PARA_LINE_SPACING + ,PROP_PARA_ORPHANS + ,PROP_PARA_RIGHT_MARGIN + ,PROP_PARA_SPLIT + ,PROP_PARA_STYLE_NAME + ,PROP_PARA_TAB_STOPS + ,PROP_PARA_TOP_MARGIN + ,PROP_PARA_WIDOWS + ,PROP_PARENT_NUMBERING + ,PROP_POSITION_AND_SPACE_MODE + ,PROP_POSITION_PROTECTED + ,PROP_PREFIX + ,PROP_PRINTER_PAPER_TRAY_INDEX + ,PROP_REDLINE_AUTHOR + ,PROP_REDLINE_COMMENT + ,PROP_REDLINE_DATE_TIME + ,PROP_REDLINE_IDENTIFIER + ,PROP_REDLINE_SUCCESSOR_DATA + ,PROP_REDLINE_TYPE + ,PROP_REFERENCE_FIELD_PART + ,PROP_REFERENCE_FIELD_SOURCE + ,PROP_RESTART_AT_EACH_PAGE + ,PROP_RIGHT_BORDER + ,PROP_RIGHT_BORDER_DISTANCE + ,PROP_RIGHT_MARGIN + ,PROP_SEPARATOR_LINE_IS_ON + ,PROP_SERVICE_CHAR_STYLE + ,PROP_SERVICE_PARA_STYLE + ,PROP_SIZE + ,PROP_SIZE100th_M_M + ,PROP_SIZE_PIXEL + ,PROP_SIZE_PROTECTED + ,PROP_SIZE_TYPE + ,PROP_SOURCE_NAME + ,PROP_STANDARD + ,PROP_START_AT + ,PROP_START_WITH + ,PROP_STREAM_NAME + ,PROP_SUBJECT + ,PROP_SUB_TYPE + ,PROP_SUFFIX + ,PROP_SURROUND + ,PROP_SURROUND_CONTOUR + ,PROP_TABLE_BORDER + ,PROP_TABLE_BORDER_DISTANCES + ,PROP_TABLE_COLUMN_SEPARATORS + ,PROP_TABS_RELATIVE_TO_INDENT + ,PROP_TAB_STOP_DISTANCE + ,PROP_TEXT + ,PROP_TEXT_COLUMNS + ,PROP_TEXT_RANGE + ,PROP_TITLE + ,PROP_TOKEN_CHAPTER_INFO + ,PROP_TOKEN_HYPERLINK_END + ,PROP_TOKEN_HYPERLINK_START + ,PROP_TOKEN_TEXT + ,PROP_TOKEN_TYPE + ,PROP_TOP_BORDER + ,PROP_TOP_BORDER_DISTANCE + ,PROP_TOP_MARGIN + ,PROP_USER_DATA_TYPE + ,PROP_VERTICAL_MERGE + ,PROP_VERT_MIRRORED + ,PROP_VERT_ORIENT + ,PROP_VERT_ORIENT_POSITION + ,PROP_VERT_ORIENT_RELATION + ,PROP_WIDTH + ,PROP_WIDTH_TYPE + ,PROP_WRITING_MODE + }; struct PropertyNameSupplier_Impl; class PropertyNameSupplier { diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 9a5999b4f353..f8dcb0592cee 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -180,7 +180,27 @@ XMLTag::Pointer_t PropertyMap::toTag() const pTag->addTag(lcl_TableColumnSeparatorsToTag(aMapIter->second)); break; default: - lcl_AnyToTag(pTag, aMapIter->second); + { + try { + sal_Int32 aInt = 0; + aMapIter->second >>= aInt; + pTag->addAttr("value", aInt); + + sal_uInt32 auInt = 0; + aMapIter->second >>= auInt; + pTag->addAttr("unsignedValue", auInt); + + float aFloat = 0.0; + aMapIter->second >>= aFloat; + pTag->addAttr("floatValue", aFloat); + + ::rtl::OUString aStr; + aMapIter->second >>= auInt; + pTag->addAttr("stringValue", aStr); + } + catch (...) { + } + } break; } diff --git a/writerfilter/source/dmapper/PropertyMapHelper.cxx b/writerfilter/source/dmapper/PropertyMapHelper.cxx index fa5972d217da..3496c5e04f44 100644 --- a/writerfilter/source/dmapper/PropertyMapHelper.cxx +++ b/writerfilter/source/dmapper/PropertyMapHelper.cxx @@ -127,4 +127,3 @@ XMLTag::Pointer_t lcl_PropertyValueSeqSeqToTag(PropertyValueSeqSeq_t rPropValSeq } } - diff --git a/writerfilter/source/dmapper/PropertyMapHelper.hxx b/writerfilter/source/dmapper/PropertyMapHelper.hxx index a5a25a2f357a..fc9ea0a85bb4 100644 --- a/writerfilter/source/dmapper/PropertyMapHelper.hxx +++ b/writerfilter/source/dmapper/PropertyMapHelper.hxx @@ -46,4 +46,3 @@ typedef uno::Sequence<PropertyValueSeq_t> PropertyValueSeqSeq_t; XMLTag::Pointer_t lcl_PropertyValueSeqSeqToTag(PropertyValueSeqSeq_t & rPropValSeqSeq); } } - diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx index 94a4eb5b74b3..6065d33ddb17 100755..100644 --- a/writerfilter/source/dmapper/SettingsTable.cxx +++ b/writerfilter/source/dmapper/SettingsTable.cxx @@ -30,6 +30,7 @@ #include <stdio.h> #include <rtl/ustring.hxx> +#include <resourcemodel/ResourceModelHelper.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <SettingsTable.hxx> #include <resourcemodel/ResourceModelHelper.hxx> diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 86d02a026542..a0d5039a155b 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -156,7 +156,7 @@ PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask, StyleSheetE // First get the parent properties StyleSheetEntryPtr pEntry = m_pStyleSheet->FindParentStyleSheet( sBaseStyleIdentifier ); - if ( pEntry.get( )) + if ( pEntry.get( ) ) { if (pStack.get() == NULL) pStack.reset(new StyleSheetEntryDeque()); @@ -167,11 +167,11 @@ PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask, StyleSheetE { pStack->push_back(pEntry); - TableStyleSheetEntry* pParent = static_cast<TableStyleSheetEntry *>( pEntry.get( ) ); + TableStyleSheetEntry* pParent = static_cast<TableStyleSheetEntry *>( pEntry.get( ) ); pProps->insert( pParent->GetProperties( nMask ), pStack ); pStack->pop_back(); - } + } } // And finally get the mask ones @@ -198,7 +198,7 @@ void lcl_mergeProps( PropertyMapPtr pToFill, PropertyMapPtr pToAdd, TblStyleTyp ( nStyleId == TBL_STYLE_FIRSTCOL ) }; - for ( int i = 0 ; i < 7; i++ ) + for ( unsigned i = 0 ; i != sizeof(pPropsToCheck) / sizeof(PropertyIds); i++ ) { PropertyIds nId = pPropsToCheck[i]; PropertyDefinition aProp( nId, false ); @@ -658,7 +658,7 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm) } } break; - } +} } /*-- 19.06.2006 12:04:33--------------------------------------------------- diff --git a/writerfilter/source/dmapper/ThemeTable.cxx b/writerfilter/source/dmapper/ThemeTable.cxx index ef870b3bae15..74f166dcf313 100755..100644 --- a/writerfilter/source/dmapper/ThemeTable.cxx +++ b/writerfilter/source/dmapper/ThemeTable.cxx @@ -61,6 +61,11 @@ ThemeTable::~ThemeTable() void ThemeTable::lcl_attribute(Id Name, Value & val) { +#ifdef DEBUG_DOMAINMAPPER + dmapper_logger->startElement("ThemeTable.attribute"); + dmapper_logger->attribute("name", (*QNameToString::Instance())(Name)); + dmapper_logger->attribute("value", val.toString()); +#endif // int nIntValue = val.getInt(); ::rtl::OUString sValue = val.getString(); // printf ( "ThemeTable::attribute(0x%.4x, 0x%.4x) [%s]\n", (unsigned int)Name, (unsigned int)nIntValue, ::rtl::OUStringToOString(sValue, RTL_TEXTENCODING_DONTKNOW).getStr()); @@ -79,10 +84,18 @@ void ThemeTable::lcl_attribute(Id Name, Value & val) #endif } } +#ifdef DEBUG_DOMAINMAPPER + dmapper_logger->endElement("ThemeTable.attribute"); +#endif } void ThemeTable::lcl_sprm(Sprm& rSprm) { +#ifdef DEBUG_DOMAINMAPPER + dmapper_logger->startElement("ThemeTable.sprm"); + dmapper_logger->chars(rSprm.toString()); +#endif + sal_uInt32 nSprmId = rSprm.getId(); (void)nSprmId; @@ -136,11 +149,22 @@ void ThemeTable::lcl_sprm(Sprm& rSprm) #endif } } +#ifdef DEBUG_DOMAINMAPPER + dmapper_logger->endElement("ThemeTable.sprm"); +#endif } void ThemeTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref) { +#ifdef DEBUG_DOMAINMAPPER + dmapper_logger->startElement("ThemeTable.entry"); +#endif + ref->resolve(*this); + +#ifdef DEBUG_DOMAINMAPPER + dmapper_logger->endElement("ThemeTable.entry"); +#endif } const ::rtl::OUString ThemeTable::getFontNameForTheme(const Id id) const diff --git a/writerfilter/source/dmapper/makefile.mk b/writerfilter/source/dmapper/makefile.mk index a4b000411b4e..a4b000411b4e 100755..100644 --- a/writerfilter/source/dmapper/makefile.mk +++ b/writerfilter/source/dmapper/makefile.mk diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx new file mode 100644 index 000000000000..040843afd7ce --- /dev/null +++ b/writerfilter/source/filter/RtfFilter.cxx @@ -0,0 +1,146 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2010 Miklos Vajna. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_ +#include <cppuhelper/implementationentry.hxx> +#endif +#include <osl/module.hxx> +#include <tools/solar.h> +#include <RtfFilter.hxx> + +using namespace ::rtl; +using namespace ::cppu; +using namespace ::com::sun::star; + +RtfFilter::RtfFilter( const uno::Reference< uno::XComponentContext >& rxContext) : + m_xContext( rxContext ) +{ +} + +RtfFilter::~RtfFilter() +{ +} + +sal_Bool RtfFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor ) + throw (uno::RuntimeException) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + if( m_xSrcDoc.is() ) + { + uno::Reference< lang::XMultiServiceFactory > xMSF(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW); + uno::Reference< uno::XInterface > xIfc( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.RtfExport" ))), uno::UNO_QUERY_THROW); + if (!xIfc.is()) + return sal_False; + uno::Reference< document::XExporter > xExprtr(xIfc, uno::UNO_QUERY_THROW); + uno::Reference< document::XFilter > xFltr(xIfc, uno::UNO_QUERY_THROW); + if (!xExprtr.is() || !xFltr.is()) + return sal_False; + xExprtr->setSourceDocument(m_xSrcDoc); + return xFltr->filter(aDescriptor); + } + else if ( m_xDstDoc.is() ) + { + uno::Reference< lang::XMultiServiceFactory > xMSF(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW); + uno::Reference< uno::XInterface > xIfc( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.RtfImport" ))), uno::UNO_QUERY_THROW); + if (!xIfc.is()) + return sal_False; + uno::Reference< document::XImporter > xImprtr(xIfc, uno::UNO_QUERY_THROW); + uno::Reference< document::XFilter > xFltr(xIfc, uno::UNO_QUERY_THROW); + if (!xImprtr.is() || !xFltr.is()) + return sal_False; + xImprtr->setTargetDocument(m_xDstDoc); + return xFltr->filter(aDescriptor); + } + return sal_False; +} + +void RtfFilter::cancel( ) throw (uno::RuntimeException) +{ +} + +void RtfFilter::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc ) + throw (lang::IllegalArgumentException, uno::RuntimeException) +{ + m_xSrcDoc = xDoc; +} + +void RtfFilter::setTargetDocument( const uno::Reference< lang::XComponent >& xDoc ) + throw (lang::IllegalArgumentException, uno::RuntimeException) +{ + m_xDstDoc = xDoc; +} + +void RtfFilter::initialize( const uno::Sequence< uno::Any >& /*aArguments*/ ) throw (uno::Exception, uno::RuntimeException) +{ + // The DOCX exporter here extracts 'type' of the filter, ie 'Word' or + // 'Word Template' but we don't need it for RTF. +} + +OUString RtfFilter::getImplementationName( ) throw (uno::RuntimeException) +{ + return RtfFilter_getImplementationName(); +} + +#define SERVICE_NAME1 "com.sun.star.document.ImportFilter" +#define SERVICE_NAME2 "com.sun.star.document.ExportFilter" +sal_Bool RtfFilter::supportsService( const OUString& rServiceName ) throw (uno::RuntimeException) +{ + return (rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME1 ) ) || + rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME2 ) )); +} + +uno::Sequence< OUString > RtfFilter::getSupportedServiceNames( ) throw (uno::RuntimeException) +{ + return RtfFilter_getSupportedServiceNames(); +} + +/* Helpers, used by shared lib exports. */ + +OUString RtfFilter_getImplementationName () throw (uno::RuntimeException) +{ + return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.RtfFilter" ) ); +} + +uno::Sequence< OUString > RtfFilter_getSupportedServiceNames( ) throw (uno::RuntimeException) +{ + uno::Sequence < OUString > aRet(2); + OUString* pArray = aRet.getArray(); + pArray[0] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME1 ) ); + pArray[1] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME2 ) ); + return aRet; +} +#undef SERVICE_NAME1 +#undef SERVICE_NAME2 + +uno::Reference< uno::XInterface > RtfFilter_createInstance( const uno::Reference< uno::XComponentContext >& xContext) + throw( uno::Exception ) +{ + return (cppu::OWeakObject*) new RtfFilter( xContext ); +} + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/writerfilter/source/filter/RtfFilter.hxx b/writerfilter/source/filter/RtfFilter.hxx new file mode 100644 index 000000000000..3a4be622ab17 --- /dev/null +++ b/writerfilter/source/filter/RtfFilter.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2010 Miklos Vajna. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RTFFILTER_HXX +#define _RTFFILTER_HXX + +#include <com/sun/star/document/XFilter.hpp> +#include <com/sun/star/document/XImporter.hpp> +#include <com/sun/star/document/XExporter.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/implbase5.hxx> +#include <WriterFilterDllApi.hxx> + +class WRITERFILTER_DLLPUBLIC RtfFilter : public cppu::WeakImplHelper5 +< + com::sun::star::document::XFilter, + com::sun::star::document::XImporter, + com::sun::star::document::XExporter, + com::sun::star::lang::XInitialization, + com::sun::star::lang::XServiceInfo +> +{ + +protected: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xSrcDoc, m_xDstDoc; + ::rtl::OUString m_sFilterName; + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xHandler; + + +public: + RtfFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext); + virtual ~RtfFilter(); + + // XFilter + virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL cancel( ) + throw (::com::sun::star::uno::RuntimeException); + + // XImporter + virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + // XExporter + virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + // XInitialization + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) + throw (::com::sun::star::uno::Exception, ::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); + +}; + + +::rtl::OUString RtfFilter_getImplementationName() + throw ( ::com::sun::star::uno::RuntimeException ); + +::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL RtfFilter_getSupportedServiceNames( ) + throw ( ::com::sun::star::uno::RuntimeException ); + +::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL RtfFilter_createInstance( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > &xContext) + throw( ::com::sun::star::uno::Exception ); +#endif + diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index 71a97d72f391..deede335d9af 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -30,6 +30,7 @@ #endif #include <WriterFilter.hxx> #include <WriterFilterDetection.hxx> +#include <RtfFilter.hxx> using namespace ::rtl; using namespace ::cppu; @@ -56,6 +57,7 @@ static struct ::cppu::ImplementationEntry s_component_entries [] = { { WriterFilter_createInstance, WriterFilter_getImplementationName, WriterFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }, { WriterFilterDetection_createInstance, WriterFilterDetection_getImplementationName, WriterFilterDetection_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0} , + { RtfFilter_createInstance, RtfFilter_getImplementationName, RtfFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }, { 0, 0, 0, 0, 0, 0 } // terminate with NULL }; @@ -64,11 +66,6 @@ void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvType *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo( ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry ) -{ - return ::cppu::component_writeInfoHelper( xMgr, xRegistry, s_component_entries ); -} - void * SAL_CALL component_getFactory(sal_Char const * implName, ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry ) { return ::cppu::component_getFactoryHelper(implName, xMgr, xRegistry, s_component_entries ); diff --git a/writerfilter/source/filter/makefile.mk b/writerfilter/source/filter/makefile.mk index f578e2853243..6b11fd4ff1f3 100644 --- a/writerfilter/source/filter/makefile.mk +++ b/writerfilter/source/filter/makefile.mk @@ -40,7 +40,8 @@ ENABLE_EXCEPTIONS=TRUE SLOFILES= $(SLO)$/WriterFilter.obj \ $(SLO)$/WriterFilterDetection.obj \ - $(SLO)$/ImportFilter.obj + $(SLO)$/ImportFilter.obj \ + $(SLO)$/RtfFilter.obj # --- Targets ---------------------------------- diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx b/writerfilter/source/ooxml/OOXMLFactory.cxx index 78c82d5dac3e..9188bef6e8cb 100755..100644 --- a/writerfilter/source/ooxml/OOXMLFactory.cxx +++ b/writerfilter/source/ooxml/OOXMLFactory.cxx @@ -25,6 +25,8 @@ * ************************************************************************/ +#include <stdio.h> + #include <rtl/instance.hxx> #include <osl/mutex.hxx> #include "OOXMLFactory.hxx" diff --git a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx index 1768d486c80d..83c568dfba50 100644 --- a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx @@ -193,9 +193,6 @@ void SAL_CALL OOXMLFastDocumentHandler::startDocument() void SAL_CALL OOXMLFastDocumentHandler::endDocument() throw (uno::RuntimeException, xml::sax::SAXException) { -#ifdef DEBUG_CONTEXT_STACK - OOXMLFastContextHandler::dumpOpenContexts(); -#endif } void SAL_CALL OOXMLFastDocumentHandler::setDocumentLocator diff --git a/writerfilter/source/ooxml/OOXMLFastHelper.hxx b/writerfilter/source/ooxml/OOXMLFastHelper.hxx index 9bfadf558d84..961b4660f036 100644 --- a/writerfilter/source/ooxml/OOXMLFastHelper.hxx +++ b/writerfilter/source/ooxml/OOXMLFastHelper.hxx @@ -85,7 +85,12 @@ OOXMLFastHelper<T>::createAndSetParent pTmp->setToken(nToken); pTmp->setId(nId); -#ifdef DEBUG_HELPER +#ifdef DEBUG_CREATE + debug_logger->startElement("createAndSetParent"); + debug_logger->attribute("context", pHandler->getType()); + debug_logger->attribute("token", fastTokenToId(pTmp->getToken())); + debug_logger->attribute("id", (*QNameToString::Instance())(nId)); + debug_logger->startElement("created"); debug_logger->addTag(pTmp->toTag()); debug_logger->endElement("created"); diff --git a/writerfilter/source/resourcemodel/TagLogger.cxx b/writerfilter/source/resourcemodel/TagLogger.cxx index 0a6f2d1aea1d..ebb28aa0148b 100644 --- a/writerfilter/source/resourcemodel/TagLogger.cxx +++ b/writerfilter/source/resourcemodel/TagLogger.cxx @@ -397,7 +397,7 @@ void TagLogger::dump(const char * name) } PropertySetToTagHandler::PropertySetToTagHandler(IdToString::Pointer_t pIdToString) -: mpTag(new XMLTag("propertyset")), mpIdToString(pIdToString) + : mpTag(new XMLTag("propertyset")), mpIdToString(pIdToString) { } diff --git a/writerfilter/unocomponent/component.cxx b/writerfilter/unocomponent/component.cxx index 327e61e41a21..06e837ef4cd6 100644 --- a/writerfilter/unocomponent/component.cxx +++ b/writerfilter/unocomponent/component.cxx @@ -61,12 +61,6 @@ static struct ::cppu::ImplementationEntry s_component_entries [] = *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo( ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry ) -{ - return ::cppu::component_writeInfoHelper( xMgr, xRegistry, s_component_entries ); -} - - void * SAL_CALL component_getFactory(sal_Char const * implName, ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry ) { fprintf(stderr, "Loading service: %s: ", implName); diff --git a/writerfilter/unocomponent/exports.dxp b/writerfilter/unocomponent/exports.dxp index 028ac4175990..f0e1c69934bc 100644 --- a/writerfilter/unocomponent/exports.dxp +++ b/writerfilter/unocomponent/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/writerfilter/util/makefile.mk b/writerfilter/util/makefile.mk index f5981222743c..c2f5c9ee37e1 100644 --- a/writerfilter/util/makefile.mk +++ b/writerfilter/util/makefile.mk @@ -75,4 +75,10 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE : target.mk +ALLTAR : $(MISC)/writerfilter.component +$(MISC)/writerfilter.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt writerfilter.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt writerfilter.component diff --git a/writerfilter/util/writerfilter.component b/writerfilter/util/writerfilter.component new file mode 100644 index 000000000000..5d4c628df978 --- /dev/null +++ b/writerfilter/util/writerfilter.component @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.Writer.WriterFilter"> + <service name="com.sun.star.document.ExportFilter"/> + <service name="com.sun.star.document.ImportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.WriterFilterDetector"> + <service name="com.sun.star.document.ExtendedTypeDetection"/> + </implementation> +</component> diff --git a/writerperfect/prj/d.lst b/writerperfect/prj/d.lst index 5b5852c6a86f..971d1ce6f50e 100644 --- a/writerperfect/prj/d.lst +++ b/writerperfect/prj/d.lst @@ -2,3 +2,4 @@ ..\%__SRC%\bin\wpft*.dll %_DEST%\bin%_EXT% ..\%__SRC%\bin\wpftgo.dll %_DEST%\bin%_EXT%\wpftgo.dll ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib +..\%__SRC%\misc\wpft.component %_DEST%\xml%_EXT%\wpft.component diff --git a/writerperfect/source/wpdimp/wpft_genericfilter.cxx b/writerperfect/source/wpdimp/wpft_genericfilter.cxx index c117b93af3c7..b107d5ff4a71 100644 --- a/writerperfect/source/wpdimp/wpft_genericfilter.cxx +++ b/writerperfect/source/wpdimp/wpft_genericfilter.cxx @@ -46,33 +46,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } //================================================================================================== -sal_Bool SAL_CALL component_writeInfo( - void * /* pServiceManager */, void * pRegistryKey ) -{ - if (pRegistryKey) - { - try - { - sal_Int32 nPos = 0; - Reference< XRegistryKey > xNewKey( - 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] ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; -} -//================================================================================================== void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) { diff --git a/writerperfect/util/makefile.mk b/writerperfect/util/makefile.mk index dca29e005287..ae8cf0b73641 100644 --- a/writerperfect/util/makefile.mk +++ b/writerperfect/util/makefile.mk @@ -43,3 +43,11 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map DEF1NAME=$(SHL1TARGET) .INCLUDE : target.mk + +ALLTAR : $(MISC)/wpft.component + +$(MISC)/wpft.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + wpft.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt wpft.component diff --git a/writerperfect/util/wpft.component b/writerperfect/util/wpft.component new file mode 100644 index 000000000000..2d8a013606a9 --- /dev/null +++ b/writerperfect/util/wpft.component @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.Writer.WordPerfectImportFilter"> + <service name="com.sun.star.document.ExtendedTypeDetection"/> + <service name="com.sun.star.document.ImportFilter"/> + </implementation> +</component> diff --git a/xmerge/prj/d.lst b/xmerge/prj/d.lst index 03cd7235c126..9cfd7927ed00 100644 --- a/xmerge/prj/d.lst +++ b/xmerge/prj/d.lst @@ -9,3 +9,4 @@ mkdir: %_DEST%\doc%_EXT%\xmerge ..\%__SRC%\doc\javadoc\package-list %_DEST%\doc%_EXT%\xmerge\package-list ..\%__SRC%\doc\xmerge_javadoc.zip %_DEST%\doc%_EXT%\xmerge_javadoc.zip ..\%__SRC%\doc\writer2latex_javadoc.zip %_DEST%\doc%_EXT%\writer2latex_javadoc.zip +..\%__SRC%\misc\XMergeBridge.component %_DEST%\xml%_EXT%\XMergeBridge.component diff --git a/xmerge/source/bridge/XMergeBridge.component b/xmerge/source/bridge/XMergeBridge.component new file mode 100644 index 000000000000..c48aae6a0e20 --- /dev/null +++ b/xmerge/source/bridge/XMergeBridge.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.Java2" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="XMergeBridge$_XMergeBridge"> + <service name="com.sun.star.documentconversion.XMergeBridge"/> + </implementation> +</component> diff --git a/xmerge/source/bridge/java/XMergeBridge.java b/xmerge/source/bridge/java/XMergeBridge.java index 38503d3b49ff..c2dafd75c996 100644 --- a/xmerge/source/bridge/java/XMergeBridge.java +++ b/xmerge/source/bridge/java/XMergeBridge.java @@ -74,9 +74,8 @@ import java.net.URI; /** This outer class provides an inner class to implement the service - * description, a method to instantiate the - * component on demand (__getServiceFactory()), and a method to give - * information about the component (__writeRegistryServiceInfo()). + * description and a method to instantiate the + * component on demand (__getServiceFactory()). */ public class XMergeBridge { @@ -695,21 +694,4 @@ public class XMergeBridge { return xSingleServiceFactory; } - - /** - * Writes the service information into the given registry key. - * This method is called by the <code>JavaLoader</code> - * <p> - * @return returns true if the operation succeeded - * @param regKey the registryKey - * @see com.sun.star.comp.loader.JavaLoader - */ - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { - - return FactoryHelper.writeRegistryServiceInfo(_XMergeBridge.class.getName(), - _XMergeBridge.__serviceName, regKey); - } } - - - diff --git a/xmerge/source/bridge/makefile.mk b/xmerge/source/bridge/makefile.mk index 77a39a568966..05fa5a738d84 100644 --- a/xmerge/source/bridge/makefile.mk +++ b/xmerge/source/bridge/makefile.mk @@ -33,3 +33,11 @@ PRJNAME=xmerge .IF "$(L10N_framework)"=="" ALLTAR: ANTBUILD .ENDIF + +ALLTAR : $(MISC)/XMergeBridge.component + +$(MISC)/XMergeBridge.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt XMergeBridge.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_JAVA)XMergeBridge.jar' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt XMergeBridge.component |