diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-27 09:51:58 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-02-06 12:03:25 +0100 |
commit | 094f92bb789ecd24793c5843bfae13e79122fc5a (patch) | |
tree | e0bcb505f942a7f323cdbc9419eede5723165f5c /odk/examples/DevelopersGuide/GUI | |
parent | a315454f349469923490e4116806ee19263849b8 (diff) |
Introduce com.sun.star.util.thePathSettings singleton.
To replace single-instance com.sun.star.util.PathSettings service,
incorrectly converted in 89b0017b22889af6a8afe28b94c06e7095dc8c6f
Keeping util::PathSettings::create in
sc/source/ui/vba/vbaapplication.cxx because for some reason
util::thePathSettings::get does not work in sc_macros_test
while testing sc/qa/extras/testdocuments/Ranges.xls.
Change-Id: I75b68ae56ac5b58f72416070dba100ab3ab70fe8
Diffstat (limited to 'odk/examples/DevelopersGuide/GUI')
-rw-r--r-- | odk/examples/DevelopersGuide/GUI/SystemDialog.java | 6 | ||||
-rw-r--r-- | odk/examples/DevelopersGuide/GUI/UnoDialogSample.java | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/odk/examples/DevelopersGuide/GUI/SystemDialog.java b/odk/examples/DevelopersGuide/GUI/SystemDialog.java index 1c1de4364cf8..453d9b99cd72 100644 --- a/odk/examples/DevelopersGuide/GUI/SystemDialog.java +++ b/odk/examples/DevelopersGuide/GUI/SystemDialog.java @@ -42,7 +42,7 @@ import com.sun.star.ui.dialogs.XFilterManager; import com.sun.star.ui.dialogs.XFolderPicker2; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; - +import com.sun.star.util.thePathSettings; public class SystemDialog { @@ -86,7 +86,7 @@ public class SystemDialog { xFilePicker.setDefaultName("MyExampleDocument"); // set the initial displaydirectory. In this example the user template directory is used - Object oPathSettings = m_xMCF.createInstanceWithContext("com.sun.star.util.PathSettings",m_xContext); + Object oPathSettings = thePathSettings.get(m_xContext); XPropertySet xPropertySet = com.sun.star.uno.UnoRuntime.queryInterface(XPropertySet.class, oPathSettings); String sTemplateUrl = (String) xPropertySet.getPropertyValue("Template_writable"); xFilePicker.setDisplayDirectory(sTemplateUrl); @@ -134,7 +134,7 @@ public class SystemDialog { String sWorkUrl = ""; try{ // retrieve the configured Work path... - Object oPathSettings = m_xMCF.createInstanceWithContext("com.sun.star.util.PathSettings",m_xContext); + Object oPathSettings = thePathSettings.get(m_xContext); XPropertySet xPropertySet = com.sun.star.uno.UnoRuntime.queryInterface(XPropertySet.class, oPathSettings); sWorkUrl = (String) xPropertySet.getPropertyValue("Work"); } catch (com.sun.star.uno.Exception exception) { diff --git a/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java b/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java index 851158f91d81..60eb85475dd5 100644 --- a/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java +++ b/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java @@ -98,6 +98,7 @@ import com.sun.star.util.XNumberFormats; import com.sun.star.util.XNumberFormatsSupplier; import com.sun.star.util.Date; import com.sun.star.util.Time; +import com.sun.star.util.thePathSettings; // Anregung von DV: @@ -1116,7 +1117,7 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis String sName = createUniqueName(m_xDlgModelNameContainer, "FileControl"); // retrieve the configured Work path... - Object oPathSettings = m_xMCF.createInstanceWithContext("com.sun.star.util.PathSettings",m_xContext); + Object oPathSettings = thePathSettings.get(m_xContext); XPropertySet xPropertySet = com.sun.star.uno.UnoRuntime.queryInterface(XPropertySet.class, oPathSettings); String sWorkUrl = (String) xPropertySet.getPropertyValue("Work"); |