Files
libreoffice/sc/source/ui/docshell/docsh8.cxx

1169 lines
47 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2000-09-18 16:07:07 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 16:07:07 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 16:07:07 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 16:07:07 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 16:07:07 +00:00
*
************************************************************************/
#ifndef DISABLE_DBCONNECTIVITY
2000-09-18 16:07:07 +00:00
#include <stdio.h>
#include <tools/urlobj.hxx>
#include <svl/converter.hxx>
#include <svl/zforlist.hxx>
2011-11-18 21:03:31 +00:00
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
2000-11-07 10:48:29 +00:00
#include <comphelper/types.hxx>
2000-11-03 18:27:07 +00:00
#include <ucbhelper/content.hxx>
CWS-TOOLING: integrate CWS dba31f 2008-12-10 14:16:09 +0100 oj r265185 : #i96658# remove is 2008-12-10 08:46:07 +0100 oj r265147 : remove duplicate ids 2008-12-10 08:35:02 +0100 oj r265146 : #i96658# remove is 2008-12-09 11:44:35 +0100 oj r265072 : use of tools::StringresourceList 2008-12-09 11:43:41 +0100 oj r265071 : new class to read string elements from a Resource 2008-12-09 11:41:56 +0100 oj r265070 : export StringListResource 2008-12-09 11:38:17 +0100 oj r265068 : change string ; to more string objects 2008-12-08 12:11:43 +0100 oj r264985 : change default-license-id to lic-en-US 2008-12-05 12:06:09 +0100 oj r264896 : disable check to uncheck 2008-12-04 08:58:50 +0100 oj r264814 : #i96517,i96520,i96522# d&d, background, state fixed 2008-12-04 08:53:29 +0100 oj r264813 : #i96434# use document ui name from filter 2008-12-04 08:41:06 +0100 oj r264812 : #i96434# use document ui name from filter 2008-12-02 13:48:49 +0100 lla r264697 : #i96526# extra string for default otr wasn't found 2008-11-28 11:46:31 +0100 oj r264536 : move toolbar and resize add field dlg 2008-11-28 08:38:22 +0100 oj r264526 : load string resources 2008-11-27 19:28:52 +0100 oj r264520 : unsigned 2008-11-27 19:10:19 +0100 oj r264517 : move class into unnamed namespace 2008-11-27 18:33:38 +0100 oj r264514 : wrong param 2008-11-27 16:52:39 +0100 oj r264510 : #i96622# wrong string replacement 2008-11-27 16:46:03 +0100 oj r264509 : remove unused var 2008-11-27 13:37:16 +0100 oj r264484 : #i96432# notify only when not in special mode of the page 2008-11-27 13:16:47 +0100 oj r264479 : #i95224# accept alias in group by 2008-11-27 12:35:19 +0100 oj r264477 : #i95416# always show localized strings in the start marker 2008-11-27 09:49:29 +0100 oj r264455 : #i93460# set split pos 2008-11-27 09:05:27 +0100 oj r264447 : #i96453# use extension from mimetype / mediatype 2008-11-26 16:24:43 +0100 oj r264416 : #i96520# #i96522# #i96519# some changes at the add field dialog 2008-11-26 16:20:27 +0100 oj r264414 : #i93420# prevent to register a none system file url 2008-11-26 16:19:02 +0100 oj r264413 : #i96522# new class to paste multiple objects 2008-11-26 10:06:12 +0100 oj r264349 : #i96191# introduce new error message and check if type was defined aand should not be changed 2008-11-26 10:06:12 +0100 oj r264348 : #i96191# throw error when decimal is to big 2008-11-25 12:08:59 +0100 oj r264281 : #i96431# correct state for align and move 2008-11-25 11:54:47 +0100 oj r264280 : #i96428# when new bind to first table 2008-11-25 11:49:55 +0100 oj r264279 : #i96434# add report output format to inspection 2008-11-25 11:49:05 +0100 oj r264278 : #i96434# add report output format to inspection 2008-11-24 10:46:23 +0100 oj r264215 : #i96458# size width for controls 2008-11-24 09:28:56 +0100 oj r264199 : #i96459# mark detail section when nothing is selected 2008-11-20 12:02:35 +0100 oj r264038 : #i96191# fix check for prec 2008-11-20 08:06:32 +0100 oj r264026 : #i90949# patch MID function 2008-11-11 13:14:58 +0100 oj r263555 : #i96086# apply patch 2008-11-11 11:34:46 +0100 oj r263549 : #i94128# correct height of section when controls moved outside 2008-11-11 07:52:08 +0100 oj r263544 : #i94729# fix string with ; as sep 2008-11-11 07:45:27 +0100 oj r263543 : #i95222# export chart title style 2008-11-11 07:43:37 +0100 oj r263542 : #i92541# fix line height
2008-12-10 13:41:25 +00:00
#include <unotools/sharedunocomponent.hxx>
#include <svx/txenctab.hxx>
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
#include <svx/dbcharsethelper.hxx>
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdbc/XDriver.hpp>
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
#include <com/sun/star/sdbc/XDriverAccess.hpp>
#include <com/sun/star/sdbc/XDriverManager.hpp>
#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XRowSet.hpp>
#include <com/sun/star/sdbc/XRowUpdate.hpp>
#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
#include <com/sun/star/sdbcx/XAppend.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
2000-11-03 12:37:05 +00:00
#include <com/sun/star/lang/XComponent.hpp>
2000-11-03 18:27:07 +00:00
#include <com/sun/star/ucb/NameClash.hpp>
#include <com/sun/star/ucb/TransferInfo.hpp>
#include <com/sun/star/ucb/XCommandInfo.hpp>
2000-09-18 16:07:07 +00:00
#include "scerrors.hxx"
#include "docsh.hxx"
#include "filter.hxx"
#include "progress.hxx"
#include "cell.hxx"
#include "editutil.hxx"
#include "cellform.hxx"
#include "dbdocutl.hxx"
#include "dociter.hxx"
2000-09-18 16:07:07 +00:00
#include "globstr.hrc"
#include "svl/zformat.hxx"
#include "svl/intitem.hxx"
#include "patattr.hxx"
#include "scitems.hxx"
#include "docpool.hxx"
#include "segmenttree.hxx"
#include "docparam.hxx"
#include <vector>
#include <boost/unordered_set.hpp>
2000-09-18 16:07:07 +00:00
using namespace com::sun::star;
using ::std::vector;
2000-09-18 16:07:07 +00:00
// -----------------------------------------------------------------------
#define SC_SERVICE_ROWSET "com.sun.star.sdb.RowSet"
#define SC_SERVICE_DRVMAN "com.sun.star.sdbc.DriverManager"
//! move to a header file?
#define SC_DBPROP_ACTIVECONNECTION "ActiveConnection"
#define SC_DBPROP_COMMAND "Command"
#define SC_DBPROP_COMMANDTYPE "CommandType"
#define SC_DBPROP_PROPCHANGE_NOTIFY "PropertyChangeNotificationEnabled"
#define SC_DBPROP_NAME "Name"
#define SC_DBPROP_TYPE "Type"
#define SC_DBPROP_PRECISION "Precision"
#define SC_DBPROP_SCALE "Scale"
#define SC_DBPROP_EXTENSION "Extension"
#define SC_DBPROP_CHARSET "CharSet"
#define SC_ROWCOUNT_ERROR (-1)
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
namespace
{
sal_uLong lcl_getDBaseConnection(uno::Reference<sdbc::XDriverManager>& _rDrvMgr,uno::Reference<sdbc::XConnection>& _rConnection,String& _rTabName,const String& rFullFileName,rtl_TextEncoding eCharSet)
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
{
INetURLObject aURL;
aURL.SetSmartProtocol( INET_PROT_FILE );
aURL.SetSmartURL( rFullFileName );
_rTabName = aURL.getBase( INetURLObject::LAST_SEGMENT, true,
INetURLObject::DECODE_UNAMBIGUOUS );
String aExtension = aURL.getExtension();
aURL.removeSegment();
aURL.removeFinalSlash();
String aPath = aURL.GetMainURL(INetURLObject::NO_DECODE);
uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
if (!xFactory.is()) return SCERR_EXPORT_CONNECT;
_rDrvMgr.set( xFactory->createInstance(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_DRVMAN )) ),
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
uno::UNO_QUERY);
OSL_ENSURE( _rDrvMgr.is(), "can't get DriverManager" );
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if (!_rDrvMgr.is()) return SCERR_EXPORT_CONNECT;
// get connection
String aConnUrl = String::CreateFromAscii("sdbc:dbase:");
aConnUrl += aPath;
svxform::ODataAccessCharsetHelper aHelper;
::std::vector< rtl_TextEncoding > aEncodings;
aHelper.getSupportedTextEncodings( aEncodings );
::std::vector< rtl_TextEncoding >::iterator aIter = ::std::find(aEncodings.begin(),aEncodings.end(),(rtl_TextEncoding) eCharSet);
if ( aIter == aEncodings.end() )
{
OSL_FAIL( "DBaseImport: dbtools::OCharsetMap doesn't know text encoding" );
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
return SCERR_IMPORT_CONNECT;
} // if ( aIter == aMap.end() )
rtl::OUString aCharSetStr;
if ( RTL_TEXTENCODING_DONTKNOW != *aIter )
{ // it's not the virtual "system charset"
const char* pIanaName = rtl_getMimeCharsetFromTextEncoding( *aIter );
OSL_ENSURE( pIanaName, "invalid mime name!" );
if ( pIanaName )
aCharSetStr = ::rtl::OUString::createFromAscii( pIanaName );
}
uno::Sequence<beans::PropertyValue> aProps(2);
aProps[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_EXTENSION));
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
aProps[0].Value <<= rtl::OUString( aExtension );
aProps[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_CHARSET));
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
aProps[1].Value <<= aCharSetStr;
_rConnection = _rDrvMgr->getConnectionWithInfo( aConnUrl, aProps );
return 0L;
}
}
2000-11-03 18:27:07 +00:00
// -----------------------------------------------------------------------
// MoveFile/KillFile/IsDocument: similar to SfxContentHelper
2011-11-15 21:09:53 -05:00
bool ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObject& rDestObj )
2000-11-03 18:27:07 +00:00
{
2011-11-15 21:09:53 -05:00
bool bMoveData = true;
bool bRet = true, bKillSource = false;
2000-11-03 18:27:07 +00:00
if ( rSourceObj.GetProtocol() != rDestObj.GetProtocol() )
{
bMoveData = false;
2011-11-15 21:09:53 -05:00
bKillSource = true;
2000-11-03 18:27:07 +00:00
}
String aName = rDestObj.getName();
INetURLObject aDestPathObj = rDestObj;
aDestPathObj.removeSegment();
aDestPathObj.setFinalSlash();
try
{
::ucbhelper::Content aDestPath( aDestPathObj.GetMainURL(INetURLObject::NO_DECODE),
2000-11-03 18:27:07 +00:00
uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
uno::Reference< ::com::sun::star::ucb::XCommandInfo > xInfo = aDestPath.getCommands();
rtl::OUString aTransferName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "transfer" ));
2000-11-03 18:27:07 +00:00
if ( xInfo->hasCommandByName( aTransferName ) )
{
aDestPath.executeCommand( aTransferName, uno::makeAny(
::com::sun::star::ucb::TransferInfo( bMoveData, rSourceObj.GetMainURL(INetURLObject::NO_DECODE), aName,
2000-11-03 18:27:07 +00:00
::com::sun::star::ucb::NameClash::ERROR ) ) );
}
else
{
OSL_FAIL( "transfer command not available" );
2000-11-03 18:27:07 +00:00
}
}
catch( uno::Exception& )
{
// ucb may throw different exceptions on failure now
bRet = false;
2000-11-03 18:27:07 +00:00
}
if ( bKillSource )
KillFile( rSourceObj );
return bRet;
}
2011-11-15 21:09:53 -05:00
bool ScDocShell::KillFile( const INetURLObject& rURL )
2000-11-03 18:27:07 +00:00
{
2011-11-15 21:09:53 -05:00
bool bRet = true;
2000-11-03 18:27:07 +00:00
try
{
::ucbhelper::Content aCnt( rURL.GetMainURL(INetURLObject::NO_DECODE),
2000-11-03 18:27:07 +00:00
uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
aCnt.executeCommand( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "delete" )),
2000-11-07 10:48:29 +00:00
comphelper::makeBoolAny( sal_True ) );
2000-11-03 18:27:07 +00:00
}
catch( uno::Exception& )
{
// ucb may throw different exceptions on failure now
bRet = false;
2000-11-03 18:27:07 +00:00
}
return bRet;
}
2011-11-15 21:09:53 -05:00
bool ScDocShell::IsDocument( const INetURLObject& rURL )
2000-11-03 18:27:07 +00:00
{
2011-11-15 21:09:53 -05:00
bool bRet = false;
2000-11-03 18:27:07 +00:00
try
{
::ucbhelper::Content aCnt( rURL.GetMainURL(INetURLObject::NO_DECODE),
2000-11-03 18:27:07 +00:00
uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
bRet = aCnt.isDocument();
}
catch( uno::Exception& )
{
// ucb may throw different exceptions on failure now - warning only
OSL_FAIL( "Any other exception" );
2000-11-03 18:27:07 +00:00
}
return bRet;
}
// -----------------------------------------------------------------------
static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales)
{
SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
if (!pFormatter)
return;
SCCOL nColCount = static_cast<SCCOL>(rScales.size());
for (SCCOL i = 0; i < nColCount; ++i)
{
if (rScales[i] < 0)
continue;
sal_uInt32 nOldFormat;
rDoc.GetNumberFormat(static_cast<SCCOL>(i), 0, 0, nOldFormat);
const SvNumberformat* pOldEntry = pFormatter->GetEntry(nOldFormat);
if (!pOldEntry)
continue;
LanguageType eLang = pOldEntry->GetLanguage();
bool bThousand, bNegRed;
sal_uInt16 nPrecision, nLeading;
pOldEntry->GetFormatSpecialInfo(bThousand, bNegRed, nPrecision, nLeading);
nPrecision = static_cast<sal_uInt16>(rScales[i]);
String aNewPicture;
pFormatter->GenerateFormat(aNewPicture, nOldFormat, eLang,
bThousand, bNegRed, nPrecision, nLeading);
sal_uInt32 nNewFormat = pFormatter->GetEntryKey(aNewPicture, eLang);
if (nNewFormat == NUMBERFORMAT_ENTRY_NOT_FOUND)
{
xub_StrLen nErrPos = 0;
short nNewType = 0;
bool bOk = pFormatter->PutEntry(
aNewPicture, nErrPos, nNewType, nNewFormat, eLang);
if (!bOk)
continue;
}
ScPatternAttr aNewAttrs( rDoc.GetPool() );
SfxItemSet& rSet = aNewAttrs.GetItemSet();
rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nNewFormat) );
rDoc.ApplyPatternAreaTab(static_cast<SCCOL>(i), 0, static_cast<SCCOL>(i), MAXROW, 0, aNewAttrs);
}
}
sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
ScColWidthParam aColWidthParam[MAXCOLCOUNT], ScFlatBoolRowSegments& rRowHeightsRecalc )
2000-09-18 16:07:07 +00:00
{
ScColumn::DoubleAllocSwitch aAllocSwitch(true);
sal_uLong nErr = eERR_OK;
long i;
long nColCount = 0;
2000-09-18 16:07:07 +00:00
// Try to get the Text Encoding from the driver
if( eCharSet == RTL_TEXTENCODING_IBM_850 )
eCharSet = RTL_TEXTENCODING_DONTKNOW;
try
2000-09-18 16:07:07 +00:00
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
String aTabName;
uno::Reference<sdbc::XDriverManager> xDrvMan;
uno::Reference<sdbc::XConnection> xConnection;
sal_uLong nRet = lcl_getDBaseConnection(xDrvMan,xConnection,aTabName,rFullFileName,eCharSet);
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if ( !xConnection.is() || !xDrvMan.is() )
return nRet;
::utl::DisposableComponent aConnectionHelper(xConnection);
ScProgress aProgress( this, ScGlobal::GetRscString( STR_LOAD_DOC ), 0 );
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
2000-11-03 12:37:05 +00:00
uno::Reference<sdbc::XRowSet> xRowSet( xFactory->createInstance(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_ROWSET )) ),
2000-11-03 12:37:05 +00:00
uno::UNO_QUERY);
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
::utl::DisposableComponent aRowSetHelper(xRowSet);
2000-11-03 12:37:05 +00:00
uno::Reference<beans::XPropertySet> xRowProp( xRowSet, uno::UNO_QUERY );
OSL_ENSURE( xRowProp.is(), "can't get RowSet" );
2000-11-03 12:37:05 +00:00
if (!xRowProp.is()) return SCERR_IMPORT_CONNECT;
2000-11-03 12:37:05 +00:00
sal_Int32 nType = sdb::CommandType::TABLE;
uno::Any aAny;
2000-11-03 12:37:05 +00:00
aAny <<= xConnection;
xRowProp->setPropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_ACTIVECONNECTION)), aAny );
2000-11-03 12:37:05 +00:00
aAny <<= nType;
xRowProp->setPropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMANDTYPE)), aAny );
2000-11-03 12:37:05 +00:00
aAny <<= rtl::OUString( aTabName );
xRowProp->setPropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMAND)), aAny );
aAny <<= false;
xRowProp->setPropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_PROPCHANGE_NOTIFY)), aAny );
2000-11-03 12:37:05 +00:00
xRowSet->execute();
uno::Reference<sdbc::XResultSetMetaData> xMeta;
2000-11-03 12:37:05 +00:00
uno::Reference<sdbc::XResultSetMetaDataSupplier> xMetaSupp( xRowSet, uno::UNO_QUERY );
if ( xMetaSupp.is() )
xMeta = xMetaSupp->getMetaData();
if ( xMeta.is() )
nColCount = xMeta->getColumnCount(); // this is the number of real columns
if ( nColCount > MAXCOL+1 )
{
nColCount = MAXCOL+1;
nErr = SCWARN_IMPORT_COLUMN_OVERFLOW; // warning
}
2000-11-03 12:37:05 +00:00
uno::Reference<sdbc::XRow> xRow( xRowSet, uno::UNO_QUERY );
OSL_ENSURE( xRow.is(), "can't get Row" );
if (!xRow.is()) return SCERR_IMPORT_CONNECT;
// currency flag is not needed for dBase
uno::Sequence<sal_Int32> aColTypes( nColCount ); // column types
sal_Int32* pTypeArr = aColTypes.getArray();
for (i=0; i<nColCount; i++)
pTypeArr[i] = xMeta->getColumnType( i+1 );
// read column names
//! add type descriptions
aProgress.SetState( 0 );
ScColumn::bDoubleAlloc = true; // row count isn't readily available in advance
vector<long> aScales(nColCount, -1);
for (i=0; i<nColCount; i++)
{
String aHeader = xMeta->getColumnLabel( i+1 );
switch ( pTypeArr[i] )
{
case sdbc::DataType::BIT:
aHeader.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ",L" ));
break;
case sdbc::DataType::DATE:
aHeader.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ",D" ));
break;
case sdbc::DataType::LONGVARCHAR:
aHeader.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ",M" ));
break;
case sdbc::DataType::VARCHAR:
aHeader.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ",C," ));
aHeader += String::CreateFromInt32( xMeta->getColumnDisplaySize( i+1 ) );
break;
case sdbc::DataType::DECIMAL:
{
long nPrec = xMeta->getPrecision( i+1 );
long nScale = xMeta->getScale( i+1 );
aHeader.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ",N," ));
aHeader += String::CreateFromInt32(
SvDbaseConverter::ConvertPrecisionToDbase(
nPrec, nScale ) );
aHeader += ',';
aHeader += String::CreateFromInt32( nScale );
aScales[i] = nScale;
}
break;
}
aDocument.SetString( static_cast<SCCOL>(i), 0, 0, aHeader );
}
lcl_setScalesToColumns(aDocument, aScales);
SCROW nRow = 1; // 0 is column titles
sal_Bool bEnd = false;
2000-11-03 12:37:05 +00:00
while ( !bEnd && xRowSet->next() )
{
bool bSimpleRow = true;
if ( nRow <= MAXROW )
{
SCCOL nCol = 0;
for (i=0; i<nColCount; i++)
{
ScDatabaseDocUtil::StrData aStrData;
ScDatabaseDocUtil::PutData( &aDocument, nCol, nRow, 0,
xRow, i+1, pTypeArr[i], false,
&aStrData );
if (aStrData.mnStrLength > aColWidthParam[nCol].mnMaxTextLen)
{
aColWidthParam[nCol].mnMaxTextLen = aStrData.mnStrLength;
aColWidthParam[nCol].mnMaxTextRow = nRow;
}
if (!aStrData.mbSimpleText)
{
bSimpleRow = false;
aColWidthParam[nCol].mbSimpleText = false;
}
++nCol;
}
if (!bSimpleRow)
rRowHeightsRecalc.setTrue(nRow, nRow);
++nRow;
}
else // past the end of the spreadsheet
2000-09-18 16:07:07 +00:00
{
bEnd = sal_True; // don't continue
nErr = SCWARN_IMPORT_RANGE_OVERFLOW; // warning message
2000-09-18 16:07:07 +00:00
}
}
}
catch ( sdbc::SQLException& )
{
nErr = SCERR_IMPORT_CONNECT;
}
catch ( uno::Exception& )
{
2011-03-01 19:05:02 +01:00
OSL_FAIL("Unexpected exception in database");
nErr = ERRCODE_IO_GENERAL;
}
ScColumn::bDoubleAlloc = false;
if ( nColCount > 0 )
aDocument.DoColResize( 0, 0, static_cast<SCCOL>(nColCount) - 1, 0 );
return nErr;
}
namespace {
inline bool IsAsciiDigit( sal_Unicode c )
{
return 0x30 <= c && c <= 0x39;
}
inline bool IsAsciiAlpha( sal_Unicode c )
{
return (0x41 <= c && c <= 0x5a) || (0x61 <= c && c <= 0x7a);
}
void lcl_GetColumnTypes(
ScDocShell& rDocShell, const ScRange& rDataRange, bool bHasFieldNames,
rtl::OUString* pColNames, sal_Int32* pColTypes, sal_Int32* pColLengths,
sal_Int32* pColScales, bool& bHasMemo, CharSet eCharSet )
{
// updating of column titles didn't work in 5.2 and isn't always wanted
// (saving normally shouldn't modify the document)
//! read flag from configuration
bool bUpdateTitles = false;
ScDocument* pDoc = rDocShell.GetDocument();
SvNumberFormatter* pNumFmt = pDoc->GetFormatTable();
SCTAB nTab = rDataRange.aStart.Tab();
SCCOL nFirstCol = rDataRange.aStart.Col();
SCROW nFirstRow = rDataRange.aStart.Row();
SCCOL nLastCol = rDataRange.aEnd.Col();
SCROW nLastRow = rDataRange.aEnd.Row();
typedef boost::unordered_set<rtl::OUString, rtl::OUStringHash> StrSetType;
StrSetType aFieldNames;
long nField = 0;
SCROW nFirstDataRow = ( bHasFieldNames ? nFirstRow + 1 : nFirstRow );
for ( SCCOL nCol = nFirstCol; nCol <= nLastCol; nCol++ )
{
bool bTypeDefined = false;
bool bPrecDefined = false;
sal_Int32 nFieldLen = 0;
sal_Int32 nPrecision = 0;
sal_Int32 nDbType = sdbc::DataType::SQLNULL;
String aFieldName, aString;
// Feldname[,Type[,Width[,Prec]]]
// Typ etc.: L; D; C[,W]; N[,W[,P]]
if ( bHasFieldNames )
{
pDoc->GetString( nCol, nFirstRow, nTab, aString );
aString.ToUpperAscii();
xub_StrLen nToken = comphelper::string::getTokenCount(aString, ',');
if ( nToken > 1 )
2000-09-18 16:07:07 +00:00
{
aFieldName = aString.GetToken( 0, ',' );
2011-11-18 21:03:31 +00:00
aString = comphelper::string::remove(aString, ' ');
switch ( aString.GetToken( 1, ',' ).GetChar(0) )
2000-09-18 16:07:07 +00:00
{
case 'L' :
nDbType = sdbc::DataType::BIT;
nFieldLen = 1;
bTypeDefined = sal_True;
bPrecDefined = sal_True;
2000-09-18 16:07:07 +00:00
break;
case 'D' :
nDbType = sdbc::DataType::DATE;
nFieldLen = 8;
bTypeDefined = sal_True;
bPrecDefined = sal_True;
2000-09-18 16:07:07 +00:00
break;
case 'M' :
nDbType = sdbc::DataType::LONGVARCHAR;
nFieldLen = 10;
bTypeDefined = sal_True;
bPrecDefined = sal_True;
bHasMemo = sal_True;
2000-09-18 16:07:07 +00:00
break;
case 'C' :
nDbType = sdbc::DataType::VARCHAR;
bTypeDefined = sal_True;
bPrecDefined = sal_True;
2000-09-18 16:07:07 +00:00
break;
case 'N' :
nDbType = sdbc::DataType::DECIMAL;
2000-09-18 16:07:07 +00:00
break;
}
if ( bTypeDefined && !nFieldLen && nToken > 2 )
2000-09-18 16:07:07 +00:00
{
nFieldLen = aString.GetToken( 2, ',' ).ToInt32();
if ( !bPrecDefined && nToken > 3 )
{
String aTmp( aString.GetToken( 3, ',' ) );
if ( CharClass::isAsciiNumeric(aTmp) )
{
nPrecision = aTmp.ToInt32();
bPrecDefined = sal_True;
}
}
2000-09-18 16:07:07 +00:00
}
}
else
aFieldName = aString;
2000-09-18 16:07:07 +00:00
// Feldnamen pruefen und ggbf. gueltigen Feldnamen erzeugen.
// Erstes Zeichen muss Buchstabe sein,
// weitere nur alphanumerisch und Unterstrich erlaubt,
// "_DBASELOCK" ist reserviert (obsolet weil erstes Zeichen kein Buchstabe),
// keine doppelten Namen.
if ( !IsAsciiAlpha( aFieldName.GetChar(0) ) )
aFieldName.Insert( 'N', 0 );
String aTmpStr;
sal_Unicode c;
for ( const sal_Unicode* p = aFieldName.GetBuffer(); ( c = *p ) != 0; p++ )
2000-09-18 16:07:07 +00:00
{
if ( IsAsciiAlpha( c ) || IsAsciiDigit( c ) || c == '_' )
aTmpStr += c;
else
aTmpStr += '_';
}
aFieldName = aTmpStr;
if ( aFieldName.Len() > 10 )
aFieldName.Erase( 10 );
if (!aFieldNames.insert(aFieldName).second)
{ // doppelter Feldname, numerisch erweitern
sal_uInt16 nSub = 1;
String aFixPart( aFieldName );
do
2000-09-18 16:07:07 +00:00
{
++nSub;
String aVarPart = String::CreateFromInt32( nSub );
if ( aFixPart.Len() + aVarPart.Len() > 10 )
aFixPart.Erase( 10 - aVarPart.Len() );
aFieldName = aFixPart;
aFieldName += aVarPart;
} while (!aFieldNames.insert(aFieldName).second);
}
}
else
{
aFieldName = 'N';
aFieldName += String::CreateFromInt32(nCol+1);
}
2000-09-18 16:07:07 +00:00
if ( !bTypeDefined )
{ // Feldtyp
ScBaseCell* pCell;
pDoc->GetCell( nCol, nFirstDataRow, nTab, pCell );
if ( !pCell || pCell->HasStringData() )
nDbType = sdbc::DataType::VARCHAR;
else
{
sal_uInt32 nFormat;
pDoc->GetNumberFormat( nCol, nFirstDataRow, nTab, nFormat );
if ( pCell && pCell->GetCellType() == CELLTYPE_FORMULA
&& ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0) )
{
nFormat = ScGlobal::GetStandardFormat(
((ScFormulaCell*)pCell)->GetValue(), *pNumFmt, nFormat,
((ScFormulaCell*)pCell)->GetFormatType() );
}
switch ( pNumFmt->GetType( nFormat ) )
2000-09-18 16:07:07 +00:00
{
case NUMBERFORMAT_LOGICAL :
nDbType = sdbc::DataType::BIT;
nFieldLen = 1;
break;
case NUMBERFORMAT_DATE :
nDbType = sdbc::DataType::DATE;
nFieldLen = 8;
break;
case NUMBERFORMAT_TIME :
case NUMBERFORMAT_DATETIME :
nDbType = sdbc::DataType::VARCHAR;
break;
default:
nDbType = sdbc::DataType::DECIMAL;
}
}
}
bool bSdbLenAdjusted = false;
bool bSdbLenBad = false;
// Feldlaenge
if ( nDbType == sdbc::DataType::VARCHAR && !nFieldLen )
{ // maximale Feldbreite bestimmen
nFieldLen = pDoc->GetMaxStringLen( nTab, nCol, nFirstDataRow,
nLastRow, eCharSet );
if ( nFieldLen == 0 )
nFieldLen = 1;
}
else if ( nDbType == sdbc::DataType::DECIMAL )
{ // maximale Feldbreite und Nachkommastellen bestimmen
xub_StrLen nLen;
sal_uInt16 nPrec;
nLen = pDoc->GetMaxNumberStringLen( nPrec, nTab, nCol,
nFirstDataRow, nLastRow );
// dBaseIII Limit Nachkommastellen: 15
if ( nPrecision > 15 )
nPrecision = 15;
if ( nPrec > 15 )
nPrec = 15;
if ( bPrecDefined && nPrecision != nPrec )
{ // Laenge auf vorgegebene Nachkommastellen anpassen
if ( nPrecision )
nLen = sal::static_int_cast<xub_StrLen>( nLen + ( nPrecision - nPrec ) );
else
nLen -= nPrec+1; // auch den . mit raus
}
CWS-TOOLING: integrate CWS dba31f 2008-12-10 14:16:09 +0100 oj r265185 : #i96658# remove is 2008-12-10 08:46:07 +0100 oj r265147 : remove duplicate ids 2008-12-10 08:35:02 +0100 oj r265146 : #i96658# remove is 2008-12-09 11:44:35 +0100 oj r265072 : use of tools::StringresourceList 2008-12-09 11:43:41 +0100 oj r265071 : new class to read string elements from a Resource 2008-12-09 11:41:56 +0100 oj r265070 : export StringListResource 2008-12-09 11:38:17 +0100 oj r265068 : change string ; to more string objects 2008-12-08 12:11:43 +0100 oj r264985 : change default-license-id to lic-en-US 2008-12-05 12:06:09 +0100 oj r264896 : disable check to uncheck 2008-12-04 08:58:50 +0100 oj r264814 : #i96517,i96520,i96522# d&d, background, state fixed 2008-12-04 08:53:29 +0100 oj r264813 : #i96434# use document ui name from filter 2008-12-04 08:41:06 +0100 oj r264812 : #i96434# use document ui name from filter 2008-12-02 13:48:49 +0100 lla r264697 : #i96526# extra string for default otr wasn't found 2008-11-28 11:46:31 +0100 oj r264536 : move toolbar and resize add field dlg 2008-11-28 08:38:22 +0100 oj r264526 : load string resources 2008-11-27 19:28:52 +0100 oj r264520 : unsigned 2008-11-27 19:10:19 +0100 oj r264517 : move class into unnamed namespace 2008-11-27 18:33:38 +0100 oj r264514 : wrong param 2008-11-27 16:52:39 +0100 oj r264510 : #i96622# wrong string replacement 2008-11-27 16:46:03 +0100 oj r264509 : remove unused var 2008-11-27 13:37:16 +0100 oj r264484 : #i96432# notify only when not in special mode of the page 2008-11-27 13:16:47 +0100 oj r264479 : #i95224# accept alias in group by 2008-11-27 12:35:19 +0100 oj r264477 : #i95416# always show localized strings in the start marker 2008-11-27 09:49:29 +0100 oj r264455 : #i93460# set split pos 2008-11-27 09:05:27 +0100 oj r264447 : #i96453# use extension from mimetype / mediatype 2008-11-26 16:24:43 +0100 oj r264416 : #i96520# #i96522# #i96519# some changes at the add field dialog 2008-11-26 16:20:27 +0100 oj r264414 : #i93420# prevent to register a none system file url 2008-11-26 16:19:02 +0100 oj r264413 : #i96522# new class to paste multiple objects 2008-11-26 10:06:12 +0100 oj r264349 : #i96191# introduce new error message and check if type was defined aand should not be changed 2008-11-26 10:06:12 +0100 oj r264348 : #i96191# throw error when decimal is to big 2008-11-25 12:08:59 +0100 oj r264281 : #i96431# correct state for align and move 2008-11-25 11:54:47 +0100 oj r264280 : #i96428# when new bind to first table 2008-11-25 11:49:55 +0100 oj r264279 : #i96434# add report output format to inspection 2008-11-25 11:49:05 +0100 oj r264278 : #i96434# add report output format to inspection 2008-11-24 10:46:23 +0100 oj r264215 : #i96458# size width for controls 2008-11-24 09:28:56 +0100 oj r264199 : #i96459# mark detail section when nothing is selected 2008-11-20 12:02:35 +0100 oj r264038 : #i96191# fix check for prec 2008-11-20 08:06:32 +0100 oj r264026 : #i90949# patch MID function 2008-11-11 13:14:58 +0100 oj r263555 : #i96086# apply patch 2008-11-11 11:34:46 +0100 oj r263549 : #i94128# correct height of section when controls moved outside 2008-11-11 07:52:08 +0100 oj r263544 : #i94729# fix string with ; as sep 2008-11-11 07:45:27 +0100 oj r263543 : #i95222# export chart title style 2008-11-11 07:43:37 +0100 oj r263542 : #i92541# fix line height
2008-12-10 13:41:25 +00:00
if ( nLen > nFieldLen && !bTypeDefined )
nFieldLen = nLen;
if ( !bPrecDefined )
nPrecision = nPrec;
if ( nFieldLen == 0 )
nFieldLen = 1;
else if ( nFieldLen > 19 )
nFieldLen = 19; // dBaseIII Limit Feldlaenge numerisch: 19
if ( nPrecision && nFieldLen < nPrecision + 2 )
nFieldLen = nPrecision + 2; // 0. muss mit reinpassen
// 538 MUST: Sdb internal representation adds 2 to the field length!
// To give the user what he wants we must substract it here.
//! CAVEAT! There is no way to define a numeric field with a length
//! of 1 and no decimals!
if ( nFieldLen == 1 && nPrecision == 0 )
bSdbLenBad = sal_True;
nFieldLen = SvDbaseConverter::ConvertPrecisionToOdbc( nFieldLen, nPrecision );
bSdbLenAdjusted = sal_True;
}
if ( nFieldLen > 254 )
{
if ( nDbType == sdbc::DataType::VARCHAR )
{ // zu lang fuer normales Textfeld => Memofeld
nDbType = sdbc::DataType::LONGVARCHAR;
nFieldLen = 10;
bHasMemo = sal_True;
}
else
nFieldLen = 254; // dumm gelaufen..
}
2000-09-18 16:07:07 +00:00
pColNames[nField] = aFieldName;
pColTypes[nField] = nDbType;
pColLengths[nField] = nFieldLen;
pColScales[nField] = nPrecision;
2000-09-18 16:07:07 +00:00
// undo change to field length, reflect reality
if ( bSdbLenAdjusted )
{
nFieldLen = SvDbaseConverter::ConvertPrecisionToDbase( nFieldLen, nPrecision );
if ( bSdbLenBad && nFieldLen == 1 )
nFieldLen = 2; // THIS is reality
}
if ( bUpdateTitles )
{ // Angabe anpassen und ausgeben
String aOutString = aFieldName;
switch ( nDbType )
{
case sdbc::DataType::BIT :
aOutString.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ",L" ));
break;
case sdbc::DataType::DATE :
aOutString.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ",D" ));
break;
case sdbc::DataType::LONGVARCHAR :
aOutString.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ",M" ));
break;
case sdbc::DataType::VARCHAR :
aOutString.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ",C," ));
aOutString += String::CreateFromInt32( nFieldLen );
break;
case sdbc::DataType::DECIMAL :
aOutString.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ",N," ));
aOutString += String::CreateFromInt32( nFieldLen );
aOutString += ',';
aOutString += String::CreateFromInt32( nPrecision );
break;
}
if ( !aOutString.EqualsIgnoreCaseAscii( aString ) )
{
pDoc->SetString( nCol, nFirstRow, nTab, aOutString );
rDocShell.PostPaint( nCol, nFirstRow, nTab, nCol, nFirstRow, nTab, PAINT_GRID );
2000-09-18 16:07:07 +00:00
}
}
++nField;
}
}
inline void lcl_getLongVarCharEditString( rtl::OUString& rString,
const ScBaseCell* pCell, ScFieldEditEngine& rEditEngine )
{
rEditEngine.SetText( *((const ScEditCell*)pCell)->GetData() );
rString = rEditEngine.GetText( LINEEND_CRLF );
}
inline void lcl_getLongVarCharString( rtl::OUString& rString, ScBaseCell* pCell,
ScDocument& rDocument, SCCOL nCol, SCROW nRow, SCTAB nTab,
SvNumberFormatter& rNumFmt )
{
sal_uInt32 nFormat;
Color* pColor;
rDocument.GetNumberFormat( nCol, nRow, nTab, nFormat );
ScCellFormat::GetString( pCell, nFormat, rString, &pColor, rNumFmt );
}
}
sal_uLong ScDocShell::DBaseExport( const rtl::OUString& rFullFileName, CharSet eCharSet, bool& bHasMemo )
{
2000-11-03 18:27:07 +00:00
// remove the file so the dBase driver doesn't find an invalid file
INetURLObject aDeleteObj( rFullFileName, INET_PROT_FILE );
KillFile( aDeleteObj );
sal_uLong nErr = eERR_OK;
uno::Any aAny;
SCCOL nFirstCol, nLastCol;
SCROW nFirstRow, nLastRow;
SCTAB nTab = GetSaveTab();
aDocument.GetDataStart( nTab, nFirstCol, nFirstRow );
aDocument.GetCellArea( nTab, nLastCol, nLastRow );
if ( nFirstCol > nLastCol )
nFirstCol = nLastCol;
if ( nFirstRow > nLastRow )
nFirstRow = nLastRow;
ScProgress aProgress( this, ScGlobal::GetRscString( STR_SAVE_DOC ),
nLastRow - nFirstRow );
SvNumberFormatter* pNumFmt = aDocument.GetFormatTable();
sal_Bool bHasFieldNames = sal_True;
for ( SCCOL nDocCol = nFirstCol; nDocCol <= nLastCol && bHasFieldNames; nDocCol++ )
{ // nur Strings in erster Zeile => sind Feldnamen
if ( !aDocument.HasStringData( nDocCol, nFirstRow, nTab ) )
bHasFieldNames = false;
}
long nColCount = nLastCol - nFirstCol + 1;
uno::Sequence<rtl::OUString> aColNames( nColCount );
uno::Sequence<sal_Int32> aColTypes( nColCount );
uno::Sequence<sal_Int32> aColLengths( nColCount );
uno::Sequence<sal_Int32> aColScales( nColCount );
ScRange aDataRange( nFirstCol, nFirstRow, nTab, nLastCol, nLastRow, nTab );
lcl_GetColumnTypes( *this, aDataRange, bHasFieldNames,
aColNames.getArray(), aColTypes.getArray(),
aColLengths.getArray(), aColScales.getArray(),
bHasMemo, eCharSet );
// also needed for exception catch
SCROW nDocRow = 0;
ScFieldEditEngine aEditEngine( aDocument.GetEditPool() );
rtl::OUString aString;
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
String aTabName;
2000-10-27 18:03:06 +00:00
try
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
uno::Reference<sdbc::XDriverManager> xDrvMan;
uno::Reference<sdbc::XConnection> xConnection;
sal_uLong nRet = lcl_getDBaseConnection(xDrvMan,xConnection,aTabName,rFullFileName,eCharSet);
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if ( !xConnection.is() || !xDrvMan.is() )
return nRet;
CWS-TOOLING: integrate CWS dba31f 2008-12-10 14:16:09 +0100 oj r265185 : #i96658# remove is 2008-12-10 08:46:07 +0100 oj r265147 : remove duplicate ids 2008-12-10 08:35:02 +0100 oj r265146 : #i96658# remove is 2008-12-09 11:44:35 +0100 oj r265072 : use of tools::StringresourceList 2008-12-09 11:43:41 +0100 oj r265071 : new class to read string elements from a Resource 2008-12-09 11:41:56 +0100 oj r265070 : export StringListResource 2008-12-09 11:38:17 +0100 oj r265068 : change string ; to more string objects 2008-12-08 12:11:43 +0100 oj r264985 : change default-license-id to lic-en-US 2008-12-05 12:06:09 +0100 oj r264896 : disable check to uncheck 2008-12-04 08:58:50 +0100 oj r264814 : #i96517,i96520,i96522# d&d, background, state fixed 2008-12-04 08:53:29 +0100 oj r264813 : #i96434# use document ui name from filter 2008-12-04 08:41:06 +0100 oj r264812 : #i96434# use document ui name from filter 2008-12-02 13:48:49 +0100 lla r264697 : #i96526# extra string for default otr wasn't found 2008-11-28 11:46:31 +0100 oj r264536 : move toolbar and resize add field dlg 2008-11-28 08:38:22 +0100 oj r264526 : load string resources 2008-11-27 19:28:52 +0100 oj r264520 : unsigned 2008-11-27 19:10:19 +0100 oj r264517 : move class into unnamed namespace 2008-11-27 18:33:38 +0100 oj r264514 : wrong param 2008-11-27 16:52:39 +0100 oj r264510 : #i96622# wrong string replacement 2008-11-27 16:46:03 +0100 oj r264509 : remove unused var 2008-11-27 13:37:16 +0100 oj r264484 : #i96432# notify only when not in special mode of the page 2008-11-27 13:16:47 +0100 oj r264479 : #i95224# accept alias in group by 2008-11-27 12:35:19 +0100 oj r264477 : #i95416# always show localized strings in the start marker 2008-11-27 09:49:29 +0100 oj r264455 : #i93460# set split pos 2008-11-27 09:05:27 +0100 oj r264447 : #i96453# use extension from mimetype / mediatype 2008-11-26 16:24:43 +0100 oj r264416 : #i96520# #i96522# #i96519# some changes at the add field dialog 2008-11-26 16:20:27 +0100 oj r264414 : #i93420# prevent to register a none system file url 2008-11-26 16:19:02 +0100 oj r264413 : #i96522# new class to paste multiple objects 2008-11-26 10:06:12 +0100 oj r264349 : #i96191# introduce new error message and check if type was defined aand should not be changed 2008-11-26 10:06:12 +0100 oj r264348 : #i96191# throw error when decimal is to big 2008-11-25 12:08:59 +0100 oj r264281 : #i96431# correct state for align and move 2008-11-25 11:54:47 +0100 oj r264280 : #i96428# when new bind to first table 2008-11-25 11:49:55 +0100 oj r264279 : #i96434# add report output format to inspection 2008-11-25 11:49:05 +0100 oj r264278 : #i96434# add report output format to inspection 2008-11-24 10:46:23 +0100 oj r264215 : #i96458# size width for controls 2008-11-24 09:28:56 +0100 oj r264199 : #i96459# mark detail section when nothing is selected 2008-11-20 12:02:35 +0100 oj r264038 : #i96191# fix check for prec 2008-11-20 08:06:32 +0100 oj r264026 : #i90949# patch MID function 2008-11-11 13:14:58 +0100 oj r263555 : #i96086# apply patch 2008-11-11 11:34:46 +0100 oj r263549 : #i94128# correct height of section when controls moved outside 2008-11-11 07:52:08 +0100 oj r263544 : #i94729# fix string with ; as sep 2008-11-11 07:45:27 +0100 oj r263543 : #i95222# export chart title style 2008-11-11 07:43:37 +0100 oj r263542 : #i92541# fix line height
2008-12-10 13:41:25 +00:00
::utl::DisposableComponent aConnectionHelper(xConnection);
2000-10-27 18:03:06 +00:00
// get dBase driver
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
uno::Reference< sdbc::XDriverAccess> xAccess(xDrvMan,uno::UNO_QUERY);
uno::Reference< sdbcx::XDataDefinitionSupplier > xDDSup( xAccess->getDriverByURL( xConnection->getMetaData()->getURL() ), uno::UNO_QUERY );
if ( !xDDSup.is() )
return SCERR_EXPORT_CONNECT;
2000-10-27 18:03:06 +00:00
// create table
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
uno::Reference<sdbcx::XTablesSupplier> xTablesSupp =xDDSup->getDataDefinitionByConnection( xConnection );
OSL_ENSURE( xTablesSupp.is(), "can't get Data Definition" );
2000-10-27 18:03:06 +00:00
if (!xTablesSupp.is()) return SCERR_EXPORT_CONNECT;
2000-10-27 18:03:06 +00:00
uno::Reference<container::XNameAccess> xTables = xTablesSupp->getTables();
OSL_ENSURE( xTables.is(), "can't get Tables" );
2000-10-27 18:03:06 +00:00
if (!xTables.is()) return SCERR_EXPORT_CONNECT;
2000-10-27 18:03:06 +00:00
uno::Reference<sdbcx::XDataDescriptorFactory> xTablesFact( xTables, uno::UNO_QUERY );
OSL_ENSURE( xTablesFact.is(), "can't get tables factory" );
2000-10-27 18:03:06 +00:00
if (!xTablesFact.is()) return SCERR_EXPORT_CONNECT;
2000-10-27 18:03:06 +00:00
uno::Reference<sdbcx::XAppend> xTablesAppend( xTables, uno::UNO_QUERY );
OSL_ENSURE( xTablesAppend.is(), "can't get tables XAppend" );
2000-10-27 18:03:06 +00:00
if (!xTablesAppend.is()) return SCERR_EXPORT_CONNECT;
2000-10-27 18:03:06 +00:00
uno::Reference<beans::XPropertySet> xTableDesc = xTablesFact->createDataDescriptor();
OSL_ENSURE( xTableDesc.is(), "can't get table descriptor" );
2000-10-27 18:03:06 +00:00
if (!xTableDesc.is()) return SCERR_EXPORT_CONNECT;
2000-10-27 18:03:06 +00:00
aAny <<= rtl::OUString( aTabName );
xTableDesc->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_NAME)), aAny );
2000-10-27 18:03:06 +00:00
// create columns
2000-10-27 18:03:06 +00:00
uno::Reference<sdbcx::XColumnsSupplier> xColumnsSupp( xTableDesc, uno::UNO_QUERY );
OSL_ENSURE( xColumnsSupp.is(), "can't get columns supplier" );
2000-10-27 18:03:06 +00:00
if (!xColumnsSupp.is()) return SCERR_EXPORT_CONNECT;
2000-10-27 18:03:06 +00:00
uno::Reference<container::XNameAccess> xColumns = xColumnsSupp->getColumns();
OSL_ENSURE( xColumns.is(), "can't get columns" );
2000-10-27 18:03:06 +00:00
if (!xColumns.is()) return SCERR_EXPORT_CONNECT;
2000-10-27 18:03:06 +00:00
uno::Reference<sdbcx::XDataDescriptorFactory> xColumnsFact( xColumns, uno::UNO_QUERY );
OSL_ENSURE( xColumnsFact.is(), "can't get columns factory" );
2000-10-27 18:03:06 +00:00
if (!xColumnsFact.is()) return SCERR_EXPORT_CONNECT;
2000-10-27 18:03:06 +00:00
uno::Reference<sdbcx::XAppend> xColumnsAppend( xColumns, uno::UNO_QUERY );
OSL_ENSURE( xColumnsAppend.is(), "can't get columns XAppend" );
2000-10-27 18:03:06 +00:00
if (!xColumnsAppend.is()) return SCERR_EXPORT_CONNECT;
2000-10-27 18:03:06 +00:00
const rtl::OUString* pColNames = aColNames.getConstArray();
const sal_Int32* pColTypes = aColTypes.getConstArray();
const sal_Int32* pColLengths = aColLengths.getConstArray();
const sal_Int32* pColScales = aColScales.getConstArray();
long nCol;
2000-10-27 18:03:06 +00:00
for (nCol=0; nCol<nColCount; nCol++)
{
uno::Reference<beans::XPropertySet> xColumnDesc = xColumnsFact->createDataDescriptor();
OSL_ENSURE( xColumnDesc.is(), "can't get column descriptor" );
2000-10-27 18:03:06 +00:00
if (!xColumnDesc.is()) return SCERR_EXPORT_CONNECT;
2000-10-27 18:03:06 +00:00
aAny <<= pColNames[nCol];
xColumnDesc->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_NAME)), aAny );
2000-10-27 18:03:06 +00:00
aAny <<= pColTypes[nCol];
xColumnDesc->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_TYPE)), aAny );
2000-10-27 18:03:06 +00:00
aAny <<= pColLengths[nCol];
xColumnDesc->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_PRECISION)), aAny );
2000-10-27 18:03:06 +00:00
aAny <<= pColScales[nCol];
xColumnDesc->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_SCALE)), aAny );
2000-10-27 18:03:06 +00:00
xColumnsAppend->appendByDescriptor( xColumnDesc );
}
2000-10-27 18:03:06 +00:00
xTablesAppend->appendByDescriptor( xTableDesc );
2000-10-27 18:03:06 +00:00
// get row set for writing
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
2000-10-27 18:03:06 +00:00
uno::Reference<sdbc::XRowSet> xRowSet( xFactory->createInstance(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_ROWSET )) ),
2000-10-27 18:03:06 +00:00
uno::UNO_QUERY);
CWS-TOOLING: integrate CWS dba31f 2008-12-10 14:16:09 +0100 oj r265185 : #i96658# remove is 2008-12-10 08:46:07 +0100 oj r265147 : remove duplicate ids 2008-12-10 08:35:02 +0100 oj r265146 : #i96658# remove is 2008-12-09 11:44:35 +0100 oj r265072 : use of tools::StringresourceList 2008-12-09 11:43:41 +0100 oj r265071 : new class to read string elements from a Resource 2008-12-09 11:41:56 +0100 oj r265070 : export StringListResource 2008-12-09 11:38:17 +0100 oj r265068 : change string ; to more string objects 2008-12-08 12:11:43 +0100 oj r264985 : change default-license-id to lic-en-US 2008-12-05 12:06:09 +0100 oj r264896 : disable check to uncheck 2008-12-04 08:58:50 +0100 oj r264814 : #i96517,i96520,i96522# d&d, background, state fixed 2008-12-04 08:53:29 +0100 oj r264813 : #i96434# use document ui name from filter 2008-12-04 08:41:06 +0100 oj r264812 : #i96434# use document ui name from filter 2008-12-02 13:48:49 +0100 lla r264697 : #i96526# extra string for default otr wasn't found 2008-11-28 11:46:31 +0100 oj r264536 : move toolbar and resize add field dlg 2008-11-28 08:38:22 +0100 oj r264526 : load string resources 2008-11-27 19:28:52 +0100 oj r264520 : unsigned 2008-11-27 19:10:19 +0100 oj r264517 : move class into unnamed namespace 2008-11-27 18:33:38 +0100 oj r264514 : wrong param 2008-11-27 16:52:39 +0100 oj r264510 : #i96622# wrong string replacement 2008-11-27 16:46:03 +0100 oj r264509 : remove unused var 2008-11-27 13:37:16 +0100 oj r264484 : #i96432# notify only when not in special mode of the page 2008-11-27 13:16:47 +0100 oj r264479 : #i95224# accept alias in group by 2008-11-27 12:35:19 +0100 oj r264477 : #i95416# always show localized strings in the start marker 2008-11-27 09:49:29 +0100 oj r264455 : #i93460# set split pos 2008-11-27 09:05:27 +0100 oj r264447 : #i96453# use extension from mimetype / mediatype 2008-11-26 16:24:43 +0100 oj r264416 : #i96520# #i96522# #i96519# some changes at the add field dialog 2008-11-26 16:20:27 +0100 oj r264414 : #i93420# prevent to register a none system file url 2008-11-26 16:19:02 +0100 oj r264413 : #i96522# new class to paste multiple objects 2008-11-26 10:06:12 +0100 oj r264349 : #i96191# introduce new error message and check if type was defined aand should not be changed 2008-11-26 10:06:12 +0100 oj r264348 : #i96191# throw error when decimal is to big 2008-11-25 12:08:59 +0100 oj r264281 : #i96431# correct state for align and move 2008-11-25 11:54:47 +0100 oj r264280 : #i96428# when new bind to first table 2008-11-25 11:49:55 +0100 oj r264279 : #i96434# add report output format to inspection 2008-11-25 11:49:05 +0100 oj r264278 : #i96434# add report output format to inspection 2008-11-24 10:46:23 +0100 oj r264215 : #i96458# size width for controls 2008-11-24 09:28:56 +0100 oj r264199 : #i96459# mark detail section when nothing is selected 2008-11-20 12:02:35 +0100 oj r264038 : #i96191# fix check for prec 2008-11-20 08:06:32 +0100 oj r264026 : #i90949# patch MID function 2008-11-11 13:14:58 +0100 oj r263555 : #i96086# apply patch 2008-11-11 11:34:46 +0100 oj r263549 : #i94128# correct height of section when controls moved outside 2008-11-11 07:52:08 +0100 oj r263544 : #i94729# fix string with ; as sep 2008-11-11 07:45:27 +0100 oj r263543 : #i95222# export chart title style 2008-11-11 07:43:37 +0100 oj r263542 : #i92541# fix line height
2008-12-10 13:41:25 +00:00
::utl::DisposableComponent aRowSetHelper(xRowSet);
2000-10-27 18:03:06 +00:00
uno::Reference<beans::XPropertySet> xRowProp( xRowSet, uno::UNO_QUERY );
OSL_ENSURE( xRowProp.is(), "can't get RowSet" );
2000-10-27 18:03:06 +00:00
if (!xRowProp.is()) return SCERR_EXPORT_CONNECT;
2000-10-27 18:03:06 +00:00
aAny <<= xConnection;
xRowProp->setPropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_ACTIVECONNECTION)), aAny );
2000-10-27 18:03:06 +00:00
aAny <<= (sal_Int32) sdb::CommandType::TABLE;
xRowProp->setPropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMANDTYPE)), aAny );
2000-10-27 18:03:06 +00:00
aAny <<= rtl::OUString( aTabName );
xRowProp->setPropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMAND)), aAny );
2000-10-27 18:03:06 +00:00
xRowSet->execute();
2000-10-27 18:03:06 +00:00
// write data rows
2000-10-27 18:03:06 +00:00
uno::Reference<sdbc::XResultSetUpdate> xResultUpdate( xRowSet, uno::UNO_QUERY );
OSL_ENSURE( xResultUpdate.is(), "can't get XResultSetUpdate" );
2000-10-27 18:03:06 +00:00
if (!xResultUpdate.is()) return SCERR_EXPORT_CONNECT;
2000-10-27 18:03:06 +00:00
uno::Reference<sdbc::XRowUpdate> xRowUpdate( xRowSet, uno::UNO_QUERY );
OSL_ENSURE( xRowUpdate.is(), "can't get XRowUpdate" );
2000-10-27 18:03:06 +00:00
if (!xRowUpdate.is()) return SCERR_EXPORT_CONNECT;
SCROW nFirstDataRow = ( bHasFieldNames ? nFirstRow + 1 : nFirstRow );
2000-10-27 18:03:06 +00:00
double fVal;
for ( nDocRow = nFirstDataRow; nDocRow <= nLastRow; nDocRow++ )
{
2000-10-27 18:03:06 +00:00
xResultUpdate->moveToInsertRow();
2000-10-27 18:03:06 +00:00
for (nCol=0; nCol<nColCount; nCol++)
{
SCCOL nDocCol = sal::static_int_cast<SCCOL>( nFirstCol + nCol );
2000-10-27 18:03:06 +00:00
switch (pColTypes[nCol])
{
case sdbc::DataType::LONGVARCHAR:
{
2000-10-27 18:03:06 +00:00
ScBaseCell* pCell;
aDocument.GetCell( nDocCol, nDocRow, nTab, pCell );
if ( pCell && pCell->GetCellType() != CELLTYPE_NOTE )
{
2000-10-27 18:03:06 +00:00
if ( pCell->GetCellType() == CELLTYPE_EDIT )
2011-03-01 14:29:24 +01:00
{ // Paragraphs erhalten
lcl_getLongVarCharEditString( aString,
pCell, aEditEngine);
2000-10-27 18:03:06 +00:00
}
else
{
lcl_getLongVarCharString( aString, pCell,
aDocument, nDocCol, nDocRow, nTab,
*pNumFmt);
2000-10-27 18:03:06 +00:00
}
xRowUpdate->updateString( nCol+1, aString );
}
2000-10-27 18:03:06 +00:00
else
xRowUpdate->updateNull( nCol+1 );
}
2000-10-27 18:03:06 +00:00
break;
2000-10-27 18:03:06 +00:00
case sdbc::DataType::VARCHAR:
aDocument.GetString( nDocCol, nDocRow, nTab, aString );
xRowUpdate->updateString( nCol+1, aString );
if ( nErr == eERR_OK && pColLengths[nCol] < aString.getLength() )
2000-10-27 18:03:06 +00:00
nErr = SCWARN_EXPORT_DATALOST;
break;
2000-10-27 18:03:06 +00:00
case sdbc::DataType::DATE:
{
2000-10-27 18:03:06 +00:00
aDocument.GetValue( nDocCol, nDocRow, nTab, fVal );
2011-03-01 14:29:24 +01:00
// zwischen 0 Wert und 0 kein Wert unterscheiden
sal_Bool bIsNull = (fVal == 0.0);
2000-10-27 18:03:06 +00:00
if ( bIsNull )
bIsNull = !aDocument.HasValueData( nDocCol, nDocRow, nTab );
if ( bIsNull )
{
xRowUpdate->updateNull( nCol+1 );
if ( nErr == eERR_OK &&
aDocument.HasStringData( nDocCol, nDocRow, nTab ) )
nErr = SCWARN_EXPORT_DATALOST;
}
else
{
Date aDate = *(pNumFmt->GetNullDate()); // tools date
aDate += (long)fVal; //! approxfloor?
util::Date aUnoDate( aDate.GetDay(), aDate.GetMonth(), aDate.GetYear() );
xRowUpdate->updateDate( nCol+1, aUnoDate );
}
}
2000-10-27 18:03:06 +00:00
break;
case sdbc::DataType::DECIMAL:
case sdbc::DataType::BIT:
aDocument.GetValue( nDocCol, nDocRow, nTab, fVal );
if ( fVal == 0.0 && nErr == eERR_OK &&
aDocument.HasStringData( nDocCol, nDocRow, nTab ) )
nErr = SCWARN_EXPORT_DATALOST;
if ( pColTypes[nCol] == sdbc::DataType::BIT )
xRowUpdate->updateBoolean( nCol+1, ( fVal != 0.0 ) );
else
2000-10-27 18:03:06 +00:00
xRowUpdate->updateDouble( nCol+1, fVal );
break;
2000-10-27 18:03:06 +00:00
default:
2011-03-01 19:05:02 +01:00
OSL_FAIL( "ScDocShell::DBaseExport: unknown FieldType" );
2000-10-27 18:03:06 +00:00
if ( nErr == eERR_OK )
nErr = SCWARN_EXPORT_DATALOST;
aDocument.GetValue( nDocCol, nDocRow, nTab, fVal );
xRowUpdate->updateDouble( nCol+1, fVal );
2000-10-27 18:03:06 +00:00
}
}
2000-10-27 18:03:06 +00:00
xResultUpdate->insertRow();
2000-10-27 18:03:06 +00:00
//! error handling and recovery of old
//! ScDocShell::SbaSdbExport is still missing!
2000-10-27 18:03:06 +00:00
if ( !aProgress.SetStateOnPercent( nDocRow - nFirstRow ) )
{ // UserBreak
nErr = SCERR_EXPORT_DATA;
break;
}
}
2000-11-03 12:37:05 +00:00
comphelper::disposeComponent( xRowSet );
comphelper::disposeComponent( xConnection );
}
2011-11-04 02:02:20 +09:00
catch ( const sdbc::SQLException& aException )
2000-10-27 18:03:06 +00:00
{
sal_Int32 nError = aException.ErrorCode;
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "ScDocShell::DBaseExport: SQLException ErrorCode: %d, SQLState: %s, Message: %s\n",
(int)nError, OUStringToOString( aException.SQLState,
RTL_TEXTENCODING_UTF8).getStr(), OUStringToOString(
aException.Message, RTL_TEXTENCODING_UTF8).getStr());
#endif
if (nError == 22018 || nError == 22001)
{
// SQL error 22018: Character not in target encoding.
// SQL error 22001: String length exceeds field width (after encoding).
bool bEncErr = (nError == 22018);
bool bIsOctetTextEncoding = rtl_isOctetTextEncoding( eCharSet);
OSL_ENSURE( !bEncErr || bIsOctetTextEncoding, "ScDocShell::DBaseExport: encoding error and not an octect textencoding");
SCCOL nDocCol = nFirstCol;
const sal_Int32* pColTypes = aColTypes.getConstArray();
const sal_Int32* pColLengths = aColLengths.getConstArray();
ScHorizontalCellIterator aIter( &aDocument, nTab, nFirstCol,
nDocRow, nLastCol, nDocRow);
ScBaseCell* pCell = NULL;
bool bTest = true;
while (bTest && ((pCell = aIter.GetNext( nDocCol, nDocRow)) != NULL))
{
SCCOL nCol = nDocCol - nFirstCol;
switch (pColTypes[nCol])
{
case sdbc::DataType::LONGVARCHAR:
{
if ( pCell->GetCellType() != CELLTYPE_NOTE )
{
if ( pCell->GetCellType() == CELLTYPE_EDIT )
lcl_getLongVarCharEditString( aString,
pCell, aEditEngine);
else
lcl_getLongVarCharString( aString,
pCell, aDocument, nDocCol,
nDocRow, nTab, *pNumFmt);
}
}
break;
case sdbc::DataType::VARCHAR:
aDocument.GetString( nDocCol, nDocRow, nTab, aString);
break;
// NOTE: length of DECIMAL fields doesn't need to be
// checked here, the database driver adjusts the field
// width accordingly.
default:
bTest = false;
}
if (bTest)
{
sal_Int32 nLen;
if (bIsOctetTextEncoding)
{
rtl::OUString aOUString( aString);
rtl::OString aOString;
if (!aOUString.convertToString( &aOString, eCharSet,
RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))
{
bTest = false;
bEncErr = true;
}
nLen = aOString.getLength();
#if OSL_DEBUG_LEVEL > 1
if (!bTest)
fprintf( stderr, "ScDocShell::DBaseExport encoding error, string with default replacements: ``%s''\n",
OUStringToOString( aOUString, eCharSet).getStr());
#endif
}
else
nLen = aString.getLength() * sizeof(sal_Unicode);
if (!bEncErr &&
pColTypes[nCol] != sdbc::DataType::LONGVARCHAR &&
pColLengths[nCol] < nLen)
{
bTest = false;
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "ScDocShell::DBaseExport: field width: %d, encoded length: %d\n",
(int)pColLengths[nCol], (int)nLen);
#endif
}
}
else
bTest = true;
}
String sPosition( ScAddress( nDocCol, nDocRow, nTab).GetColRowString());
String sEncoding( SvxTextEncodingTable().GetTextString( eCharSet));
nErr = *new TwoStringErrorInfo( (bEncErr ? SCERR_EXPORT_ENCODING :
SCERR_EXPORT_FIELDWIDTH), sPosition, sEncoding,
ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR);
}
else if ( !aException.Message.isEmpty() )
CWS-TOOLING: integrate CWS dba31f 2008-12-10 14:16:09 +0100 oj r265185 : #i96658# remove is 2008-12-10 08:46:07 +0100 oj r265147 : remove duplicate ids 2008-12-10 08:35:02 +0100 oj r265146 : #i96658# remove is 2008-12-09 11:44:35 +0100 oj r265072 : use of tools::StringresourceList 2008-12-09 11:43:41 +0100 oj r265071 : new class to read string elements from a Resource 2008-12-09 11:41:56 +0100 oj r265070 : export StringListResource 2008-12-09 11:38:17 +0100 oj r265068 : change string ; to more string objects 2008-12-08 12:11:43 +0100 oj r264985 : change default-license-id to lic-en-US 2008-12-05 12:06:09 +0100 oj r264896 : disable check to uncheck 2008-12-04 08:58:50 +0100 oj r264814 : #i96517,i96520,i96522# d&d, background, state fixed 2008-12-04 08:53:29 +0100 oj r264813 : #i96434# use document ui name from filter 2008-12-04 08:41:06 +0100 oj r264812 : #i96434# use document ui name from filter 2008-12-02 13:48:49 +0100 lla r264697 : #i96526# extra string for default otr wasn't found 2008-11-28 11:46:31 +0100 oj r264536 : move toolbar and resize add field dlg 2008-11-28 08:38:22 +0100 oj r264526 : load string resources 2008-11-27 19:28:52 +0100 oj r264520 : unsigned 2008-11-27 19:10:19 +0100 oj r264517 : move class into unnamed namespace 2008-11-27 18:33:38 +0100 oj r264514 : wrong param 2008-11-27 16:52:39 +0100 oj r264510 : #i96622# wrong string replacement 2008-11-27 16:46:03 +0100 oj r264509 : remove unused var 2008-11-27 13:37:16 +0100 oj r264484 : #i96432# notify only when not in special mode of the page 2008-11-27 13:16:47 +0100 oj r264479 : #i95224# accept alias in group by 2008-11-27 12:35:19 +0100 oj r264477 : #i95416# always show localized strings in the start marker 2008-11-27 09:49:29 +0100 oj r264455 : #i93460# set split pos 2008-11-27 09:05:27 +0100 oj r264447 : #i96453# use extension from mimetype / mediatype 2008-11-26 16:24:43 +0100 oj r264416 : #i96520# #i96522# #i96519# some changes at the add field dialog 2008-11-26 16:20:27 +0100 oj r264414 : #i93420# prevent to register a none system file url 2008-11-26 16:19:02 +0100 oj r264413 : #i96522# new class to paste multiple objects 2008-11-26 10:06:12 +0100 oj r264349 : #i96191# introduce new error message and check if type was defined aand should not be changed 2008-11-26 10:06:12 +0100 oj r264348 : #i96191# throw error when decimal is to big 2008-11-25 12:08:59 +0100 oj r264281 : #i96431# correct state for align and move 2008-11-25 11:54:47 +0100 oj r264280 : #i96428# when new bind to first table 2008-11-25 11:49:55 +0100 oj r264279 : #i96434# add report output format to inspection 2008-11-25 11:49:05 +0100 oj r264278 : #i96434# add report output format to inspection 2008-11-24 10:46:23 +0100 oj r264215 : #i96458# size width for controls 2008-11-24 09:28:56 +0100 oj r264199 : #i96459# mark detail section when nothing is selected 2008-11-20 12:02:35 +0100 oj r264038 : #i96191# fix check for prec 2008-11-20 08:06:32 +0100 oj r264026 : #i90949# patch MID function 2008-11-11 13:14:58 +0100 oj r263555 : #i96086# apply patch 2008-11-11 11:34:46 +0100 oj r263549 : #i94128# correct height of section when controls moved outside 2008-11-11 07:52:08 +0100 oj r263544 : #i94729# fix string with ; as sep 2008-11-11 07:45:27 +0100 oj r263543 : #i95222# export chart title style 2008-11-11 07:43:37 +0100 oj r263542 : #i92541# fix line height
2008-12-10 13:41:25 +00:00
nErr = *new StringErrorInfo( (SCERR_EXPORT_SQLEXCEPTION), aException.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR);
else
CWS-TOOLING: integrate CWS dba31f 2008-12-10 14:16:09 +0100 oj r265185 : #i96658# remove is 2008-12-10 08:46:07 +0100 oj r265147 : remove duplicate ids 2008-12-10 08:35:02 +0100 oj r265146 : #i96658# remove is 2008-12-09 11:44:35 +0100 oj r265072 : use of tools::StringresourceList 2008-12-09 11:43:41 +0100 oj r265071 : new class to read string elements from a Resource 2008-12-09 11:41:56 +0100 oj r265070 : export StringListResource 2008-12-09 11:38:17 +0100 oj r265068 : change string ; to more string objects 2008-12-08 12:11:43 +0100 oj r264985 : change default-license-id to lic-en-US 2008-12-05 12:06:09 +0100 oj r264896 : disable check to uncheck 2008-12-04 08:58:50 +0100 oj r264814 : #i96517,i96520,i96522# d&d, background, state fixed 2008-12-04 08:53:29 +0100 oj r264813 : #i96434# use document ui name from filter 2008-12-04 08:41:06 +0100 oj r264812 : #i96434# use document ui name from filter 2008-12-02 13:48:49 +0100 lla r264697 : #i96526# extra string for default otr wasn't found 2008-11-28 11:46:31 +0100 oj r264536 : move toolbar and resize add field dlg 2008-11-28 08:38:22 +0100 oj r264526 : load string resources 2008-11-27 19:28:52 +0100 oj r264520 : unsigned 2008-11-27 19:10:19 +0100 oj r264517 : move class into unnamed namespace 2008-11-27 18:33:38 +0100 oj r264514 : wrong param 2008-11-27 16:52:39 +0100 oj r264510 : #i96622# wrong string replacement 2008-11-27 16:46:03 +0100 oj r264509 : remove unused var 2008-11-27 13:37:16 +0100 oj r264484 : #i96432# notify only when not in special mode of the page 2008-11-27 13:16:47 +0100 oj r264479 : #i95224# accept alias in group by 2008-11-27 12:35:19 +0100 oj r264477 : #i95416# always show localized strings in the start marker 2008-11-27 09:49:29 +0100 oj r264455 : #i93460# set split pos 2008-11-27 09:05:27 +0100 oj r264447 : #i96453# use extension from mimetype / mediatype 2008-11-26 16:24:43 +0100 oj r264416 : #i96520# #i96522# #i96519# some changes at the add field dialog 2008-11-26 16:20:27 +0100 oj r264414 : #i93420# prevent to register a none system file url 2008-11-26 16:19:02 +0100 oj r264413 : #i96522# new class to paste multiple objects 2008-11-26 10:06:12 +0100 oj r264349 : #i96191# introduce new error message and check if type was defined aand should not be changed 2008-11-26 10:06:12 +0100 oj r264348 : #i96191# throw error when decimal is to big 2008-11-25 12:08:59 +0100 oj r264281 : #i96431# correct state for align and move 2008-11-25 11:54:47 +0100 oj r264280 : #i96428# when new bind to first table 2008-11-25 11:49:55 +0100 oj r264279 : #i96434# add report output format to inspection 2008-11-25 11:49:05 +0100 oj r264278 : #i96434# add report output format to inspection 2008-11-24 10:46:23 +0100 oj r264215 : #i96458# size width for controls 2008-11-24 09:28:56 +0100 oj r264199 : #i96459# mark detail section when nothing is selected 2008-11-20 12:02:35 +0100 oj r264038 : #i96191# fix check for prec 2008-11-20 08:06:32 +0100 oj r264026 : #i90949# patch MID function 2008-11-11 13:14:58 +0100 oj r263555 : #i96086# apply patch 2008-11-11 11:34:46 +0100 oj r263549 : #i94128# correct height of section when controls moved outside 2008-11-11 07:52:08 +0100 oj r263544 : #i94729# fix string with ; as sep 2008-11-11 07:45:27 +0100 oj r263543 : #i95222# export chart title style 2008-11-11 07:43:37 +0100 oj r263542 : #i92541# fix line height
2008-12-10 13:41:25 +00:00
nErr = SCERR_EXPORT_DATA;
2000-10-27 18:03:06 +00:00
}
catch ( uno::Exception& )
{
2011-03-01 19:05:02 +01:00
OSL_FAIL("Unexpected exception in database");
2000-10-27 18:03:06 +00:00
nErr = ERRCODE_IO_GENERAL;
}
2000-09-18 16:07:07 +00:00
return nErr;
}
#endif // !DISABLE_DBCONNECTIVITY
2000-09-18 16:07:07 +00:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */