summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2007-07-05 06:31:27 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2007-07-05 06:31:27 +0000
commit108d97eba7d681f6ced91bf78e7cfb74924a1098 (patch)
tree147650e386c7c1b75727c98cbd61a5168b67c414 /xmloff
parent8225fe734ce048a31188afcc6fb6f413662d0189 (diff)
INTEGRATION: CWS os96 (1.24.144); FILE MERGED
2007/06/19 07:07:20 pb 1.24.144.1: fix: #i76855# read configuration before load printer settings
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/DocumentSettingsContext.cxx55
1 files changed, 45 insertions, 10 deletions
diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index 975fb2dd2117..323614aef89e 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: DocumentSettingsContext.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: hr $ $Date: 2007-06-27 14:54:00 $
+ * last change: $Author: rt $ $Date: 2007-07-05 07:31:27 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -79,12 +79,9 @@
#ifndef _COM_SUN_STAR_FORMULA_SYMBOLDESCRIPTOR_HPP_
#include <com/sun/star/formula/SymbolDescriptor.hpp>
#endif
-
-// #110680#
-//#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
-//#include <comphelper/processfactory.hxx>
-//#endif
-
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
#ifndef _COM_SUN_STAR_UTIL_DATETIME_HPP_
#include <com/sun/star/util/DateTime.hpp>
#endif
@@ -94,6 +91,9 @@
#ifndef _COM_SUN_STAR_DOCUMENT_PRINTERINDEPENDENTLAYOUT_HPP_
#include <com/sun/star/document/PrinterIndependentLayout.hpp>
#endif
+#ifndef _COMPHELPER_CONFIGURATIONHELPER_HXX_
+#include <comphelper/configurationhelper.hxx>
+#endif
#ifndef _RTL_USTRBUF_HXX_
#include <rtl/ustrbuf.hxx>
#endif
@@ -104,6 +104,7 @@
using namespace com::sun::star;
using namespace ::xmloff::token;
+#define C2U(cChar) ::rtl::OUString::createFromAscii(cChar)
//------------------------------------------------------------------
@@ -460,9 +461,43 @@ void XMLDocumentSettingsContext::EndElement()
i--;
}
}
+
+ sal_Bool bLoadDocPrinter( sal_True );
+ ::comphelper::ConfigurationHelper::readDirectKey(
+ ::comphelper::getProcessServiceFactory(),
+ C2U("org.openoffice.Office.Common/"), C2U("Save/Document"), C2U("LoadPrinter"),
+ ::comphelper::ConfigurationHelper::E_READONLY ) >>= bLoadDocPrinter;
uno::Sequence<beans::PropertyValue> aSeqConfigProps;
- if (aConfigProps >>= aSeqConfigProps)
- GetImport().SetConfigurationSettings(aSeqConfigProps);
+ if ( aConfigProps >>= aSeqConfigProps )
+ {
+ if ( !bLoadDocPrinter )
+ {
+ sal_Int32 i = aSeqConfigProps.getLength() - 1;
+ int nFound = 0;
+
+ while ( ( i >= 0 ) && nFound < 2 )
+ {
+ rtl::OUString sProp( aSeqConfigProps[i].Name );
+
+ if ( sProp.compareToAscii("PrinterName") == 0 )
+ {
+ rtl::OUString sEmpty;
+ aSeqConfigProps[i].Value = uno::makeAny( sEmpty );
+ nFound++;
+ }
+ else if ( sProp.compareToAscii("PrinterSetup") == 0 )
+ {
+ uno::Sequence< sal_Int8 > aEmpty;
+ aSeqConfigProps[i].Value = uno::makeAny( aEmpty );
+ nFound++;
+ }
+
+ i--;
+ }
+ }
+
+ GetImport().SetConfigurationSettings( aSeqConfigProps );
+ }
}
//=============================================================================