Kaydet (Commit) 20cea29a authored tarafından Oliver Bolte's avatar Oliver Bolte

CWS-TOOLING: integrate CWS fwk99

2009-01-20 17:39:31 +0100 pb  r266605 : fix: #i98280# new 'More templates'-URL
2009-01-15 20:17:58 +0100 mst  r266391 : #i95702# convert wizards to DocumentProperties (partially based on patch by cmc)
2009-01-12 07:35:44 +0100 pb  r266131 : fix: #i96851# HID_PASTE_DLG and HID_LINKDLG_TABLB added
2009-01-09 10:40:48 +0100 pb  r266061 : fix: #i97386# Execute_Impl() while sub-dialog is open this could be deleted; #i68415# patch from cmc
2009-01-09 10:35:24 +0100 pb  r266059 : fix: #i97386# struct Deleted added
2009-01-09 10:05:17 +0100 pb  r266057 : fix: #i97365# ModalDialog RID_SVXPAGE_IMPROVEMENT removed
2009-01-09 10:02:39 +0100 pb  r266056 : fix: #i97841# new: set InfoURL and HandleHyperLink()
2009-01-09 09:59:13 +0100 pb  r266053 : fix: #i97391# MinWidth re-calculated; #i97365# SvxImprovementDialog2 removed
2009-01-09 09:55:00 +0100 pb  r266051 : fix: #i97841# new: HandleHyperLink(); #i97365# SvxImprovementDialog2 removed
2009-01-06 14:24:24 +0100 cd  r265921 : #i96831# Fix build problem with gcc 4.3.2 using the return value of link correctly.
2009-01-06 12:18:41 +0100 cd  r265907 : #i96831# Fix build problem with gcc 4.3.2
2009-01-06 12:02:59 +0100 mst  r265905 : fix #i97775#
- xmloff/source/core/nmspmap.cxx:
  + SvXMLNamespaceMap::GetQNameByKey does not handle default namespace
    correctly
