优化项目结构、优化 maven 结构

This commit is contained in:
chenkailing
2021-02-10 00:58:13 +08:00
parent 28d3e05ca9
commit 2542a24675
3610 changed files with 77 additions and 180 deletions

View File

@@ -0,0 +1,114 @@
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
// Change the case of a selection, or current word from upper case,
// to first char upper case, to all lower case to upper case...
import com.sun.star.uno.UnoRuntime;
import com.sun.star.frame.XModel;
import com.sun.star.view.XSelectionSupplier;
import com.sun.star.container.XIndexAccess;
import com.sun.star.text.XText;
import com.sun.star.text.XTextRange;
import com.sun.star.text.XWordCursor;
import com.sun.star.script.provider.XScriptContext;
// return the new string based on the string passed in
String getNewString( theString ) {
String newString;
if(theString==null || theString.length()==0) {
return newString;
}
// should we tokenize on "."?
if(Character.isUpperCase(theString.charAt(0)) && theString.length()>=2 && Character.isUpperCase(theString.charAt(1))) { // first two chars are UC => first UC, rest LC
newString=theString.substring(0,1).toUpperCase()+theString.substring(1).toLowerCase();
} else if (Character.isUpperCase(theString.charAt(0))) { // first char UC => all to LC
newString=theString.toLowerCase();
} else { // all to UC.
newString=theString.toUpperCase();
}
return newString;
}
//the method that does the work
void capitalise() {
// get the number of regions selected
count = xIndexAccess.getCount();
if(count>=1) { //ie we have a selection
for(i=0;i<count;i++) {
// get the i-th region selected
xTextRange = (XTextRange)
UnoRuntime.queryInterface(XTextRange.class, xIndexAccess.getByIndex(i));
System.out.println("string: "+xTextRange.getString());
// get the selected string
theString = xTextRange.getString();
if(theString.length()==0) {
// sadly we can have a selection where nothing is selected
// in this case we get the XWordCursor and make a selection!
xText = (XText)
UnoRuntime.queryInterface(XText.class, xTextRange.getText());
xWordCursor = (XWordCursor)
UnoRuntime.queryInterface(XWordCursor.class, xText.createTextCursorByRange(xTextRange));
// move the Word cursor to the start of the word if its not
// already there
if(!xWordCursor.isStartOfWord()) {
xWordCursor.gotoStartOfWord(false);
}
// move the cursor to the next word, selecting all chars
// in between
xWordCursor.gotoNextWord(true);
// get the selected string
theString = xWordCursor.getString();
// get the new string
newString = getNewString(theString);
if(newString!=null) {
// set the new string
xWordCursor.setString(newString);
// keep the current selection
xSelectionSupplier.select(xWordCursor);
}
} else {
newString = getNewString( theString );
if(newString!=null) {
// set the new string
xTextRange.setString(newString);
// keep the current selection
xSelectionSupplier.select(xTextRange);
}
}
}
}
}
// The XSCRIPTCONTEXT variable is of type XScriptContext and is available to
// all BeanShell scripts executed by the Script Framework
xModel = (XModel)
UnoRuntime.queryInterface(XModel.class, XSCRIPTCONTEXT.getDocument());
//the writer controller impl supports the css.view.XSelectionSupplier interface
xSelectionSupplier = (XSelectionSupplier)
UnoRuntime.queryInterface(XSelectionSupplier.class, xModel.getCurrentController());
//see section 7.5.1 of developers' guide
xIndexAccess = (XIndexAccess)
UnoRuntime.queryInterface(XIndexAccess.class, xSelectionSupplier.getSelection());
//call the method that does the work
capitalise();
return 0;

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<parcel language="BeanShell" xmlns:parcel="scripting.dtd">
<script language="BeanShell">
<locale lang="en">
<displayname value="Capitalise"/>
<description>
Change the case of a selection, or current word from upper case, to first char upper case, to all lower case to upper case...
</description>
</locale>
<functionname value="capitalise.bsh"/>
<logicalname value="Capitalise.BeanShell"/>
</script>
</parcel>

View File

@@ -0,0 +1,37 @@
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
// Hello World in BeanShell
import com.sun.star.uno.UnoRuntime;
import com.sun.star.text.XTextDocument;
import com.sun.star.text.XText;
import com.sun.star.text.XTextRange;
// get the document from the scripting context which is made available to all
// scripts
oDoc = XSCRIPTCONTEXT.getDocument();
//get the XTextDocument interface
xTextDoc = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class,oDoc);
//get the XText interface
xText = xTextDoc.getText();
// get an (empty) XTextRange at the end of the document
xTextRange = xText.getEnd();
// set the string
xTextRange.setString( "Hello World (in BeanShell)" );

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<parcel language="BeanShell" xmlns:parcel="scripting.dtd">
<script language="BeanShell">
<locale lang="en">
<displayname value="Hello World"/>
<description>
Adds the the string "Hello World" into the current text doc.
</description>
</locale>
<functionname value="helloworld.bsh"/>
<logicalname value="HelloWorld.BeanShell"/>
</script>
</parcel>

View File

@@ -0,0 +1,126 @@
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
// this code is bound to the events generated by the buttons in the dialog
// it will close the dialog or find and highlight the text entered in the
// dialog (depending on the button pressed)
import com.sun.star.uno.*;
import com.sun.star.awt.*;
import com.sun.star.lang.*;
import com.sun.star.beans.*;
import com.sun.star.util.*;
import com.sun.star.script.framework.browse.DialogFactory;
// Get the ActionEvent object from the ARGUMENTS list
ActionEvent event = (ActionEvent) ARGUMENTS[0];
// Each argument is of type Any so we must use the AnyConverter class to
// convert it into the interface or primitive type we expect
XButton button = (XButton)AnyConverter.toObject(
new Type(XButton.class), event.Source);
// We can now query for the model of the button and get its properties
XControl control = (XControl)UnoRuntime.queryInterface(XControl.class, button);
XControlModel cmodel = control.getModel();
XPropertySet pset = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, cmodel);
if (pset.getPropertyValue("Label").equals("Exit"))
{
// We can get the XDialog in which this control appears by calling
// getContext() on the XControl interface
XDialog xDialog = (XDialog)UnoRuntime.queryInterface(
XDialog.class, control.getContext());
// Close the dialog
xDialog.endExecute();
}
else
{
// We can get the list of controls for this dialog by calling
// getContext() on the XControl interface of the button
XControlContainer controls = (XControlContainer)UnoRuntime.queryInterface(
XControlContainer.class, control.getContext());
// Now get the text field control from the list
XTextComponent textField = (XTextComponent)
UnoRuntime.queryInterface(
XTextComponent.class, controls.getControl("HighlightTextField"));
String searchKey = textField.getText();
// highlight the text in red
java.awt.Color cRed = new java.awt.Color(255, 0, 0);
int red = cRed.getRGB();
XReplaceable replaceable = (XReplaceable)
UnoRuntime.queryInterface(XReplaceable.class, XSCRIPTCONTEXT.getDocument());
XReplaceDescriptor descriptor =
(XReplaceDescriptor) replaceable.createReplaceDescriptor();
// Gets a XPropertyReplace object for altering the properties
// of the replaced text
XPropertyReplace xPropertyReplace = (XPropertyReplace)
UnoRuntime.queryInterface(XPropertyReplace.class, descriptor);
// Sets the replaced text property fontweight value to Bold
PropertyValue wv = new PropertyValue("CharWeight", -1,
new Float(com.sun.star.awt.FontWeight.BOLD),
com.sun.star.beans.PropertyState.DIRECT_VALUE);
// Sets the replaced text property color value to RGB parameter
PropertyValue cv = new PropertyValue("CharColor", -1,
new Integer(red),
com.sun.star.beans.PropertyState.DIRECT_VALUE);
// Apply the properties
PropertyValue[] props = new PropertyValue[] { cv, wv };
try {
xPropertyReplace.setReplaceAttributes(props);
// Only matches whole words and case sensitive
descriptor.setPropertyValue(
"SearchCaseSensitive", new Boolean(true));
descriptor.setPropertyValue("SearchWords", new Boolean(true));
}
catch (com.sun.star.beans.UnknownPropertyException upe) {
System.err.println("Error setting up search properties");
return;
}
catch (com.sun.star.beans.PropertyVetoException pve) {
System.err.println("Error setting up search properties");
return;
}
catch (com.sun.star.lang.WrappedTargetException wte) {
System.err.println("Error setting up search properties");
return;
}
// Replaces all instances of searchKey with new Text properties
// and gets the number of instances of the searchKey
descriptor.setSearchString(searchKey);
descriptor.setReplaceString(searchKey);
replaceable.replaceAll(descriptor);
}
// BeanShell OpenOffice.org scripts should always return 0
return 0;

View File

@@ -0,0 +1,144 @@
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
// this script serves as an example of how to launch a Basic Dialog
// from a script
import com.sun.star.uno.UnoRuntime;
import com.sun.star.script.provider.XScriptContext;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.EventObject;
import com.sun.star.uno.Type;
import com.sun.star.uno.AnyConverter;
import com.sun.star.text.XTextDocument;
import com.sun.star.beans.PropertyValue;
import com.sun.star.script.XLibraryContainer;
import com.sun.star.awt.*;
import com.sun.star.util.*;
boolean tryLoadingLibrary( xmcf, context, name )
{
try
{
obj = xmcf.createInstanceWithContext(
"com.sun.star.script.Application" + name + "LibraryContainer",
context.getComponentContext());
xLibraryContainer = (XLibraryContainer)
UnoRuntime.queryInterface(XLibraryContainer.class, obj);
System.err.println("Got XLibraryContainer");
serviceObj = context.getComponentContext().getValueByName(
"/singletons/com.sun.star.util.theMacroExpander");
xme = (XMacroExpander) AnyConverter.toObject(
new Type(XMacroExpander.class), serviceObj);
bootstrapName = "bootstraprc";
if (System.getProperty("os.name").startsWith("Windows"))
{
bootstrapName = "bootstrap.ini";
}
libURL = xme.expandMacros(
"${$OOO_BASE_DIR/program/" + bootstrapName + "::BaseInstallation}" +
"/share/basic/ScriptBindingLibrary/" +
name.toLowerCase() + ".xlb/");
System.err.println("libURL is: " + libURL);
xLibraryContainer.createLibraryLink(
"ScriptBindingLibrary", libURL, false);
System.err.println("liblink created");
}
catch (com.sun.star.uno.Exception e)
{
System.err.println("Got an exception loading lib: " + e.getMessage());
return false;
}
return true;
}
// get the XMultiComponentFactory from the XSCRIPTCONTEXT
XMultiComponentFactory xmcf =
XSCRIPTCONTEXT.getComponentContext().getServiceManager();
Object[] args = new Object[1];
args[0] = XSCRIPTCONTEXT.getDocument();
Object obj;
try {
// try to create an instance of the DialogProvider
obj = xmcf.createInstanceWithArgumentsAndContext(
"com.sun.star.awt.DialogProvider", args,
XSCRIPTCONTEXT.getComponentContext());
/*
obj = xmcf.createInstanceWithContext(
"com.sun.star.awt.DialogProvider",
XSCRIPTCONTEXT.getComponentContext());
*/
}
catch (com.sun.star.uno.Exception e) {
System.err.println("Error getting DialogProvider object");
return 0;
}
// get the XDialogProvider interface from the object created above
XDialogProvider xDialogProvider = (XDialogProvider)
UnoRuntime.queryInterface(XDialogProvider.class, obj);
System.err.println("Got DialogProvider, now get dialog");
try {
// try to create the Highlight dialog (found in the ScriptBindingLibrary)
findDialog = xDialogProvider.createDialog("vnd.sun.star.script:" +
"ScriptBindingLibrary.Highlight?location=application");
if( findDialog == null )
{
if (tryLoadingLibrary(xmcf, XSCRIPTCONTEXT, "Dialog") == false ||
tryLoadingLibrary(xmcf, XSCRIPTCONTEXT, "Script") == false)
{
System.err.println("Error loading ScriptBindingLibrary");
return 0;
}
else
{
// try to create the Highlight dialog (found in the ScriptBindingLibrary)
findDialog = xDialogProvider.createDialog("vnd.sun.star.script:" +
"ScriptBindingLibrary.Highlight?location=application");
}
}
}
catch (java.lang.Exception e) {
System.err.println("Got exception on first creating dialog: " +
e.getMessage());
}
// execute the dialog in a new thread (so that this script can finish)
Thread t = new Thread() {
public void run() {
findDialog.execute();
}
};
t.start();
return 0;

View File

@@ -0,0 +1,169 @@
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
import com.sun.star.uno.UnoRuntime;
import com.sun.star.util.XReplaceable;
import com.sun.star.util.XReplaceDescriptor;
import com.sun.star.util.XPropertyReplace;
import com.sun.star.beans.PropertyValue;
import com.sun.star.text.XTextDocument;
import com.sun.star.script.provider.XScriptContext;
int replaceText(searchKey, color, bold) {
result = 0;
try {
// Create an XReplaceable object and an XReplaceDescriptor
replaceable = (XReplaceable)
UnoRuntime.queryInterface(XReplaceable.class, xTextDocument);
descriptor =
(XReplaceDescriptor) replaceable.createReplaceDescriptor();
// Gets a XPropertyReplace object for altering the properties
// of the replaced text
xPropertyReplace = (XPropertyReplace)
UnoRuntime.queryInterface(XPropertyReplace.class, descriptor);
// Sets the replaced text property fontweight value to Bold or Normal
wv = null;
if (bold) {
wv = new PropertyValue("CharWeight", -1,
new Float(com.sun.star.awt.FontWeight.BOLD),
com.sun.star.beans.PropertyState.DIRECT_VALUE);
}
else {
wv = new PropertyValue("CharWeight", -1,
new Float(com.sun.star.awt.FontWeight.NORMAL),
com.sun.star.beans.PropertyState.DIRECT_VALUE);
}
// Sets the replaced text property color value to RGB color parameter
cv = new PropertyValue("CharColor", -1, new Integer(color),
com.sun.star.beans.PropertyState.DIRECT_VALUE);
// Apply the properties
PropertyValue[] props = { cv, wv };
xPropertyReplace.setReplaceAttributes(props);
// Only matches whole words and case sensitive
descriptor.setPropertyValue("SearchCaseSensitive", new Boolean(true));
descriptor.setPropertyValue("SearchWords", new Boolean(true));
// Replaces all instances of searchKey with new Text properties
// and gets the number of instances of the searchKey
descriptor.setSearchString(searchKey);
descriptor.setReplaceString(searchKey);
result = replaceable.replaceAll(descriptor);
}
catch (Exception e) {
}
return result;
}
searchKey = "";
// The XSCRIPTCONTEXT variable is of type XScriptContext and is available to
// all BeanShell scripts executed by the Script Framework
xTextDocument = (XTextDocument)
UnoRuntime.queryInterface(XTextDocument.class, XSCRIPTCONTEXT.getDocument());
// Create a JButton and add an ActionListener
// When clicked the value for the searchKey is read and passed to replaceText
myListener = new ActionListener() {
actionPerformed(ActionEvent e) {
searchKey = findTextBox.getText();
if(searchKey.equalsIgnoreCase("")) {
JOptionPane.showMessageDialog(null,
"No text entered for search",
"No text", JOptionPane.INFORMATION_MESSAGE);
}
else {
// highlight the text in red
cRed = new Color(255, 0, 0);
red = cRed.getRGB();
num = replaceText(searchKey, red, true);
if(num > 0) {
int response = JOptionPane.showConfirmDialog(null,
searchKey + " was found " + num +
" times\nDo you wish to keep the text highlighted?",
"Confirm highlight", JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (response == 1) {
cBlack = new Color(255, 255, 255);
black = cBlack.getRGB();
replaceText(searchKey, black, false);
}
}
else {
JOptionPane.showMessageDialog(null,
"No matches were found", "Not found",
JOptionPane.INFORMATION_MESSAGE);
}
}
}
};
exitListener = new ActionListener() {
actionPerformed(ActionEvent e) {
frame.dispose();
}
};
searchButton = new JButton("Highlight");
searchButton.addActionListener(myListener);
exitButton = new JButton("Exit");
exitButton.addActionListener(exitListener);
buttonPanel = new JPanel();
buttonPanel.setLayout(new FlowLayout());
buttonPanel.add(searchButton);
buttonPanel.add(exitButton);
// Create a JPanel containing one JTextField for the search text.
searchPanel = new JPanel();
searchPanel.setLayout(new FlowLayout());
findTextBox = new JTextField(20);
findWhat = new JLabel("Find What: ");
searchPanel.add(findWhat);
searchPanel.add(findTextBox);
// Create frame and add a window listener
frame = new JFrame("Highlight Text");
frame.setSize(350,130);
frame.setLocation(430,430);
frame.setResizable(false);
// Add the panel and button to the frame
frame.getContentPane().setLayout(new GridLayout(2,1,10,10));
frame.getContentPane().add(searchPanel);
frame.getContentPane().add(buttonPanel);
frame.setVisible(true);
frame.pack();

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<parcel language="BeanShell" xmlns:parcel="scripting.dtd">
<script language="BeanShell">
<locale lang="en">
<displayname value="ShowDialog" />
<description>
Example of how to show a dialog from BeanShell
</description>
</locale>
<functionname value="ShowDialog.bsh" />
<logicalname value="ShowDialog.BeanShell" />
</script>
<script language="BeanShell">
<locale lang="en">
<displayname value="ButtonPressHandler" />
<description>
Example of handle button press events for the Dialog
</description>
</locale>
<functionname value="ButtonPressHandler.bsh" />
<logicalname value="ButtonPressHandler.BeanShell" />
</script>
</parcel>

View File

@@ -0,0 +1,140 @@
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Type;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.frame.XComponentLoader;
import com.sun.star.document.XEmbeddedObjectSupplier;
import com.sun.star.awt.ActionEvent;
import com.sun.star.awt.Rectangle;
import com.sun.star.beans.XPropertySet;
import com.sun.star.beans.PropertyValue;
import com.sun.star.container.*;
import com.sun.star.chart.*;
import com.sun.star.table.*;
import com.sun.star.sheet.*;
import com.sun.star.script.provider.XScriptContext;
createSpreadsheet()
{
loader = (XComponentLoader)
UnoRuntime.queryInterface(
XComponentLoader.class, XSCRIPTCONTEXT.getDesktop());
comp = loader.loadComponentFromURL(
"private:factory/scalc", "_blank", 4, new PropertyValue[0]);
doc = (XSpreadsheetDocument)
UnoRuntime.queryInterface(XSpreadsheetDocument.class, comp);
index = (XIndexAccess)
UnoRuntime.queryInterface(XIndexAccess.class, doc.getSheets());
sheet = (XSpreadsheet) AnyConverter.toObject(
new Type(com.sun.star.sheet.XSpreadsheet.class), index.getByIndex(0));
return sheet;
}
addData(sheet, date, total, free)
{
// set the labels
sheet.getCellByPosition(0, 0).setFormula("Used");
sheet.getCellByPosition(0, 1).setFormula("Free");
sheet.getCellByPosition(0, 2).setFormula("Total");
// set the values in the cells
sheet.getCellByPosition(1, 0).setValue(total - free);
sheet.getCellByPosition(1, 1).setValue(free);
sheet.getCellByPosition(1, 2).setValue(total);
}
addChart(sheet)
{
rect = new Rectangle();
rect.X = 500;
rect.Y = 3000;
rect.Width = 10000;
rect.Height = 8000;
range = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, sheet);
myRange = range.getCellRangeByName("A1:B2");
rangeAddr = (XCellRangeAddressable)
UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange);
myAddr = rangeAddr.getRangeAddress();
CellRangeAddress[] addr = new CellRangeAddress[1];
addr[0] = myAddr;
supp = (XTableChartsSupplier)
UnoRuntime.queryInterface( XTableChartsSupplier.class, sheet);
charts = supp.getCharts();
charts.addNewByName("Example", rect, addr, false, true);
try { Thread.sleep(3000); } catch (java.lang.InterruptedException e) { }
// get the diagram and Change some of the properties
chartsAccess = (XNameAccess)
UnoRuntime.queryInterface( XNameAccess.class, charts);
tchart = (XTableChart)
UnoRuntime.queryInterface(
XTableChart.class, chartsAccess.getByName("Example"));
eos = (XEmbeddedObjectSupplier)
UnoRuntime.queryInterface( XEmbeddedObjectSupplier.class, tchart );
xifc = eos.getEmbeddedObject();
xChart = (XChartDocument)
UnoRuntime.queryInterface(XChartDocument.class, xifc);
xDocMSF = (XMultiServiceFactory)
UnoRuntime.queryInterface(XMultiServiceFactory.class, xChart);
diagObject = xDocMSF.createInstance("com.sun.star.chart.PieDiagram");
xDiagram = (XDiagram)
UnoRuntime.queryInterface(XDiagram.class, diagObject);
xChart.setDiagram(xDiagram);
propset = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, xChart.getTitle() );
propset.setPropertyValue("String", "JVM Memory Usage");
}
runtime = Runtime.getRuntime();
generator = new Random();
date = new Date();
// allocate a random number of bytes so that the data changes
len = (int)(generator.nextFloat() * runtime.freeMemory() / 5);
bytes = new byte[len];
sheet = createSpreadsheet();
addData(sheet, date.toString(), runtime.totalMemory(), runtime.freeMemory());
addChart(sheet);
return 0;

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<parcel language="BeanShell" xmlns:parcel="scripting.dtd">
<script language="BeanShell">
<locale lang="en">
<displayname value="BeanShell JVM Usage"/>
<description>
Updates a spreadsheet with the current memory usage statistics for the Java Virtual Machine
</description>
</locale>
<functionname value="memusage.bsh"/>
<logicalname value="MemoryUsage.BeanShell"/>
</script>
</parcel>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<parcel language="BeanShell" xmlns:parcel="scripting.dtd">
<script language="BeanShell">
<locale lang="en">
<displayname value="Word Count"/>
<description>
Provides a word count of the selected text in A Writer document.
</description>
</locale>
<functionname value="wordcount.bsh"/>
<logicalname value="WordCount.BeanShell"/>
</script>
</parcel>

View File

@@ -0,0 +1,84 @@
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
//Provides a word count of the selected text in A Writer document.
import com.sun.star.uno.UnoRuntime;
import com.sun.star.frame.XModel;
import com.sun.star.view.XSelectionSupplier;
import com.sun.star.container.XIndexAccess;
import com.sun.star.text.XText;
import com.sun.star.text.XTextRange;
import com.sun.star.script.provider.XScriptContext;
// display the count in a Swing dialog
void doDisplay(numWords) {
wordsLabel = new JLabel("Word count = " + numWords);
closeButton = new JButton("Close");
frame = new JFrame("Word Count");
closeButton.addActionListener(new ActionListener() {
actionPerformed(ActionEvent e) {
frame.setVisible(false);
}
});
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(wordsLabel, BorderLayout.CENTER);
frame.getContentPane().add(closeButton, BorderLayout.SOUTH);
frame.pack();
frame.setSize(190,90);
frame.setLocation(430,430);
frame.setVisible(true);
}
int wordcount() {
result = 0;
// iterate through each of the selections
count = xIndexAccess.getCount();
for(i=0;i<count;i++) {
// get the XTextRange of the selection
xTextRange = (XTextRange)
UnoRuntime.queryInterface(XTextRange.class, xIndexAccess.getByIndex(i));
//System.out.println("string: "+xTextRange.getString());
// use the standard J2SE delimiters to tokenize the string
// obtained from the XTextRange
strTok = new StringTokenizer(xTextRange.getString());
result += strTok.countTokens();
}
doDisplay(result);
return result;
}
// The XSCRIPTCONTEXT variable is of type XScriptContext and is available to
// all BeanShell scripts executed by the Script Framework
xModel = (XModel)
UnoRuntime.queryInterface(XModel.class, XSCRIPTCONTEXT.getDocument());
//the writer controller impl supports the css.view.XSelectionSupplier interface
xSelectionSupplier = (XSelectionSupplier)
UnoRuntime.queryInterface(XSelectionSupplier.class, xModel.getCurrentController());
//see section 7.5.1 of developers' guide
// the getSelection provides an XIndexAccess to the one or more selections
xIndexAccess = (XIndexAccess)
UnoRuntime.queryInterface(XIndexAccess.class, xSelectionSupplier.getSelection());
count = wordcount();
System.out.println("count = "+count);
return 0;

View File

@@ -0,0 +1,43 @@
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
import com.sun.star.script.provider.XScriptContext;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.text.XTextDocument;
import com.sun.star.text.XTextRange;
import com.sun.star.text.XText;
/**
* HelloWorld class
*
*/
public class HelloWorld {
public static void printHW(XScriptContext xSc) {
// getting the text document object
XTextDocument xtextdocument = (XTextDocument) UnoRuntime.queryInterface(
XTextDocument.class, xSc.getDocument());
XText xText = xtextdocument.getText();
XTextRange xTextRange = xText.getEnd();
xTextRange.setString( "Hello World (in Java)" );
}// printHW
}

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<parcel language="Java" xmlns:parcel="scripting.dtd">
<script language="Java">
<locale lang="en">
<displayname value="HelloWorld.Java"/>
<description>
Prints "Helo World".
</description>
</locale>
<functionname value="HelloWorld.printHW"/>
<logicalname value="HelloWorld.printHW"/>
<languagedepprops>
<prop name="classpath" value="HelloWorld.jar"/>
</languagedepprops>
</script>
</parcel>

View File

@@ -0,0 +1,244 @@
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
import com.sun.star.uno.UnoRuntime;
import com.sun.star.script.provider.XScriptContext;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.EventObject;
import com.sun.star.uno.Type;
import com.sun.star.uno.AnyConverter;
import com.sun.star.text.XTextDocument;
import com.sun.star.beans.PropertyValue;
import com.sun.star.script.XLibraryContainer;
import com.sun.star.awt.*;
import com.sun.star.util.*;
import java.awt.Color;
public class HighlightText implements com.sun.star.awt.XActionListener {
// UNO awt components of the Highlight dialog
XDialog findDialog = null;
XTextComponent findTextBox;
// The document being searched
XTextDocument theDocument;
// The text to be searched for
private String searchKey = "";
public void showForm(XScriptContext context) {
System.err.println("Starting showForm");
XMultiComponentFactory xmcf =
context.getComponentContext().getServiceManager();
Object[] args = new Object[1];
args[0] = context.getDocument();
Object obj;
try {
obj = xmcf.createInstanceWithArgumentsAndContext(
"com.sun.star.awt.DialogProvider", args,
context.getComponentContext());
}
catch (com.sun.star.uno.Exception e) {
System.err.println("Error getting DialogProvider object");
return;
}
XDialogProvider xDialogProvider = (XDialogProvider)
UnoRuntime.queryInterface(XDialogProvider.class, obj);
System.err.println("Got DialogProvider, now get dialog");
try {
findDialog = xDialogProvider.createDialog(
"vnd.sun.star.script:" +
"ScriptBindingLibrary.Highlight?location=application");
}
catch (java.lang.Exception e) {
System.err.println("Got exception on first creating dialog: " +
e.getMessage());
}
if (findDialog == null) {
if (tryLoadingLibrary(xmcf, context, "Dialog") == false ||
tryLoadingLibrary(xmcf, context, "Script") == false)
{
System.err.println("Error loading ScriptBindingLibrary");
return;
}
try {
findDialog = xDialogProvider.createDialog(
"vnd.sun.star.script://" +
"ScriptBindingLibrary.Highlight?location=application");
}
catch (com.sun.star.lang.IllegalArgumentException iae) {
System.err.println("Error loading ScriptBindingLibrary");
return;
}
}
XControlContainer controls = (XControlContainer)
UnoRuntime.queryInterface(XControlContainer.class, findDialog);
XButton highlightButton = (XButton) UnoRuntime.queryInterface(
XButton.class, controls.getControl("HighlightButton"));
highlightButton.setActionCommand("Highlight");
findTextBox = (XTextComponent) UnoRuntime.queryInterface(
XTextComponent.class, controls.getControl("HighlightTextField"));
XButton exitButton = (XButton) UnoRuntime.queryInterface(
XButton.class, controls.getControl("ExitButton"));
exitButton.setActionCommand("Exit");
theDocument = (XTextDocument) UnoRuntime.queryInterface(
XTextDocument.class, context.getDocument());
highlightButton.addActionListener(this);
exitButton.addActionListener(this);
findDialog.execute();
return;
}
public void actionPerformed(ActionEvent e) {
if (e.ActionCommand.equals("Exit")) {
findDialog.endExecute();
return;
}
else if (e.ActionCommand.equals("Highlight")) {
searchKey = findTextBox.getText();
// highlight the text in red
Color cRed = new Color(255, 0, 0);
int red = cRed.getRGB();
XReplaceable replaceable = (XReplaceable)
UnoRuntime.queryInterface(XReplaceable.class, theDocument);
XReplaceDescriptor descriptor =
(XReplaceDescriptor) replaceable.createReplaceDescriptor();
// Gets a XPropertyReplace object for altering the properties
// of the replaced text
XPropertyReplace xPropertyReplace = (XPropertyReplace)
UnoRuntime.queryInterface(XPropertyReplace.class, descriptor);
// Sets the replaced text property fontweight value to Bold
PropertyValue wv = new PropertyValue("CharWeight", -1,
new Float(com.sun.star.awt.FontWeight.BOLD),
com.sun.star.beans.PropertyState.DIRECT_VALUE);
// Sets the replaced text property color value to RGB parameter
PropertyValue cv = new PropertyValue("CharColor", -1,
new Integer(red),
com.sun.star.beans.PropertyState.DIRECT_VALUE);
// Apply the properties
PropertyValue[] props = new PropertyValue[] { cv, wv };
try {
xPropertyReplace.setReplaceAttributes(props);
// Only matches whole words and case sensitive
descriptor.setPropertyValue(
"SearchCaseSensitive", new Boolean(true));
descriptor.setPropertyValue("SearchWords", new Boolean(true));
}
catch (com.sun.star.beans.UnknownPropertyException upe) {
System.err.println("Error setting up search properties");
return;
}
catch (com.sun.star.beans.PropertyVetoException pve) {
System.err.println("Error setting up search properties");
return;
}
catch (com.sun.star.lang.WrappedTargetException wte) {
System.err.println("Error setting up search properties");
return;
}
catch (com.sun.star.lang.IllegalArgumentException iae) {
System.err.println("Error setting up search properties");
return;
}
// Replaces all instances of searchKey with new Text properties
// and gets the number of instances of the searchKey
descriptor.setSearchString(searchKey);
descriptor.setReplaceString(searchKey);
replaceable.replaceAll(descriptor);
}
}
public void disposing(EventObject o)
{
// do nothing
}
private boolean tryLoadingLibrary(
XMultiComponentFactory xmcf, XScriptContext context, String name)
{
System.err.println("Try to load ScriptBindingLibrary");
try {
Object obj = xmcf.createInstanceWithContext(
"com.sun.star.script.Application" + name + "LibraryContainer",
context.getComponentContext());
XLibraryContainer xLibraryContainer = (XLibraryContainer)
UnoRuntime.queryInterface(XLibraryContainer.class, obj);
System.err.println("Got XLibraryContainer");
Object serviceObj = context.getComponentContext().getValueByName(
"/singletons/com.sun.star.util.theMacroExpander");
XMacroExpander xme = (XMacroExpander) AnyConverter.toObject(
new Type(XMacroExpander.class), serviceObj);
String bootstrapName = "bootstraprc";
if (System.getProperty("os.name").startsWith("Windows")) {
bootstrapName = "bootstrap.ini";
}
String libURL = xme.expandMacros(
"${$OOO_BASE_DIR/program/" + bootstrapName + "::BaseInstallation}" +
"/share/basic/ScriptBindingLibrary/" +
name.toLowerCase() + ".xlb/");
System.err.println("libURL is: " + libURL);
xLibraryContainer.createLibraryLink(
"ScriptBindingLibrary", libURL, false);
System.err.println("liblink created");
} catch (com.sun.star.uno.Exception e) {
System.err.println("Got an exception loading lib: " + e.getMessage());
return false;
}
return true;
}
}

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<parcel language="Java" xmlns:parcel="scripting.dtd">
<script language="Java">
<locale lang="en">
<displayname value="HighlightText.showForm"/>
<description>
Text highlighting
</description>
</locale>
<functionname value="HighlightText.showForm"/>
<logicalname value="HighlightText.showForm"/>
<languagedepprops>
<prop name="classpath" value="Highlight.jar"/>
</languagedepprops>
</script>
</parcel>

View File

@@ -0,0 +1,162 @@
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
import java.util.Random;
import java.util.Date;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Type;
import com.sun.star.uno.XInterface;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.frame.XComponentLoader;
import com.sun.star.document.XEmbeddedObjectSupplier;
import com.sun.star.awt.Rectangle;
import com.sun.star.beans.XPropertySet;
import com.sun.star.beans.PropertyValue;
import com.sun.star.container.*;
import com.sun.star.chart.*;
import com.sun.star.table.*;
import com.sun.star.sheet.*;
import com.sun.star.script.provider.XScriptContext;
public class MemoryUsage
{
// public void updateMemoryUsage(XScriptContext ctxt, ActionEvent evt)
public void updateMemoryUsage(XScriptContext ctxt)
throws Exception
{
XSpreadsheet sheet = createSpreadsheet(ctxt);
Runtime runtime = Runtime.getRuntime();
Random generator = new Random();
Date date = new Date();
// allocate a random amount of memory
int len = (int)(generator.nextFloat() * runtime.freeMemory() / 5);
byte[] bytes = new byte[len];
addData(sheet, date.toString(),
runtime.totalMemory(), runtime.freeMemory());
addChart(sheet);
}
private XSpreadsheet createSpreadsheet(XScriptContext ctxt)
throws Exception
{
XComponentLoader loader = (XComponentLoader)
UnoRuntime.queryInterface(
XComponentLoader.class, ctxt.getDesktop());
XComponent comp = loader.loadComponentFromURL(
"private:factory/scalc", "_blank", 4, new PropertyValue[0]);
XSpreadsheetDocument doc = (XSpreadsheetDocument)
UnoRuntime.queryInterface(XSpreadsheetDocument.class, comp);
XIndexAccess index = (XIndexAccess)
UnoRuntime.queryInterface(XIndexAccess.class, doc.getSheets());
XSpreadsheet sheet = (XSpreadsheet) AnyConverter.toObject(
new Type(com.sun.star.sheet.XSpreadsheet.class), index.getByIndex(0));
return sheet;
}
private void addData(
XSpreadsheet sheet, String date, long total, long free)
throws Exception
{
sheet.getCellByPosition(0, 0).setFormula("Used");
sheet.getCellByPosition(0, 1).setFormula("Free");
sheet.getCellByPosition(0, 2).setFormula("Total");
sheet.getCellByPosition(1, 0).setValue(total - free);
sheet.getCellByPosition(1, 1).setValue(free);
sheet.getCellByPosition(1, 2).setValue(total);
}
private void addChart(XSpreadsheet sheet)
throws Exception
{
Rectangle rect = new Rectangle();
rect.X = 500;
rect.Y = 3000;
rect.Width = 10000;
rect.Height = 8000;
XCellRange range = (XCellRange)
UnoRuntime.queryInterface(XCellRange.class, sheet);
XCellRange myRange =
range.getCellRangeByName("A1:B2");
XCellRangeAddressable rangeAddr = (XCellRangeAddressable)
UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange);
CellRangeAddress myAddr = rangeAddr.getRangeAddress();
CellRangeAddress[] addr = new CellRangeAddress[1];
addr[0] = myAddr;
XTableChartsSupplier supp = (XTableChartsSupplier)
UnoRuntime.queryInterface( XTableChartsSupplier.class, sheet);
XTableCharts charts = supp.getCharts();
charts.addNewByName("Example", rect, addr, false, true);
try { Thread.sleep(3000); } catch (java.lang.InterruptedException e) { }
// get the diagram and Change some of the properties
XNameAccess chartsAccess = (XNameAccess)
UnoRuntime.queryInterface( XNameAccess.class, charts);
XTableChart tchart = (XTableChart)
UnoRuntime.queryInterface(
XTableChart.class, chartsAccess.getByName("Example"));
XEmbeddedObjectSupplier eos = (XEmbeddedObjectSupplier)
UnoRuntime.queryInterface( XEmbeddedObjectSupplier.class, tchart );
XInterface xifc = eos.getEmbeddedObject();
XChartDocument xChart = (XChartDocument)
UnoRuntime.queryInterface(XChartDocument.class, xifc);
XMultiServiceFactory xDocMSF = (XMultiServiceFactory)
UnoRuntime.queryInterface(XMultiServiceFactory.class, xChart);
Object diagObject =
xDocMSF.createInstance("com.sun.star.chart.PieDiagram");
XDiagram xDiagram = (XDiagram)
UnoRuntime.queryInterface(XDiagram.class, diagObject);
xChart.setDiagram(xDiagram);
XPropertySet propset = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, xChart.getTitle() );
propset.setPropertyValue("String", "JVM Memory Usage");
}
}

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<parcel language="Java" xmlns:parcel="scripting.dtd">
<script language="Java">
<locale lang="en">
<displayname value="MemoryUtils.MemUsage"/>
<description>
Text highlighting
</description>
</locale>
<functionname value="MemoryUsage.updateMemoryUsage"/>
<logicalname value="MemoryUtils.MemUsage"/>
<languagedepprops>
<prop name="classpath" value="MemoryUsage.jar"/>
</languagedepprops>
</script>
</parcel>

View File

@@ -0,0 +1,91 @@
// *************************************************************
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
// *************************************************************
// When this script is run on an existing, saved, spreadsheet,
// eg. /home/testuser/myspreadsheet.sxc, the script will export
// each sheet to a separate html file,
// eg. /home/testuser/myspreadsheet_sheet1.html,
// /home/testuser/myspreadsheet_sheet2.html etc
importClass(Packages.com.sun.star.uno.UnoRuntime);
importClass(Packages.com.sun.star.sheet.XSpreadsheetDocument);
importClass(Packages.com.sun.star.container.XIndexAccess);
importClass(Packages.com.sun.star.beans.XPropertySet);
importClass(Packages.com.sun.star.beans.PropertyValue);
importClass(Packages.com.sun.star.util.XModifiable);
importClass(Packages.com.sun.star.frame.XStorable);
importClass(Packages.com.sun.star.frame.XModel);
importClass(Packages.com.sun.star.uno.AnyConverter);
importClass(Packages.com.sun.star.uno.Type);
importClass(java.lang.System);
//get the document object from the scripting context
oDoc = XSCRIPTCONTEXT.getDocument();
//get the XSpreadsheetDocument interface from the document
xSDoc = UnoRuntime.queryInterface(XSpreadsheetDocument, oDoc);
//get the XModel interface from the document
xModel = UnoRuntime.queryInterface(XModel,oDoc);
//get the XIndexAccess interface used to access each sheet
xSheetsIndexAccess = UnoRuntime.queryInterface(XIndexAccess, xSDoc.getSheets());
//get the XStorable interface used to save the document
xStorable = UnoRuntime.queryInterface(XStorable,xSDoc);
//get the XModifiable interface used to indicate if the document has been
//changed
xModifiable = UnoRuntime.queryInterface(XModifiable,xSDoc);
//set up an array of PropertyValue objects used to save each sheet in the
//document
storeProps = new Array;//PropertyValue[1];
storeProps[0] = new PropertyValue();
storeProps[0].Name = "FilterName";
storeProps[0].Value = "HTML (StarCalc)";
storeUrl = xModel.getURL();
storeUrl = storeUrl.substring(0,storeUrl.lastIndexOf('.'));
//set only one sheet visible, and store to HTML doc
for(var i=0;i<xSheetsIndexAccess.getCount();i++)
{
setAllButOneHidden(xSheetsIndexAccess,i);
xModifiable.setModified(false);
xStorable.storeToURL(storeUrl+"_sheet"+(i+1)+".html", storeProps);
}
// now set all visible again
for(var i=0;i<xSheetsIndexAccess.getCount();i++)
{
xPropSet = AnyConverter.toObject( new Type(XPropertySet), xSheetsIndexAccess.getByIndex(i));
xPropSet.setPropertyValue("IsVisible", true);
}
function setAllButOneHidden(xSheetsIndexAccess,vis) {
//System.err.println("count="+xSheetsIndexAccess.getCount());
//get an XPropertySet interface for the vis-th sheet
xPropSet = AnyConverter.toObject( new Type(XPropertySet), xSheetsIndexAccess.getByIndex(vis));
//set the vis-th sheet to be visible
xPropSet.setPropertyValue("IsVisible", true);
// set all other sheets to be invisible
for(var i=0;i<xSheetsIndexAccess.getCount();i++)
{
xPropSet = AnyConverter.toObject( new Type(XPropertySet), xSheetsIndexAccess.getByIndex(i));
if(i!=vis) {
xPropSet.setPropertyValue("IsVisible", false);
}
}
}

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<parcel language="JavaScript" xmlns:parcel="scripting.dtd">
<script language="JavaScript">
<locale lang="en">
<displayname value="ExportSheetsToHTML"/>
<description>
Saves each sheet in the current Calc document as a separate HTML file in the same directory as the original Calc document.
</description>
</locale>
<functionname value="exportsheetstohtml.js"/>
<logicalname value="ExportSheetsToHTML.JavaScript"/>
</script>
</parcel>

View File

@@ -0,0 +1,36 @@
// *************************************************************
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
// *************************************************************
// Hello World in JavaScript
importClass(Packages.com.sun.star.uno.UnoRuntime);
importClass(Packages.com.sun.star.text.XTextDocument);
importClass(Packages.com.sun.star.text.XText);
importClass(Packages.com.sun.star.text.XTextRange);
//get the document from the scripting context
oDoc = XSCRIPTCONTEXT.getDocument();
//get the XTextDocument interface
xTextDoc = UnoRuntime.queryInterface(XTextDocument,oDoc);
//get the XText interface
xText = xTextDoc.getText();
//get an (empty) XTextRange interface at the end of the text
xTextRange = xText.getEnd();
//set the text in the XTextRange
xTextRange.setString( "Hello World (in JavaScript)" );

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<parcel language="JavaScript" xmlns:parcel="scripting.dtd">
<script language="JavaScript">
<locale lang="en">
<displayname value="Hello World"/>
<description>
Adds the the string "Hello World" into the current text doc.
</description>
</locale>
<functionname value="helloworld.js"/>
<logicalname value="HelloWorld.JavaScript"/>
</script>
</parcel>

View File

@@ -0,0 +1,125 @@
// *************************************************************
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
// *************************************************************
//this script acts as a handler for the buttons in the Highlight dialog
importClass(Packages.com.sun.star.uno.UnoRuntime);
importClass(Packages.com.sun.star.uno.Type);
importClass(Packages.com.sun.star.uno.AnyConverter);
importClass(Packages.com.sun.star.awt.XButton);
importClass(Packages.com.sun.star.awt.XControl);
importClass(Packages.com.sun.star.awt.ActionEvent);
importClass(Packages.com.sun.star.awt.XControlModel);
importClass(Packages.com.sun.star.awt.XControlContainer);
importClass(Packages.com.sun.star.awt.XDialog);
importClass(Packages.com.sun.star.awt.XTextComponent);
importClass(Packages.com.sun.star.util.XReplaceable);
importClass(Packages.com.sun.star.util.XReplaceDescriptor);
importClass(Packages.com.sun.star.util.XPropertyReplace);
importClass(Packages.com.sun.star.beans.XPropertySet);
importClass(Packages.com.sun.star.beans.PropertyValue);
// Scripting Framework DialogFactory class
importClass(Packages.com.sun.star.script.framework.browse.DialogFactory);
// Get the ActionEvent object from the ARGUMENTS list
event = ARGUMENTS[0];
// Each argument is of type Any so we must use the AnyConverter class to
// convert it into the interface or primitive type we expect
button = AnyConverter.toObject(new Type(XButton), event.Source);
// We can now query for the model of the button and get its properties
control = UnoRuntime.queryInterface(XControl, button);
cmodel = control.getModel();
pset = UnoRuntime.queryInterface(XPropertySet, cmodel);
if (pset.getPropertyValue("Label").equals("Exit"))
{
// We can get the XDialog in which this control appears by calling
// getContext() on the XControl interface
xDialog = UnoRuntime.queryInterface(
XDialog, control.getContext());
// Close the dialog
xDialog.endExecute();
}
else
{
// We can get the list of controls for this dialog by calling
// getContext() on the XControl interface of the button
controls = UnoRuntime.queryInterface(
XControlContainer, control.getContext());
// Now get the text field control from the list
textField =
UnoRuntime.queryInterface(
XTextComponent, controls.getControl("HighlightTextField"));
searchKey = textField.getText();
// highlight the text in red
red = java.awt.Color.red.getRGB();
replaceable =
UnoRuntime.queryInterface(XReplaceable, XSCRIPTCONTEXT.getDocument());
descriptor = replaceable.createReplaceDescriptor();
// Gets a XPropertyReplace object for altering the properties
// of the replaced text
xPropertyReplace = UnoRuntime.queryInterface(XPropertyReplace, descriptor);
// Sets the replaced text property fontweight value to Bold
wv = new PropertyValue("CharWeight", -1,
new java.lang.Float(Packages.com.sun.star.awt.FontWeight.BOLD),
Packages.com.sun.star.beans.PropertyState.DIRECT_VALUE);
// Sets the replaced text property color value to RGB parameter
cv = new PropertyValue("CharColor", -1,
new java.lang.Integer(red),
Packages.com.sun.star.beans.PropertyState.DIRECT_VALUE);
// Apply the properties
props = new Array;
props[0] = cv;
props[1] = wv;
try {
xPropertyReplace.setReplaceAttributes(props);
// Only matches whole words and case sensitive
descriptor.setPropertyValue(
"SearchCaseSensitive", new java.lang.Boolean(true));
descriptor.setPropertyValue("SearchWords", new java.lang.Boolean(true));
// Replaces all instances of searchKey with new Text properties
// and gets the number of instances of the searchKey
descriptor.setSearchString(searchKey);
descriptor.setReplaceString(searchKey);
replaceable.replaceAll(descriptor);
}
catch (e) {
java.lang.System.err.println("Error setting up search properties"
+ e.getMessage());
}
}

View File

@@ -0,0 +1,135 @@
// *************************************************************
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
// *************************************************************
importClass(Packages.com.sun.star.uno.UnoRuntime);
importClass(Packages.com.sun.star.lang.XMultiComponentFactory);
importClass(Packages.com.sun.star.awt.XDialogProvider);
importClass(Packages.com.sun.star.awt.XDialog);
importClass(Packages.com.sun.star.uno.Exception);
importClass(Packages.com.sun.star.script.provider.XScriptContext);
importClass(java.lang.Thread);
importClass(java.lang.System);
function tryLoadingLibrary( xmcf, context, name )
{
try
{
obj = xmcf.createInstanceWithContext(
"com.sun.star.script.Application" + name + "LibraryContainer",
context.getComponentContext());
xLibraryContainer = UnoRuntime.queryInterface(XLibraryContainer, obj);
System.err.println("Got XLibraryContainer");
serviceObj = context.getComponentContext().getValueByName(
"/singletons/com.sun.star.util.theMacroExpander");
xme = AnyConverter.toObject(new Type(XMacroExpander), serviceObj);
bootstrapName = "bootstraprc";
if (System.getProperty("os.name").startsWith("Windows"))
{
bootstrapName = "bootstrap.ini";
}
libURL = xme.expandMacros(
"${$OOO_BASE_DIR/program/" + bootstrapName + "::BaseInstallation}" +
"/share/basic/ScriptBindingLibrary/" +
name.toLowerCase() + ".xlb/");
System.err.println("libURL is: " + libURL);
xLibraryContainer.createLibraryLink(
"ScriptBindingLibrary", libURL, false);
System.err.println("liblink created");
}
catch (e)
{
System.err.println("Got an exception loading lib: " + e.getMessage());
return false;
}
return true;
}
function getDialogProvider()
{
// UNO awt components of the Highlight dialog
//get the XMultiServiceFactory
xmcf = XSCRIPTCONTEXT.getComponentContext().getServiceManager();
args = new Array;
//get the XDocument from the context
args[0] = XSCRIPTCONTEXT.getDocument();
//try to create the DialogProvider
try {
obj = xmcf.createInstanceWithArgumentsAndContext(
"com.sun.star.awt.DialogProvider", args,
XSCRIPTCONTEXT.getComponentContext());
}
catch (e) {
System.err.println("Error getting DialogProvider object");
return null;
}
return UnoRuntime.queryInterface(XDialogProvider, obj);
}
//get the DialogProvider
xDialogProvider = getDialogProvider();
if (xDialogProvider != null)
{
//try to create the Highlight dialog (found in the ScriptBinding library)
try
{
findDialog = xDialogProvider.createDialog("vnd.sun.star.script:" +
"ScriptBindingLibrary.Highlight?location=application");
if( findDialog == null )
{
if (tryLoadingLibrary(xmcf, XSCRIPTCONTEXT, "Dialog") == false ||
tryLoadingLibrary(xmcf, XSCRIPTCONTEXT, "Script") == false)
{
System.err.println("Error loading ScriptBindingLibrary");
}
else
{
// try to create the Highlight dialog (found in the
// ScriptBindingLibrary)
findDialog = xDialogProvider.createDialog("vnd.sun.star.script:" +
"ScriptBindingLibrary.Highlight?location=application");
}
}
//launch the dialog
if ( findDialog != null )
{
findDialog.execute();
}
}
catch (e) {
System.err.println("Got exception on first creating dialog: " +
e.getMessage());
}
}

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<parcel language="JavaScript" xmlns:parcel="scripting.dtd">
<script language="JavaScript">
<locale lang="en">
<displayname value="ShowDialog" />
<description>
Example of how to show a dialog from JavaScript
</description>
</locale>
<functionname value="ShowDialog.js" />
<logicalname value="ShowDialog.JavaScript" />
</script>
<script language="JavaScript">
<locale lang="en">
<displayname value="ButtonPressHandler" />
<description>
Example of handle button press events for the Dialog
</description>
</locale>
<functionname value="ButtonPressHandler.js" />
<logicalname value="ButtonPressHandler.JavaScript" />
</script>
</parcel>

View File

@@ -0,0 +1,82 @@
# *************************************************************
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# *************************************************************
# helper function
def getNewString( theString ) :
if( not theString or len(theString) ==0) :
return ""
# should we tokenize on "."?
if theString[0].isupper() and len(theString)>=2 and theString[1].isupper() :
# first two chars are UC => first UC, rest LC
newString=theString[0:1].upper() + theString[1:].lower();
elif theString[0].isupper():
# first char UC => all to LC
newString=theString.lower()
else: # all to UC.
newString=theString.upper()
return newString;
def capitalisePython( ):
"""Change the case of a selection, or current word from upper case, to first char upper case, to all lower case to upper case..."""
import string
# The context variable is of type XScriptContext and is available to
# all BeanShell scripts executed by the Script Framework
xModel = XSCRIPTCONTEXT.getDocument()
#the writer controller impl supports the css.view.XSelectionSupplier interface
xSelectionSupplier = xModel.getCurrentController()
#see section 7.5.1 of developers' guide
xIndexAccess = xSelectionSupplier.getSelection()
count = xIndexAccess.getCount();
if(count>=1): #ie we have a selection
i=0
while i < count :
xTextRange = xIndexAccess.getByIndex(i);
#print "string: " + xTextRange.getString();
theString = xTextRange.getString();
if len(theString)==0 :
# sadly we can have a selection where nothing is selected
# in this case we get the XWordCursor and make a selection!
xText = xTextRange.getText();
xWordCursor = xText.createTextCursorByRange(xTextRange);
if not xWordCursor.isStartOfWord():
xWordCursor.gotoStartOfWord(False);
xWordCursor.gotoNextWord(True);
theString = xWordCursor.getString();
newString = getNewString(theString);
if newString :
xWordCursor.setString(newString);
xSelectionSupplier.select(xWordCursor);
else :
newString = getNewString( theString );
if newString:
xTextRange.setString(newString);
xSelectionSupplier.select(xTextRange);
i+= 1
# lists the scripts, that shall be visible inside OOo. Can be omited, if
# all functions shall be visible, however here getNewString shall be surpressed
g_exportedScripts = capitalisePython,

View File

@@ -0,0 +1,34 @@
# *************************************************************
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# *************************************************************
# HelloWorld python script for the scripting framework
def HelloWorldPython( ):
"""Prints the string 'Hello World(in Python)' into the current document"""
#get the doc from the scripting context which is made available to all scripts
model = XSCRIPTCONTEXT.getDocument()
#get the XText interface
text = model.Text
#create an XTextRange at the end of the document
tRange = text.End
#and set the string
tRange.String = "Hello World (in Python)"
return None

View File

@@ -0,0 +1,117 @@
# *************************************************************
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# *************************************************************
import uno
# a UNO struct later needed to create a document
from com.sun.star.text.ControlCharacter import PARAGRAPH_BREAK
from com.sun.star.text.TextContentAnchorType import AS_CHARACTER
from com.sun.star.awt import Size
from com.sun.star.lang import XMain
def insertTextIntoCell( table, cellName, text, color ):
tableText = table.getCellByName( cellName )
cursor = tableText.createTextCursor()
cursor.setPropertyValue( "CharColor", color )
tableText.setString( text )
def createTable():
"""creates a new writer document and inserts a table with some data (also known as the SWriter sample)"""
ctx = uno.getComponentContext()
smgr = ctx.ServiceManager
desktop = smgr.createInstanceWithContext( "com.sun.star.frame.Desktop",ctx)
# open a writer document
doc = desktop.loadComponentFromURL( "private:factory/swriter","_blank", 0, () )
text = doc.Text
cursor = text.createTextCursor()
text.insertString( cursor, "The first line in the newly created text document.\n", 0 )
text.insertString( cursor, "Now we are in the second line\n" , 0 )
# create a text table
table = doc.createInstance( "com.sun.star.text.TextTable" )
# with 4 rows and 4 columns
table.initialize( 4,4)
text.insertTextContent( cursor, table, 0 )
rows = table.Rows
table.setPropertyValue( "BackTransparent", uno.Bool(0) )
table.setPropertyValue( "BackColor", 13421823 )
row = rows.getByIndex(0)
row.setPropertyValue( "BackTransparent", uno.Bool(0) )
row.setPropertyValue( "BackColor", 6710932 )
textColor = 16777215
insertTextIntoCell( table, "A1", "FirstColumn", textColor )
insertTextIntoCell( table, "B1", "SecondColumn", textColor )
insertTextIntoCell( table, "C1", "ThirdColumn", textColor )
insertTextIntoCell( table, "D1", "SUM", textColor )
values = ( (22.5,21.5,121.5),
(5615.3,615.3,-615.3),
(-2315.7,315.7,415.7) )
table.getCellByName("A2").setValue(22.5)
table.getCellByName("B2").setValue(5615.3)
table.getCellByName("C2").setValue(-2315.7)
table.getCellByName("D2").setFormula("sum <A2:C2>")
table.getCellByName("A3").setValue(21.5)
table.getCellByName("B3").setValue(615.3)
table.getCellByName("C3").setValue(-315.7)
table.getCellByName("D3").setFormula("sum <A3:C3>")
table.getCellByName("A4").setValue(121.5)
table.getCellByName("B4").setValue(-615.3)
table.getCellByName("C4").setValue(415.7)
table.getCellByName("D4").setFormula("sum <A4:C4>")
cursor.setPropertyValue( "CharColor", 255 )
cursor.setPropertyValue( "CharShadowed", uno.Bool(1) )
text.insertControlCharacter( cursor, PARAGRAPH_BREAK, 0 )
text.insertString( cursor, " This is a colored Text - blue with shadow\n" , 0 )
text.insertControlCharacter( cursor, PARAGRAPH_BREAK, 0 )
textFrame = doc.createInstance( "com.sun.star.text.TextFrame" )
textFrame.setSize( Size(15000,400))
textFrame.setPropertyValue( "AnchorType" , AS_CHARACTER )
text.insertTextContent( cursor, textFrame, 0 )
textInTextFrame = textFrame.getText()
cursorInTextFrame = textInTextFrame.createTextCursor()
textInTextFrame.insertString( cursorInTextFrame, "The first line in the newly created text frame.", 0 )
textInTextFrame.insertString( cursorInTextFrame, "\nWith this second line the height of the rame raises.",0)
text.insertControlCharacter( cursor, PARAGRAPH_BREAK, 0 )
cursor.setPropertyValue( "CharColor", 65536 )
cursor.setPropertyValue( "CharShadowed", uno.Bool(0) )
text.insertString( cursor, " That's all for now !!" , 0 )
g_exportedScripts = createTable,

View File

@@ -0,0 +1,371 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="CommonLang" script:language="StarBasic">REM ***** BASIC *****
&apos; Column A has the index 1
Public Const SBCOLUMNNAME1 = 3 &apos; Stock names, sheet 1
Public Const SBCOLUMNID1 = 4 &apos; Stock ID, sheet 1
Public Const SBCOLUMNQUANTITY1 = 5 &apos; Stock quantity sheet 1
Public Const SBCOLUMNRATE1 = 7 &apos; Price for stocks, sheet 1
Public Const SBCOLUMNNAME2 = 3 &apos; Stock names, sheet 2
Public Const SBCOLUMNDATE2 = 4 &apos; Transaction dates, sheet 2
Public Const SBCOLUMNQUANTITY2 = 5 &apos; Transaction quantity, sheet 2
Public Const SBCOLUMNRATE2 = 6 &apos; Price for stocks, sheet 2
Public Const SBCOLUMNPROVPERCENT2 = 7 &apos; Provision in %, sheet 2
Public Const SBCOLUMNPROVMIN2 = 8 &apos; Minimum provision, sheet 2
Public Const SBCOLUMNPROVFIX2 = 9 &apos; Fixed provision, sheet 2
Public Const SBCOLUMNPROCEEDS2 = 12 &apos; Profit, sheet 2
Public Const SBCOLUMNQTYSOLD2 = 14 &apos; Quantity sold, sheet 2
Public Const SBCOLUMNQTYREST2 = 15 &apos; Quantity not sold yet, sheet 2
Public Const SBCOLUMNPRCREST2 = 16 &apos; Proportional proce for quantity not sold yet, sheet 2
Public Const SBCOLUMNREALPROC2 = 17 &apos; Realized proceeds, sheet 2
Public Const SBCOLUMNDIVIDEND2 = 18 &apos; Dividend paid, sheet 2
Public Const SBCOLUMNREALPROFIT2 = 19 &apos; Realized profit, sheet 2
Public Const SBROWFIRSTTRANSACT2 = 8 &apos; First data row, sheet 2
Public Const SBROWHEADER1 = 6 &apos; Headline, sheet 1
Public Const SBMSGOK = 0
Public Const SBMSGYESNO = 4
Public Const SBMSGSTOP = 16
Public Const SBMSGQUESTION = 32
Public Const SBMSGDEFAULTBTN2 = 256
Public Const SBHASID = 1 &apos; 0 = no ID, 1 = stocks have an ID
Public Const SBDIALOGSELL = 1 &apos; Step for main dialog
Public Const SBDIALOGBUY = 2 &apos; Step for main dialog
Public Const SBBINARY = 0
Public TransactMode as Integer
Public Const LIFO = -1
Public Const FIFO = 1
Public Const HANDLEDIVIDEND = 1
Public Const HANDLESPLIT = 2
Global oDocument as Object
Global oDocFormats() as Object
Global oController as Object
Global oFirstSheet as Object
Global oBankSheet as Object
Global oMovementSheet as Object
Global sDocLanguage as String
Global sDocCountry as String
Global oSheets as Object
Global oDocLocale as New com.sun.star.lang.Locale
Global bEnableMarket as Boolean
Global bEnableInternet as Boolean
Global oMarketModel as Object
Global oInternetModel as Object
Global sCurCurrency$, sCurExtension$, sCurChartSource$, sCurStockIDLabel$, sCurSeparator$
Public oNumberFormatter as Object
Public bDebugmode as Boolean
Global GlobListindex as Integer
Public blabla() as String
Public SplitDate as Date
Public oChartSheet as Object
Public oBackgroundSheet as Object
Public Const SBDATECOLUMN = 3
Public Const SBVALUECOLUMN = 4
Public Const SBSTARTROW = 25
Public Const SBCHARTPERIOD = 14
Public Const SBINTERVAL = &quot;d&quot;
Public sColumnHeader as String
Public StartDate as Date
Public EndDate as Date
Public iCurRow as Integer
Public iMaxRow as Integer
Public iStartDay as Integer
Public iStartMonth as Integer
Public iStartYear as Integer
Public iEndDay as Integer
Public iEndMonth as Integer
Public iEndYear as Integer
Public oStatusLine as Object
Public Today as Date
Public sInterval as String
Public ShortMonths(11,1)
Public iStep as Integer
Public sDepotCurrency as String
Public iValueCol as Integer
Public DlgReference as Object
Public DlgTransaction as Object
Public DlgStockRates as Object
Public DlgStartUp as Object
Public TransactModel as Object
Public StockRatesModel as Object
Public StartUpModel as Object
Public StockRatesTitle(1 To 3)
Public TransactTitle(1 To 2)
Public NullList()
Public sStartupWelcome$, sStartupChooseMarket$, sStartupHint$
Public sMarket(7,10) as String
Public sCountryMarket(7,10) as String
Public cDlgCaption1$, cDlgCaption2$
Public sMsgError$, sMsgNoName$, sMsgNoQuantity$, sMsgNoDividend$, sMsgNoExchangeRate$
Public sMsgNoValidExchangeDate$, sMsgWrongExchangeDate$, sMsgSellTooMuch$, sMsgConfirm$
Public sMsgFreeStock$, sMsgTotalLoss$, sMsgEndDatebeforeNow$, sMsgStartDatebeforeEndDate$
Public sOk$, sCancel$
Public sMsgAuthorization$, sMsgDeleteAll$
Public SellMethod$
Public cSplit$
Global HistoryChartSource as String
Public DateCellStyle as String
Public CurrCellStyle as String
Public sStartDate$, sEndDate$, sHistory$
Public sInsertStockname$
Public sProductname$, sTitle$
Public sInsertStocks$, sStockname$, sNoInternetUpdate$, sMarketplace$, sNoInternetDataAvailable$
Public sCheckInternetSettings as String
Sub LoadLanguage()
LoadDepotDialogs()
Select Case sDocLanguage
Case &quot;de&quot;
LoadGermanLanguage()
Case &quot;en&quot;
LoadEnglishLanguage()
Case &quot;fr&quot;
LoadFrenchLanguage()
Case &quot;it&quot;
LoadItalianLanguage()
Case &quot;es&quot;
LoadSpanishLanguage()
Case &quot;sv&quot;
LoadSwedishLanguage()
Case &quot;ja&quot;
LoadJapaneseLanguage()
Case &quot;ko&quot;
LoadKoreanLanguage()
Case &quot;zh&quot;
If sDocCountry = &quot;CN&quot; Then
LoadChineseSimpleLanguage()
Else
LoadChineseTradLanguage()
End If
End Select
InitializeStartUpModel()
End Sub
Sub CompleteMarketList()
Dim EuroIndex as Integer
Dim LocCountry as String
Dim LocLanguage as String
Dim sLangList() as String
Dim sCountryList() as String
Dim sExtensionList() as String
Dim MaxIndex as Integer
Dim bIsLocale as Boolean
GlobListIndex = -1
For n = 0 To 5
LocLanguage = sMarket(n,6)
LocCountry = sMarket(n,7)
If Instr(1,LocLanguage,&quot;;&quot;,SBBINARY) = 0 Then
bIsLocale = CheckDocLocale(LocLanguage, LocCountry)
Else
EuroIndex = 0
sLangList() = ArrayoutofString(LocLanguage, &quot;;&quot;, MaxIndex)
sCountryList() = ArrayoutofString(LocCountry, &quot;;&quot;, MaxIndex)
sExtensionList() = ArrayoutofString(sMarket(n,8), &quot;;&quot;, MaxIndex)
For m = 0 To MaxIndex
bIsLocale = CheckDocLocale(sLangList(m), sCountryList(m))
If bIsLocale Then
EuroIndex = m
Exit For
End If
Next m
sMarket(n,6) = sLangList(EuroIndex)
sMarket(n,7) = sCountryList(EuroIndex)
sMarket(n,8) = sExtensionList(EuroIndex)
End If
If bIsLocale Then
GlobListIndex = n
Exit For
End If
Next n
End Sub
Sub LocalizedCurrencies()
If GlobListIndex = -1 Then
sCountryMarket(0,0) = &quot;Euro&quot;
sCountryMarket(0,1) = chr(8364)
sCountryMarket(0,2) = &quot;Paris&quot;
sCountryMarket(0,3) = &quot;http://fr.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.PA&amp;f=s4l1t1c1ghov&amp;e=.csv&quot;
sCountryMarket(0,5) = &quot;Code&quot;
sCountryMarket(0,6) = &quot;fr&quot;
sCountryMarket(0,7) = &quot;FR&quot;
sCountryMarket(0,8) = &quot;40C&quot;
sCountryMarket(0,9) = &quot;59/9&quot;
sCountryMarket(0,10) = &quot;1&quot;
sCountryMarket(1,0) = &quot;Euro&quot;
sCountryMarket(1,1) = chr(8364)
sCountryMarket(1,2) = &quot;Milano&quot;
sCountryMarket(1,3) = &quot;http://it.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.MI&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sCountryMarket(1,5) = &quot;Codice&quot;
sCountryMarket(1,6) = &quot;it&quot;
sCountryMarket(1,7) = &quot;IT&quot;
sCountryMarket(1,8) = &quot;410&quot;
sCountryMarket(1,9) = &quot;44&quot;
sCountryMarket(1,10) = &quot;1&quot;
sCountryMarket(2,0) = &quot;Euro&quot;
sCountryMarket(2,1) = chr(8364)
sCountryMarket(2,2) = &quot;Madrid&quot;
sCountryMarket(2,3) = &quot;http://es.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;m=MC&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sCountryMarket(2,5) = &quot;Simbolo&quot;
sCountryMarket(2,6) = &quot;es&quot;
sCountryMarket(2,7) = &quot;ES&quot;
sCountryMarket(2,8) = &quot;40A&quot;
sCountryMarket(2,9) = &quot;44&quot;
sCountryMarket(2,10) = &quot;1&quot;
sCountryMarket(3,0) = &quot;Dansk krone&quot;
sCountryMarket(3,1) = &quot;kr&quot;
sCountryMarket(3,2) = &quot;København&quot;
sCountryMarket(3,3) = &quot;http://dk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID.CO&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sCountryMarket(3,5) = &quot;Aktiesymbol&quot;
sCountryMarket(3,6) = &quot;da&quot;
sCountryMarket(3,7) = &quot;DK&quot;
sCountryMarket(3,8) = &quot;406&quot;
sCountryMarket(3,9) = &quot;44&quot;
sCountryMarket(3,10) = &quot;1&quot;
sCountryMarket(4,0) = &quot;Svensk krona&quot;
sCountryMarket(4,1) = &quot;kr&quot;
sCountryMarket(4,2) = &quot;Stockholm&quot;
sCountryMarket(4,3) = &quot;http://se.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;f=sl1d1t1c1ohgv&amp;e=.c&quot;
sCountryMarket(4,5) = &quot;Kod&quot;
sCountryMarket(4,6) = &quot;sv&quot;
sCountryMarket(4,7) = &quot;SE&quot;
sCountryMarket(4,8) = &quot;41D&quot;
sCountryMarket(4,9) = &quot;44&quot;
sCountryMarket(4,10) = &quot;1&quot;
&apos; Taiwan Dollar
sCountryMarket(5,0) = &quot;新臺幣&quot;
sCountryMarket(5,1) = &quot;&quot;
sCountryMarket(5,2) = &quot;代號&quot;
sCountryMarket(5,3) = &quot;http://tw.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.TW&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sCountryMarket(5,5) = &quot;代號&quot;
sCountryMarket(5,6) = &quot;zh&quot;
sCountryMarket(5,7) = &quot;TW&quot;
sCountryMarket(5,8) = &quot;404&quot;
sCountryMarket(5,9) = &quot;44&quot;
sCountryMarket(5,10) = &quot;1&quot;
&apos; Chinese Yuan
sCountryMarket(6,0) = &quot;人民币&quot;
sCountryMarket(6,1) = &quot;&quot;
sCountryMarket(6,2) = &quot;代号&quot;
sCountryMarket(6,3) = &quot;http://cn.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.SS&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sCountryMarket(6,5) = &quot;代号&quot;
sCountryMarket(6,6) = &quot;zh&quot;
sCountryMarket(6,7) = &quot;CN&quot;
sCountryMarket(6,8) = &quot;804&quot;
sCountryMarket(6,9) = &quot;44&quot;
sCountryMarket(6,10) = &quot;1&quot;
&apos; korean Won
sCountryMarket(7,0) = &quot;한국 원화&quot;
sCountryMarket(7,1) = &quot;&quot;
sCountryMarket(7,2) = &quot;서울&quot;
sCountryMarket(7,3) = &quot;http://kr.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.KS&amp;f=snl1d1t1c1ohgv&amp;e=.csv&quot;
sCountryMarket(7,5) = &quot;종목 코드&quot;
sCountryMarket(7,6) = &quot;ko&quot;
sCountryMarket(7,7) = &quot;KR&quot;
sCountryMarket(7,8) = &quot;412&quot;
sCountryMarket(7,9) = &quot;44&quot;
sCountryMarket(7,10) = &quot;2&quot;
&apos; sCountryMarket(5,0) = &quot;Российский рубль&quot;
&apos; sCountryMarket(5,1) = &quot;р.&quot;
&apos; sCountryMarket(5,2) = &quot;&quot;
&apos; sCountryMarket(5,3) = &quot;&quot;
&apos; sCountryMarket(5,5) = &quot;&quot;
&apos; sCountryMarket(5,6) = &quot;ru&quot;
&apos; sCountryMarket(5,7) = &quot;RU&quot;
&apos; sCountryMarket(5,8) = &quot;-419&quot;
&apos; sCountryMarket(5,9) = &quot;&quot;
&apos;
&apos; sCountryMarket(6,0) = &quot;Złoty polski&quot;
&apos; sCountryMarket(6,1) = &quot;&quot;
&apos; sCountryMarket(6,2) = &quot;&quot;
&apos; sCountryMarket(6,3) = &quot;&quot;
&apos; sCountryMarket(6,5) = &quot;&quot; &apos;Still Todo!!
&apos; sCountryMarket(6,6) = &quot;pl&quot;
&apos; sCountryMarket(6,7) = &quot;PL&quot;
&apos; sCountryMarket(6,8) = &quot;-415&quot;
&apos; sCountryMarket(6,9) = &quot;&quot;
&apos;
&apos; sCountryMarket(7,0) = &quot;Türkische Lira&quot;
&apos; sCountryMarket(7,1) = &quot;TL&quot;
&apos; sCountryMarket(7,2) = &quot;&quot;
&apos; sCountryMarket(7,3) = &quot;&quot;
&apos; sCountryMarket(7,5) = &quot;&quot; &apos;Still Todo!!
&apos; sCountryMarket(7,6) = &quot;tr&quot;
&apos; sCountryMarket(7,7) = &quot;TR&quot;
&apos; sCountryMarket(7,8) = &quot;-41F&quot;
&apos; sCountryMarket(7,9) = &quot;&quot;
Dim n as Integer
Dim m as Integer
&apos; Dim sCountryMarket(6,9) as String
For n = 0 To Ubound(sCountryMarket(),1)
If sDocLanguage = sCountryMarket(n,6) and sDocCountry = sCountryMarket(n,7) Then
GlobListIndex = 6
For m = 0 To 10
sMarket(6,m) = sCountryMarket(n,m)
Next m
Exit For
End If
Next n
End If
End Sub
Sub LoadDepotDialogs()
DlgTransaction = LoadDialog(&quot;Depot&quot;, &quot;Dialog2&quot;)
DlgStockRates = LoadDialog(&quot;Depot&quot;, &quot;Dialog3&quot;)
DlgStartUp = LoadDialog(&quot;Depot&quot;, &quot;Dialog4&quot;)
TransactModel = DlgTransaction.Model
StockRatesModel = DlgStockRates.Model
StartUpModel = DlgStartUp.Model
End Sub
Sub InitializeStartUpModel()
With StartUpModel
.lblWelcome.Label = sStartupWelcome &amp; Chr(13) &amp; chr(13) &amp; sStartUpChooseMarket
sStartUpHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
.lblHint.Label = sStartupHint
&apos; .cmdGoOn.Enabled = Ubound(StartUpModel.lstMarkets.SelectedItems()) &lt;&gt; -1
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
End Sub</script:module>

View File

@@ -0,0 +1,198 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Currency" script:language="StarBasic">REM ***** BASIC *****
Option Explicit
Dim bDoUnLoad as Boolean
Sub Startup()
Dim i as Integer
Dim a as Integer
Dim ListString as String
Dim MarketListBoxControl as Object
Initialize(False)
MarketListBoxControl = DlgStartUp.GetControl(&quot;lstMarkets&quot;)
a = 0
For i = 0 To Ubound(sMarket(),1)
ListString = sMarket(i,0)
If sMarket(i,0) &lt;&gt; &quot;&quot; Then
If sMarket(i,3) = &quot;&quot; Then
ListString = ListString &amp; &quot; (&quot; &amp; sNoInternetUpdate &amp; &quot;)&quot;
Else
ListString = ListString &amp; &quot; (&quot; &amp; sMarketplace &amp; &quot; &quot; &amp; sMarket(i,2) &amp; &quot;)&quot;
End If
MarketListBoxControl.AddItem(ListString, a)
a = a + 1
End If
Next i
MarketListBoxControl.SelectItemPos(GlobListIndex, True)
DlgStartUp.Title = sDepotCurrency
DlgStartUp.Model.cmdGoOn.DefaultButton = True
DlgStartUp.GetControl(&quot;lstMarkets&quot;).SetFocus()
DlgStartUp.Execute()
DlgStartUp.Dispose()
End Sub
Sub EnableGoOnButton()
StartUpModel.cmdGoOn.Enabled = True
StartUpModel.cmdGoOn.DefaultButton = True
End Sub
Sub CloseStartUpDialog()
DlgStartUp.EndExecute()
&apos; oDocument.Dispose()
End Sub
Sub DisposeDocument()
If bDoUnload Then
oDocument.Dispose()
End If
End Sub
Sub ChooseMarket(Optional aEvent)
Dim Index as Integer
Dim bIsDocLanguage as Boolean
Dim bIsDocCountry as Boolean
oInternetModel = GetControlModel(oDocument.Sheets(0), &quot;CmdInternet&quot;)
If Not IsMissing(aEvent) Then
Index = StartupModel.lstMarkets.SelectedItems(0)
oInternetModel.Tag = Index
Else
Index = oInternetModel.Tag
End If
oMarketModel = GetControlModel(oDocument.Sheets(0), &quot;CmdHistory&quot;)
sCurCurrency = sMarket(Index,1)
If Index = 0 Then
HistoryChartSource = sMarket(Index,4)
End If
sCurStockIDLabel = sMarket(Index,5)
sCurExtension = sMarket(Index,8)
iValueCol = Val(sMarket(Index,10)
If Instr(sCurExtension,&quot;;&quot;) &lt;&gt; 0 Then
&apos; Take the german extension as the stock place is Frankfurt
sCurExtension = &quot;407&quot;
End If
sCurChartSource = sMarket(Index,3)
bIsDocLanguage = Instr(1, sMarket(Index,6), sDocLanguage, SBBINARY) &lt;&gt; 0
bIsDocCountry = Instr(1, sMarket(Index,7), sDocCountry, SBBINARY) &lt;&gt; 0 OR SDocCountry = &quot;&quot;
sCurSeparator = sMarket(Index,9)
TransactModel.txtRate.CurrencySymbol = sCurCurrency
TransactModel.txtFix.CurrencySymbol = sCurCurrency
TransactModel.txtMinimum.CurrencySymbol = sCurCurrency
bEnableMarket = Index = 0
bEnableInternet = sCurChartSource &lt;&gt; &quot;&quot;
oMarketModel.Enabled = bEnableMarket
oInternetModel.Enabled = bEnableInternet
If Not IsMissing(aEvent) Then
ConvertStylesCurrencies()
bDoUnload = False
DlgStartUp.EndExecute()
End If
End Sub
Sub ConvertStylesCurrencies()
Dim m as integer
Dim aStyleFormat as Object
Dim StyleName as String
Dim bAddToList as Boolean
Dim oStyle as Object
Dim oStyles as Object
UnprotectSheets(oSheets)
oFirstSheet.GetCellByPosition(SBCOLUMNID1, SBROWHEADER1).SetString(sCurStockIDLabel)
oStyles = oDocument.StyleFamilies.GetbyIndex(0)
For m = 0 To oStyles.count-1
oStyle = oStyles.GetbyIndex(m)
StyleName = oStyle.Name
bAddToList = CheckFormatType(oStyle)
If bAddToList Then
SwitchNumberFormat(ostyle, oDocFormats, sCurCurrency, sCurExtension)
End If
Next m
ProtectSheets(oSheets)
End Sub
Sub SwitchNumberFormat(oObject as Object, oFormats as object, sNewSymbol as String, sNewExtension as String)
Dim nFormatLanguage as Integer
Dim nFormatDecimals as Integer
Dim nFormatLeading as Integer
Dim bFormatLeading as Integer
Dim bFormatNegRed as Integer
Dim bFormatThousands as Integer
Dim aNewStr as String
Dim iNumberFormat as Long
Dim sSimpleStr as String
Dim nSimpleKey as Long
Dim aFormat()
Dim oLocale as New com.sun.star.lang.Locale
&apos; Numberformat with the new Symbol as Base for new Format
sSimpleStr = &quot;0 [$&quot; &amp; sNewSymbol &amp; &quot;-&quot; &amp; sNewExtension &amp; &quot;]&quot;
nSimpleKey = Numberformat(oFormats, sSimpleStr, oDocLocale)
On Local Error Resume Next
iNumberFormat = oObject.NumberFormat
If Err &lt;&gt; 0 Then
Msgbox &quot;Error Reading the Number Format&quot;
Resume CLERROR
End If
On Local Error GoTo NOKEY
aFormat() = oFormats.getByKey(iNumberFormat)
On Local Error GoTo 0
&apos; set new currency format with according settings
nFormatDecimals = aFormat.Decimals
nFormatLeading = aFormat.LeadingZeros
bFormatNegRed = aFormat.NegativeRed
bFormatThousands = aFormat.ThousandsSeparator
oLocale = aFormat.Locale
aNewStr = oFormats.generateFormat(nSimpleKey, oLocale, bFormatThousands, bFormatNegRed, nFormatDecimals, nFormatLeading)
oObject.NumberFormat = Numberformat(oFormats, aNewStr, oLocale)
NOKEY:
If Err &lt;&gt; 0 Then
Resume CLERROR
End If
CLERROR:
End Sub
Function Numberformat( oFormats as Object, aFormatStr as String, oLocale as Variant )
Dim nRetkey
nRetKey = oFormats.queryKey(aFormatStr, oLocale, True)
If nRetKey = -1 Then
nRetKey = oFormats.addNew( aFormatStr, oLocale )
If nRetKey = -1 Then nRetKey = 0
End If
Numberformat = nRetKey
End Function
Function CheckFormatType(oStyle as Object)
Dim oFormatofObject as Object
oFormatofObject = oDocFormats.getByKey(oStyle.NumberFormat)
CheckFormatType = INT(oFormatOfObject.Type) AND com.sun.star.util.NumberFormat.CURRENCY
End Function</script:module>

View File

@@ -0,0 +1,520 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Depot" script:language="StarBasic">Option Explicit
Sub Initialize(Optional bChooseMarketPlace as Boolean)
Dim bEnableHistory as Boolean
GlobalScope.BasicLibraries.LoadLibrary(&quot;Tools&quot;)
&apos; oMarketModel = GetControlModel(oDocument.Sheets(0), &quot;CmdHistory&quot;)
&apos; bEnableHistory = oMarketModel.Enabled
ToggleWindow(False)
Today = Date()
bDebugmode = False
oDocument = ThisComponent
oController = oDocument.GetCurrentController
oSheets = oDocument.Sheets
oFirstSheet = oSheets(0)
oMovementSheet = oSheets(1)
oBankSheet = oSheets(2)
oDocFormats = oDocument.NumberFormats
oNumberFormatter = CreateUnoService(&quot;com.sun.star.util.NumberFormatter&quot;)
oNumberFormatter.AttachNumberFormatsSupplier(oDocument)
oDocLocale = oDocument.CharLocale
sDocLanguage = oDocLocale.Language
sDocCountry = oDocLocale.Country
LoadLanguage()
ToggleWindow(True)
&apos; oMarketModel.Enabled = bEnableHistory
If Not IsMissing(bChooseMarketPlace) Then
If bChoosemarketPlace Then
ChooseMarket()
End If
Else
ChooseMarket()
End If
If Not IsMissing(bChooseMarketPlace) Then
If bChooseMarketPlace Then
oMarketModel.Enabled = bEnableMarket
oInternetModel.Enabled = bEnableInternet
End If
End If
End Sub
Sub Buy()
Initialize(True)
FillListbox(DlgTransaction.GetControl(&quot;lstBuyStocks&quot;), TransactTitle(SBDIALOGBUY), False)
SetupTransactionControls(SBDIALOGBUY)
EnableTransactionControls(False)
DlgTransaction.Execute()
End Sub
Sub Sell()
Initialize(True)
If FillListbox(DlgTransaction.GetControl(&quot;lstSellStocks&quot;), TransactTitle(SBDIALOGSELL), True) Then
SetupTransactionControls(SBDIALOGSELL)
EnableTransactionControls(False)
DlgTransaction.Execute()
End If
End Sub
Sub Reset()
Dim TransactionCount as Integer
Dim StockCount, iStartRow, i as Integer
Dim oRows, oRange as Object
Dim StockName as String
Initialize(True)
&apos; Delete transactions and reset overview
If MsgBox(sMsgDeleteAll, SBMSGYESNO+SBMSGQUESTION+SBMSGDEFAULTBTN2, sMsgAuthorization) = 6 Then
&apos; Assumption: If and only if there is an overview, then there are transactions, too
UnprotectSheets(oSheets)
StockCount = GetStocksCount(iStartRow)
For i = 1 To StockCount
StockName = oFirstSheet.GetCellbyPosition(SBCOLUMNNAME1, iStartRow + i).String
If oSheets.HasbyName(StockName) Then
oSheets.RemoveByName(StockName)
End If
Next
oDocument.AddActionLock
RemoveStockRows(oFirstSheet, iStartRow + 1, StockCount)
TransactionCount = GetTransactionCount(iStartRow)
RemoveStockRows(oMovementSheet, iStartRow + 2, TransactionCount)
ProtectSheets(oSheets)
oDocument.RemoveActionLock
End If
End Sub
Sub TransactionOk
Dim Sold as Long
Dim RestQuantity, Value, PartialValue, Profit
Dim iNewRow as Integer, iRow as Integer
Dim iStockRow as Long, iRestQuantity as Long
Dim oNameCell as Object
Dim CellStockName as String, SelStockName as String
Dim CurRate as Double
Dim TransactDate as Date
Dim LocStockName as String
&apos; Check for rate entered
If TransactModel.txtRate.Value = 0 Then
If TransactModel.Step = SBDIALOGBUY Then
If MsgBox(sMsgFreeStock, SBMSGYESNO+SBMSGQUESTION, sMsgConfirm)=7 Then
Exit Sub
End If
Else
If MsgBox(sMsgTotalLoss, SBMSGYESNO+SBMSGQUESTION, sMsgConfirm)=7 Then
Exit Sub
End If
End If
End If
CurRate = TransactModel.txtRate.Value
TransactDate = CDateFromISO(TransactModel.txtDate.Date)
DlgTransaction.EndExecute()
UnprotectSheets(oSheets)
iNewRow = DuplicateRow(oMovementSheet, &quot;HiddenRow3&quot;)
If TransactModel.Step = SBDIALOGBUY Then
CellStockName = TransactModel.lstBuyStocks.Text
If Instr(1,CellStockName,&quot;$&quot;) &lt;&gt; 0 Then
CellStockName = &quot;&apos;&quot; &amp; CellStockName &amp; &quot;&apos;&quot;
End If
oMovementSheet.GetCellByPosition(SBCOLUMNNAME2, iNewRow).String = CellStockName
oMovementSheet.GetCellByPosition(SBCOLUMNQUANTITY2, iNewRow).Value = TransactModel.txtQuantity.Value
Else
CellStockName = DlgTransaction.GetControl(&quot;lstSellStocks&quot;).GetSelectedItem()
oMovementSheet.GetCellByPosition(SBCOLUMNNAME2, iNewRow).String = CellStockName
oMovementSheet.GetCellByPosition(SBCOLUMNQUANTITY2, iNewRow).Value = -TransactModel.txtQuantity.Value
End If
oMovementSheet.GetCellByPosition(SBCOLUMNDATE2, iNewRow).Value = CDateFromISO(TransactModel.txtDate.Date)
oMovementSheet.GetCellByPosition(SBCOLUMNRATE2, iNewRow).Value = TransactModel.txtRate.Value
oMovementSheet.GetCellByPosition(SBCOLUMNPROVPERCENT2, iNewRow).Value = TransactModel.txtCommission.EffectiveValue
oMovementSheet.GetCellByPosition(SBCOLUMNPROVMIN2, iNewRow).Value = TransactModel.txtMinimum.Value
oMovementSheet.GetCellByPosition(SBCOLUMNPROVFIX2, iNewRow).Value = TransactModel.txtFix.Value
&apos; Buy stocks: Update overview for new stocks
If TransactModel.Step = SBDIALOGBUY Then
iStockRow = GetStockRowIndex(CellStockName)
If iStockRow = -1 Then
iNewRow = DuplicateRow(oFirstSheet, &quot;HiddenRow2&quot;)
oFirstSheet.GetCellByPosition(SBCOLUMNNAME1, iNewRow).String = CellStockName
oFirstSheet.GetCellByPosition(SBCOLUMNID1, iNewRow).String = TransactModel.txtStockID.Text
iStockRow = GetStockRowIndex(CellStockName)
End If
&apos; Sell stocks: Get transaction value, then update Transaction sheet
ElseIf TransactModel.Step = SBDIALOGSELL Then
Profit = oMovementSheet.GetCellByPosition(SBCOLUMNPROCEEDS2, iNewRow).Value
Value = Profit
Sold = TransactModel.txtQuantity.Value
SelStockName = DlgTransaction.GetControl(&quot;lstSellStocks&quot;).GetSelectedItem()
&apos; Go to first name
If TransactMode = FIFO Then
iRow = SBROWFIRSTTRANSACT2
Else
iRow = iNewRow-1
End If
&apos; Check that no transaction after split date exists else cancel split
Do While Sold &gt; 0
oNameCell = oMovementSheet.GetCellByPosition(SBCOLUMNNAME2, iRow)
CellStockName = oNameCell.String
If CellStockName = SelStockName Then
&apos; Update transactions: Note quantity sold
RestQuantity = oMovementSheet.GetCellByPosition(SBCOLUMNQTYREST2, iRow).Value
&apos; If there still is a rest left ...
If RestQuantity &gt; 0 Then
If RestQuantity &lt; Sold Then
&apos; Recalculate profit of new transaction
Profit = Profit - oMovementSheet.GetCellByPosition(SBCOLUMNPRCREST2, iRow).Value
AddValueToCellContent(SBCOLUMNQTYSOLD2, iRow, RestQuantity)
PartialValue = RestQuantity / Sold * Value
AddValueToCellContent(SBCOLUMNREALPROC2, iRow, PartialValue)
Sold = Sold - RestQuantity
Value = Value - PartialValue
Else
&apos; Recalculate profit of neTransactModel.lstBuyStocks.Textw transaction
PartialValue = oMovementSheet.GetCellByPosition(SBCOLUMNPRCREST2, iRow).Value
Profit = Profit - PartialValue/RestQuantity * Sold
&apos; Update sold shares cell
AddValueToCellContent(SBCOLUMNQTYSOLD2, iRow, Sold)
&apos; Update sales turnover cell
AddValueToCellContent(SBCOLUMNREALPROC2, iRow, Value)
&apos; Update variables for rest of transaction
Sold = 0
Value = 0
End If
End If
End If
iRow = iRow + TransactMode
Loop
oMovementSheet.GetCellByPosition(SBCOLUMNREALPROFIT2,iNewRow).Value = Profit
iStockRow = GetStockRowIndex(SelStockName)
iRestQuantity = oFirstSheet.GetCellbyPosition(SBCOLUMNQUANTITY1, iStockRow).Value
&apos; If iRestQuantity = 0 Then
&apos; If oSheets.HasbyName(SelStockName) Then
&apos; oSheets.RemoveByName(SelStockName)
&apos; End If
&apos; Else
&apos; End If
End If
InsertCurrentValue(CurRate, iStockRow,TransactDate)
ProtectSheets(oSheets)
End Sub
Sub SelectStockname(aEvent as Object)
Dim iCurRow as Integer
Dim CurStockName as String
With TransactModel
&apos; Find row with stock name
If TransactModel.Step = SBDIALOGBUY Then
CurStockName = .lstBuyStocks.Text
iCurRow = GetStockRowIndex(CurStockName)
.txtQuantity.ValueMax = 10000000
Else
Dim ListBoxList() as String
ListBoxList() = GetSelectedListboxItems(aEvent.Source.getModel())
CurStockName = ListBoxList(0)
&apos; CurStockName = DlgTransaction.GetControl(aEvent.Source.getModel.Name).GetSelectedItem()
iCurRow = GetStockRowIndex(CurStockName)
Dim fdouble as Double
fdouble = oFirstSheet.GetCellByPosition(SBCOLUMNQUANTITY1, iCurRow).Value
.txtQuantity.Value = fdouble
.txtQuantity.ValueMax = oFirstSheet.GetCellByPosition(SBCOLUMNQUANTITY1, iCurRow).Value
.txtRate.Value = oFirstSheet.GetCellbyPosition(SBCOLUMNRATE1, iCurRow).Value
End If
.txtStockID.Enabled = .Step = SBDIALOGBUY
.lblStockID.Enabled = .Step = SBDIALOGBUY
&apos; Default settings for quantity and rate
.txtStockID.Text = GetStockID(CurStockName, iCurRow)
End With
EnableTransactionControls(CurStockName &lt;&gt; &quot;&quot;)
TransactModel.cmdGoOn.DefaultButton = True
End Sub
Sub HandleStocks(Mode as Integer, oDialog as Object)
Dim DividendPerShare, DividendTotal, RestQuantity, OldValue
Dim SelStockName, CellStockName as String
Dim oNameCell as Object, oDateCell as Object
Dim iRow as Integer
Dim oDividendCell as Object
Dim Amount
Dim OldNumber, NewNumber as Integer
Dim NoteText as String
Dim TotalStocksCount as Long
Dim oModel as Object
oDocument.AddActionLock
oDialog.EndExecute()
oModel = oDialog.Model
SelStockName = DlgStockRates.GetControl(&quot;lstStockNames&quot;).GetSelectedItem()
Select Case Mode
Case HANDLEDIVIDEND
Dim bTakeTotal as Boolean
&apos; Update transactions: Enter dividend paid for all Buy transactions not sold completely
bTakeTotal = oModel.optTotal.State = 1
If bTakeTotal Then
DividendTotal = oModel.txtDividend.Value
iRow = GetStockRowIndex(SelStockName)
TotalStocksCount = oFirstSheet.GetCellByPosition(SBCOLUMNQUANTITY1,iRow).Value
DividendPerShare = DividendTotal/TotalStocksCount
Else
DividendPerShare = oModel.txtDividend.Value
End If
Case HANDLESPLIT
&apos; Store entered values in variables
OldNumber = oModel.txtOldRate.Value
NewNumber = oModel.txtNewRate.Value
SplitDate = CDateFromISO(oModel.txtDate.Date)
iRow = SBROWFIRSTTRANSACT2
NoteText = cSplit &amp; SplitDate &amp; &quot;, &quot; &amp; oModel.txtOldRate.Value &amp; oModel.lblColon.Label &amp; oModel.txtNewRate.Value
Do
oNameCell = oMovementSheet.GetCellByPosition(SBCOLUMNNAME2, iRow)
CellStockName = oNameCell.String
If CellStockName = SelStockName Then
oDateCell = oMovementSheet.GetCellByPosition(SBCOLUMNDATE2, iRow)
If oDateCell.Value &gt;= SplitDate Then
MsgBox sMsgWrongExchangeDate, SBMSGOK + SBMSGSTOP, sMsgError
Exit Sub
End If
End If
iRow = iRow + 1
Loop Until CellStockName = &quot;&quot;
End Select
iRow = SBROWFIRSTTRANSACT2
UnprotectSheets(oSheets)
Do
oNameCell = oMovementSheet.GetCellByPosition(SBCOLUMNNAME2, iRow)
CellStockName = oNameCell.String
If CellStockName = SelStockName Then
Select Case Mode
Case HANDLEDIVIDEND
RestQuantity = oMovementSheet.GetCellByPosition(SBCOLUMNQTYREST2, iRow).Value
If RestQuantity &gt; 0 Then
oDividendCell = oMovementSheet.GetCellByPosition(SBCOLUMNDIVIDEND2, iRow)
OldValue = oDividendCell.Value
oDividendCell.Value = OldValue + RestQuantity * DividendPerShare
End If
Case HANDLESPLIT
oDateCell = oMovementSheet.GetCellByPosition(SBCOLUMNDATE2, iRow)
SplitCellValue(oMovementSheet, NewNumber, OldNumber, SBCOLUMNQUANTITY2, iRow, NoteText)
SplitCellValue(oMovementSheet, OldNumber, NewNumber, SBCOLUMNRATE2, iRow, &quot;&quot;)
SplitCellValue(oMovementSheet, NewNumber, OldNumber, SBCOLUMNQTYSOLD2, iRow, &quot;&quot;)
End Select
End If
iRow = iRow + 1
Loop Until CellStockName = &quot;&quot;
If Mode = HANDLESPLIT Then
CalculateChartafterSplit(SelStockName, NewNumber, OldNumber, NoteText, SplitDate)
End If
oDocument.CalculateAll()
ProtectSheets(oSheets)
oDocument.RemoveActionLock
End Sub
Sub CancelStockRate()
DlgStockRates.EndExecute()
End Sub
Sub CancelTransaction()
DlgTransaction.EndExecute()
End Sub
Sub CommitStockRate()
Dim CurStep as Integer
CurStep = StockRatesModel.Step
Select Case CurStep
Case 1
&apos; Check for quantity entered
If StockRatesModel.txtDividend.Value = 0 Then
MsgBox sMsgNoDividend, SBMSGSTOP+SBMSGSTOP, sMsgError
Exit Sub
End If
HandleStocks(HANDLEDIVIDEND, DlgStockRates)
Case 2
HandleStocks(HANDLESPLIT, DlgStockRates)
Case 3
InsertCompanyHistory()
End Select
End Sub
Sub EnableTransactionControls(bEnable as Boolean)
With TransactModel
.lblQuantity.Enabled = bEnable
.txtQuantity.Enabled = bEnable
.lblRate.Enabled = bEnable
.txtRate.Enabled = bEnable
.lblDate.Enabled = bEnable
.txtDate.Enabled = bEnable
.lblCommission.Enabled = bEnable
.txtCommission.Enabled = bEnable
.lblMinimum.Enabled = bEnable
.txtMinimum.Enabled = bEnable
.lblFix.Enabled = bEnable
.txtFix.Enabled = bEnable
If TransactModel.Step = SBDIALOGSELL Then
.cmdGoOn.Enabled = Ubound(TransactModel.lstSellStocks.SelectedItems()) &gt; -1
DlgTransaction.GetControl(&quot;lstSellStocks&quot;).SetFocus()
Else
.cmdGoOn.Enabled = TransactModel.lstBuyStocks.Text &lt;&gt; &quot;&quot;
DlgTransaction.GetControl(&quot;lstBuyStocks&quot;).SetFocus()
End If
If bEnable Then
TransactModel.cmdGoOn.DefaultButton = True
End If
End With
End Sub
Sub SetupTransactionControls(CurStep as Integer)
DlgReference = DlgTransaction
With TransactModel
.txtDate.Date = CDateToISO(Date())
.txtDate.DateMax = CDateToISO(Date())
.txtStockID.Enabled = False
.lblStockID.Enabled = False
.lblStockID.Label = sCurStockIDLabel
.txtRate.CurrencySymbol = sCurCurrency
.txtFix.CurrencySymbol = sCurCurrency
.Step = CurStep
End With
DlgTransaction.Title = TransactTitle(CurStep)
CellValuetoControl(oBankSheet, TransactModel.txtCommission, &quot;ProvisionPercent&quot;)
CellValuetoControl(oBankSheet, TransactModel.txtMinimum, &quot;ProvisionMinimum&quot;)
CellValuetoControl(oBankSheet, TransactModel.txtFix, &quot;ProvisionFix&quot;)
End Sub
Sub AddShortCuttoControl()
Dim SelCompany as String
Dim iRow, SelIndex as Integer
SelIndex = DlgTransaction.GetControl(&quot;lstBuyStocks&quot;).GetSelectedItemPos()
If SelIndex &lt;&gt; -1 Then
SelCompany = TransactModel.lstBuyStocks.StringItemList(SelIndex)
iRow = GetStockRowIndex(SelCompany)
If iRow &lt;&gt; -1 Then
TransactModel.txtStockID.Text = oFirstSheet.GetCellByPosition(SBCOLUMNID1,iRow).String
TransactModel.txtRate.Value = oFirstSheet.GetCellByPosition(SBCOLUMNRATE1,iRow).Value
Else
TransactModel.txtStockID.Text = &quot;&quot;
TransactModel.txtRate.Value = 0
End If
Else
TransactModel.txtStockID.Text = &quot;&quot;
TransactModel.txtRate.Value = 0
End If
End Sub
Sub OpenStockRatePage(aEvent)
Dim CurStep as Integer
Initialize(True)
CurStep = aEvent.Source.Model.Tag
If FillListbox(DlgStockRates.GetControl(&quot;lstStockNames&quot;), StockRatesTitle(CurStep), True) Then
StockRatesModel.Step = CurStep
ToggleStockRateControls(False, CurStep)
InitializeStockRatesControls(CurStep)
DlgStockRates.Execute()
End If
End Sub
Sub SelectStockNameForRates()
Dim StockName as String
StockName = DlgStockRates.GetControl(&quot;lstStockNames&quot;).GetSelectedItem()
If StockName &lt;&gt; &quot;&quot; Then
StockRatesModel.txtStockID.Text = GetStockID(StockName)
ToggleStockRateControls(True, StockRatesModel.Step)
End If
StockRatesModel.cmdGoOn.DefaultButton = True
End Sub
Sub ToggleStockRateControls(bDoEnable as Boolean, CurStep as Integer)
With StockRatesModel
.lblStockID.Enabled = False
.txtStockID.Enabled = False
.cmdGoOn.Enabled = Ubound(StockRatesModel.lstStockNames.SelectedItems()) &lt;&gt; -1
Select Case CurStep
Case 1
.optPerShare.Enabled = bDoEnable
.optTotal.Enabled = bDoEnable
.lblDividend.Enabled = bDoEnable
.txtDividend.Enabled = bDoEnable
Case 2
.lblExchangeRate.Enabled = bDoEnable
.lblDate.Enabled = bDoEnable
.lblColon.Enabled = bDoEnable
.txtOldRate.Enabled = bDoEnable
.txtNewRate.Enabled = bDoEnable
.txtDate.Enabled = bDoEnable
Case 3
.lblStartDate.Enabled = bDoEnable
.lblEndDate.Enabled = bDoEnable
.txtStartDate.Enabled = bDoEnable
.txtEndDate.Enabled = bDoEnable
.hlnInterval.Enabled = bDoEnable
.optDaily.Enabled = bDoEnable
.optWeekly.Enabled = bDoEnable
End Select
End With
End Sub
Sub InitializeStockRatesControls(CurStep as Integer)
DlgReference = DlgStockRates
DlgStockRates.Title = StockRatesTitle(CurStep)
With StockRatesModel
.txtStockID.Text = &quot;&quot;
.lblStockID.Label = sCurStockIDLabel
Select Case CurStep
Case 1
.txtDividend.Value = 0
.optPerShare.State = 1
.txtDividend.CurrencySymbol = sCurCurrency
Case 2
.txtOldRate.Value = 1
.txtNewRate.Value = 1
.txtDate.Date = CDateToISO(Date())
Case 3
.txtStartDate.DateMax = CDateToISO(CDate(Date())-1)
.txtEndDate.DateMax = CDateToISO(CDate(Date())-1)
.txtStartDate.Date = CDateToISO(CDate(Date())-8)
.txtEndDate.Date = CDateToISO(CDate(Date())-1)
.optDaily.State = 1
End Select
End With
End Sub
</script:module>

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Dialog2" dlg:tab-index="0" dlg:left="91" dlg:top="24" dlg:width="220" dlg:height="128" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_DIALOG_SELLBUY" dlg:closeable="true" dlg:moveable="true">
<dlg:bulletinboard>
<dlg:text dlg:id="lblStockNames" dlg:tab-index="0" dlg:left="6" dlg:top="6" dlg:width="102" dlg:height="8" dlg:value="lblStockNames"/>
<dlg:menulist dlg:id="lstSellStocks" dlg:tab-index="1" dlg:left="6" dlg:top="17" dlg:width="102" dlg:height="12" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_1_LSTSELLSTOCKS" dlg:spin="true">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Depot.Depot.SelectStockname?language=Basic&amp;location=application" script:language="Script"/>
</dlg:menulist>
<dlg:combobox dlg:id="lstBuyStocks" dlg:tab-index="2" dlg:left="6" dlg:top="17" dlg:width="102" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_2_LSTBUYSTOCKS" dlg:spin="true">
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:Depot.Depot.SelectStockname?language=Basic&amp;location=application" script:language="Script"/>
</dlg:combobox>
<dlg:text dlg:id="lblStockID" dlg:tab-index="3" dlg:left="150" dlg:top="6" dlg:width="66" dlg:height="8" dlg:value="lblStockID"/>
<dlg:textfield dlg:id="txtStockID" dlg:tab-index="4" dlg:left="150" dlg:top="17" dlg:width="40" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTSTOCKID_SELLBUY"/>
<dlg:text dlg:id="lblQuantity" dlg:tab-index="5" dlg:left="6" dlg:top="36" dlg:width="57" dlg:height="8" dlg:value="lblQuantity"/>
<dlg:numericfield dlg:id="txtQuantity" dlg:tab-index="6" dlg:left="6" dlg:top="47" dlg:width="46" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTQUANTITY" dlg:decimal-accuracy="0" dlg:value-min="1"/>
<dlg:currencyfield dlg:id="txtRate" dlg:tab-index="7" dlg:left="68" dlg:top="47" dlg:width="40" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTRATE" dlg:value-min="0"/>
<dlg:datefield dlg:id="txtDate" dlg:tab-index="8" dlg:left="150" dlg:top="47" dlg:width="50" dlg:height="12" dlg:tag="Dialog2" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTDATE" dlg:strict-format="true" dlg:spin="true">
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:Depot.tools.CheckInputDate?language=Basic&amp;location=application" script:language="Script"/>
</dlg:datefield>
<dlg:text dlg:id="lblRate" dlg:tab-index="9" dlg:left="68" dlg:top="36" dlg:width="77" dlg:height="8" dlg:value="lblRate"/>
<dlg:text dlg:id="lblDate" dlg:tab-index="10" dlg:left="150" dlg:top="37" dlg:width="66" dlg:height="8" dlg:value="lblDate"/>
<dlg:formattedfield dlg:id="txtCommission" dlg:tab-index="11" dlg:left="6" dlg:top="90" dlg:width="40" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTCOMMISSION" dlg:format-code="0,00%" dlg:format-locale="de;DE"/>
<dlg:text dlg:id="lblCommission" dlg:tab-index="12" dlg:left="6" dlg:top="79" dlg:width="60" dlg:height="8" dlg:value="lblCommission"/>
<dlg:currencyfield dlg:id="txtFix" dlg:tab-index="13" dlg:left="68" dlg:top="90" dlg:width="40" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTFIX" dlg:value-min="0"/>
<dlg:currencyfield dlg:id="txtMinimum" dlg:tab-index="14" dlg:left="150" dlg:top="90" dlg:width="40" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTMINIMUM" dlg:value-min="0"/>
<dlg:text dlg:id="lblFix" dlg:tab-index="15" dlg:left="68" dlg:top="79" dlg:width="71" dlg:height="8" dlg:value="lblFix"/>
<dlg:text dlg:id="lblMinimum" dlg:tab-index="16" dlg:left="150" dlg:top="79" dlg:width="66" dlg:height="8" dlg:value="lblMinimum"/>
<dlg:button dlg:id="cmdCancel" dlg:tab-index="17" dlg:left="58" dlg:top="109" dlg:width="50" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_CMDCANCEL_SELLBUY" dlg:value="cmdCancel">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Depot.Depot.CancelTransaction?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:button dlg:id="cmdGoOn" dlg:tab-index="18" dlg:left="111" dlg:top="109" dlg:width="50" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_CMDGOON_SELLBUY" dlg:value="cmdGoOn">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Depot.Depot.TransactionOk?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:fixedline dlg:id="hlnCommission" dlg:tab-index="19" dlg:left="6" dlg:top="66" dlg:width="210" dlg:height="8" dlg:value="hlnCommission"/>
</dlg:bulletinboard>
</dlg:window>

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Dialog3" dlg:left="161" dlg:top="81" dlg:width="176" dlg:height="119" dlg:page="3" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_DIALOG_SPLIT" dlg:closeable="true" dlg:moveable="true">
<dlg:bulletinboard>
<dlg:text dlg:id="lblStockNames" dlg:tab-index="0" dlg:left="6" dlg:top="6" dlg:width="98" dlg:height="8" dlg:value="lblStockNames"/>
<dlg:menulist dlg:id="lstStockNames" dlg:tab-index="1" dlg:left="5" dlg:top="17" dlg:width="102" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_LSTSTOCKNAMES" dlg:spin="true">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Depot.Depot.SelectStockNameForRates?language=Basic&amp;location=application" script:language="Script"/>
</dlg:menulist>
<dlg:textfield dlg:id="txtStockID" dlg:tab-index="2" dlg:left="120" dlg:top="17" dlg:width="50" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTSTOCKID_SPLIT"/>
<dlg:datefield dlg:id="txtStartDate" dlg:tab-index="3" dlg:left="63" dlg:top="37" dlg:width="50" dlg:height="12" dlg:page="3" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_3_TXTSTARTDATE" dlg:spin="true">
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:Depot.tools.CheckInputDate?language=Basic&amp;location=application" script:language="Script"/>
</dlg:datefield>
<dlg:datefield dlg:id="txtEndDate" dlg:tab-index="4" dlg:left="63" dlg:top="53" dlg:width="50" dlg:height="12" dlg:page="3" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_3_TXTENDDATE" dlg:spin="true">
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:Depot.tools.CheckInputDate?language=Basic&amp;location=application" script:language="Script"/>
</dlg:datefield>
<dlg:radiogroup>
<dlg:radio dlg:id="optDaily" dlg:tab-index="5" dlg:left="12" dlg:top="83" dlg:width="75" dlg:height="10" dlg:page="3" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_3_OPTDAILY" dlg:value="optDaily"/>
<dlg:radio dlg:id="optWeekly" dlg:tab-index="6" dlg:left="101" dlg:top="83" dlg:width="69" dlg:height="10" dlg:page="3" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_3_OPTWEEKLY" dlg:value="optWeekly"/>
</dlg:radiogroup>
<dlg:datefield dlg:id="txtDate" dlg:tab-index="7" dlg:left="71" dlg:top="73" dlg:width="50" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_2_TXTDATE" dlg:spin="true">
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:Depot.tools.CheckInputDate?language=Basic&amp;location=application" script:language="Script"/>
</dlg:datefield>
<dlg:radiogroup>
<dlg:radio dlg:id="optPerShare" dlg:tab-index="8" dlg:left="6" dlg:top="37" dlg:width="69" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_1_OPTPERSHARE" dlg:value="optPerShare"/>
<dlg:radio dlg:id="optTotal" dlg:tab-index="9" dlg:left="6" dlg:top="51" dlg:width="69" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_1_OPTTOTAL" dlg:value="optTotal"/>
</dlg:radiogroup>
<dlg:currencyfield dlg:id="txtDividend" dlg:tab-index="10" dlg:left="6" dlg:top="80" dlg:width="50" dlg:height="12" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_1_TXTDIVIDEND" dlg:value-min="0" dlg:spin="true"/>
<dlg:button dlg:id="cmdCancel" dlg:tab-index="11" dlg:left="41" dlg:top="98" dlg:width="50" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_CMDCANCEL_SPLIT" dlg:value="cmdCancel">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Depot.Depot.CancelStockRate?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:button dlg:id="cmdGoOn" dlg:tab-index="12" dlg:left="94" dlg:top="98" dlg:width="50" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_CMDGOON_SPLIT" dlg:value="cmdGoOn">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Depot.Depot.CommitStockRate?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:text dlg:id="lblStockID" dlg:tab-index="13" dlg:left="120" dlg:top="6" dlg:width="50" dlg:height="8" dlg:value="lblStockID"/>
<dlg:text dlg:id="lblDividend" dlg:tab-index="14" dlg:left="6" dlg:top="68" dlg:width="73" dlg:height="8" dlg:page="1" dlg:value="lblDividend"/>
<dlg:text dlg:id="lblExchangeRate" dlg:tab-index="15" dlg:left="6" dlg:top="39" dlg:width="92" dlg:height="8" dlg:page="2" dlg:value="lblExchangeRate"/>
<dlg:text dlg:id="lblColon" dlg:tab-index="16" dlg:left="40" dlg:top="55" dlg:width="5" dlg:height="8" dlg:page="2" dlg:value=" :"/>
<dlg:text dlg:id="lblDate" dlg:tab-index="17" dlg:left="5" dlg:top="75" dlg:width="66" dlg:height="8" dlg:page="2" dlg:value="lblDate"/>
<dlg:fixedline dlg:id="hlnInterval" dlg:tab-index="18" dlg:left="6" dlg:top="72" dlg:width="164" dlg:height="8" dlg:page="3" dlg:value="hlnInterval"/>
<dlg:text dlg:id="lblStartDate" dlg:tab-index="19" dlg:left="6" dlg:top="39" dlg:width="53" dlg:height="8" dlg:page="3" dlg:value="lblStartDate"/>
<dlg:text dlg:id="lblEndDate" dlg:tab-index="20" dlg:left="6" dlg:top="55" dlg:width="53" dlg:height="8" dlg:page="3" dlg:value="lblEndDate"/>
<dlg:numericfield dlg:id="txtOldRate" dlg:tab-index="21" dlg:left="6" dlg:top="53" dlg:width="30" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_2_TXTOLDRATE" dlg:decimal-accuracy="0" dlg:value-min="1" dlg:spin="true"/>
<dlg:numericfield dlg:id="txtNewRate" dlg:tab-index="22" dlg:left="50" dlg:top="53" dlg:width="30" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_2_TXTNEWRATE" dlg:decimal-accuracy="0" dlg:value-min="1" dlg:spin="true"/>
</dlg:bulletinboard>
</dlg:window>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Dialog4" dlg:left="161" dlg:top="81" dlg:width="160" dlg:height="120" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_DIALOG_HISTORY" dlg:closeable="true" dlg:moveable="true">
<dlg:bulletinboard>
<dlg:text dlg:id="lblWelcome" dlg:tab-index="0" dlg:left="6" dlg:top="6" dlg:width="148" dlg:height="49" dlg:value="lblWelcome" dlg:multiline="true"/>
<dlg:text dlg:id="lblHint" dlg:tab-index="1" dlg:left="6" dlg:top="73" dlg:width="148" dlg:height="26" dlg:value="lblHint" dlg:multiline="true"/>
<dlg:button dlg:id="cmdCancel" dlg:tab-index="2" dlg:left="28" dlg:top="100" dlg:width="50" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_CMDCANCEL_HISTORY" dlg:value="cmdCancel">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Depot.Currency.CloseStartUpDialog?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:button dlg:id="cmdGoOn" dlg:tab-index="3" dlg:left="84" dlg:top="100" dlg:width="52" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_CMDGOON_HISTORY" dlg:value="cmdGoOn">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Depot.Currency.ChooseMarket?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:menulist dlg:id="lstMarkets" dlg:tab-index="4" dlg:left="6" dlg:top="57" dlg:width="148" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_LSTMARKETS" dlg:spin="true">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Depot.Currency.EnableGoOnButton?language=Basic&amp;location=application" script:language="Script"/>
</dlg:menulist>
</dlg:bulletinboard>
</dlg:window>

View File

@@ -0,0 +1,359 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Internet" script:language="StarBasic">REM ***** BASIC *****
Option Explicit
Public sNewSheetName as String
Function CheckHistoryControls()
Dim bLocGoOn as Boolean
Dim Firstdate as Date
Dim LastDate as Date
LastDate = CDateFromISO(StockRatesModel.txtEndDate.Date)
FirstDate = CDateFromISO(StockRatesModel.txtStartDate.Date)
bLocGoOn = FirstDate &lt;&gt; 0 And LastDate &lt;&gt; 0
If bLocGoOn Then
If FirstDate &gt;= LastDate Then
Msgbox(sMsgStartDatebeforeEndDate,16, sProductname)
bLocGoOn = False
End If
End If
CheckHistoryControls = bLocGoon
End Function
Sub InsertCompanyHistory()
Dim StockName as String
Dim CurRow as Integer
Dim sMsgInternetError as String
Dim CurRate as Double
Dim oCell as Object
Dim sStockID as String
Dim ChartSource as String
If CheckHistoryControls() Then
StartDate = CDateFromISO(StockRatesModel.txtStartDate.Date)
EndDate = CDateFromISO(StockRatesModel.txtEndDate.Date)
DlgStockRates.EndExecute()
If StockRatesModel.optDaily.State = 1 Then
sInterval = &quot;d&quot;
iStep = 1
ElseIf StockRatesModel.optWeekly.State = 1 Then
sInterval = &quot;w&quot;
iStep = 7
StartDate = StartDate - WeekDay(StartDate) + 2
EndDate = EndDate - WeekDay(EndDate) + 2
End If
iEndDay = Day(EndDate)
iEndMonth = Month(EndDate)
iEndYear = Year(EndDate)
iStartDay = Day(StartDate)
iStartMonth = Month(StartDate)
iStartYear = Year(StartDate)
&apos; oDocument.AddActionLock()
UnprotectSheets(oSheets)
InitializeStatusline(&quot;&quot;, 10, 1)
oBackGroundSheet = oSheets.GetbyName(&quot;Background&quot;)
StockName = DlgStockRates.GetControl(&quot;lstStockNames&quot;).GetSelectedItem()
CurRow = GetStockRowIndex(Stockname)
sStockID = oFirstSheet.GetCellByPosition(SBCOLUMNID1, CurRow).String
ChartSource = ReplaceString(HistoryChartSource, sStockID, &quot;&lt;StockID&gt;&quot;)
ChartSource = ReplaceString(ChartSource, iStartDay, &quot;&lt;StartDay&gt;&quot;)
ChartSource = ReplaceString(ChartSource, cStr(iStartMonth-1), &quot;&lt;StartMonth&gt;&quot;)
ChartSource = ReplaceString(ChartSource, iStartYear, &quot;&lt;StartYear&gt;&quot;)
ChartSource = ReplaceString(ChartSource, iEndDay, &quot;&lt;EndDay&gt;&quot;)
ChartSource = ReplaceString(ChartSource, cStr(iEndMonth-1), &quot;&lt;EndMonth&gt;&quot;)
ChartSource = ReplaceString(ChartSource, iEndYear, &quot;&lt;EndYear&gt;&quot;)
ChartSource = ReplaceString(ChartSource, sInterval, &quot;&lt;interval&gt;&quot;)
oStatusLine.SetValue(2)
If GetCurrentRate(ChartSource, CurRate, 1) Then
oStatusLine.SetValue(8)
UpdateValue(StockName, Today, CurRate)
oStatusLine.SetValue(9)
UpdateChart(StockName)
oStatusLine.SetValue(10)
Else
sMsgInternetError = Stockname &amp; &quot;: &quot; &amp; sNoInternetDataAvailable &amp; chr(13) &amp; sCheckInternetSettings
Msgbox(sMsgInternetError, 16, sProductname)
End If
ProtectSheets(oSheets)
oStatusLine.End
If oSheets.HasbyName(sNewSheetName) Then
oController.ActiveSheet = oSheets.GetByName(sNewSheetName)
End If
&apos; oDocument.RemoveActionLock()
End If
End Sub
Sub InternetUpdate()
Dim i as Integer
Dim StocksCount as Integer
Dim iStartRow as Integer
Dim sUrl as String
Dim StockName as String
Dim CurRate as Double
Dim oCell as Object
Dim sMsgInternetError as String
Dim sStockID as String
Dim ChartSource as String
&apos; oDocument.AddActionLock()
Initialize(True)
UnprotectSheets(oSheets)
StocksCount = GetStocksCount(iStartRow)
InitializeStatusline(&quot;&quot;, StocksCount + 1, 1)
Today = CDate(Date)
For i = iStartRow + 1 To iStartRow + StocksCount
StockName = oFirstSheet.GetCellbyPosition(SBCOLUMNNAME1, i).String
sStockID = oFirstSheet.GetCellByPosition(SBCOLUMNID1, i).String
ChartSource = ReplaceString(sCurChartSource, sStockID, &quot;&lt;StockID&gt;&quot;)
If GetCurrentRate(ChartSource, CurRate, 0) Then
InsertCurrentValue(CurRate, i, Now)
Else
sMsgInternetError = Stockname &amp; &quot;: &quot; &amp; sNoInternetDataAvailable &amp; chr(13) &amp; sCheckInternetSettings
Msgbox(sMsgInternetError, 16, sProductname)
End If
oStatusline.SetValue(i - iStartRow + 1)
Next
ProtectSheets(oSheets)
oStatusLine.End
&apos; oDocument.RemoveActionLock
End Sub
Function GetCurrentRate(sUrl as String, fValue As Double, iValueRow as Integer) as Boolean
Dim sFilter As String
Dim sOptions As String
Dim oLinkSheet As Object
Dim sDate as String
If oSheets.hasByName(&quot;Link&quot;) Then
oLinkSheet = oSheets.getByName(&quot;Link&quot;)
Else
oLinkSheet = oDocument.createInstance(&quot;com.sun.star.sheet.Spreadsheet&quot;)
oSheets.insertByName(&quot;Link&quot;, oLinkSheet)
oLinkSheet.IsVisible = False
End If
sFilter = &quot;Text - txt - csv (StarCalc)&quot;
sOptions = sCurSeparator &amp; &quot;,34,SYSTEM,1,1/10/2/10/3/10/4/10/5/10/6/10/7/10/8/10/9/10&quot;
oLinkSheet.LinkMode = com.sun.star.sheet.SheetLinkMode.NONE
oLinkSheet.link(sUrl, &quot;&quot;, sFilter, sOptions, 1 )
fValue = oLinkSheet.getCellByPosition(iValueCol, iValueRow).Value
If fValue = 0 Then
Dim sValue as String
sValue = oLinkSheet.getCellByPosition(1, iValueRow).String
sValue = ReplaceString(sValue, &quot;.&quot;,&quot;,&quot;)
fValue = Val(sValue)
End If
GetCurrentRate = fValue &lt;&gt; 0
End Function
Sub UpdateValue(ByVal sName As String, fDate As Double, fValue As Double )
Dim oSheet As Object
Dim iColumn As Long
Dim iRow As Long
Dim i as Integer
Dim oCell As Object
Dim LastDate as Date
Dim bLeaveLoop as Boolean
Dim RemoveCount as Integer
Dim iLastRow as Integer
Dim iLastLinkRow as Integer
Dim dDate as Date
Dim CurDate as Date
Dim oLinkSheet as Object
Dim StartIndex as Integer
Dim iCellValue as Long
&apos; Insert Sheet with Company - Chart
sName = CheckNewSheetname(oSheets, sName)
If NOT oSheets.hasByName(sName) Then
oSheets.CopybyName(&quot;Background&quot;, sName, oSheets.Count)
oSheet = oSheets.getByName(sName)
iCurRow = SBSTARTROW
iMaxRow = iCurRow
oCell = oSheet.getCellByPosition(SBDATECOLUMN, iCurRow)
oCell.Value = fDate
End If
sNewSheetName = sName
oLinkSheet = oSheets.GetByName(&quot;Link&quot;)
oSheet = oSheets.getByName(sName)
iLastRow = GetLastUsedRow(oSheet)- 2
iLastLinkRow = GetLastUsedRow(oLinkSheet)
iCurRow = iLastRow
bLeaveLoop = False
RemoveCount = 0
&apos; Delete all Cells in Date Area
Do
oCell = oSheet.GetCellbyPosition(SBDATECOLUMN,iCurRow)
If oCell.CellStyle = sColumnHeader Then
bLeaveLoop = True
StartIndex = iCurRow
iCurRow = iCurRow + 1
Else
RemoveCount = RemoveCount + 1
iCurRow = iCurRow - 1
End If
Loop Until bLeaveLoop
If RemoveCount &gt; 1 Then
oSheet.Rows.RemoveByIndex(iCurRow, RemoveCount-1)
End If
For i = 1 To iLastLinkRow
oCell = oSheet.GetCellbyPosition(SBDATECOLUMN,iCurRow)
iCellValue = oLinkSheet.GetCellByPosition(0,i).Value
If iCellValue &gt; 0 Then
oCell.SetValue(oLinkSheet.GetCellByPosition(0,i).Value)
Else
oCell.SetValue(StringToDate(oLinkSheet.GetCellByPosition(0,i).String)
End If
oCell = oSheet.GetCellbyPosition(SBVALUECOLUMN,iCurRow)
oCell.SetValue(oLinkSheet.GetCellByPosition(4,i).Value)
If i &lt; iLastLinkRow Then
iCurRow = iCurRow + 1
oSheet.Rows.InsertByIndex(iCurRow,1)
End If
Next i
iMaxRow = iCurRow
End Sub
Function StringToDate(DateString as String) as Date
Dim ShortMonths(11)
Dim DateList() as String
Dim MaxIndex as Integer
Dim i as Integer
ShortMonths(0) = &quot;Jan&quot;
ShortMonths(1) = &quot;Feb&quot;
ShortMonths(2) = &quot;Mar&quot;
ShortMonths(3) = &quot;Apr&quot;
ShortMonths(4) = &quot;May&quot;
ShortMonths(5) = &quot;Jun&quot;
ShortMonths(6) = &quot;Jul&quot;
ShortMonths(7) = &quot;Aug&quot;
ShortMonths(8) = &quot;Sep&quot;
ShortMonths(9) = &quot;Oct&quot;
ShortMonths(10) = &quot;Nov&quot;
ShortMonths(11) = &quot;Dec&quot;
For i = 0 To 11
DateString = ReplaceString(DateString,CStr(i+1),ShortMonths(i))
Next i
DateString = ReplaceString(DateString, &quot;.&quot;, &quot;-&quot;)
StringToDate = CDate(DateString)
End Function
Sub UpdateChart(sName As String)
Dim oSheet As Object
Dim oCell As Object, oCursor As Object
Dim oChartRange As Object
Dim oEmbeddedChart As Object, oCharts As Object
Dim oChart As Object, oDiagram As Object
Dim oYAxis As Object, oXAxis As Object
Dim fMin As Double, fMax As Double
Dim nDateFormat As Long
Dim aPos As Variant
Dim aSize As Variant
Dim oContainerChart as Object
Dim mRangeAddresses(0) as New com.sun.star.table.CellRangeAddress
mRangeAddresses(0).Sheet = GetSheetIndex(oSheets, sNewSheetName)
mRangeAddresses(0).StartColumn = SBDATECOLUMN
mRangeAddresses(0).StartRow = SBSTARTROW-1
mRangeAddresses(0).EndColumn = SBVALUECOLUMN
mRangeAddresses(0).EndRow = iMaxRow
oSheet = oDocument.Sheets.getByName(sNewSheetName)
oCharts = oSheet.Charts
If Not oCharts.hasElements Then
oSheet.GetCellbyPosition(2,2).SetString(sName)
oChartRange = oSheet.getCellRangeByPosition(SBDATECOLUMN,6,5,SBSTARTROW-3)
aPos = oChartRange.Position
aSize = oChartRange.Size
Dim oRectangleShape As New com.sun.star.awt.Rectangle
oRectangleShape.X = aPos.X
oRectangleShape.Y = aPos.Y
oRectangleShape.Width = aSize.Width
oRectangleShape.Height = aSize.Height
oCharts.addNewByName(sName, oRectangleShape, mRangeAddresses(), True, False)
oContainerChart = oCharts.getByName(sName)
oChart = oContainerChart.EmbeddedObject
oChart.Title.String = &quot;&quot;
oChart.HasLegend = False
oChart.diagram = oChart.createInstance(&quot;com.sun.star.chart.XYDiagram&quot;)
oDiagram = oChart.Diagram
oDiagram.DataRowSource = com.sun.star.chart.ChartDataRowSource.COLUMNS
oChart.Area.LineStyle = com.sun.star.drawing.LineStyle.SOLID
oXAxis = oDiagram.XAxis
oXAxis.TextBreak = False
nDateFormat = oXAxis.NumberFormats.getStandardFormat(com.sun.star.util.NumberFormat.DATE, oDocLocale)
oYAxis = oDiagram.getYAxis()
oYAxis.AutoOrigin = True
Else
oChart = oCharts(0)
oChart.Ranges = mRangeAddresses()
oChart.HasRowHeaders = False
oEmbeddedChart = oChart.EmbeddedObject
oDiagram = oEmbeddedChart.Diagram
oXAxis = oDiagram.XAxis
End If
oXAxis.AutoStepMain = False
oXAxis.AutoStepHelp = False
oXAxis.StepMain = iStep
oXAxis.StepHelp = iStep
fMin = oSheet.getCellByPosition(SBDATECOLUMN,SBSTARTROW).Value
fMax = oSheet.getCellByPosition(SBDATECOLUMN,iMaxRow).Value
oXAxis.Min = fMin
oXAxis.Max = fMax
oXAxis.AutoMin = False
oXAxis.AutoMax = False
End Sub
Sub CalculateChartafterSplit(SheetName, NewNumber, OldNumber, NoteText, SplitDate)
Dim oSheet as Object
Dim i as Integer
Dim oValueCell as Object
Dim oDateCell as Object
Dim bLeaveLoop as Boolean
If oSheets.HasbyName(SheetName) Then
oSheet = oSheets.GetbyName(SheetName)
i = 0
bLeaveLoop = False
Do
oValueCell = oSheet.GetCellbyPosition(SBVALUECOLUMN, SBSTARTROW + i)
If oValueCell.CellStyle = CurrCellStyle Then
SplitCellValue(oSheet, OldNumber, NewNumber, SBVALUECOLUMN, SBSTARTROW + i, &quot;&quot;)
i = i + 1
Else
bLeaveLoop = True
End If
Loop Until bLeaveLoop
oDateCell = oSheet.GetCellbyPosition(SBDATECOLUMN, SBSTARTROW + i-1)
oDateCell.Annotation.SetString(NoteText)
End If
End Sub
</script:module>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_de" script:language="StarBasic">Option Explicit
Sub LoadGermanLanguage()
sProductname = GetProductname
sOK = &quot;~OK&quot;
sCancel = &quot;Abbrechen&quot;
sColumnHeader = &quot;Spaltenkopf&quot;
sInsertStockName = &quot;Bitte fügen Sie zunächst einige Aktien in Ihr Depot ein!&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: Aktienverwaltung&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;Eingabefehler&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;Bitte geben Sie eine Stückzahl größer als 0 ein&quot;
sMsgNoDividend = &quot;Bitte geben Sie eine Dividende je Stück oder eine Gesamtdividende ein&quot;
sMsgNoExchangeRate = &quot;Bitte geben Sie eine korrekte Umtauschrate ein (alte Aktien -&gt; neue Aktien).&quot;
sMsgNoValidExchangeDate = &quot;Bitte geben Sie ein gültiges Datum für den Aktiensplitt ein.&quot;
sMsgWrongExchangeDate = &quot;Splitt nicht möglich, da bereits Transaktionen nach dem Splitt-Datum existieren.&quot;
sMsgSellTooMuch = &quot;So viele Aktien können Sie nicht verkaufen. Maximum: &quot;
sMsgConfirm = &quot;Bestätigung erforderlich&quot;
sMsgFreeStock = &quot;Beabsichtigen Sie die Eingabe von Gratisaktien?&quot;
sMsgTotalLoss = &quot;Beabsichtigen Sie die Eingabe eines Totalverlustes?&quot;
sMsgAuthorization = &quot;Sicherheitsabfrage&quot;
sMsgDeleteAll = &quot;Wollen Sie alle Bewegungen löschen und die Depotübersicht rücksetzen?&quot;
cSplit = &quot;Aktiensplitt am &quot;
sHistory = &quot;Historie&quot;
TransactTitle(1) = &quot;Aktien verkaufen&quot;
TransactTitle(2) = &quot;Aktien kaufen&quot;
StockRatesTitle(1) = &quot;Dividendenzahlung&quot;
StockRatesTitle(2) = &quot;Aktiensplitt&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;Depotwährung&quot;
sStockName = &quot;Aktienname&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;Ergebnis Datum&quot;
CurrCellStyle = &quot;Ergebnis Euro mit Dezimalen&quot;
sStartDate = &quot;Startdatum:&quot;
sEndDate = &quot;Enddatum:&quot;
sStartUpWelcome = &quot;Diese Vorlage ermöglicht Ihnen eine effiziente Verwaltung Ihres Aktiendepots&quot;
sStartUpChooseMarket = &quot;Wählen Sie zunächst Ihre Referenz-Währung und damit den Börsenplatz für das Internet Update aus!&quot;
sStartUpHint = &quot;Leider steht Ihnen die &lt;History&gt;- Funktion nur für den amerikanischen Markt zur Verfügung!&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;ohne Internet Update&quot;
sMarketPlace = &quot;Börsenplatz:&quot;
sNoInternetDataAvailable = &quot;Internet-Kurse konnten nicht empfangen werden!&quot;
sCheckInternetSettings = &quot;Mögliche Ursachen sind: &lt;BR&gt; Ihre Internet Einstellungen müssen überprüft werden.&lt;BR&gt; Sie haben eine falsche Kennung (z.B. Symbol, WKN) für die Aktie eingegeben.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;Das Enddatum muss vor dem heutigen Tag liegen!&quot;
sMsgStartDatebeforeEndDate = &quot;Das Startdatum muss vor dem Enddatum liegen!&quot;
sMarket(0,0) = &quot;Amerikanischer Dollar&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;New York&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;Symbol&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;Euro&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;Frankfurt&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;WKN&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;Englisches Pfund&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;London&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;Symbol&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;Japanischer Yen&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;Tokyo&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;Code&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;Hongkong Dollar&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;Hongkong&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.HK&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;Nummer&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;Australischer Dollar&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;Sydney&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;Symbol&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;Menge&quot;
.lblRate.Label = &quot;Kurs&quot;
.lblDate.Label = &quot;Transaktionsdatum&quot;
.hlnCommission.Label = &quot;Sonstige Ausgaben&quot;
.lblCommission.Label = &quot;Provision&quot;
.lblMinimum.Label = &quot;Mindestprovision&quot;
.lblFix.Label = &quot;Festbetrag/Spesen&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;Dividende/Aktie&quot;
.optTotal.Label = &quot;Dividende gesamt&quot;
.lblDividend.Label = &quot;Betrag&quot;
.lblExchangeRate.Label = &quot;Umtauschrate (alt-&gt;neu)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;Umtauschdatum:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~Täglich&quot;
.optWeekly.Label = &quot;~Wöchentlich&quot;
.hlnInterval.Label = &quot;Zeitraum&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_en" script:language="StarBasic">Option Explicit
Sub LoadEnglishLanguage()
sProductname = GetProductname
sOK = &quot;~OK&quot;
sCancel = &quot;Cancel&quot;
sColumnHeader = &quot;Column Header&quot;
sInsertStockName = &quot;Please enter shares in your portfolio.&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: Stocks Manager&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;Input Error&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;Please enter a quantity larger than 0&quot;
sMsgNoDividend = &quot;Please enter the dividend per share or the total dividend&quot;
sMsgNoExchangeRate = &quot;Please enter the correct exchange rate (old shares -&gt; new shares)&quot;
sMsgNoValidExchangeDate = &quot;Please enter a valid date for the split.&quot;
sMsgWrongExchangeDate = &quot;Splitting not possible, as transactions already exist after the split date.&quot;
sMsgSellTooMuch = &quot;You cannot sell that many shares. Maximum: &quot;
sMsgConfirm = &quot;Confirmation Required&quot;
sMsgFreeStock = &quot;Do you intend to enter free shares?&quot;
sMsgTotalLoss = &quot;Do you intend to enter a total loss?&quot;
sMsgAuthorization = &quot;Security Query&quot;
sMsgDeleteAll = &quot;Do you want to delete all movements and reset the portfolio overview?&quot;
cSplit = &quot;Stock split on &quot;
sHistory = &quot;History&quot;
TransactTitle(1) = &quot;StarOffice Stocks Manager: Selling Shares&quot;
TransactTitle(2) = &quot;StarOffice Stocks Manager: Buying Shares&quot;
StockRatesTitle(1) = &quot;StarOffice Stocks Manager: Dividend Payment&quot;
StockRatesTitle(2) = &quot;Stock Split&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;Portfolio Currency&quot;
sStockName = &quot;Name of Stock&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;Result Date&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;Start date:&quot;
sEndDate = &quot;End date:&quot;
sStartUpWelcome = &quot;This template enables you to manage your stock portfolio efficiently.&quot;
sStartUpChooseMarket = &quot;First, select your reference currency and thus the stock exchange for the Internet update.&quot;
sStartUpHint = &quot;Unfortunately, the only &lt;History&gt; function available to you is that for the American market.&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;without Internet update&quot;
sMarketPlace = &quot;Stock exchange:&quot;
sNoInternetDataAvailable = &quot;No prices could be received from the Internet!&quot;
sCheckInternetSettings = &quot;Possible causes could be: &lt;BR&gt;Your Internet settings have to be modified. &lt;BR&gt;The Symbol (e.g. Code, Ticker Symbol) entered for the stock was incorrect.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;The end date has to be before today&apos;s date.&quot;
sMsgStartDatebeforeEndDate = &quot;The start date has to be before the end date.&quot;
sMarket(0,0) = &quot;American Dollar&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;New York&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;Symbol&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;Euro&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;Frankfurt&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;Ticker Symbol&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;British Pound&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;London&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;Symbol&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;Japanese Yen&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;Tokyo&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;Code&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;Hong Kong Dollar&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;Hong Kong&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;Number&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;Australian Dollar&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;Sydney&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;Symbol&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;Quantity&quot;
.lblRate.Label = &quot;Price&quot;
.lblDate.Label = &quot;Transaction Date&quot;
.hlnCommission.Label = &quot;Other expenditures&quot;
.lblCommission.Label = &quot;Commission&quot;
.lblMinimum.Label = &quot;Min. Commission&quot;
.lblFix.Label = &quot;Fixed Costs/Charges&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;Dividends/Stocks&quot;
.optTotal.Label = &quot;Total Dividends&quot;
.lblDividend.Label = &quot;Amount&quot;
.lblExchangeRate.Label = &quot;Exchange Rate (old-&gt;new)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;Exchange Date:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~Daily&quot;
.optWeekly.Label = &quot;~Weekly&quot;
.hlnInterval.Label = &quot;Time period&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_es" script:language="StarBasic">Option Explicit
Sub LoadSpanishLanguage()
sProductname = GetProductname
sOK = &quot;~Aceptar&quot;
sCancel = &quot;Cancelar&quot;
sColumnHeader = &quot;Título de columna&quot;
sInsertStockName = &quot;Introduzca primero algunas acciones en su depósito.&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: Administración de acciones&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;Error de entrada&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;Indique una cantidad mayor que 0&quot;
sMsgNoDividend = &quot;Indique un dividendo por unidad o un dividendo total&quot;
sMsgNoExchangeRate = &quot;Indique aquí un cambio correcto (acción vieja -&gt; nueva acción)&quot;
sMsgNoValidExchangeDate = &quot;Indique una fecha correcta para el fraccionamiento de la acción.&quot;
sMsgWrongExchangeDate = &quot;El fraccionamiento no es posible porque existen transacciones después de la fecha de fraccionamiento.&quot;
sMsgSellTooMuch = &quot;No puede vender tantas acciones. Como máximo: &quot;
sMsgConfirm = &quot;Confirmación necesaria&quot;
sMsgFreeStock = &quot;¿Tiene previsto considerar acciones gratis?&quot;
sMsgTotalLoss = &quot;¿Tiene previsto introducir una pérdida total?&quot;
sMsgAuthorization = &quot;Pregunta de seguridad&quot;
sMsgDeleteAll = &quot;¿Desea borrar todos los movimientos y reiniciar el balance de depósito?&quot;
cSplit = &quot;Fraccionamiento el &quot;
sHistory = &quot;Historia&quot;
TransactTitle(1) = &quot;Vender acciones&quot;
TransactTitle(2) = &quot;Comprar acciones&quot;
StockRatesTitle(1) = &quot;Pago de dividendos&quot;
StockRatesTitle(2) = &quot;Fraccionamiento&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;Moneda del depósito&quot;
sStockName = &quot;Nombre de la acción&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;Resultado Fecha&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;Fecha de inicio:&quot;
sEndDate = &quot;Fecha final:&quot;
sStartUpWelcome = &quot;Esta plantilla le permite administrar eficientemente su depósito de acciones&quot;
sStartUpChooseMarket = &quot;Seleccione primero la moneda de referencia y la plaza bursátil para la actualización a través de Internet.&quot;
sStartUpHint = &quot;La función &lt;History&gt; está disponible únicamente para el mercado americano.&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;Sin actualización por Internet&quot;
sMarketPlace = &quot;Plaza bursátil:&quot;
sNoInternetDataAvailable = &quot;No se pudieron recibir las cotizaciones por Internet.&quot;
sCheckInternetSettings = &quot;Causas posibles: &lt;BR&gt; Debe comprobar la configuración de Internet.&lt;BR&gt; Ha indicado un código incorrecto (p.ej. número, símbolo, etc.) para la acción.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;La fecha final debe ser anterior a la fecha de hoy.&quot;
sMsgStartDatebeforeEndDate = &quot;La fecha inicial debe ser anterior a la fecha final.&quot;
sMarket(0,0) = &quot;Dólar estadounidense&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;Nueva York&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;Símbolo&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;Euro&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;Frankfurt&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;Código&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;Libra esterlina&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;Londres&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;Símbolo&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;Yen japonés&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;Tokio&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;Código&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;Dólar hongkonés&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;Hong Kong&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.HK&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;Número&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;Dólar australiano&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;Sidney&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;Símbolo&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;Cantidad&quot;
.lblRate.Label = &quot;Cotización&quot;
.lblDate.Label = &quot;Fecha de operación&quot;
.hlnCommission.Label = &quot;Otros gastos&quot;
.lblCommission.Label = &quot;Provisión&quot;
.lblMinimum.Label = &quot;Provisión mínima&quot;
.lblFix.Label = &quot;Cantidad fija/comisión&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;Dividendos/Acción&quot;
.optTotal.Label = &quot;Dividendos totales&quot;
.lblDividend.Label = &quot;Importe&quot;
.lblExchangeRate.Label = &quot;Cambio (vieja-&gt;nueva)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;Fecha de cambio:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~Diario&quot;
.optWeekly.Label = &quot;~Semanal&quot;
.hlnInterval.Label = &quot;Periodo&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_fr" script:language="StarBasic">Option Explicit
Sub LoadFrenchLanguage()
sProductname = GetProductname
sOK = &quot;~OK&quot;
sCancel = &quot;Annuler&quot;
sColumnHeader = &quot;En-tête de colonne&quot;
sInsertStockName = &quot;Saisissez quelques actions dans votre portefeuille !&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt; : Gestion d&apos;actions&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;Erreur de saisie&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;Saisissez une quantité supérieure à 0 !&quot;
sMsgNoDividend = &quot;Vous devez saisir le montant des dividendes perçus (soit les dividendes par action, soit la somme totale perçue).&quot;
sMsgNoExchangeRate = &quot;Saisissez un taux correct de conversion (anciennes actions -&gt; nouvelles actions).&quot;
sMsgNoValidExchangeDate = &quot;Saisissez une date correcte pour le split d&apos;action.&quot;
sMsgWrongExchangeDate = &quot;Split impossible car il y a déjà eu des transactions après la date du split !&quot;
sMsgSellTooMuch = &quot;Impossible de vendre autant d&apos;actions ! Maximum : &quot;
sMsgConfirm = &quot;Confirmation requise&quot;
sMsgFreeStock = &quot;S&apos;agit-il d&apos;actions gratuites ?&quot;
sMsgTotalLoss = &quot;Prévoyez-vous une perte totale ?&quot;
sMsgAuthorization = &quot;Requête de sécurité&quot;
sMsgDeleteAll = &quot;Voulez-vous supprimer tous les mouvements et remettre le portefeuille d&apos;actions à zéro ?&quot;
cSplit = &quot;Split d&apos;action le &quot;
sHistory = &quot;Historique&quot;
TransactTitle(1) = &quot;Vente d&apos;actions&quot;
TransactTitle(2) = &quot;Achat d&apos;actions&quot;
StockRatesTitle(1) = &quot;Versement des dividendes&quot;
StockRatesTitle(2) = &quot;Split d&apos;action&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;Monnaie du portefeuille&quot;
sStockName = &quot;Nom de l&apos;action&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;Résultat date&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;Date de début :&quot;
sEndDate = &quot;Date de fin :&quot;
sStartUpWelcome = &quot;Utilisez ce modèle pour une gestion efficiente de votre portefeuille d&apos;actions !&quot;
sStartUpChooseMarket = &quot;Commencez par choisir une monnaie de référence et ainsi la place boursière pour la mise à jour Internet !&quot;
sStartUpHint = &quot;La fonction &lt;History&gt; n&apos;est cependant disponible que pour le marché américain.&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;Sans mise à jour Internet&quot;
sMarketPlace = &quot;Place boursière :&quot;
sNoInternetDataAvailable = &quot;Réception des cours Internet impossible !&quot;
sCheckInternetSettings = &quot;Causes possibles : &lt;BR&gt; Problème de paramétrage Internet : vérifiez les paramètres !&lt;BR&gt; Vous avez saisi un identificateur (par ex. symbole ou code) incorrect pour l&apos;action.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;La date spécifiée pour la fin doit précéder celle de ce jour !&quot;
sMsgStartDatebeforeEndDate = &quot;La date spécifiée pour le début doit succéder à celle de ce jour !&quot;
sMarket(0,0) = &quot;Dollar Américain&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;New York&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;Symbole&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;Euro&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;Francfort&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;Code&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;Livre Sterling&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;Londres&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;Symbole&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;Yen Japonais&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;Tokyo&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;Code&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;Dollar de Hong Kong&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;Hong Kong&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;Numéro&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;Dollar Australien&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;Sydney&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;Symbole&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;Quantité&quot;
.lblRate.Label = &quot;Cours&quot;
.lblDate.Label = &quot;Date de transaction&quot;
.hlnCommission.Label = &quot;Dépenses diverses&quot;
.lblCommission.Label = &quot;Commission&quot;
.lblMinimum.Label = &quot;Commission minimale&quot;
.lblFix.Label = &quot;Montant fixe/frais&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;Dividende/action&quot;
.optTotal.Label = &quot;Dividende total&quot;
.lblDividend.Label = &quot;Montant&quot;
.lblExchangeRate.Label = &quot;Taux de conversion (ancien-&gt;nouveau)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;Date de la conversion:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~Quotidien&quot;
.optWeekly.Label = &quot;~Hebdomadaire&quot;
.hlnInterval.Label = &quot;Période&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_it" script:language="StarBasic">Option Explicit
Sub LoadItalianLanguage()
sProductname = GetProductname
sOK = &quot;~OK&quot;
sCancel = &quot;Annulla&quot;
sColumnHeader = &quot;Intestazione colonna&quot;
sInsertStockName = &quot;Inserite un nome di azioni&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: Gestione delle azioni&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;Errore dati immessi&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;Inserite il numero delle azioni&quot;
sMsgNoDividend = &quot;Inserite un dividendo a unità oppure un dividendo totale&quot;
sMsgNoExchangeRate = &quot;Indicate un corretto tasso di cambio (vecchie azioni -&gt; nuove azioni).&quot;
sMsgNoValidExchangeDate = &quot;Indicate la data di frazionamento delle azioni.&quot;
sMsgWrongExchangeDate = &quot;Il frazionamento non è possibile perché sono ancora in atto transazioni dopo la data indicata.&quot;
sMsgSellTooMuch = &quot;Non potete vendere così tante azioni. Massimo: &quot;
sMsgConfirm = &quot;È necessaria una conferma&quot;
sMsgFreeStock = &quot;Confermate la digitazione di azioni gratuite?&quot;
sMsgTotalLoss = &quot;Confermate la digitazione di perdita totale?&quot;
sMsgAuthorization = &quot;Domanda di sicurezza&quot;
sMsgDeleteAll = &quot;Eliminare tutti i movimenti e ripristinare la panoramica dei depositi?&quot;
cSplit = &quot;Frazionamento delle azioni il: &quot;
sHistory = &quot;Cronologia&quot;
TransactTitle(1) = &quot;Vendita di azioni&quot;
TransactTitle(2) = &quot;Acquisto di azioni&quot;
StockRatesTitle(1) = &quot;Pagamento dei dividendi&quot;
StockRatesTitle(2) = &quot;Frazionamento azioni&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;Valuta deposito&quot;
sStockName = &quot;Nome delle azioni&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;Risultato data&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;Data d&apos;inizio:&quot;
sEndDate = &quot;Data finale:&quot;
sStartUpWelcome = &quot;Questo modello vi permette una gestione efficace delle vostre azioni.&quot;
sStartUpChooseMarket = &quot;Selezionate la valuta di riferimento e la Borsa per il collegamento Internet.&quot;
sStartUpHint = &quot;La funzione &lt;History&gt; è disponibile solo per il mercato americano.&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;Senza aggiornamento Internet&quot;
sMarketPlace = &quot;Borsa:&quot;
sNoInternetDataAvailable = &quot;Impossibile ricevere le quotazioni Internet&quot;
sCheckInternetSettings = &quot;Possibili cause: &lt;BR&gt; le impostazioni Internet devono essere modificate.&lt;BR&gt; Avete indicato un indice (ad es. simbolo o codice) errato per le azioni.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;La data finale dev&apos;essere anteriore alla data odierna.&quot;
sMsgStartDatebeforeEndDate = &quot;La data d&apos;inizio deve precedere la data finale.&quot;
sMarket(0,0) = &quot;Dollaro USA&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;New York&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;Simbolo&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;Euro&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;Francoforte&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;Numero identificazione titoli&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;Sterlina inglese&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;Londra&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;Simbolo&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;Yen&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;Tokyo&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;Codice&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;Dollaro Hong Kong&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;Hong Kong&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;Numero&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;Dollaro australiano&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;Sydney&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;Simbolo&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;Quantità&quot;
.lblRate.Label = &quot;Quotazione&quot;
.lblDate.Label = &quot;Data della transazione&quot;
.hlnCommission.Label = &quot;Spese extra&quot;
.lblCommission.Label = &quot;Commissioni&quot;
.lblMinimum.Label = &quot;Commissione minima&quot;
.lblFix.Label = &quot;Importo fisso/Spese&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;Dividendo/Azione&quot;
.optTotal.Label = &quot;Dividendo totale&quot;
.lblDividend.Label = &quot;Importo&quot;
.lblExchangeRate.Label = &quot;Tasso di cambio (vecchio-&gt;nuovo)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;Data di cambio:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~Giornaliero&quot;
.optWeekly.Label = &quot;~Settimanale&quot;
.hlnInterval.Label = &quot;Durata&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_ja" script:language="StarBasic">Option Explicit
Sub LoadJapaneseLanguage()
sProductname = GetProductname
sOK = &quot;~OK&quot;
sCancel = &quot;キャンセル&quot;
sColumnHeader = &quot;列番号&quot;
sInsertStockName = &quot;最初に株の銘柄を入力してください&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: 株管理&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;入力フィールド&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;0 より大きな額を入力してください&quot;
sMsgNoDividend = &quot;1株当たりの配当金額または総配当金額を入力してください&quot;
sMsgNoExchangeRate = &quot;交換比率旧株-&gt;新株を入力してください&quot;
sMsgNoValidExchangeDate = &quot;株式分割日を入力してください&quot;
sMsgWrongExchangeDate = &quot;分割日以降に取引がすでに存在するので分割できません&quot;
sMsgSellTooMuch = &quot;売却できる株式数を超えています最大値: &quot;
sMsgConfirm = &quot;ご確認ください&quot;
sMsgFreeStock = &quot;無料株式を入力しますか?&quot;
sMsgTotalLoss = &quot;全損の入力を行いますか?&quot;
sMsgAuthorization = &quot;確認ダイアログ&quot;
sMsgDeleteAll = &quot;すべての移動を取り消しポートフォリオの概要をリセットしますか?&quot;
cSplit = &quot;株式分割日 &quot;
sHistory = &quot;履歴&quot;
TransactTitle(1) = &quot;株を買う&quot;
TransactTitle(2) = &quot;株を買う&quot;
StockRatesTitle(1) = &quot;配当額&quot;
StockRatesTitle(2) = &quot;株式分割&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;ポートフォリオの通貨&quot;
sStockName = &quot;株式名&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;結果日付&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;開始日:&quot;
sEndDate = &quot;終了日:&quot;
sStartUpWelcome = &quot;このテンプレートを使えば株式のポートフォリオをより効率的に管理できます&quot;
sStartUpChooseMarket = &quot;まずインターネットにより情報を更新する基準通貨と対応する証券取引所を選択します&quot;
sStartUpHint = &quot;残念ながら&lt;History&gt; 機能を使用できるのは米国市場に限られています&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;インターネットによる情報の更新を行いません&quot;
sMarketPlace = &quot;証券取引所:&quot;
sNoInternetDataAvailable = &quot;インターネットから株価情報を受信できない場合があります!&quot;
sCheckInternetSettings = &quot;考えられる原因は次のとおりです&lt;BR&gt;インターネット設定の変更が必要です&lt;BR&gt;入力した株式のが間違っています&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;終了日は今日の日付より前であることが必要です&quot;
sMsgStartDatebeforeEndDate = &quot;開始日は終了日より前であることが必要です&quot;
sMarket(0,0) = &quot;米ドル&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;ニューヨーク&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;シンボル&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;ユーロ&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;フランクフルト&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;銘柄コード&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;英ポンド&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;ロンドン&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;シンボル&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;日本円&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;東京&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;コード&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;香港ドル&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;香港&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.HK&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;番号&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;オーストリアドル&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;シドニー&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;シンボル&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;株数&quot;
.lblRate.Label = &quot;価格&quot;
.lblDate.Label = &quot;取引日&quot;
.hlnCommission.Label = &quot;その他の経費n&quot;
.lblCommission.Label = &quot;手数料&quot;
.lblMinimum.Label = &quot;最低手数料&quot;
.lblFix.Label = &quot;固定費/諸経費&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;配当金/株式数&quot;
.optTotal.Label = &quot;配当金の総額&quot;
.lblDividend.Label = &quot;金額&quot;
.lblExchangeRate.Label = &quot;交換比率旧株-&gt;新株&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;交換日:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~毎日&quot;
.optWeekly.Label = &quot;~毎週&quot;
.hlnInterval.Label = &quot;期間&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_ko" script:language="StarBasic">Option Explicit
Sub LoadKoreanLanguage()
sProductname = GetProductname
sOK = &quot;~확인&quot;
sCancel = &quot;취소&quot;
sColumnHeader = &quot; 머리글&quot;
sInsertStockName = &quot;주식 종목을 삽입해주십시오.&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: 주식 매수&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;입력 오류&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;0 이하의 매수를 입력해주십시오.&quot;
sMsgNoDividend = &quot; 주당 배당분 또는 총배당분을 입력해주십시오.&quot;
sMsgNoExchangeRate = &quot;정확한 환율을 입력해주십시오 (구주를 신주로 소급 ).&quot;
sMsgNoValidExchangeDate = &quot;유효한 배당 결제일을 입력해주십시오.&quot;
sMsgWrongExchangeDate = &quot;배당 기준일이 경과하여 배당할 없습니다.&quot;
sMsgSellTooMuch = &quot;이렇게 많은 주식을 없습니다. 최대 매도수: &quot;
sMsgConfirm = &quot;확인 필요&quot;
sMsgFreeStock = &quot;공짜 주식을 입력하시겠습니까?&quot;
sMsgTotalLoss = &quot;주가 폭락세를 입력하시겠습니까?&quot;
sMsgAuthorization = &quot;안정성 조회&quot;
sMsgDeleteAll = &quot;모든 주가 움직임을 삭제하고 계좌 현황을 원래대로 하시겠습니까?&quot;
cSplit = &quot;주식 배당일 &quot;
sHistory = &quot;내역&quot;
TransactTitle(1) = &quot;주식 관리: 주식 매도&quot;
TransactTitle(2) = &quot;주식 관리: 주식 매수&quot;
StockRatesTitle(1) = &quot;주식 관리: 배당금 지불&quot;
StockRatesTitle(2) = &quot;주식 관리: 주식 배분&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;주식 계좌 통화&quot;
sStockName = &quot;주식 종목명&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;결과, 날짜&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;매매일:&quot;
sEndDate = &quot;만기일:&quot;
sStartUpWelcome = &quot; 템플릿을 사용하여 주식 투자 관리를 효율적으로 있습니다.&quot;
sStartUpChooseMarket = &quot;인터넷 업데이트를 위해 우선 관련 통화와 증권 장소를 선택하십시오.&quot;
sStartUpHint = &quot;&lt;내역&gt; 기능은 미국 시장용으로만 사용할 있습니다.&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;인터넷 업데이트 없음&quot;
sMarketPlace = &quot;증권 장소:&quot;
sNoInternetDataAvailable = &quot;인터넷 시세는 받을 없었습니다.&quot;
sCheckInternetSettings = &quot;원인: &lt;BR&gt; 인터넷 설정을 점검해야만 합니다.&lt;BR&gt; 옳지 않은 암호&lt;예를 들어 잘못된 문자 또는 종목 코드&gt; 입력했습니다.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;만기일은 오늘 날짜 전에 기입되어야 합니다.&quot;
sMsgStartDatebeforeEndDate = &quot;매매일은 만기일 전에 기입되어야 합니다.&quot;
sMarket(0,0) = &quot;미국 달러&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;뉴욕&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;기호&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;유로&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;프랑크푸르트&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;WKN&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;영국 파운드&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;런던&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;기호&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;엔화&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;도쿄&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;코드&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;홍콩 달러&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;홍콩&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.HK&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;번호&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;호주 달러&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;시드니&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;기호&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;수량&quot;
.lblRate.Label = &quot;시세&quot;
.lblDate.Label = &quot;배당 결산일&quot;
.hlnCommission.Label = &quot;기타 지출&quot;
.lblCommission.Label = &quot;수수료&quot;
.lblMinimum.Label = &quot;최저 수수료&quot;
.lblFix.Label = &quot;약정 금액/기타 경비&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;배당분/&quot;
.optTotal.Label = &quot;배당분 합계&quot;
.lblDividend.Label = &quot;금액&quot;
.lblExchangeRate.Label = &quot;환율(구주-&gt;신주)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;환율일자&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~매일&quot;
.optWeekly.Label = &quot;~매주&quot;
.hlnInterval.Label = &quot;기간&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View File

@@ -0,0 +1,177 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_sv" script:language="StarBasic">Option Explicit
Sub LoadSwedishLanguage()
sProductname = GetProductname
sOK = &quot;~OK&quot;
sCancel = &quot;Avbryt&quot;
sColumnHeader = &quot;Kolumnhuvud&quot;
sInsertStockName = &quot;Infoga först några aktier i Din portfölj!&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: Aktieförvaltning&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;Inmatningsfel&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;Var vänlig och mata in ett större antal än 0&quot;
sMsgNoDividend = &quot;Var vänlig och mata in utdelning per styck eller den totala utdelningen&quot;
sMsgNoExchangeRate = &quot;Var vänlig och mata in en korrekt omräkningskurs (gamla aktier -&gt; nya aktier).&quot;
sMsgNoValidExchangeDate = &quot;Var vänlig och mata in ett giltigt datum för aktiesplitten.&quot;
sMsgWrongExchangeDate = &quot;Split är inte möjlig eftersom det redan finns transaktioner efter splitdatum.&quot;
sMsgSellTooMuch = &quot; många aktier kan Du inte sälja. Maximum: &quot;
sMsgConfirm = &quot;Bekräftelse krävs&quot;
sMsgFreeStock = &quot;Avser Du att mata in gratisaktier?&quot;
sMsgTotalLoss = &quot;Avser Du att mata in en totalförlust?&quot;
sMsgAuthorization = &quot;Säkerhetskontroll&quot;
sMsgDeleteAll = &quot;Vill Du ta bort alla rörelser och återställa portföljöversikten?&quot;
cSplit = &quot;Aktiesplit den &quot;
sHistory = &quot;Historik&quot;
TransactTitle(1) = &quot;Sälja aktier&quot;
TransactTitle(2) = &quot;Köpa aktier&quot;
StockRatesTitle(1) = &quot;Aktieutdelning&quot;
StockRatesTitle(2) = &quot;Aktiesplit&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;Portföljvaluta&quot;
sStockName = &quot;Aktienamn&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;Resultat datum&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;Startdatum:&quot;
sEndDate = &quot;Slutdatum:&quot;
sStartUpWelcome = &quot;Med hjälp av den här mallen kan Du förvalta Din aktieportfölj effektivt&quot;
sStartUpChooseMarket = &quot;Välj först Din referensvaluta och därigenom börs för Internet-uppdateringen!&quot;
sStartUpHint = &quot;Tyvärr är &lt;History&gt;-funktionen bara tillgänglig för den amerikanska marknaden!&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;utan Internet-uppdatering&quot;
sMarketPlace = &quot;Börs:&quot;
sNoInternetDataAvailable = &quot;Det gick inte att ta emot Internet-kurser!&quot;
sCheckInternetSettings = &quot;Detta kan bero att: &lt;BR&gt; Dina Internet-inställningar måste ändras.&lt;BR&gt; Du har angivit ett felaktigt ID (t.ex. symbol, värdepappersnr.) för aktien.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;Slutdatum måste ligga före idag!&quot;
sMsgStartDatebeforeEndDate = &quot;Startdatum måste ligga före slutdatum!&quot;
sMarket(0,0) = &quot;Amerikansk dollar&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;New York&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;Symbol&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;Euro&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;Frankfurt&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;Värdepappersnr&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;Engelskt pund&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;London&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;Symbol&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;Japansk yen&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;Tokyo&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;Kod&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;Hongkongdollar&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;Hongkong&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;Nummer&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;Australisk dollar&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;Sydney&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;Symbol&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;Antal&quot;
.lblRate.Label = &quot;Kurs&quot;
.lblDate.Label = &quot;Transaktionsdatum&quot;
.hlnCommission.Label = &quot;Övriga utgifter&quot;
.lblCommission.Label = &quot;Provision&quot;
.lblMinimum.Label = &quot;Minimiprovision&quot;
.lblFix.Label = &quot;Fast belopp/omkostnader&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;Utdelning per aktie&quot;
.optTotal.Label = &quot;Utdelning totalt&quot;
.lblDividend.Label = &quot;Belopp&quot;
.lblExchangeRate.Label = &quot;Omräkningskurs (gammal-&gt;ny)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;Omräkningsdatum:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~Dagligen&quot;
.optWeekly.Label = &quot;~Varje vecka&quot;
.hlnInterval.Label = &quot;Period&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_tw" script:language="StarBasic">Option Explicit
Sub LoadChineseTradLanguage()
sProductname = GetProductname
sOK = &quot;確定&quot;
sCancel = &quot;取消&quot;
sColumnHeader = &quot;欄標簽&quot;
sInsertStockName = &quot;請先填入股票名稱!&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: 股票管理&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;輸入無效&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;請輸入大於0的交易股數&quot;
sMsgNoDividend = &quot;請輸入每股股息金額或股息總額&quot;
sMsgNoExchangeRate = &quot;請鍵入正確的換算比率(舊股票 -&gt; 新股票)&quot;
sMsgNoValidExchangeDate = &quot;請輸入股票分割的日期&quot;
sMsgWrongExchangeDate = &quot;無法分割股票因為分割日期之後已經買進或賣出股票&quot;
sMsgSellTooMuch = &quot;最多能出售的股票數 &quot;
sMsgConfirm = &quot;需要确認&quot;
sMsgFreeStock = &quot;需要輸入一個贈送的股票&quot;
sMsgTotalLoss = &quot;要輸入一個全部損失的股票&quot;
sMsgAuthorization = &quot;安全詢問&quot;
sMsgDeleteAll = &quot;您要刪除所有的交易資料重新建立一個股票一覽表&quot;
cSplit = &quot;股票分割的日期 &quot;
sHistory = &quot;紀錄&quot;
TransactTitle(1) = &quot;出售股票&quot;
TransactTitle(2) = &quot;購買股票&quot;
StockRatesTitle(1) = &quot;支付股息&quot;
StockRatesTitle(2) = &quot;股票分割&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;股票的貨幣&quot;
sStockName = &quot;股票名稱&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;結果 日期&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;交割日期&quot;
sEndDate = &quot;到期日期&quot;
sStartUpWelcome = &quot;這個樣式用於高效能地管理股票交易&quot;
sStartUpChooseMarket = &quot;請先選一個參照的貨幣和一個可直接從 Internet 更新資料的贈券交易所&quot;
sStartUpHint = &quot;很遺憾&lt;History&gt;-功能僅適用於美國的交易所&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;不透過 internet 更新&quot;
sMarketPlace = &quot;證券交易所&quot;
sNoInternetDataAvailable = &quot;無法接受 Internet 股票價格!&quot;
sCheckInternetSettings = &quot;可能的原因&lt;BR&gt;Internet 設定不正確需要重新設定&lt;BR&gt;輸入了一個錯誤的股票代碼&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;到期日期必須是在今日之前&quot;
sMsgStartDatebeforeEndDate = &quot;交割日期必須是在到期日期之前&quot;
sMarket(0,0) = &quot;美元&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;紐約&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;股票符號&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;歐元&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;法蘭克福&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;股代碼&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;英鎊&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;倫敦&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;股票符號&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;日元&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;東京&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;代碼&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;港幣&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;香港&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.HK&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;編號&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;澳元&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;悉尼&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;股票符號&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;數量&quot;
.lblRate.Label = &quot;股票價格&quot;
.lblDate.Label = &quot;交易日期&quot;
.hlnCommission.Label = &quot;其它的支出費用&quot;
.lblCommission.Label = &quot;手續費&quot;
.lblMinimum.Label = &quot;最低手續費&quot;
.lblFix.Label = &quot;固定金額/費用&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;每股股息&quot;
.optTotal.Label = &quot;股息總計&quot;
.lblDividend.Label = &quot;金額&quot;
.lblExchangeRate.Label = &quot;轉換比率(舊股票 -&gt; 新股票)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;轉換日期:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;每日&quot;
.optWeekly.Label = &quot;每週&quot;
.hlnInterval.Label = &quot;時間週期&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_zh" script:language="StarBasic">Option Explicit
Sub LoadChineseSimpleLanguage()
sProductname = GetProductname
sOK = &quot;确定&quot;
sCancel = &quot;取消&quot;
sColumnHeader = &quot;列标题&quot;
sInsertStockName = &quot;请首先往您的帐号内输入一些股票名称&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;股票管理&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;输入错误&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;请输入大于0的交易股数&quot;
sMsgNoDividend = &quot;请输入每股的红利金额或红利总额&quot;
sMsgNoExchangeRate = &quot;请输入一个正确的兑换率(旧股-&gt; 新股)&quot;
sMsgNoValidExchangeDate = &quot;请输入拆股生效日期&quot;
sMsgWrongExchangeDate = &quot;因为在拆股生效后已经进行了股票交易所以无法拆股&quot;
sMsgSellTooMuch = &quot;您最多能出售的股票数为 &quot;
sMsgConfirm = &quot;需要确认&quot;
sMsgFreeStock = &quot;您想要输入赠送股票&quot;
sMsgTotalLoss = &quot;您想要输入总亏损值&quot;
sMsgAuthorization = &quot;安全查询&quot;
sMsgDeleteAll = &quot;您要删除所有的交易信息并重新建立股票帐号一览表吗&quot;
cSplit = &quot;股票拆股日期 &quot;
sHistory = &quot;记录&quot;
TransactTitle(1) = &quot;出售股票&quot;
TransactTitle(2) = &quot;购买股票&quot;
StockRatesTitle(1) = &quot;支付红利&quot;
StockRatesTitle(2) = &quot;股票拆股&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;股票交易的货币&quot;
sStockName = &quot;股票名称&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;结果 日期&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;起始日期&quot;
sEndDate = &quot;终止日期&quot;
sStartUpWelcome = &quot;这个样式能够帮助您有效地管理自己的股票帐号&quot;
sStartUpChooseMarket = &quot;请首先选择采用的参考货币以及要直接用国际互联网来更新资料的证券交易所&quot;
sStartUpHint = &quot;很遗憾&lt;History&gt;功能仅可供美国市场使用&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;不通过国际互联网更新&quot;
sMarketPlace = &quot;交易所&quot;
sNoInternetDataAvailable = &quot;无法获得国际互联网上的行情&quot;
sCheckInternetSettings = &quot;可能的原因是&lt;BR&gt;您的国际互联网设定不正确需要重新设定&lt;BR&gt;输入了一个错误的股票号码&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;终止日期必须在今天之前&quot;
sMsgStartDatebeforeEndDate = &quot;起始日期必须在终止日期之前&quot;
sMarket(0,0) = &quot;美元&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;纽约&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;图标&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;欧元&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;法兰克福&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;代码&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;英镑&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;伦敦&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;股票代码&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;日元&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;东京&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;代码&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;港币&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;香港&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.HK&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;编号&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;澳元&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;悉尼&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;股票代码&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;数量&quot;
.lblRate.Label = &quot;股票牌价&quot;
.lblDate.Label = &quot;交易日期&quot;
.hlnCommission.Label = &quot;其它支出费用&quot;
.lblCommission.Label = &quot;手续费&quot;
.lblMinimum.Label = &quot;最低手续费&quot;
.lblFix.Label = &quot;固定金额/费用&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;每股红利&quot;
.optTotal.Label = &quot;红利总计&quot;
.lblDividend.Label = &quot;金额&quot;
.lblExchangeRate.Label = &quot;兑换率(-&gt;)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;兑换日期:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;每天&quot;
.optWeekly.Label = &quot;每周&quot;
.hlnInterval.Label = &quot;时间周期&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Depot" library:readonly="true" library:passwordprotected="false">
<library:element library:name="Dialog2"/>
<library:element library:name="Dialog3"/>
<library:element library:name="Dialog4"/>
</library:library>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Depot" library:readonly="true" library:passwordprotected="false">
<library:element library:name="Depot"/>
<library:element library:name="CommonLang"/>
<library:element library:name="Currency"/>
<library:element library:name="Internet"/>
<library:element library:name="Lang_de"/>
<library:element library:name="tools"/>
<library:element library:name="Lang_en"/>
<library:element library:name="Lang_fr"/>
<library:element library:name="Lang_it"/>
<library:element library:name="Lang_es"/>
<library:element library:name="Lang_sv"/>
<library:element library:name="Lang_zh"/>
<library:element library:name="Lang_tw"/>
<library:element library:name="Lang_ko"/>
<library:element library:name="Lang_ja"/>
</library:library>

View File

@@ -0,0 +1,220 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="tools" script:language="StarBasic">REM ***** BASIC *****
Option Explicit
Sub RemoveSheet()
If oSheets.HasbyName(&quot;Link&quot;) then
oSheets.RemovebyName(&quot;Link&quot;)
End If
End Sub
Sub InitializeStatusLine(StatusText as String, MaxValue as Integer, FirstValue as Integer)
oStatusline = oDocument.GetCurrentController.GetFrame.CreateStatusIndicator()
oStatusLine.Start(StatusText, MaxValue)
oStatusline.SetValue(FirstValue)
End Sub
Sub MakeRangeVisible(oSheet as Object, RangeName as String, BIsVisible as Boolean)
Dim oRangeAddress, oColumns as Object
Dim i, iStartColumn, iEndColumn as Integer
oRangeAddress = oSheet.GetCellRangeByName(RangeName).RangeAddress
iStartColumn = oRangeAddress.StartColumn
iEndColumn = oRangeAddress.EndColumn
oColumns = oSheet.Columns
For i = iStartColumn To iEndColumn
oSheet.Columns(i).IsVisible = bIsVisible
Next i
End Sub
Function GetRowIndex(oSheet as Object, RowName as String)
Dim oRange as Object
oRange = oSheet.GetCellRangeByName(RowName)
GetRowIndex = oRange.RangeAddress.StartRow
End Function
Function GetTransactionCount(iStartRow as Integer)
Dim iEndRow as Integer
iStartRow = GetRowIndex(oMovementSheet, &quot;ColumnsToHide&quot;)
iEndRow = GetRowIndex(oMovementSheet, &quot;HiddenRow3&quot; )
GetTransactionCount = iEndRow -iStartRow - 2
End Function
Function GetStocksCount(iStartRow as Integer)
Dim iEndRow as Integer
iStartRow = GetRowIndex(oFirstSheet, &quot;HiddenRow1&quot;)
iEndRow = GetRowIndex(oFirstSheet, &quot;HiddenRow2&quot;)
GetStocksCount = iEndRow -iStartRow - 1
End Function
Function FillListbox(ListboxControl as Object, MsgTitle as String, bShowMessage) as Boolean
Dim i, StocksCount as Integer
Dim iStartRow as Integer
Dim oCell as Object
&apos; Add stock names to empty list box
StocksCount = GetStocksCount(iStartRow)
If StocksCount &gt; 0 Then
ListboxControl.Model.StringItemList() = NullList()
For i = 1 To StocksCount
oCell = oFirstSheet.GetCellByPosition(SBCOLUMNNAME1,iStartRow + i)
ListboxControl.AddItem(oCell.String, i-1)
Next
FillListbox() = True
Else
If bShowMessage Then
Msgbox(sInsertStockName, 16, MsgTitle)
FillListbox() = False
End If
End If
End Function
Sub CellValuetoControl(oSheet, oControl as Object, CellName as String)
Dim oCell as Object
Dim StringValue
oCell = GetCellByName(oSheet, CellName)
If oControl.PropertySetInfo.HasPropertyByName(&quot;EffectiveValue&quot;) Then
oControl.EffectiveValue = oCell.Value
Else
oControl.Value = oCell.Value
End If
&apos; If oCell.FormulaResultType = 1 Then
&apos; StringValue = oNumberFormatter.GetInputString(oCell.NumberFormat, oCell.Value)
&apos; oControl.Text = DeleteStr(StringValue, &quot;%&quot;)
&apos; Else
&apos; oControl.Text = oCell.String
&apos; End If
End Sub
Sub RemoveStockRows(oSheet as Object, iStartRow, RowCount as Integer)
If RowCount &gt; 0 Then
oSheet.Rows.RemoveByIndex(iStartRow, RowCount)
End If
End Sub
Sub AddValueToCellContent(iCellCol, iCellRow as Integer, AddValue)
Dim oCell as Object
Dim OldValue
oCell = oMovementSheet.GetCellByPosition(iCellCol, iCellRow)
OldValue = oCell.Value
oCell.Value = OldValue + AddValue
End Sub
Sub CheckInputDate(aEvent as Object)
Dim oRefDialog as Object
Dim oRefModel as Object
Dim oDateModel as Object
oDateModel = aEvent.Source.Model
oRefModel = DlgReference.GetControl(&quot;cmdGoOn&quot;).Model
oRefModel.Enabled = oDateModel.Date &lt;&gt; 0
End Sub
&apos; Updates the cell with the CurrentValue after checking if the
&apos; Newdate is later than the one that is refered to in the annotation
&apos; of the cell
Sub InsertCurrentValue(CurValue as Double, iRow as Integer, Newdate as Date)
Dim oCell as Object
Dim OldDate as Date
oCell = oFirstSheet.GetCellByPosition(SBCOLUMNRATE1, iRow)
OldDate = CDate(oCell.Annotation.Text.String)
If NewDate &gt;= OldDate Then
oCell.SetValue(CurValue)
oCell.Annotation.Text.SetString(CStr(NewDate))
End If
End Sub
Sub SplitCellValue(oSheet, FirstNumber, SecondNumber, iCol, iRow, NoteText)
Dim oCell as Object
Dim OldValue
oCell = oSheet.GetCellByPosition(iCol, iRow)
OldValue = oCell.Value
oCell.Value = OldValue * FirstNumber / SecondNumber
If NoteText &lt;&gt; &quot;&quot; Then
oCell.Annotation.SetString(NoteText)
End If
End Sub
Function GetStockRowIndex(ByVal Stockname) as Integer
Dim i, StocksCount as Integer
Dim iStartRow as Integer
Dim oCell as Object
StocksCount = GetStocksCount(iStartRow)
For i = 1 To StocksCount
oCell = oFirstSheet.GetCellByPosition(SBCOLUMNNAME1,iStartRow + i)
If oCell.String = Stockname Then
GetStockRowIndex = iStartRow + i
Exit Function
End If
Next
GetStockRowIndex = -1
End Function
Function GetStockID(StockName as String, Optional iFirstRow as Integer) as String
Dim CellStockName as String
Dim i as Integer
Dim iCount as Integer
Dim iLastRow as Integer
If IsMissing(iFirstRow) Then
iFirstRow = GetRowIndex(oFirstSheet, &quot;HiddenRow1&quot;)
End If
iCount = GetStocksCount(iFirstRow)
iLastRow = iFirstRow + iCount
For i = iFirstRow To iLastRow
CellStockName = oFirstSheet.GetCellByPosition(SBCOLUMNNAME1, i).String
If CellStockname = StockName Then
Exit For
End If
Next i
If i &gt; iLastRow Then
GetStockID() = &quot;&quot;
Else
If Not IsMissing(iFirstRow) Then
iFirstRow = i
End If
GetStockID() = oFirstSheet.GetCellByPosition(SBCOLUMNID1, i).String
End If
End Function
Function CheckDocLocale(LocLanguage as String, LocCountry as String)
Dim bIsDocLanguage as Boolean
Dim bIsDocCountry as Boolean
bIsDocLanguage = Instr(1, LocLanguage, sDocLanguage, SBBINARY) &lt;&gt; 0
bIsDocCountry = Instr(1, LocCountry, sDocCountry, SBBINARY) &lt;&gt; 0 OR SDocCountry = &quot;&quot;
CheckDocLocale = (bIsDocLanguage And bIsDocCountry)
End Function
</script:module>

View File

@@ -0,0 +1,434 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="AutoPilotRun" script:language="StarBasic">Option Explicit
Public SourceDir as String
Public TargetDir as String
Public TargetStemDir as String
Public SourceFile as String
Public TargetFile as String
Public Source as String
Public SubstFile as String
Public SubstDir as String
Public NoArgs()
Public TypeList(14) as String
Public GoOn as Boolean
Public DoUnprotect as Integer
Public Password as String
Public DocIndex as Integer
Public oPathSettings as Object
Public oUcb as Object
Public TotDocCount as Integer
Public sTotDocCount as String
Public OpenProperties(1) as New com.sun.star.beans.PropertyValue
Sub StartAutoPilot()
Dim i As Integer
Dim oFactoryKey as Object
BasicLibraries.LoadLibrary(&quot;Tools&quot;)
BasicLibraries.LoadLibrary(&quot;ImportWizard&quot;)
If InitResources(&quot;Euro Converter&quot;, &quot;eur&quot;) Then
oUcb = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
oLocale = GetStarOfficeLocale()
InitializeConverter(oLocale, 2)
ToggleGoOnButton()
oFactoryKey = GetRegistryKeyContent(&quot;org.openoffice.Setup/Office/Factories&quot;)
DialogModel.chkTextDocuments.Enabled = oFactoryKey.hasbyName(&quot;com.sun.star.text.TextDocument&quot;)
DialogModel.cmdGoOn.DefaultButton = True
DialogModel.lstCurrencies.TabIndex = 12
DialogConvert.GetControl(&quot;optWholeDir&quot;).SetFocus()
DialogConvert.Execute()
DialogConvert.Dispose()
End If
End Sub
Sub ConvertDocuments()
Dim FilesList()
Dim bDisposable as Boolean
If Source &lt;&gt; &quot;&quot; And TargetDir &lt;&gt; &quot;&quot; Then
If DialogModel.optSingleFile.State = 1 Then
SourceFile = Source
TotDocCount = 1
Else
SourceDir = Source
TargetStemDir = TargetDir
TypeList(0) = &quot;calc8&quot;
TypeList(1) = &quot;calc_StarOffice_XML_Calc&quot;
TypeList(2) = &quot;calc_StarCalc_30&quot;
TypeList(3) = &quot;calc_StarCalc_40&quot;
TypeList(4) = &quot;calc_StarCalc_50&quot;
If DialogModel.chkTextDocuments.State = 1 Then
ReDim Preserve TypeList(13) as String
TypeList(5) = &quot;writer8&quot;
TypeList(6) = &quot;writerglobal8&quot;
TypeList(7) = &quot;writer_StarOffice_XML_Writer&quot;
TypeList(8) = &quot;writer_globaldocument_StarOffice_XML_Writer_GlobalDocument&quot;
TypeList(9) = &quot;writer_StarWriter_30&quot;
TypeList(10) = &quot;writer_StarWriter_40&quot;
TypeList(11) = &quot;writer_globaldocument_StarWriter_40GlobalDocument&quot;
TypeList(12) = &quot;writer_StarWriter_50&quot;
TypeList(13) = &quot;writer_globaldocument_StarWriter_50GlobalDocument&quot;
End If
FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, TypeList())
TotDocCount = Ubound(FilesList(),1) + 1
End If
InitializeProgressPage(DialogModel)
&apos; ChangeToNextProgressStep()
sTotDocCount = CStr(TotDocCount)
OpenProperties(0).Name = &quot;Hidden&quot;
OpenProperties(0).Value = True
OpenProperties(1).Name = &quot;AsTemplate&quot;
OpenProperties(1).Value = False
For DocIndex = 0 To TotDocCount - 1
If InitializeDocument(FilesList(), bDisposable) Then
If StoreDocument() Then
ConvertDocument()
oDocument.Store
End If
If bDisposable Then
oDocument.Dispose()
End If
End If
Next DocIndex
DialogModel.cmdBack.Enabled = True
DialogModel.cmdGoOn.Enabled = True
DialogModel.cmdGoOn.Label = sReady
DialogModel.cmdCancel.Label = sEnd
End If
End Sub
Function InitializeDocument(FilesList(), bDisposable as Boolean) as Boolean
&apos; The Autopilot is started from step No. 2
Dim sViewPath as String
Dim bIsReadOnly as Boolean
Dim sExtension as String
On Local Error Goto NEXTFILE
If Not bCancelTask Then
If DialogModel.optWholeDir.State = 1 Then
SourceFile = FilesList(DocIndex,0)
TargetFile = ReplaceString(SourceFile,TargetStemDir,SourceDir)
TargetDir = DirectorynameoutofPath(TargetFile, &quot;/&quot;)
Else
SourceFile = Source
TargetFile = TargetDir &amp; &quot;/&quot; &amp; FileNameoutofPath(SourceFile, &quot;/&quot;)
End If
If CreateFolder(TargetDir) Then
sExtension = GetFileNameExtension(SourceFile, &quot;/&quot;)
oDocument = OpenDocument(SourceFile, OpenProperties(), bDisposable)
If (oDocument.IsReadOnly) AND (UCase(SourceFile) = UCase(TargetFile)) Then
bIsReadOnly = True
Msgbox(sMsgDOCISREADONLY, 16, GetProductName())
Else
bIsReadOnly = False
RetrieveDocumentObjects()
sViewPath = CutPathView(SourceFile, 60)
DialogModel.lblCurDocument.Label = Str(DocIndex+1) &amp; &quot;/&quot; &amp; sTotDocCount &amp; &quot; (&quot; &amp; sViewPath &amp; &quot;)&quot;
End If
InitializeDocument() = Not bIsReadOnly
Else
InitializeDocument() = False
End If
Else
InitializeDocument() = False
End If
NEXTFILE:
If Err &lt;&gt; 0 Then
InitializeDocument() = False
Resume LETSGO
LETSGO:
End If
End Function
Sub ChangeToNextProgressStep()
DialogModel.lblCurProgress.FontWeight = com.sun.star.awt.FontWeight.NORMAL
DialogConvert.GetControl(&quot;lblCurProgress&quot;).Visible = True
End Sub
Function StoreDocument() as Boolean
Dim sCurFileExists as String
Dim iOverWrite as Integer
If (TargetFile &lt;&gt; &quot;&quot;) And (Not bCancelTask) Then
On Local Error Goto NOSAVING
If oUcb.Exists(TargetFile) Then
sCurFileExists = ReplaceString(sMsgFileExists, ConvertFromUrl(TargetFile), &quot;&lt;1&gt;&quot;)
sCurFileExists = ReplaceString(sCurFileExists, chr(13), &quot;&lt;CR&gt;&quot;)
iOverWrite = Msgbox (sCurFileExists, 32 + 3, sMsgDLGTITLE)
Select Case iOverWrite
Case 1 &apos; OK
Case 2 &apos; Abort
bCancelTask = True
StoreDocument() = False
Exit Function
Case 7 &apos; No
StoreDocument() = False
Exit Function
End Select
End If
If TargetFile &lt;&gt; SourceFile Then
oDocument.StoreAsUrl(TargetFile,NoArgs)
Else
oDocument.Store
End If
StoreDocument() = True
NOSAVING:
If Err &lt;&gt; 0 Then
StoreDocument() = False
Resume CLERROR
End If
CLERROR:
End If
End Function
Sub SwapExtent()
DialogModel.chkRecursive.Enabled = DialogModel.optWholeDir.State = 1
If DialogModel.optWholeDir.State = 1 Then
DialogModel.lblSource.Label = sSOURCEDIR
If Not IsNull(SubstFile) Then
SubstFile = DialogModel.txtSource.Text
DialogModel.txtSource.Text = SubstDir
End If
Else
DialogModel.LblSource.Label = sSOURCEFILE
If Not IsNull(SubstDir) Then
SubstDir = DialogModel.txtSource.Text
DialogModel.txtSource.Text = SubstFile
End If
End If
ToggleGoOnButton()
End Sub
Function InitializeThirdStep() as Boolean
Dim TextBoxText as String
Source = AssignFileName(DialogModel.txtSource.Text, DialogModel.lblSource.Label, True)
If CheckTextBoxPath(DialogModel.txtTarget, True, True, sMsgDLGTITLE, True) Then
TargetDir = AssignFileName(DialogModel.txtTarget.Text, DialogModel.lblTarget.Label, False)
Else
TargetDir = &quot;&quot;
End If
If Source &lt;&gt; &quot;&quot; And TargetDir &lt;&gt; &quot;&quot; Then
bRecursive = DialogModel.chkRecursive.State = 1
bDoUnprotect = DialogModel.chkProtect.State = 1
DialogModel.lblRetrieval.FontWeight = com.sun.star.awt.FontWeight.BOLD
DialogModel.lblRetrieval.Label = sPrgsRETRIEVAL
DialogModel.lblCurProgress.Label = sPrgsCONVERTING
If DialogModel.optWholeDir.State = 1 Then
TextBoxText = sSOURCEDIR &amp; &quot; &quot; &amp; ConvertFromUrl(Source) &amp; chr(13)
If DialogModel.chkRecursive.State = 1 Then
TextBoxText = TextBoxText &amp; DeleteStr(sInclusiveSubDir,&quot;~&quot;) &amp; chr(13)
End If
Else
TextBoxText = sSOURCEFILE &amp; &quot; &quot; &amp; ConvertFromUrl(Source) &amp; chr(13)
End If
TextBoxText = TextBoxText &amp; sTARGETDIR &amp; &quot; &quot; &amp; ConvertFromUrl(TargetDir) &amp; chr(13)
If DialogModel.chkProtect.State = 1 Then
TextBoxText = TextboxText &amp; sPrgsUNPROTECT
End If
DialogModel.txtConfig.Text = TextBoxText
ToggleProgressStep()
DialogModel.cmdGoOn.Enabled = False
InitializeThirdStep() = True
Else
InitializeThirdStep() = False
End If
End Function
Sub ToggleProgressStep(Optional aEvent as Object)
Dim bMakeVisible as Boolean
Dim LocStep as Integer
&apos; If the Sub is call by the &apos;cmdBack&apos; Button then set the &apos;bMakeVisible&apos; variable accordingly
bMakeVisible = IsMissing(aEvent)
If bMakeVisible Then
DialogModel.Step = 3
Else
DialogModel.Step = 2
End If
DialogConvert.GetControl(&quot;lblCurrencies&quot;).Visible = Not bMakeVisible
DialogConvert.GetControl(&quot;lstCurrencies&quot;).Visible = Not bMakeVisible
DialogConvert.GetControl(&quot;cmdBack&quot;).Visible = bMakeVisible
DialogConvert.GetControl(&quot;cmdGoOn&quot;).Visible = bMakeVisible
DialogModel.imgPreview.ImageUrl = BitmapDir &amp; &quot;euro_&quot; &amp; DialogModel.Step &amp; &quot;.bmp&quot;
End Sub
Sub EnableStep2DialogControls(OnValue as Boolean)
With DialogModel
.hlnExtent.Enabled = OnValue
.optWholeDir.Enabled = OnValue
.optSingleFile.Enabled = OnValue
.chkProtect.Enabled = OnValue
.cmdCallSourceDialog.Enabled = OnValue
.cmdCallTargetDialog.Enabled = OnValue
.lblSource.Enabled = OnValue
.lblTarget.Enabled = OnValue
.txtSource.Enabled = OnValue
.txtTarget.Enabled = OnValue
.imgPreview.Enabled = OnValue
.lstCurrencies.Enabled = OnValue
.lblCurrencies.Enabled = OnValue
If OnValue Then
ToggleGoOnButton()
.chkRecursive.Enabled = .optWholeDir.State = 1
Else
.cmdGoOn.Enabled = False
.chkRecursive.Enabled = False
End If
End With
End Sub
Sub InitializeProgressPage()
DialogConvert.GetControl(&quot;lblRetrieval&quot;).Visible = False
DialogConvert.GetControl(&quot;lblCurProgress&quot;).Visible = False
DialogModel.lblRetrieval.FontWeight = com.sun.star.awt.FontWeight.NORMAL
DialogModel.lblCurProgress.FontWeight = com.sun.star.awt.FontWeight.BOLD
DialogConvert.GetControl(&quot;lblRetrieval&quot;).Visible = True
DialogConvert.GetControl(&quot;lblCurProgress&quot;).Visible = True
End Sub
Function AssignFileName(sPath as String, ByVal HeaderString, bCheckFileType as Boolean) as String
Dim bIsValid as Boolean
Dim sLocMimeType as String
Dim sNoDirMessage as String
HeaderString = DeleteStr(HeaderString, &quot;:&quot;)
sPath = ConvertToUrl(Trim(sPath))
bIsValid = oUcb.Exists(sPath)
If bIsValid Then
If DialogModel.optSingleFile.State = 1 Then
If bCheckFileType Then
sLocMimeType = GetRealFileContent(sPath)
If DialogModel.chkTextDocuments.State = 1 Then
If (Instr(1, sLocMimeType, &quot;text&quot;) = 0) And (Instr(1, sLocMimeType, &quot;calc&quot;) = 0) Then
Msgbox(sMsgFileInvalid, 48, sMsgDLGTITLE)
bIsValid = False
End If
Else
If (Instr(1, sLocMimeType, &quot;spreadsheet&quot;) = 0) And (Instr(1, sLocMimeType, &quot;calc&quot;)) = 0 Then
Msgbox(sMsgFileInvalid, 48, sMsgDLGTITLE)
bIsValid = False
End If
End If
End If
Else
If Not oUcb.IsFolder(sPath) Then
sNoDirMessage = ReplaceString(sMsgNODIRECTORY,sPath,&quot;&lt;1&gt;&quot;)
Msgbox(sNoDirMessage,48, sMsgDLGTITLE)
bIsValid = False
Else
sPath = RTrimStr(sPath,&quot;/&quot;)
sPath = sPath &amp; &quot;/&quot;
End If
End if
Else
Msgbox(HeaderString &amp; &quot; &apos;&quot; &amp; ConvertFromUrl(sPath) &amp; &quot;&apos; &quot; &amp; sMsgNOTTHERE,48, sMsgDLGTITLE)
End If
If bIsValid Then
AssignFileName() = sPath
Else
AssignFilename() = &quot;&quot;
End If
End Function
Sub ToggleGoOnButton()
Dim bDoEnable as Boolean
Dim sLocMimeType as String
Dim sPath as String
bDoEnable = Ubound(DialogModel.lstCurrencies.SelectedItems()) &gt; -1
If bDoEnable Then
&apos; Check if Source is set correctly
sPath = ConvertToUrl(Trim(DialogModel.txtSource.Text))
bDoEnable = oUcb.Exists(sPath)
End If
DialogModel.cmdGoOn.Enabled = bDoEnable
End Sub
Sub CallFolderPicker()
GetFolderName(DialogModel.txtTarget)
ToggleGoOnButton()
End Sub
Sub CallFilePicker()
If DialogModel.optSingleFile.State = 1 Then
Dim oMasterKey as Object
Dim oTypes() as Object
Dim oUIKey() as Object
oMasterKey = GetRegistryKeyContent(&quot;org.openoffice.TypeDetection.Types&quot;)
oTypes() = oMasterKey.Types
oUIKey = GetRegistryKeyContent(&quot;org.openoffice.Office.UI/FilterClassification/LocalFilters&quot;)
If DialogModel.chkTextDocuments.State = 1 Then
Dim FilterNames(11,1) as String
FilterNames(6,0) = oTypes.GetByName(&quot;writer_StarOffice_XML_Writer&quot;).UIName
FilterNames(6,1) = &quot;*.sxw&quot;
FilterNames(7,0) = oTypes.GetByName(&quot;writer_StarOffice_XML_Writer_Template&quot;).UIName
FilterNames(7,1) = &quot;*.stw&quot;
FilterNames(8,0) = oUIKey.Classes.GetByName(&quot;sw3to5&quot;).DisplayName
FilterNames(8,1) = &quot;*.sdw&quot;
FilterNames(9,0) = oUIKey.Classes.GetByName(&quot;sw3to5templ&quot;).DisplayName
Filternames(9,1) = &quot;*.vor&quot;
FilterNames(10,0) = oTypes.GetByName(&quot;writer8&quot;).UIName
FilterNames(10,1) = &quot;*.odt&quot;
FilterNames(11,0) = oTypes.GetByName(&quot;writer8_template&quot;).UIName
FilterNames(11,1) = &quot;*.ott&quot;
Else
ReDim FilterNames(5,1) as String
End If
FilterNames(0,0) = oTypes.GetByName(&quot;calc_StarOffice_XML_Calc&quot;).UIName
Filternames(0,1) = &quot;*.sxc&quot;
FilterNames(1,0) = oTypes.GetByName(&quot;calc_StarOffice_XML_Calc_Template&quot;).UIName
Filternames(1,1) = &quot;*.stc&quot;
FilterNames(2,0) = oUIKey.Classes.GetByName(&quot;sc345&quot;).DisplayName
FilterNames(2,1) = &quot;*.sdc&quot;
FilterNames(3,0) = oUIKey.Classes.GetByName(&quot;sc345templ&quot;).DisplayName
Filternames(3,1) = &quot;*.vor&quot;
FilterNames(4,0) = oTypes.GetByName(&quot;calc8&quot;).UIName
Filternames(4,1) = &quot;*.ods&quot;
FilterNames(5,0) = oTypes.GetByName(&quot;calc8_template&quot;).UIName
Filternames(5,1) = &quot;*.ots&quot;
GetFileName(DialogModel.txtSource, Filternames())
Else
GetFolderName(DialogModel.txtSource)
End If
ToggleGoOnButton()
End Sub
Sub PreviousStep()
DialogModel.Step = 2
DialogModel.cmdGoOn.Label = sGOON
DialogModel.cmdCancel.Label = sCANCEL
End Sub
</script:module>

View File

@@ -0,0 +1,292 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Common" script:language="StarBasic"> REM ***** BASIC *****
Public DialogModel as Object
Public DialogConvert as Object
Public DialogPassword as Object
Public PasswordModel as Object
Sub RetrieveDocumentObjects()
CurMimeType = Tools.GetDocumentType(oDocument)
If Instr(1, CurMimeType, &quot;calc&quot;) &lt;&gt; 0 Then
oSheets = oDocument.Sheets
oSheet = oDocument.Sheets.GetbyIndex(0)
oAddressRanges = oDocument.createInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
End If
&apos; Retrieve the indices for the cellformatations
oFormats = oDocument.NumberFormats
End Sub
Sub CancelTask()
&apos; If Not DocDisposed Then
&apos; ReprotectSheets()
&apos; End If
If DialogModel.Step = 3 And (Not bCancelTask) Then
If Msgbox(sMsgCancelConversion, 36, sMsgCancelTitle) = 6 Then
bCancelTask = True
DialogConvert.EndExecute
Else
bCancelTask = False
End If
Else
DialogConvert.EndExecute()
End If
End Sub
Function ConvertDocument()
GoOn = True
&apos; DocDisposed = True
InitializeProgressbar()
If Instr(1, CurMimeType, &quot;calc&quot;) &lt;&gt; 0 Then
bDocHasProtectedSheets = CheckSheetProtection(oSheets)
If bDocHasProtectedSheets Then
bDocHasProtectedSheets = UnprotectSheetsWithPassword(oSheets, bDoUnProtect)
End If
If Not bDocHasProtectedSheets Then
If Not bRangeListDefined Then
TotCellCount = 0
CreateRangeEnumeration(True)
Else
IncreaseStatusvalue(SBRelGet/3)
End If
RangeIndex = Ubound(RangeList())
If RangeIndex &gt; -1 Then
ConvertThehardWay(RangeList(), True, False)
MakeStyleEnumeration(True)
oDocument.calculateAll()
End If
ReprotectSheets()
bRangeListDefined = False
End If
Else
DialogModel.ProgressBar.ProgressValue = 10 &apos; oStatusline.SetValue(10)
ConvertTextFields()
DialogModel.ProgressBar.ProgressValue = 80 &apos; oStatusline.SetValue(80)
ConvertWriterTables()
End If
EndStatusLine()
On Local Error Goto 0
End Function
Sub SwitchNumberFormat(oObject as Object, oFormats as object)
Dim nFormatLanguage as Integer
Dim nFormatDecimals as Integer
Dim nFormatLeading as Integer
Dim bFormatLeading as Integer
Dim bFormatNegRed as Integer
Dim bFormatThousands as Integer
Dim i as Integer
Dim aNewStr as String
Dim iNumberFormat as Long
Dim AddToList as Boolean
Dim sOldCurrSymbol as String
On Local Error Resume Next
iNumberFormat = oObject.NumberFormat
On Local Error GoTo NOKEY
aFormat() = oFormats.getByKey(iNumberFormat)
On Local Error GoTo 0
sOldCurrSymbol = aFormat.CurrencySymbol
If sOldCurrSymbol = CurrValue(CurrIndex,5) Then
aSimpleStr = &quot;0 [$EUR]&quot;
Else
aSimpleStr = &quot;0 [$&quot; &amp; sEuroSign &amp; aFormat.CurrencyExtension &amp; &quot;]&quot;
End If
nSimpleKey = Numberformat(oFormats, aSimpleStr, oLocale)
&apos; set new Currency format with according settings
nFormatDecimals = 2
nFormatLeading = aFormat.LeadingZeros
bFormatNegRed = aFormat.NegativeRed
bFormatThousands = aFormat.ThousandsSeparator
aNewStr = oFormats.generateFormat( nSimpleKey, aFormat.Locale, bFormatThousands, bFormatNegRed, nFormatDecimals, nFormatLeading)
oObject.NumberFormat = Numberformat(oFormats, aNewStr, aFormat.Locale)
NOKEY:
If Err &lt;&gt; 0 Then
Resume CLERROR
End If
CLERROR:
End Sub
Function Numberformat( oFormats as Object, aFormatStr as String, oLocale as Object)
Dim nRetkey
Dim l as String
Dim c as String
nRetKey = oFormats.queryKey( aFormatStr, oLocale, True )
If nRetKey = -1 Then
l = oLocale.Language
c = oLocale.Country
nRetKey = oFormats.addNew( aFormatStr, oLocale )
If nRetKey = -1 Then nRetKey = 0
End If
Numberformat = nRetKey
End Function
Function CheckFormatType( FormatObject as object)
Dim i as Integer
Dim LocCurrIndex as Integer
Dim nFormatFormatString as String
Dim FormatLangID as Integer
Dim sFormatCurrExt as String
Dim oFormatofObject() as Object
&apos; Retrieve the Format of the Object
On Local Error GoTo NOKEY
oFormatofObject = oFormats.getByKey(FormatObject.NumberFormat)
On Local Error GoTo 0
If NOT INT(oFormatofObject.Type) AND com.sun.star.util.NumberFormat.CURRENCY Then
CheckFormatType = False
Exit Function
End If
If FieldinArray(CurrSymbolList(),2,oFormatofObject.CurrencySymbol) Then
&apos; If the Currencysymbol of the object ist the one needed, then check the Currency extension
sFormatCurrExt = oFormatofObject.CurrencyExtension
If FieldInList(CurExtension(),2,sFormatCurrExt) Then
&apos; The Currency - extension also fits
CheckFormatType = True
Else
&apos; The Currency - symbol is Euro-conforming (like &apos;DEM&apos;), so there is no Currency-Extension
CheckFormatType = oFormatofObject.CurrencySymbol = CurrsymbolList(2)
End If
Else
&apos; The Currency Symbol of the object is not the desired one
If oFormatofObject.CurrencySymbol = &quot;&quot; Then
&apos; Format is &quot;automatic&quot;
CheckFormatType = CheckLocale(oFormatofObject.Locale)
Else
CheckFormatType = False
End If
End If
NOKEY:
If Err &lt;&gt; 0 Then
CheckFormatType = False
Resume CLERROR
End If
CLERROR:
End Function
Sub StartConversion()
GoOn = True
Select Case DialogModel.Step
Case 1
If DialogModel.chkComplete.State = 1 Then
ConvertWholeDocument()
Else
ConvertRangesorStylesofDocument()
End If
Case 2
bCancelTask = False
If InitializeThirdStep() Then
ConvertDocuments()
bCancelTask = True
End If
Case 3
DialogConvert.EndExecute()
End Select
End Sub
Sub IncreaseStatusValue(AddStatusValue as Integer)
StatusValue = Int(StatusValue + AddStatusValue)
If DialogModel.Step = 3 Then
DialogModel.ProgressBar.ProgressValue = StatusValue
Else
oStatusline.SetValue(StatusValue)
End If
End Sub
Sub SelectCurrency()
Dim AddtoList as Boolean
Dim NullList()
Dim OldCurrIndex as Integer
bRangeListDefined = False
OldCurrIndex = CurrIndex
CurrIndex = DialogModel.lstCurrencies.SelectedItems(0)
If OldCurrIndex &lt;&gt; CurrIndex Then
InitializeCurrencyValues(CurrIndex)
CurExtension(0) = LangIDValue(CurrIndex,0,2)
CurExtension(1) = LangIDValue(CurrIndex,1,2)
CurExtension(2) = LangIDValue(CurrIndex,2,2)
If DialogModel.Step = 1 Then
EnableStep1DialogControls(False,False, False)
If DialogModel.optCellTemplates.State = 1 Then
EnableStep1DialogControls(False, False, False)
CreateStyleEnumeration()
ElseIf ((DialogModel.optSheetRanges.State = 1) OR (DialogModel.optDocRanges.State = 1)) AND (DialogModel.Step = 1) Then
CreateRangeEnumeration(False)
If Ubound(RangeList()) = -1 Then
DialogModel.lstSelection.StringItemList() = NullList()
End If
ElseIf DialogModel.optSelRange.State= 1 Then
&apos;Preselected Range
End If
EnableStep1DialogControls(True, True, True)
ElseIf DialogModel.Step = 2 Then
EnableStep2DialogControls(True)
End If
End If
End Sub
Sub FillUpCurrencyListbox()
Dim i as Integer
Dim MaxIndex as Integer
MaxIndex = Ubound(CurrValue(),1)
Dim LocList(MaxIndex) as String
For i = 0 To MaxIndex
LocList(i) = CurrValue(i,0)
Next i
DialogModel.lstCurrencies.StringItemList() = LocList()
If CurrIndex &gt; -1 Then
SelectListboxItem(DialogModel.lstCurrencies, CurrIndex)
End If
End Sub
Sub InitializeProgressbar()
CurCellCount = 0
If Not IsNull(oStatusLine) Then
oStatusline.Start(sStsPROGRESS, 100)
Else
DialogModel.ProgressBar.ProgressValue = 0
End If
StatusValue = 0
End Sub
Sub EndStatusLine()
If Not IsNull(oStatusLine) Then
oStatusline.End
Else
DialogModel.ProgressBar.ProgressValue = 100
End If
End Sub
</script:module>

View File

@@ -0,0 +1,337 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="ConvertRun" script:language="StarBasic">Option Explicit
Public oPreSelRange as Object
Sub Main()
BasicLibraries.LoadLibrary(&quot;Tools&quot;)
If InitResources(&quot;Euro Converter&quot;, &quot;eur&quot;) Then
bDoUnProtect = False
bPreSelected = True
oDocument = ThisComponent
RetrieveDocumentObjects() &apos; Statusline, SheetsCollection etc.
InitializeConverter(oDocument.CharLocale, 1)
GetPreSelectedRange()
If GoOn Then
DialogModel.lstCurrencies.TabIndex = 2
DialogConvert.GetControl(&quot;chkComplete&quot;).SetFocus()
DialogConvert.Execute
End If
DialogConvert.Dispose
End If
End Sub
Sub SelectListItem()
Dim Listbox as Object
Dim oListSheet as Object
Dim CurStyleName as String
Dim oCursheet as Object
Dim oTempRanges as Object
Dim sCurSheetName as String
Dim RangeName as String
Dim oSheetRanges as Object
Dim ListIndex as Integer
Dim a as Integer
Dim i as Integer
Dim n as Integer
Dim m as Integer
Dim MaxIndex as Integer
Listbox = DialogModel.lstSelection
If Ubound(Listbox.SelectedItems()) &gt; -1 Then
EnableStep1DialogControls(False, False, False)
oSelRanges = oDocument.createInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
&apos; Is the sheet the basis, then the sheetobject has to be created
If DialogModel.optDocRanges.State = 1 Then
&apos; Document is the basis for the conversion
ListIndex = Listbox.SelectedItems(0)
oCurSheet = RetrieveSheetoutofRangeName(Listbox.StringItemList(ListIndex))
oDocument.CurrentController.SetActiveSheet(oCurSheet)
Else
oCurSheet = oDocument.CurrentController.ActiveSheet
End If
sCurSheetName = oCurSheet.Name
If DialogModel.optCellTemplates.State = 1 Then
Dim CurIndex as Integer
For i = 0 To Ubound(Listbox.SelectedItems())
CurIndex = Listbox.SelectedItems(i)
CurStylename = Listbox.StringItemList(CurIndex)
oSheetRanges = oCursheet.CellFormatRanges.createEnumeration
While oSheetRanges.hasMoreElements
oRange = oSheetRanges.NextElement
If oRange.getPropertyState(&quot;NumberFormat&quot;) = 1 Then
If oRange.CellStyle = CurStyleName Then
oSelRanges.InsertbyName(&quot;&quot;,oRange)
End If
End If
Wend
Next i
Else
&apos; Hard Formatation is selected
a = -1
For n = 0 To Ubound(Listbox.SelectedItems())
m = Listbox.SelectedItems(n)
RangeName = Listbox.StringItemList(m)
oListSheet = RetrieveSheetoutofRangeName(RangeName)
a = a + 1
MaxIndex = Ubound(SelRangeList())
If a &gt; MaxIndex Then
Redim Preserve SelRangeList(MaxIndex + SBRANGEUBOUND)
End If
SelRangeList(a) = RangeName
If oListSheet.Name = sCurSheetName Then
oRange = RetrieveRangeoutofRangeName(RangeName)
oSelRanges.InsertbyName(&quot;&quot;,oRange)
End If
Next n
End If
If a &gt; -1 Then
ReDim Preserve SelRangeList(a)
Else
ReDim SelRangeList()
End If
oDocument.CurrentController.Select(oSelRanges)
EnableStep1DialogControls(True, True, True)
End If
End Sub
&apos; Procedure that is called by an event
Sub RetrieveEnableValue()
Dim EnableValue as Boolean
EnableValue = Not DialogModel.lstSelection.Enabled
EnableStep1DialogControls(True, EnableValue, True)
End Sub
Sub EnableStep1DialogControls(bCurrEnabled as Boolean, bFrameEnabled as Boolean, bButtonsEnabled as Boolean)
Dim bCurrIsSelected as Boolean
Dim bObjectIsSelected as Boolean
Dim bConvertWholeDoc as Boolean
Dim bDoEnableFrame as Boolean
bConvertWholeDoc = DialogModel.chkComplete.State = 1
bDoEnableFrame = bFrameEnabled And (NOT bConvertWholeDoc)
&apos; Controls around the Selection Listbox
With DialogModel
.lblCurrencies.Enabled = bCurrEnabled
.lstCurrencies.Enabled = bCurrEnabled
.lstSelection.Enabled = bDoEnableFrame
.lblSelection.Enabled = bDoEnableFrame
.hlnSelection.Enabled = bDoEnableFrame
.optCellTemplates.Enabled = bDoEnableFrame
.optSheetRanges.Enabled = bDoEnableFrame
.optDocRanges.Enabled = bDoEnableFrame
.optSelRange.Enabled = bDoEnableFrame
End With
&apos; The CheckBox has the Value &apos;1&apos; when the Controls in the Frame are disabled
If bButtonsEnabled Then
bCurrIsSelected = Ubound(DialogModel.lstCurrencies.SelectedItems()) &lt;&gt; -1
&apos; Enable GoOnButton only when Currency is selected
DialogModel.cmdGoOn.Enabled = bCurrIsSelected
DialogModel.chkComplete.Enabled = bCurrIsSelected
If bDoEnableFrame AND DialogModel.cmdGoOn.Enabled Then
&apos; If FrameControls are enabled, check if Listbox is Empty
bObjectIsSelected = Ubound(DialogModel.lstSelection.SelectedItems()) &lt;&gt; -1
DialogModel.cmdGoOn.Enabled = bObjectIsSelected
End If
Else
DialogModel.cmdGoOn.Enabled = False
DialogModel.chkComplete.Enabled = False
End If
End Sub
Sub ConvertRangesOrStylesOfDocument()
Dim i as Integer
Dim ItemName as String
Dim SelList() as String
Dim oSheetRanges as Object
bDocHasProtectedSheets = CheckSheetProtection(oSheets)
If bDocHasProtectedSheets Then
bDocHasProtectedSheets = UnprotectSheetsWithPassWord(oSheets, bDoUnProtect)
DialogModel.cmdGoOn.Enabled = False
End If
If Not bDocHasProtectedSheets Then
EnableStep1DialogControls(False, False, False)
InitializeProgressBar()
If DialogModel.optSelRange.State = 1 Then
SelectListItem()
End If
SelList() = DialogConvert.GetControl(&quot;lstSelection&quot;).SelectedItems()
If DialogModel.optCellTemplates.State = 1 Then
&apos; Option &apos;Soft&apos; Formatation is selected
AssignRangestoStyle(DialogModel.lstSelection.StringItemList(), SelList())
ConverttheSoftWay(SelList(), True)
ElseIf DialogModel.optSelRange.State = 1 Then
oSheetRanges = oPreSelRange.CellFormatRanges.createEnumeration
While oSheetRanges.hasMoreElements
oRange = oSheetRanges.NextElement
If CheckFormatType(oRange) Then
ConvertCellCurrencies(oRange)
SwitchNumberFormat(oRange, oFormats, sEuroSign)
End If
Wend
Else
ConverttheHardWay(SelList(), False, True)
End If
oStatusline.End
EnableStep1DialogControls(True, False, True)
DialogModel.cmdGoOn.Enabled = True
oDocument.CurrentController.Select(oSelRanges)
End If
End Sub
Sub ConvertWholeDocument()
Dim s as Integer
DialogModel.cmdGoOn.Enabled = False
DialogModel.chkComplete.Enabled = False
GoOn = ConvertDocument()
EmptyListbox(DialogModel.lstSelection())
EnableStep1DialogControls(True, True, True)
End Sub
&apos; Everything previously selected will be deselected
Sub EmptySelection()
Dim RangeName as String
Dim i as Integer
Dim MaxIndex as Integer
Dim EmptySelRangeList() as String
If Not IsNull(oSelRanges) Then
If oSelRanges.HasElements Then
EmptySelRangeList() = ArrayOutofString(oSelRanges.RangeAddressesasString, &quot;;&quot;, MaxIndex)
For i = 0 To MaxIndex
oSelRanges.RemovebyName(EmptySelRangeList(i))
Next i
End If
oDocument.CurrentController.Select(oSelRanges)
Else
oSelRanges = oDocument.createInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
End If
End Sub
Function AddSelectedRangeToSelRangesEnum() as Object
Dim oLocRange as Object
osheet = oDocument.CurrentController.GetActiveSheet
oSelRanges = oDocument.createInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
&apos; Check if a Currency-Range has been selected
oLocRange = oDocument.CurrentController.Selection
bPreSelected = oLocRange.SupportsService(&quot;com.sun.star.sheet.SheetCellRange&quot;)
If bPreSelected Then
oSelRanges.InsertbyName(&quot;&quot;,oLocRange)
AddSelectedRangeToSelRangesEnum() = oLocRange
End If
End Function
Sub GetPreSelectedRange()
Dim i as Integer
Dim OldCurrSymbolList(2) as String
Dim OldCurrIndex as Integer
Dim OldCurExtension(2) as String
oPreSelRange = AddSelectedRangeToSelRangesEnum()
DialogModel.chkComplete.State = Abs(Not(bPreSelected))
If bPreSelected Then
DialogModel.optSelRange.State = 1
AddRangeToListbox(oPreSelRange)
Else
DialogModel.optCellTemplates.State = 1
CreateStyleEnumeration()
End If
EnableStep1DialogControls(True, bPreSelected, True)
DialogModel.optSelRange.Enabled = bPreSelected
End Sub
Sub AddRangeToListbox(oLocRange as Object)
EmptyListBox(DialogModel.lstSelection)
PreName = RetrieveRangeNamefromAddress(oLocRange)
AddSingleItemToListbox(DialogModel.lstSelection, Prename)&apos;, 0)
SelectListboxItem(DialogModel.lstCurrencies, CurrIndex)
TotCellCount = CountRangeCells(oLocRange)
End Sub
Sub CheckRangeSelection(Optional oEvent)
EmptySelection()
AddRangeToListbox(oPreSelRange)
oPreSelRange = AddSelectedRangeToSelRangesEnum()
End Sub
&apos; Checks if a Field (LocField) is already defined in an Array
&apos; Returns &apos;True&apos; or &apos;False&apos;
Function FieldinList(LocList(), MaxIndex as integer, ByVal LocField ) As Boolean
Dim i as integer
LocField = Ucase(LocField)
For i = Lbound(LocList()) to MaxIndex
If Ucase(LocList(i)) = LocField then
FieldInList = True
Exit Function
End if
Next
FieldInList = False
End Function
Function CheckLocale(oLocale) as Boolean
Dim i as Integer
Dim LocCountry as String
Dim LocLanguage as String
LocCountry = oLocale.Country
LocLanguage = oLocale.Language
For i = 0 To 1
If LocLanguage = LangIDValue(CurrIndex,i,0) AND LocCountry = LangIDValue(CurrIndex,i,1) Then
CheckLocale = True
Exit Function
End If
Next i
CheckLocale = False
End Function
Sub SetOptionValuestoNull()
With DialogModel
.optCellTemplates.State = 0
.optSheetRanges.State = 0
.optDocRanges.State = 0
.optSelRange.State = 0
End With
End Sub
Sub SetStatusLineText(sStsREPROTECT as String)
If Not IsNull(oStatusLine) Then
oStatusline.SetText(sStsREPROTECT)
End If
End Sub
</script:module>

View File

@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="DialogConvert" dlg:left="96" dlg:top="28" dlg:width="270" dlg:height="210" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_DIALOG" dlg:closeable="true" dlg:moveable="true">
<dlg:bulletinboard>
<dlg:text dlg:id="lblCurrencies" dlg:tab-index="1" dlg:left="170" dlg:top="39" dlg:width="89" dlg:height="8" dlg:value="lblCurrencies"/>
<dlg:checkbox dlg:id="chkComplete" dlg:tab-index="0" dlg:left="12" dlg:top="43" dlg:width="129" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CHECKBOX1" dlg:value="chkComplete" dlg:checked="true">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Euro.ConvertRun.RetrieveEnableValue?language=Basic&amp;location=application" script:language="Script"/>
</dlg:checkbox>
<dlg:menulist dlg:id="lstCurrencies" dlg:tab-index="2" dlg:left="170" dlg:top="51" dlg:width="90" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_COMBOBOX1" dlg:spin="true" dlg:linecount="12">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Euro.Common.SelectCurrency?language=Basic&amp;location=application" script:language="Script"/>
</dlg:menulist>
<dlg:radiogroup>
<dlg:radio dlg:id="optCellTemplates" dlg:tab-index="3" dlg:left="12" dlg:top="96" dlg:width="129" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_OPTIONBUTTON1" dlg:value="optCellTemplates">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.Soft.CreateStyleEnumeration?language=Basic&amp;location=application" script:language="Script"/>
</dlg:radio>
<dlg:radio dlg:id="optSheetRanges" dlg:tab-index="4" dlg:left="12" dlg:top="110" dlg:width="130" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_OPTIONBUTTON2" dlg:value="optSheetRanges">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.Hard.CreateRangeList?language=Basic&amp;location=application" script:language="Script"/>
</dlg:radio>
<dlg:radio dlg:id="optDocRanges" dlg:tab-index="5" dlg:left="12" dlg:top="124" dlg:width="130" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_OPTIONBUTTON3" dlg:value="optDocRanges">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.Hard.CreateRangeList?language=Basic&amp;location=application" script:language="Script"/>
</dlg:radio>
<dlg:radio dlg:id="optSelRange" dlg:tab-index="6" dlg:left="12" dlg:top="138" dlg:width="130" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_OPTIONBUTTON4" dlg:value="optSelRange">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.ConvertRun.CheckRangeSelection?language=Basic&amp;location=application" script:language="Script"/>
</dlg:radio>
</dlg:radiogroup>
<dlg:text dlg:id="lblSelection" dlg:tab-index="7" dlg:left="170" dlg:top="84" dlg:width="73" dlg:height="8" dlg:page="1" dlg:value="lblSelection"/>
<dlg:menulist dlg:id="lstSelection" dlg:tab-index="8" dlg:left="170" dlg:top="96" dlg:width="90" dlg:height="52" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_LISTBOX1" dlg:multiselection="true">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Euro.ConvertRun.SelectListItem?language=Basic&amp;location=application" script:language="Script"/>
</dlg:menulist>
<dlg:radiogroup>
<dlg:radio dlg:id="optSingleFile" dlg:tab-index="9" dlg:left="12" dlg:top="51" dlg:width="146" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_OBFILE" dlg:value="optSingleFile">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.AutoPilotRun.SwapExtent?language=Basic&amp;location=application" script:language="Script"/>
</dlg:radio>
<dlg:radio dlg:id="optWholeDir" dlg:tab-index="10" dlg:left="12" dlg:top="65" dlg:width="146" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_OBDIR" dlg:value="optWholeDir" dlg:checked="true">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.AutoPilotRun.SwapExtent?language=Basic&amp;location=application" script:language="Script"/>
</dlg:radio>
</dlg:radiogroup>
<dlg:textfield dlg:id="txtConfig" dlg:tab-index="11" dlg:left="6" dlg:top="50" dlg:width="258" dlg:height="55" dlg:page="3" dlg:vscroll="true" dlg:multiline="true" dlg:readonly="true"/>
<dlg:textfield dlg:id="txtSource" dlg:tab-index="12" dlg:left="80" dlg:top="82" dlg:width="165" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_TBSOURCE">
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:Euro.AutoPilotRun.ToggleGoOnButton?language=Basic&amp;location=application" script:language="Script"/>
</dlg:textfield>
<dlg:button dlg:id="cmdCallSourceDialog" dlg:tab-index="13" dlg:left="249" dlg:top="81" dlg:width="15" dlg:height="14" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CBSOURCEOPEN" dlg:value="...">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.AutoPilotRun.CallFilePicker?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:checkbox dlg:id="chkRecursive" dlg:tab-index="14" dlg:left="12" dlg:top="98" dlg:width="252" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CHECKRECURSIVE" dlg:value="chkRecursive" dlg:checked="false"/>
<dlg:checkbox dlg:id="chkTextDocuments" dlg:tab-index="15" dlg:left="12" dlg:top="112" dlg:width="251" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CHKTEXTDOCUMENTS" dlg:value="chkTextDocuments" dlg:checked="false"/>
<dlg:checkbox dlg:id="chkProtect" dlg:tab-index="16" dlg:left="12" dlg:top="126" dlg:width="251" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CHKPROTECT" dlg:value="chkProtect" dlg:checked="false"/>
<dlg:textfield dlg:id="txtTarget" dlg:tab-index="17" dlg:left="80" dlg:top="143" dlg:width="165" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_TBTARGET"/>
<dlg:button dlg:id="cmdCallTargetDialog" dlg:tab-index="18" dlg:left="249" dlg:top="142" dlg:width="15" dlg:height="14" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CBTARGETOPEN" dlg:value="...">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.AutoPilotRun.CallFolderPicker?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:progressmeter dlg:id="ProgressBar" dlg:tab-index="19" dlg:left="85" dlg:top="152" dlg:width="179" dlg:height="10" dlg:page="3"/>
<dlg:text dlg:id="lblHint" dlg:tab-index="20" dlg:left="6" dlg:top="166" dlg:width="258" dlg:height="20" dlg:value="lblHint" dlg:multiline="true"/>
<dlg:text dlg:id="lblTarget" dlg:tab-index="21" dlg:left="6" dlg:top="145" dlg:width="73" dlg:height="8" dlg:page="2" dlg:value="lblTarget"/>
<dlg:text dlg:id="lblSource" dlg:tab-index="22" dlg:left="6" dlg:top="84" dlg:width="73" dlg:height="8" dlg:page="2" dlg:value="lblSource"/>
<dlg:text dlg:id="lblCurProgress" dlg:tab-index="23" dlg:left="16" dlg:top="130" dlg:width="208" dlg:height="8" dlg:page="3"/>
<dlg:text dlg:id="lblRetrieval" dlg:tab-index="24" dlg:left="9" dlg:top="119" dlg:width="216" dlg:height="8" dlg:page="3" dlg:value="lblRetrieval"/>
<dlg:text dlg:id="lblConfig" dlg:tab-index="25" dlg:left="6" dlg:top="39" dlg:width="94" dlg:height="8" dlg:page="3" dlg:value="lblConfig"/>
<dlg:text dlg:id="lblCurDocument" dlg:tab-index="26" dlg:left="16" dlg:top="141" dlg:width="208" dlg:height="8" dlg:page="3"/>
<dlg:img dlg:id="imgPreview" dlg:tab-index="27" dlg:left="6" dlg:top="6" dlg:width="258" dlg:height="26" dlg:src="file:///D:/office630np/share/template/german/wizard/bitmap/euro_2.bmp"/>
<dlg:fixedline dlg:id="hlnSelection" dlg:tab-index="28" dlg:left="7" dlg:top="72" dlg:width="258" dlg:height="8" dlg:page="1" dlg:value="hlnSelection"/>
<dlg:fixedline dlg:id="hlnExtent" dlg:tab-index="29" dlg:left="6" dlg:top="39" dlg:width="156" dlg:height="8" dlg:page="2" dlg:value="hlnExtent"/>
<dlg:fixedline dlg:id="hlnProgress" dlg:tab-index="30" dlg:left="6" dlg:top="108" dlg:width="258" dlg:height="8" dlg:page="3" dlg:value="hlnProgress"/>
<dlg:fixedline dlg:id="FixedLine1" dlg:tab-index="31" dlg:left="6" dlg:top="152" dlg:width="258" dlg:height="9" dlg:page="1"/>
<dlg:text dlg:id="lblProgress" dlg:tab-index="32" dlg:left="6" dlg:top="153" dlg:width="79" dlg:height="8" dlg:page="3" dlg:value="lblProgress"/>
<dlg:button dlg:id="cmdCancel" dlg:tab-index="33" dlg:left="6" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CBCANCEL" dlg:value="cmdCancel">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.Common.CancelTask?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:button dlg:id="cmdHelp" dlg:tab-index="34" dlg:left="63" dlg:top="190" dlg:width="53" dlg:height="14" dlg:value="cmdHelp" dlg:button-type="help"/>
<dlg:button dlg:id="cmdBack" dlg:tab-index="35" dlg:left="155" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CBBACK" dlg:value="cmdBack">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.AutoPilotRun.PreviousStep?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:button dlg:id="cmdGoOn" dlg:tab-index="36" dlg:left="211" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CBGOON" dlg:value="cmdGoOn">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.Common.StartConversion?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
</dlg:bulletinboard>
</dlg:window>

Some files were not shown because too many files have changed in this diff Show More