üst bbef3ea3
...@@ -41,6 +41,7 @@ import com.sun.star.beans.PropertyValue; ...@@ -41,6 +41,7 @@ import com.sun.star.beans.PropertyValue;
import com.sun.star.container.NoSuchElementException; import com.sun.star.container.NoSuchElementException;
import com.sun.star.container.XIndexAccess; import com.sun.star.container.XIndexAccess;
import com.sun.star.container.XNamed; import com.sun.star.container.XNamed;
import com.sun.star.document.XDocumentProperties;
import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XComponentLoader;
import com.sun.star.frame.XTerminateListener; import com.sun.star.frame.XTerminateListener;
import com.sun.star.i18n.NumberFormatIndex; import com.sun.star.i18n.NumberFormatIndex;
...@@ -189,7 +190,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data ...@@ -189,7 +190,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data
/** /**
* used to set the document title property (step 6). * used to set the document title property (step 6).
*/ */
private Object docInfo; private XDocumentProperties m_xDocProps;
/** /**
* loads the given template, and analyze its structure. * loads the given template, and analyze its structure.
...@@ -282,7 +283,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data ...@@ -282,7 +283,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data
*/ */
synchronized void setTemplateTitle(String newTitle) synchronized void setTemplateTitle(String newTitle)
{ {
Helper.setUnoPropertyValue(docInfo, "Title", newTitle); m_xDocProps.setTitle(newTitle);
} }
/** /**
...@@ -476,9 +477,9 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data ...@@ -476,9 +477,9 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data
} }
/* /*
* get the document info object. * get the document properties object.
*/ */
docInfo = OfficeDocument.getDocumentInfo(document); m_xDocProps = OfficeDocument.getDocumentProperties(document);
initItemsCache(); initItemsCache();
initializeItems(); initializeItems();
......
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
************************************************************************/ ************************************************************************/
package com.sun.star.wizards.common; package com.sun.star.wizards.common;
import java.util.Date;
import com.sun.star.awt.XToolkit;
import com.sun.star.beans.PropertyValue; import com.sun.star.beans.PropertyValue;
import com.sun.star.frame.XDesktop; import com.sun.star.frame.XDesktop;
import com.sun.star.frame.XFrame; import com.sun.star.frame.XFrame;
......
...@@ -48,6 +48,8 @@ import com.sun.star.ucb.*; ...@@ -48,6 +48,8 @@ import com.sun.star.ucb.*;
import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface; import com.sun.star.uno.XInterface;
import com.sun.star.util.DateTime; import com.sun.star.util.DateTime;
import com.sun.star.beans.PropertyValue;
import com.sun.star.document.XDocumentProperties;
/** /**
* This class delivers static convenience methods * This class delivers static convenience methods
...@@ -76,9 +78,7 @@ public class FileAccess ...@@ -76,9 +78,7 @@ public class FileAccess
// As there are several conventions about the look of Url (e.g. with " " or with "%20") you cannot make a // As there are several conventions about the look of Url (e.g. with " " or with "%20") you cannot make a
// simple String comparison to find out, if a path is already in "ResultPath" // simple String comparison to find out, if a path is already in "ResultPath"
String[] PathList = JavaTools.ArrayoutofString(ResultPath, ";"); String[] PathList = JavaTools.ArrayoutofString(ResultPath, ";");
boolean badd = false;
int MaxIndex = PathList.length - 1; int MaxIndex = PathList.length - 1;
int iPos;
String CompCurPath; String CompCurPath;
// sAddPath.replace(null, (char) 47); // sAddPath.replace(null, (char) 47);
String CompAddPath = JavaTools.replaceSubString(sAddPath, "", "/"); String CompAddPath = JavaTools.replaceSubString(sAddPath, "", "/");
...@@ -607,8 +607,8 @@ public class FileAccess ...@@ -607,8 +607,8 @@ public class FileAccess
java.util.Vector TitleVector = null; java.util.Vector TitleVector = null;
java.util.Vector NameVector = null; java.util.Vector NameVector = null;
XInterface xDocInterface = (XInterface) xMSF.createInstance("com.sun.star.document.StandaloneDocumentInfo"); XInterface xDocInterface = (XInterface) xMSF.createInstance("com.sun.star.document.DocumentProperties");
com.sun.star.document.XStandaloneDocumentInfo xDocInfo = (com.sun.star.document.XStandaloneDocumentInfo) UnoRuntime.queryInterface(com.sun.star.document.XStandaloneDocumentInfo.class, xDocInterface); XDocumentProperties xDocProps = (XDocumentProperties) UnoRuntime.queryInterface(XDocumentProperties.class, xDocInterface);
XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess");
com.sun.star.ucb.XSimpleFileAccess xSimpleFileAccess = (com.sun.star.ucb.XSimpleFileAccess) UnoRuntime.queryInterface(com.sun.star.ucb.XSimpleFileAccess.class, xInterface); com.sun.star.ucb.XSimpleFileAccess xSimpleFileAccess = (com.sun.star.ucb.XSimpleFileAccess) UnoRuntime.queryInterface(com.sun.star.ucb.XSimpleFileAccess.class, xInterface);
...@@ -621,17 +621,16 @@ public class FileAccess ...@@ -621,17 +621,16 @@ public class FileAccess
FilterName = FilterName == null || FilterName.equals("") ? null : FilterName + "-"; FilterName = FilterName == null || FilterName.equals("") ? null : FilterName + "-";
String fileName = ""; String fileName = "";
PropertyValue[] noArgs = { };
for (int i = 0; i < nameList.length; i++) for (int i = 0; i < nameList.length; i++)
{ {
fileName = getFilename(nameList[i]); fileName = getFilename(nameList[i]);
if (FilterName == null || fileName.startsWith(FilterName)) if (FilterName == null || fileName.startsWith(FilterName))
{ {
xDocProps.loadFromMedium(nameList[i], noArgs);
xDocInfo.loadFromURL(nameList[i]);
NameVector.addElement(nameList[i]); NameVector.addElement(nameList[i]);
TitleVector.addElement(com.sun.star.uno.AnyConverter.toString(Helper.getUnoPropertyValue(xDocInterface, "Title"))); TitleVector.addElement(xDocProps.getTitle());
} }
} }
String[] LocNameList = new String[NameVector.size()]; String[] LocNameList = new String[NameVector.size()];
...@@ -715,11 +714,11 @@ public class FileAccess ...@@ -715,11 +714,11 @@ public class FileAccess
String sTitle = ""; String sTitle = "";
try try
{ {
XInterface xDocInterface = (XInterface) xMSF.createInstance("com.sun.star.document.StandaloneDocumentInfo"); XInterface xDocInterface = (XInterface) xMSF.createInstance("com.sun.star.document.DocumentProperties");
com.sun.star.document.XStandaloneDocumentInfo xDocInfo = (com.sun.star.document.XStandaloneDocumentInfo) UnoRuntime.queryInterface(com.sun.star.document.XStandaloneDocumentInfo.class, xDocInterface); XDocumentProperties xDocProps = (XDocumentProperties) UnoRuntime.queryInterface(XDocumentProperties.class, xDocInterface);
PropertyValue[] noArgs = { };
xDocInfo.loadFromURL(_sFile); xDocProps.loadFromMedium(_sFile, noArgs);
sTitle = com.sun.star.uno.AnyConverter.toString(Helper.getUnoPropertyValue(xDocInterface, "Title")); sTitle = xDocProps.getTitle();
} }
catch (Exception e) catch (Exception e)
{ {
......
...@@ -36,10 +36,8 @@ import java.util.Calendar; ...@@ -36,10 +36,8 @@ import java.util.Calendar;
import com.sun.star.beans.Property; import com.sun.star.beans.Property;
import com.sun.star.beans.PropertyValue; import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet; import com.sun.star.beans.XPropertySet;
import com.sun.star.i18n.NumberFormatIndex;
import com.sun.star.lang.Locale; import com.sun.star.lang.Locale;
import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.Any;
import com.sun.star.uno.AnyConverter; import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.RuntimeException; import com.sun.star.uno.RuntimeException;
import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.UnoRuntime;
......
...@@ -33,7 +33,8 @@ import com.sun.star.lang.IllegalArgumentException; ...@@ -33,7 +33,8 @@ import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.XComponent; import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.container.XNameAccess; import com.sun.star.container.XNameAccess;
import com.sun.star.document.XDocumentInfoSupplier; import com.sun.star.document.XDocumentProperties;
import com.sun.star.document.XDocumentPropertiesSupplier;
import com.sun.star.document.XEventsSupplier; import com.sun.star.document.XEventsSupplier;
import com.sun.star.document.XTypeDetection; import com.sun.star.document.XTypeDetection;
import com.sun.star.drawing.XDrawPagesSupplier; import com.sun.star.drawing.XDrawPagesSupplier;
...@@ -425,10 +426,10 @@ public class OfficeDocument ...@@ -425,10 +426,10 @@ public class OfficeDocument
return xDrawPagesSupplier.getDrawPages().getCount(); return xDrawPagesSupplier.getDrawPages().getCount();
} }
public static Object getDocumentInfo(Object document) public static XDocumentProperties getDocumentProperties(Object document)
{ {
XDocumentInfoSupplier xDocumentInfoSupplier = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, document); XDocumentPropertiesSupplier xDocumentPropertiesSupplier = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, document);
return xDocumentInfoSupplier.getDocumentInfo(); return xDocumentPropertiesSupplier.getDocumentProperties();
} }
public static int showMessageBox(XMultiServiceFactory xMSF, String windowServiceName, int windowAttribute, String MessageText) public static int showMessageBox(XMultiServiceFactory xMSF, String windowServiceName, int windowAttribute, String MessageText)
......
...@@ -41,8 +41,8 @@ import com.sun.star.awt.XTextComponent; ...@@ -41,8 +41,8 @@ import com.sun.star.awt.XTextComponent;
import com.sun.star.awt.XWindow; import com.sun.star.awt.XWindow;
import com.sun.star.awt.XWindowPeer; import com.sun.star.awt.XWindowPeer;
import com.sun.star.beans.PropertyValue; import com.sun.star.beans.PropertyValue;
import com.sun.star.document.XDocumentInfo; import com.sun.star.document.XDocumentProperties;
import com.sun.star.document.XDocumentInfoSupplier; import com.sun.star.document.XDocumentPropertiesSupplier;
import com.sun.star.graphic.XGraphicProvider; import com.sun.star.graphic.XGraphicProvider;
import com.sun.star.graphic.XGraphic; import com.sun.star.graphic.XGraphic;
import com.sun.star.uno.AnyConverter; import com.sun.star.uno.AnyConverter;
...@@ -594,10 +594,10 @@ public class FaxWizardDialogImpl extends FaxWizardDialog ...@@ -594,10 +594,10 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
public void txtTemplateNameTextChanged() public void txtTemplateNameTextChanged()
{ {
XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocument); XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument);
XDocumentInfo xDocInfo = xDocInfoSuppl.getDocumentInfo(); XDocumentProperties xDocProps = xDocPropsSuppl.getDocumentProperties();
String TitleName = txtTemplateName.getText(); String TitleName = txtTemplateName.getText();
Helper.setUnoPropertyValue(xDocInfo, "Title", TitleName); xDocProps.setTitle(TitleName);
} }
public void optSenderPlaceholderItemChanged() public void optSenderPlaceholderItemChanged()
......
...@@ -46,8 +46,8 @@ import com.sun.star.awt.XWindowPeer; ...@@ -46,8 +46,8 @@ import com.sun.star.awt.XWindowPeer;
import com.sun.star.beans.PropertyValue; import com.sun.star.beans.PropertyValue;
import com.sun.star.container.NoSuchElementException; import com.sun.star.container.NoSuchElementException;
import com.sun.star.document.MacroExecMode; import com.sun.star.document.MacroExecMode;
import com.sun.star.document.XDocumentInfo; import com.sun.star.document.XDocumentProperties;
import com.sun.star.document.XDocumentInfoSupplier; import com.sun.star.document.XDocumentPropertiesSupplier;
import com.sun.star.ucb.CommandAbortedException; import com.sun.star.ucb.CommandAbortedException;
import com.sun.star.uno.AnyConverter; import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Exception; import com.sun.star.uno.Exception;
...@@ -910,10 +910,10 @@ public class LetterWizardDialogImpl extends LetterWizardDialog ...@@ -910,10 +910,10 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
public void txtTemplateNameTextChanged() public void txtTemplateNameTextChanged()
{ {
XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocument); XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument);
XDocumentInfo xDocInfo = xDocInfoSuppl.getDocumentInfo(); XDocumentProperties xDocProps = xDocPropsSuppl.getDocumentProperties();
String TitleName = txtTemplateName.getText(); String TitleName = txtTemplateName.getText();
Helper.setUnoPropertyValue(xDocInfo, "Title", TitleName); xDocProps.setTitle(TitleName);
} }
public void chkUseSalutationItemChanged() public void chkUseSalutationItemChanged()
......
...@@ -223,7 +223,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen ...@@ -223,7 +223,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen
public void updateReportTitle(String _sTitleName) public void updateReportTitle(String _sTitleName)
{ {
Helper.setUnoPropertyValue(xDocInfo, "Title", _sTitleName); m_xDocProps.setTitle(_sTitleName);
} }
public void getReportPageStyles() public void getReportPageStyles()
......
...@@ -34,8 +34,8 @@ import java.util.GregorianCalendar; ...@@ -34,8 +34,8 @@ import java.util.GregorianCalendar;
import com.sun.star.container.NoSuchElementException; import com.sun.star.container.NoSuchElementException;
import com.sun.star.container.XNameAccess; import com.sun.star.container.XNameAccess;
import com.sun.star.document.XDocumentInfo; import com.sun.star.document.XDocumentProperties;
import com.sun.star.document.XDocumentInfoSupplier; import com.sun.star.document.XDocumentPropertiesSupplier;
import com.sun.star.frame.XController; import com.sun.star.frame.XController;
import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XComponentLoader;
import com.sun.star.frame.XDesktop; import com.sun.star.frame.XDesktop;
...@@ -87,7 +87,7 @@ public class TextDocument ...@@ -87,7 +87,7 @@ public class TextDocument
public XComponent xComponent; public XComponent xComponent;
public com.sun.star.text.XTextDocument xTextDocument; public com.sun.star.text.XTextDocument xTextDocument;
public com.sun.star.util.XNumberFormats NumberFormats; public com.sun.star.util.XNumberFormats NumberFormats;
public com.sun.star.document.XDocumentInfo xDocInfo; public com.sun.star.document.XDocumentProperties m_xDocProps;
public com.sun.star.task.XStatusIndicator xProgressBar; public com.sun.star.task.XStatusIndicator xProgressBar;
public com.sun.star.frame.XFrame xFrame; public com.sun.star.frame.XFrame xFrame;
public XText xText; public XText xText;
...@@ -222,8 +222,8 @@ public class TextDocument ...@@ -222,8 +222,8 @@ public class TextDocument
xMSFDoc = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); xMSFDoc = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument);
xNumberFormatsSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument); xNumberFormatsSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument);
XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocument); XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument);
xDocInfo = xDocInfoSuppl.getDocumentInfo(); m_xDocProps = xDocPropsSuppl.getDocumentProperties();
CharLocale = (Locale) Helper.getUnoStructValue((Object) xComponent, "CharLocale"); CharLocale = (Locale) Helper.getUnoStructValue((Object) xComponent, "CharLocale");
xText = xTextDocument.getText(); xText = xTextDocument.getText();
} }
...@@ -233,8 +233,8 @@ public class TextDocument ...@@ -233,8 +233,8 @@ public class TextDocument
xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xFrame.getComponentWindow()); xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xFrame.getComponentWindow());
xMSFDoc = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); xMSFDoc = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument);
xNumberFormatsSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument); xNumberFormatsSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument);
XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocument); XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument);
xDocInfo = xDocInfoSuppl.getDocumentInfo(); m_xDocProps = xDocPropsSuppl.getDocumentProperties();
CharLocale = (Locale) Helper.getUnoStructValue((Object) xComponent, "CharLocale"); CharLocale = (Locale) Helper.getUnoStructValue((Object) xComponent, "CharLocale");
xStorable = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); xStorable = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument);
xText = xTextDocument.getText(); xText = xTextDocument.getText();
...@@ -333,8 +333,8 @@ public class TextDocument ...@@ -333,8 +333,8 @@ public class TextDocument
xMSFDoc = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); xMSFDoc = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument);
xNumberFormatsSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument); xNumberFormatsSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument);
XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocument); XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument);
xDocInfo = xDocInfoSuppl.getDocumentInfo(); m_xDocProps = xDocPropsSuppl.getDocumentProperties();
CharLocale = (Locale) Helper.getUnoStructValue((Object) xComponent, "CharLocale"); CharLocale = (Locale) Helper.getUnoStructValue((Object) xComponent, "CharLocale");
} }
...@@ -418,15 +418,15 @@ public class TextDocument ...@@ -418,15 +418,15 @@ public class TextDocument
int ff = du.getFormat(NumberFormatIndex.DATE_SYS_DDMMYY); int ff = du.getFormat(NumberFormatIndex.DATE_SYS_DDMMYY);
String myDate = du.format(ff, currentDate); String myDate = du.format(ff, currentDate);
XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocument); XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument);
XDocumentInfo xDocInfo2 = xDocInfoSuppl.getDocumentInfo(); XDocumentProperties xDocProps2 = xDocPropsSuppl.getDocumentProperties();
Helper.setUnoPropertyValue(xDocInfo2, "Author", fullname); xDocProps2.setAuthor(fullname);
Helper.setUnoPropertyValue(xDocInfo2, "ModifiedBy", fullname); xDocProps2.setModifiedBy(fullname);
String description = (String) Helper.getUnoPropertyValue(xDocInfo2, "Description"); String description = xDocProps2.getDescription();
description = description + " " + TemplateDescription; description = description + " " + TemplateDescription;
description = JavaTools.replaceSubString(description, WizardName, "<wizard_name>"); description = JavaTools.replaceSubString(description, WizardName, "<wizard_name>");
description = JavaTools.replaceSubString(description, myDate, "<current_date>"); description = JavaTools.replaceSubString(description, myDate, "<current_date>");
Helper.setUnoPropertyValue(xDocInfo2, "Description", description); xDocProps2.setDescription(description);
} }
catch (NoSuchElementException e) catch (NoSuchElementException e)
{ {
......
...@@ -38,8 +38,8 @@ import com.sun.star.beans.Property; ...@@ -38,8 +38,8 @@ import com.sun.star.beans.Property;
import com.sun.star.beans.PropertyValue; import com.sun.star.beans.PropertyValue;
import com.sun.star.document.MacroExecMode; import com.sun.star.document.MacroExecMode;
import com.sun.star.document.UpdateDocMode; import com.sun.star.document.UpdateDocMode;
import com.sun.star.document.XDocumentInfoSupplier; import com.sun.star.document.XDocumentProperties;
import com.sun.star.document.XStandaloneDocumentInfo; import com.sun.star.document.XDocumentPropertiesSupplier;
import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XComponentLoader;
import com.sun.star.frame.XDesktop; import com.sun.star.frame.XDesktop;
import com.sun.star.lang.XComponent; import com.sun.star.lang.XComponent;
...@@ -170,38 +170,31 @@ public class CGDocument extends ConfigSetItem implements XMLProvider ...@@ -170,38 +170,31 @@ public class CGDocument extends ConfigSetItem implements XMLProvider
* We try to open the document to get some properties * We try to open the document to get some properties
*/ */
//first get the info object which is a DocumentInfo service. XDocumentProperties xProps = null;
Object info = null;
if (isSODocument)
{//for SO documents, use StandaloneDocumentInfo service.
info = xmsf.createInstance("com.sun.star.document.StandaloneDocumentInfo");
((XStandaloneDocumentInfo) UnoRuntime.queryInterface(XStandaloneDocumentInfo.class, info)).loadFromURL(cp_URL);
}
task.advance(true); //3 task.advance(true); //3
if (!isSODocument && isSOOpenable) if (isSOOpenable)
{ //for other documents which are openable through SO, use DocumentInfo service. { // for documents which are openable through SO, use DocumentProperties service.
XDesktop desktop = Desktop.getDesktop(xmsf); XDesktop desktop = Desktop.getDesktop(xmsf);
PropertyValue[] props = new PropertyValue[3]; PropertyValue[] props = new PropertyValue[3];
props[0] = Properties.createProperty("Hidden", Boolean.TRUE); props[0] = Properties.createProperty("Hidden", Boolean.TRUE);
props[1] = Properties.createProperty("MacroExecutionMode", new Short(MacroExecMode.NEVER_EXECUTE)); props[1] = Properties.createProperty("MacroExecutionMode", new Short(MacroExecMode.NEVER_EXECUTE));
props[2] = Properties.createProperty("UpdateDocMode", new Short(UpdateDocMode.NO_UPDATE)); props[2] = Properties.createProperty("UpdateDocMode", new Short(UpdateDocMode.NO_UPDATE));
XComponent component = ((XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, desktop)).loadComponentFromURL(cp_URL, "_default", 0, props); XComponent component = ((XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, desktop)).loadComponentFromURL(cp_URL, "_default", 0, props);
info = ((XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, component)).getDocumentInfo(); xProps = ((XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, component)).getDocumentProperties();
} }
task.advance(true); //4 task.advance(true); //4
//now use the object to read some document properties. //now use the object to read some document properties.
if (isSODocument || isSOOpenable) if (xProps != null)
{ {
title = (String) Helper.getUnoPropertyValue(info, "Title"); title = xProps.getTitle();
description = (String) Helper.getUnoPropertyValue(info, "Description"); description = xProps.getDescription();
author = (String) Helper.getUnoPropertyValue(info, "Author"); author = xProps.getAuthor();
createDate = (DateTime) Helper.getUnoPropertyValue(info, "CreationDate", DateTime.class); createDate = xProps.getCreationDate();
updateDate = (DateTime) Helper.getUnoPropertyValue(info, "ModifyDate", DateTime.class); updateDate = xProps.getModificationDate();
//TODO get pages here.
} }
else else
{ //get some information from OS. { //get some information from OS.
...@@ -238,7 +231,7 @@ public class CGDocument extends ConfigSetItem implements XMLProvider ...@@ -238,7 +231,7 @@ public class CGDocument extends ConfigSetItem implements XMLProvider
/** /**
* Analyzes a type-detection string, returned from the TypeDetection service, * Analyzes a type-detection string, returned from the TypeDetection service,
* and sets the appType, isSOOpenable and isSODocument memebres. * and sets the appType, isSOOpenable and isSODocument members.
*/ */
private void analyzeFileType(PropertyValue[] mediaDesc) private void analyzeFileType(PropertyValue[] mediaDesc)
{ {
......
...@@ -17,7 +17,6 @@ Public DoUnprotect as Integer ...@@ -17,7 +17,6 @@ Public DoUnprotect as Integer
Public Password as String Public Password as String
Public DocIndex as Integer Public DocIndex as Integer
Public oPathSettings as Object Public oPathSettings as Object
Public oDocInfo as Object
Public oUcb as Object Public oUcb as Object
Public TotDocCount as Integer Public TotDocCount as Integer
Public sTotDocCount as String Public sTotDocCount as String
...@@ -30,7 +29,6 @@ Dim oFactoryKey as Object ...@@ -30,7 +29,6 @@ Dim oFactoryKey as Object
BasicLibraries.LoadLibrary(&quot;Tools&quot;) BasicLibraries.LoadLibrary(&quot;Tools&quot;)
BasicLibraries.LoadLibrary(&quot;ImportWizard&quot;) BasicLibraries.LoadLibrary(&quot;ImportWizard&quot;)
If InitResources(&quot;Euro Converter&quot;, &quot;eur&quot;) Then If InitResources(&quot;Euro Converter&quot;, &quot;eur&quot;) Then
oDocInfo = CreateUnoService(&quot;com.sun.star.document.StandaloneDocumentInfo&quot;)
oUcb = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;) oUcb = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
oLocale = GetStarOfficeLocale() oLocale = GetStarOfficeLocale()
InitializeConverter(oLocale, 2) InitializeConverter(oLocale, 2)
...@@ -303,7 +301,7 @@ Dim sNoDirMessage as String ...@@ -303,7 +301,7 @@ Dim sNoDirMessage as String
If bIsValid Then If bIsValid Then
If DialogModel.optSingleFile.State = 1 Then If DialogModel.optSingleFile.State = 1 Then
If bCheckFileType Then If bCheckFileType Then
sLocMimeType = GetRealFileContent(oDocInfo, sPath) sLocMimeType = GetRealFileContent(sPath)
If DialogModel.chkTextDocuments.State = 1 Then If DialogModel.chkTextDocuments.State = 1 Then
If (Instr(1, sLocMimeType, &quot;text&quot;) = 0) And (Instr(1, sLocMimeType, &quot;calc&quot;) = 0) Then If (Instr(1, sLocMimeType, &quot;text&quot;) = 0) And (Instr(1, sLocMimeType, &quot;calc&quot;) = 0) Then
Msgbox(sMsgFileInvalid, 48, sMsgDLGTITLE) Msgbox(sMsgFileInvalid, 48, sMsgDLGTITLE)
...@@ -408,4 +406,4 @@ Sub PreviousStep() ...@@ -408,4 +406,4 @@ Sub PreviousStep()
DialogModel.cmdGoOn.Label = sGOON DialogModel.cmdGoOn.Label = sGOON
DialogModel.cmdCancel.Label = sCANCEL DialogModel.cmdCancel.Label = sCANCEL
End Sub End Sub
</script:module> </script:module>
\ No newline at end of file
...@@ -25,7 +25,7 @@ Dim n, m, iAutoCount as Integer ...@@ -25,7 +25,7 @@ Dim n, m, iAutoCount as Integer
&apos; Open a new empty document &apos; Open a new empty document
oDocument = CreateNewDocument(&quot;swriter&quot;) oDocument = CreateNewDocument(&quot;swriter&quot;)
If Not IsNull(oDocument) Then If Not IsNull(oDocument) Then
oDocument.DocumentInfo.Title = sDocumentTitle oDocument.DocumentProperties.Title = sDocumentTitle
oDocuText = oDocument.Text oDocuText = oDocument.Text
&apos; Create The Character-templates &apos; Create The Character-templates
...@@ -94,4 +94,4 @@ Dim oCellCursor as Object ...@@ -94,4 +94,4 @@ Dim oCellCursor as Object
oCellCursor.CharStyleName = sCellStyle oCellCursor.CharStyleName = sCellStyle
oCell.Text.insertString(oCellCursor,sCellString,False) oCell.Text.insertString(oCellCursor,sCellString,False)
oDocument.CurrentController.Select(oCellCursor) oDocument.CurrentController.Select(oCellCursor)
End Sub</script:module> End Sub</script:module>
\ No newline at end of file
...@@ -50,10 +50,10 @@ Dim oCharStyles as Object ...@@ -50,10 +50,10 @@ Dim oCharStyles as Object
oHyperCursor.gotoStart(False) oHyperCursor.gotoStart(False)
oHyperCursor.HyperLinkURL = oDocument.URL oHyperCursor.HyperLinkURL = oDocument.URL
oHyperCursor.HyperLinkTarget = oDocument.URL oHyperCursor.HyperLinkTarget = oDocument.URL
If oDocument.DocumentInfo.Title &lt;&gt; &quot;&quot; Then If oDocument.DocumentProperties.Title &lt;&gt; &quot;&quot; Then
oHyperCursor.HyperlinkName = oDocument.DocumentInfo.Title oHyperCursor.HyperlinkName = oDocument.DocumentProperties.Title
End If End If
oLogText.insertString(oHyperCursor, oDocument.DocumentInfo.Title, False) oLogText.insertString(oHyperCursor, oDocument.DocumentProperties.Title, False)
oLogText.insertControlCharacter(oHyperCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False) oLogText.insertControlCharacter(oHyperCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
oLogCursor = oLogText.createTextCursor() oLogCursor = oLogText.createTextCursor()
...@@ -64,8 +64,8 @@ Dim oCharStyles as Object ...@@ -64,8 +64,8 @@ Dim oCharStyles as Object
oLogCursor.SetPropertyToDefault(&quot;HyperLinkName&quot;) oLogCursor.SetPropertyToDefault(&quot;HyperLinkName&quot;)
LogIndex = 0 LogIndex = 0
&apos; Get the Properties of the document Info &apos; Get the Properties of the document
GetDocumentInfo() GetDocumentProps()
Select Case sDocType Select Case sDocType
Case &quot;swriter&quot; Case &quot;swriter&quot;
...@@ -400,18 +400,18 @@ End Sub ...@@ -400,18 +400,18 @@ End Sub
&apos; ***********************************************Misc************************************************** &apos; ***********************************************Misc**************************************************
Sub GetDocumentInfo() Sub GetDocumentProps()
Dim oDocuInfo as Object Dim oDocuProps as Object
MakeLogHeadLine(&quot;Document Properties&quot;) MakeLogHeadLine(&quot;Document Properties&quot;)
oDocuInfo = oDocument.DocumentInfo oDocuProps = oDocument.DocumentProperties
WriteStringToLogFile(oDocuInfo.Title) WriteStringToLogFile(oDocuProps.Title)
WriteStringToLogFile(oDocuInfo.Description) WriteStringToLogFile(oDocuProps.Description)
WriteStringToLogFile(oDocuInfo.Theme) WriteStringToLogFile(oDocuProps.Subject)
WriteStringToLogFile(oDocuInfo.Author) WriteStringToLogFile(oDocuProps.Author)
WriteStringToLogFile(oDocuInfo.ReplyTo) &apos; WriteStringToLogFile(oDocuProps.UserDefinedProperties.ReplyTo)
WriteStringToLogFile(oDocuInfo.Recipient) &apos; WriteStringToLogFile(oDocuProps.UserDefinedProperties.Recipient)
WriteStringToLogFile(oDocuInfo.References) &apos; WriteStringToLogFile(oDocuProps.UserDefinedProperties.References)
WriteStringToLogFile(oDocuInfo.Keywords) &apos; WriteStringToLogFile(oDocuProps.Keywords)
End Sub End Sub
...@@ -519,4 +519,4 @@ Sub MakeLogHeadLine(HeadText as String) ...@@ -519,4 +519,4 @@ Sub MakeLogHeadLine(HeadText as String)
oLogText.insertControlCharacter(oLogCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False) oLogText.insertControlCharacter(oLogCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
oLogCursor.CharStyleName = &quot;Log Body&quot; oLogCursor.CharStyleName = &quot;Log Body&quot;
End Sub End Sub
</script:module> </script:module>
\ No newline at end of file
...@@ -41,7 +41,6 @@ Dim NewContentList() as String ...@@ -41,7 +41,6 @@ Dim NewContentList() as String
Dim XMLTemplateContentString as String Dim XMLTemplateContentString as String
Dim ApplIndex as Integer Dim ApplIndex as Integer
Dim bAssignFileName as Boolean Dim bAssignFileName as Boolean
oDocInfo = CreateUnoService(&quot;com.sun.star.document.StandaloneDocumentInfo&quot;)
bInterruptSearch = False bInterruptSearch = False
For i = 0 To MaxCollectIndex For i = 0 To MaxCollectIndex
SearchDir = PathCollection(i,0) SearchDir = PathCollection(i,0)
...@@ -71,7 +70,7 @@ Dim bAssignFileName as Boolean ...@@ -71,7 +70,7 @@ Dim bAssignFileName as Boolean
CurFileContent = &quot;&quot; CurFileContent = &quot;&quot;
CurFileName = NewList(n,0) CurFileName = NewList(n,0)
If (FieldInList(NewList(n,1), XMLTemplateList())) Then If (FieldInList(NewList(n,1), XMLTemplateList())) Then
CurFileContent = GetRealFileContent(oDocInfo, CurFileName) CurFileContent = GetRealFileContent(CurFileName)
t = SearchArrayforPartString(CurFileContent, XMLTemplateContentList()) t = SearchArrayforPartString(CurFileContent, XMLTemplateContentList())
bAssignFileName = (t &gt; -1) bAssignFileName = (t &gt; -1)
If bAssignFileName Then If bAssignFileName Then
...@@ -822,4 +821,4 @@ Function ConcatComment(sComment as String, AdditionalComment as String) ...@@ -822,4 +821,4 @@ Function ConcatComment(sComment as String, AdditionalComment as String)
End If End If
ConcatComment = sComment ConcatComment = sComment
End Function End Function
</script:module> </script:module>
\ No newline at end of file
...@@ -9,6 +9,7 @@ Dim sDirArray(SBMAXDIRCOUNT-1) as String ...@@ -9,6 +9,7 @@ Dim sDirArray(SBMAXDIRCOUNT-1) as String
Dim DirIndex As Integer Dim DirIndex As Integer
Dim iDirCount as Integer Dim iDirCount as Integer
Public bInterruptSearch as Boolean Public bInterruptSearch as Boolean
Public NoArgs()as New com.sun.star.beans.PropertyValue
Sub Main() Sub Main()
Dim LocsfileContent(0) as String Dim LocsfileContent(0) as String
...@@ -64,7 +65,7 @@ Dim sFileArray(StartUbound,1) as String ...@@ -64,7 +65,7 @@ Dim sFileArray(StartUbound,1) as String
End If End If
Else Else
If bcheckFileType Then If bcheckFileType Then
RealFileContent = GetRealFileContent(oDocInfo, FileName) RealFileContent = GetRealFileContent(FileName)
Else Else
RealFileContent = GetFileNameExtension(FileName) RealFileContent = GetFileNameExtension(FileName)
End If End If
...@@ -143,14 +144,14 @@ Dim FileCount As Integer ...@@ -143,14 +144,14 @@ Dim FileCount As Integer
End Sub End Sub
Function RetrieveDocTitle(oDocInfo as Object, sFileName as String) As String Function RetrieveDocTitle(oDocProps as Object, sFileName as String) As String
Dim sDocTitle as String Dim sDocTitle as String
On Local Error Goto NOFILE On Local Error Goto NOFILE
oDocInfo.Read(sFileName) oDocProps.loadFromMedium(sFileName, NoArgs())
sDocTitle = oDocInfo.Title sDocTitle = oDocProps.Title
NOFILE: NOFILE:
If Err &lt;&gt; 0 Then If Err &lt;&gt; 0 Then
GetRealFileContent = &quot;&quot; RetrieveDocTitle = &quot;&quot;
RESUME CLR_ERROR RESUME CLR_ERROR
End If End If
CLR_ERROR: CLR_ERROR:
...@@ -163,10 +164,10 @@ End Function ...@@ -163,10 +164,10 @@ End Function
&apos; Retrieves The Filecontent of a Document by extracting the content &apos; Retrieves The Filecontent of a Document by extracting the content
&apos; from the Header of the document &apos; from the Header of the document
Function GetRealFileContent(oDocInfo as Object, FileName as String) As String Function GetRealFileContent(FileName as String) As String
On Local Error Goto NOFILE On Local Error Goto NOFILE
oDocInfo.Read(FileName) oTypeDetect = createUnoService(&quot;com.sun.star.document.TypeDetection&quot;)
GetRealFileContent = oDocInfo.MIMEType GetRealFileContent = oTypeDetect.queryTypeByURL(FileName)
NOFILE: NOFILE:
If Err &lt;&gt; 0 Then If Err &lt;&gt; 0 Then
GetRealFileContent = &quot;&quot; GetRealFileContent = &quot;&quot;
...@@ -290,4 +291,4 @@ NOSPACEONDRIVE: ...@@ -290,4 +291,4 @@ NOSPACEONDRIVE:
End If End If
GOON: GOON:
End Function End Function
</script:module> </script:module>
\ No newline at end of file
...@@ -39,8 +39,8 @@ Sub LoadTutorialDialog(exampleToUse, documentTYP) ...@@ -39,8 +39,8 @@ Sub LoadTutorialDialog(exampleToUse, documentTYP)
SetTutorialDocumentPosSize() SetTutorialDocumentPosSize()
documentInfo = ThisComponent.getDocumentInfo() documentProps = ThisComponent.getDocumentProperties()
myDialog.Title = &quot;Tutorials - &quot; &amp; documentInfo.Title myDialog.Title = &quot;Tutorials - &quot; &amp; documentProps.Title
oTextField = myDialog.GetControl(&quot;myTextField&quot;) oTextField = myDialog.GetControl(&quot;myTextField&quot;)
oTextField.setVisible(False) oTextField.setVisible(False)
...@@ -143,18 +143,16 @@ Sub Init ...@@ -143,18 +143,16 @@ Sub Init
End Sub End Sub
Sub InitStep Sub InitStep
userFieldName = ThisComponent.getDocumentInfo.getUserFieldName(0) udProps = ThisComponent.DocumentProperties.UserDefinedProperties
ResultString = InStr (userFieldName, &quot;CurrentStep:&quot;) If udProps.PropertySetInfo.hasPropertyByName(&quot;CurrentStep&quot;) Then
If ResultString &lt;&gt; 0 Then TutorStep = udProps.CurrentStep
TutorStep = Val(ThisComponent.getDocumentInfo.getUserFieldValue(0)) Else
Else udProps.addProperty(&quot;CurrentStep&quot;, 0, TutorStep)
ThisComponent.getDocumentInfo.setUserFieldName(0, &quot;CurrentStep:&quot;) End If
ThisComponent.getDocumentInfo.setUserFieldValue(0, TutorStep)
End If
End Sub End Sub
Sub setStep Sub setStep
ThisComponent.getDocumentInfo.setUserFieldValue(0, TutorStep) ThisComponent.DocumentProperties.UserDefinedProperties.CurrentStep = TutorStep
End Sub End Sub
Sub InitAction() Sub InitAction()
...@@ -367,4 +365,4 @@ Sub ExitTutorial() ...@@ -367,4 +365,4 @@ Sub ExitTutorial()
msgBox &quot;Error! Cannot close document.&quot; msgBox &quot;Error! Cannot close document.&quot;
End If End If
End Sub End Sub
</script:module> </script:module>
\ No newline at end of file
...@@ -153,11 +153,11 @@ Dim OldWebPageIndex as Integer ...@@ -153,11 +153,11 @@ Dim OldWebPageIndex as Integer
CurrentNext$ = GraphicsDir + Style(CurWebPageIndex, 3) CurrentNext$ = GraphicsDir + Style(CurWebPageIndex, 3)
CurrentHome$ = GraphicsDir + Style(CurWebPageIndex, 4) CurrentHome$ = GraphicsDir + Style(CurWebPageIndex, 4)
CurrentTop$ = GraphicsDir + Style(CurWebPageIndex, 5) CurrentTop$ = GraphicsDir + Style(CurWebPageIndex, 5)
With oBaseDocument.DocumentInfo With oBaseDocument.DocumentProperties.UserDefinedProperties
.GetUserFieldValue(0) = ExtractGraphicNames(CurWebPageIndex,2) .AutoPilotName1 = ExtractGraphicNames(CurWebPageIndex,2)
.GetUserFieldValue(1) = ExtractGraphicNames(CurWebPageIndex, 4) .AutoPilotName2 = ExtractGraphicNames(CurWebPageIndex, 4)
.GetUserFieldValue(2) = Style(CurWebPageIndex, 6) &apos; Bullet .AutoPilotBullet = Style(CurWebPageIndex, 6)
.GetUserFieldValue(3) = Style(CurWebPageIndex, 7) &apos; Background .AutoPilotBackground = Style(CurWebPageIndex, 7)
End With End With
SetBulletAndGraphics() SetBulletAndGraphics()
CheckControls(oBaseDocument.DrawPage) CheckControls(oBaseDocument.DrawPage)
...@@ -235,6 +235,7 @@ Sub CopyGraphics ...@@ -235,6 +235,7 @@ Sub CopyGraphics
Dim oGraphicObjects as Object Dim oGraphicObjects as Object
Dim oGraphic as Object Dim oGraphic as Object
Dim i as Integer Dim i as Integer
Dim udProps as Object
Dim SavePath as String Dim SavePath as String
BasicLibraries.LoadLibrary(&quot;Tools&quot;) BasicLibraries.LoadLibrary(&quot;Tools&quot;)
oUcb = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;) oUcb = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
...@@ -255,12 +256,12 @@ Dim SavePath as String ...@@ -255,12 +256,12 @@ Dim SavePath as String
BulletUrlsToSavePath(SavePath) BulletUrlsToSavePath(SavePath)
With oBaseDocument.DocumentInfo udProps = oBaseDocument.DocumentProperties.UserDefinedProperties
.GetUserFieldValue(0) = &quot;&quot; udProps.addProperty(&quot;AutoPilotName1&quot;, 0, &quot;&quot;)
.GetUserFieldValue(1) = &quot;&quot; udProps.addProperty(&quot;AutoPilotName2&quot;, 0, &quot;&quot;)
.GetUserFieldValue(2) = &quot;&quot; udProps.addProperty(&quot;AutoPilotBullet&quot;, 0, &quot;&quot;)
.GetUserFieldValue(3) = &quot;&quot; udProps.addProperty(&quot;AutoPilotBackground&quot;, 0, &quot;&quot;)
End With
AttachBasicMacroToEvent(oBaseDocument,&quot;OnSaveDone&quot;, &quot;&quot;) AttachBasicMacroToEvent(oBaseDocument,&quot;OnSaveDone&quot;, &quot;&quot;)
AttachBasicMacroToEvent(oBaseDocument,&quot;OnSaveAsDone&quot;, &quot;&quot;) AttachBasicMacroToEvent(oBaseDocument,&quot;OnSaveAsDone&quot;, &quot;&quot;)
AttachBasicMacroToEvent(oBaseDocument,&quot;OnNew&quot;, &quot;&quot;) AttachBasicMacroToEvent(oBaseDocument,&quot;OnNew&quot;, &quot;&quot;)
...@@ -284,7 +285,7 @@ End Function ...@@ -284,7 +285,7 @@ End Function
Function getListBoxArrays(oUcb as Object, sFileFilter as String) Function getListBoxArrays(oUcb as Object, sFileFilter as String)
Dim oDocInfo as Object Dim oDocProps as Object
Dim oListboxControl as Object Dim oListboxControl as Object
Dim Description as String Dim Description as String
Dim sField as String Dim sField as String
...@@ -301,10 +302,10 @@ Dim n as Integer ...@@ -301,10 +302,10 @@ Dim n as Integer
Dim s as Integer Dim s as Integer
Dim a as Integer Dim a as Integer
Dim LocMaxIndex as Integer Dim LocMaxIndex as Integer
Dim InfoNames() Dim Properties()
Dim DimCount as Integer Dim DimCount as Integer
Dim sExtension as String Dim sExtension as String
oDocInfo = CreateUnoService(&quot;com.sun.star.document.DocumentProperties&quot;) oDocProps = CreateUnoService(&quot;com.sun.star.document.DocumentProperties&quot;)
FilterLen = Len(sFileFilter) FilterLen = Len(sFileFilter)
bItemFound = False bItemFound = False
&apos; It has to be made sure that the TemplatePath &lt;&gt; &quot;&quot; &apos; It has to be made sure that the TemplatePath &lt;&gt; &quot;&quot;
...@@ -325,7 +326,7 @@ Dim sExtension as String ...@@ -325,7 +326,7 @@ Dim sExtension as String
Dim SortList(LocMaxIndex,1) Dim SortList(LocMaxIndex,1)
For i = 0 to LocMaxIndex For i = 0 to LocMaxIndex
SortList(i,0) = DirContent(i) SortList(i,0) = DirContent(i)
SortList(i,1) = RetrieveDocTitle(oDocInfo, DirContent(i)) SortList(i,1) = RetrieveDocTitle(oDocProps, DirContent(i))
Next i Next i
SortList() = BubbleSortList(SortList(),True) SortList() = BubbleSortList(SortList(),True)
For i = 0 to LocMaxIndex For i = 0 to LocMaxIndex
...@@ -337,16 +338,15 @@ Dim sExtension as String ...@@ -337,16 +338,15 @@ Dim sExtension as String
sExtension = Ucase(GetFileNameExtension(FileName)) sExtension = Ucase(GetFileNameExtension(FileName))
If Instr(1,Filename, sFileFilter) And sExtension = &quot;STW&quot; Then If Instr(1,Filename, sFileFilter) And sExtension = &quot;STW&quot; Then
bItemFound = True bItemFound = True
Description = RetrieveDocTitle(oDocInfo, FileName) Description = RetrieveDocTitle(oDocProps, FileName)
oDocInfo.Read(FileName) Properties = oDocProps.UserDefinedProperties.PropertyValues
InfoNames = oDocInfo.ElementNames()
List(a,1) = Description List(a,1) = Description
If sFileFilter = &quot;/cnt&quot; Then If sFileFilter = &quot;/cnt&quot; Then
List(a,2) = Filename List(a,2) = Filename
Else Else
m = 2 m = 2
For n = 0 To 3 For n = 0 To 3
sField = oDocInfo.GetByName(InfoNames(n)) sField = Properties(n).Value
sFieldList() = ArrayoutofString(sField, &quot; &quot;, MaxIndex) sFieldList() = ArrayoutofString(sField, &quot; &quot;, MaxIndex)
For s = 0 To MaxIndex For s = 0 To MaxIndex
If m &lt; 6 Then If m &lt; 6 Then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment