View | Details | Raw Unified | Return to issue 121837
Collapse All | Expand All

(-)connectivity/qa/connectivity/tools/CRMDatabase.java (-1 / +1 lines)
Lines 180-186 Link Here
180
                new HsqlColumnDescriptor( "Address",VARCHAR50),
184
                new HsqlColumnDescriptor( "Address",VARCHAR50),
181
                new HsqlColumnDescriptor( "City",VARCHAR50),
185
                new HsqlColumnDescriptor( "City",VARCHAR50),
182
                new HsqlColumnDescriptor( "Postal",VARCHAR50),
186
                new HsqlColumnDescriptor( "Postal",VARCHAR50),
183
                new HsqlColumnDescriptor( "Comment","LONGVARCHAR")} );
187
                new HsqlColumnDescriptor( "Comment","CLOB")} );
184
        m_database.createTable( table, true );
188
        m_database.createTable( table, true );
185
189
186
        m_database.executeSQL( "INSERT INTO \"customers\" VALUES(1,'Food, Inc.','Down Under','Melbourne','509','Prefered') " );
190
        m_database.executeSQL( "INSERT INTO \"customers\" VALUES(1,'Food, Inc.','Down Under','Melbourne','509','Prefered') " );
(-)connectivity/source/commontools/FValue.cxx (-6 / +4 lines)
Lines 783-794 Link Here
783
787
784
bool ORowSetValue::operator==(const ORowSetValue& _rRH) const
788
bool ORowSetValue::operator==(const ORowSetValue& _rRH) const
785
{
789
{
786
	if ( m_bNull != _rRH.isNull() )
787
        return false;
788
789
	if(m_bNull && _rRH.isNull())
790
		return true;
791
792
	if ( m_eTypeKind != _rRH.m_eTypeKind )
790
	if ( m_eTypeKind != _rRH.m_eTypeKind )
793
    {
791
    {
794
        switch(m_eTypeKind)
792
        switch(m_eTypeKind)
Lines 811-816 Link Here
811
            }
809
            }
812
        return false;
810
        return false;
813
    }
811
    }
812
    if ( m_bNull != _rRH.isNull() )
813
            return false;
814
	if(m_bNull && _rRH.isNull())
815
		return true;
814
816
815
	bool bRet = false;
817
	bool bRet = false;
816
	OSL_ENSURE(!m_bNull,"SHould not be null!");
818
	OSL_ENSURE(!m_bNull,"SHould not be null!");
(-)connectivity/source/drivers/hsqldb/HDriver.cxx (-18 / +59 lines)
Lines 40-45 Link Here
40
#include <com/sun/star/frame/XDesktop.hpp>
40
#include <com/sun/star/frame/XDesktop.hpp>
41
#include <com/sun/star/lang/Locale.hpp>
41
#include <com/sun/star/lang/Locale.hpp>
42
#include <com/sun/star/util/XFlushable.hpp>
42
#include <com/sun/star/util/XFlushable.hpp>
43
#include <com/sun/star/task/XInteractionHandler.hpp>
43
#include "HTerminateListener.hxx"
44
#include "HTerminateListener.hxx"
44
#include "hsqldb/HCatalog.hxx"
45
#include "hsqldb/HCatalog.hxx"
45
#include "diagnose_ex.h"
46
#include "diagnose_ex.h"
Lines 48-53 Link Here
48
#include <osl/process.h>
49
#include <osl/process.h>
49
#include <connectivity/dbexception.hxx>
50
#include <connectivity/dbexception.hxx>
50
#include <comphelper/namedvaluecollection.hxx>
51
#include <comphelper/namedvaluecollection.hxx>
52
#include <comphelper/interaction.hxx>
51
#include <unotools/confignode.hxx>
53
#include <unotools/confignode.hxx>
52
#include <unotools/ucbstreamhelper.hxx>
54
#include <unotools/ucbstreamhelper.hxx>
53
#include "resource/hsqldb_res.hrc"
55
#include "resource/hsqldb_res.hrc"
Lines 58-63 Link Here
58
{
60
{
59
//........................................................................
61
//........................................................................
60
	using namespace hsqldb;
62
	using namespace hsqldb;
63
    using namespace ::comphelper;
61
	using namespace ::com::sun::star::uno;
64
	using namespace ::com::sun::star::uno;
62
	using namespace ::com::sun::star::sdbc;
65
	using namespace ::com::sun::star::sdbc;
63
	using namespace ::com::sun::star::sdbcx;
66
	using namespace ::com::sun::star::sdbcx;
Lines 65-73 Link Here
65
    using namespace ::com::sun::star::frame;
68
    using namespace ::com::sun::star::frame;
66
	using namespace ::com::sun::star::lang;
69
	using namespace ::com::sun::star::lang;
67
	using namespace ::com::sun::star::embed;
70
	using namespace ::com::sun::star::embed;
68
	using namespace ::com::sun::star::io;
71
    using namespace ::com::sun::star::io;
72
	using namespace ::com::sun::star::util;
69
    using namespace ::com::sun::star::task;
73
    using namespace ::com::sun::star::task;
70
    using namespace ::com::sun::star::util;
71
	using namespace ::com::sun::star::reflection;
74
	using namespace ::com::sun::star::reflection;
72
75
73
	namespace hsqldb
76
	namespace hsqldb
Lines 182-187 Link Here
182
			{
185
			{
183
				::rtl::OUString sURL;
186
				::rtl::OUString sURL;
184
				Reference<XStorage> xStorage;
187
				Reference<XStorage> xStorage;
188
                Reference< XInteractionHandler > xInteraction;
185
				const PropertyValue* pIter = info.getConstArray();
189
				const PropertyValue* pIter = info.getConstArray();
186
				const PropertyValue* pEnd = pIter + info.getLength();
190
				const PropertyValue* pEnd = pIter + info.getLength();
187
191
Lines 195-200 Link Here
195
					{
199
					{
196
						pIter->Value >>= sURL;
200
						pIter->Value >>= sURL;
197
					}
201
					}
202
                    else if ( pIter->Name.equalsAscii("InteractionHandler") )
203
					{
204
						pIter->Value >>= xInteraction;
205
					}
198
				}
206
				}
199
207
200
				if ( !xStorage.is() || !sURL.getLength() )
208
				if ( !xStorage.is() || !sURL.getLength() )
Lines 250-255 Link Here
250
                // don't want to expose HSQLDB's schema capabilities which exist since 1.8.0RC10
258
                // don't want to expose HSQLDB's schema capabilities which exist since 1.8.0RC10
251
                aProperties.put( "default_schema",
259
                aProperties.put( "default_schema",
252
                    ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
260
                    ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
261
				aProperties.put( "hsqldb.default_table_type",
262
                    ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cached" ) ) );
253
263
254
                // security: permitted Java classes
264
                // security: permitted Java classes
255
                NamedValue aPermittedClasses(
265
                NamedValue aPermittedClasses(
Lines 257-265 Link Here
257
                    makeAny( lcl_getPermittedJavaMethods_nothrow( m_xFactory ) )
267
                    makeAny( lcl_getPermittedJavaMethods_nothrow( m_xFactory ) )
258
                );
268
                );
259
                aProperties.put( "SystemProperties", Sequence< NamedValue >( &aPermittedClasses, 1 ) );
269
                aProperties.put( "SystemProperties", Sequence< NamedValue >( &aPermittedClasses, 1 ) );
260
				
270
				aProperties.put( "jdbc.interval_as_varchar", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
261
				const ::rtl::OUString sProperties( RTL_CONSTASCII_USTRINGPARAM( "properties" ) );
271
				aProperties.put( "get_column_name", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) ) );
262
				::rtl::OUString sMessage;
272
273
                bool bAskUser = false,bModified = false;
274
                ::rtl::OUString sProperties( RTL_CONSTASCII_USTRINGPARAM( "properties" ) );
263
                try
275
                try
264
                {
276
                {
265
                    if ( !bIsNewDatabase && xStorage->isStreamElement(sProperties) )
277
                    if ( !bIsNewDatabase && xStorage->isStreamElement(sProperties) )
Lines 282-291 Link Here
282
                                    {
294
                                    {
283
                                        sVersionString = sValue;
295
                                        sVersionString = sValue;
284
                                    }
296
                                    }
297
									else if ( sLine.Equals("modified=yes",0,sizeof("modified=yes")-1) )
298
                                    {
299
										bModified = true;
300
									}
285
                                    else
301
                                    else
286
                                    {
302
                                    {
287
                                        if  (   sIniKey.Equals( "version" )
303
                                        if  (   (  sVersionString.Len() == 0 )
288
                                            &&  ( sVersionString.Len() == 0 )
304
												&& sIniKey.Equals( "version" )
289
                                            )
305
                                            )
290
                                        {
306
                                        {
291
                                            sVersionString = sValue;
307
                                            sVersionString = sValue;
Lines 295-308 Link Here
295
                                if ( sVersionString.Len() )
311
                                if ( sVersionString.Len() )
296
                                {
312
                                {
297
									const sal_Int32 nMajor = sVersionString.GetToken(0,'.').ToInt32();
313
									const sal_Int32 nMajor = sVersionString.GetToken(0,'.').ToInt32();
298
									const sal_Int32 nMinor = sVersionString.GetToken(1,'.').ToInt32();
314
									if ( nMajor < 2 )
299
									const sal_Int32 nMicro = sVersionString.GetToken(2,'.').ToInt32();
300
									if ( 	 nMajor > 1 
301
										|| ( nMajor == 1 && nMinor > 8 )
302
										|| ( nMajor == 1 && nMinor == 8 && nMicro > 0 ) )
303
					                {
315
					                {
304
					                    ::connectivity::SharedResources aResources;
316
										bAskUser = true;
305
					                    sMessage = aResources.getResourceString(STR_ERROR_NEW_VERSION);
306
					                }
317
					                }
307
                                }
318
                                }
308
                            }
319
                            }
Lines 313-322 Link Here
313
                catch(Exception&)
324
                catch(Exception&)
314
                {
325
                {
315
                }
326
                }
316
				if ( sMessage.getLength() )
327
328
				// check if database was shutdown correctly before converting to new a version
329
				if ( bModified && bAskUser )
317
				{
330
				{
331
					::connectivity::SharedResources aResources;
332
					const ::rtl::OUString sMessage = aResources.getResourceString(STR_SHUTDOWN_REQUIRED);
318
					::dbtools::throwGenericSQLException(sMessage ,*this);
333
					::dbtools::throwGenericSQLException(sMessage ,*this);
319
				}
334
				}
335
				// need to convert file, ask for user approvement
336
                if ( xInteraction.is() && bAskUser )
337
                {
338
					::connectivity::SharedResources aResources;
339
					const ::rtl::OUString sRequest( aResources.getResourceString(STR_CONVERT_TO_NEW_VERSION));
340
                    SQLException aInfo(sRequest,*this,::rtl::OUString(),0,Any());
341
                    OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aInfo));
342
			        Reference< XInteractionRequest > xRequest(pRequest);
343
                    OInteraction< XInteractionApprove >* pApprove = new OInteraction< XInteractionApprove >();
344
			        pRequest->addContinuation(pApprove);
345
                    OInteraction< XInteractionDisapprove >* pDisApprove = new OInteraction< XInteractionDisapprove >;
346
			        pRequest->addContinuation(pDisApprove);
347
                    xInteraction->handle(xRequest);
348
                    if ( !pDisApprove->wasSelected() )
349
				        bAskUser = false;
350
					aProperties.put( "sql.enforce_size", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) ) );
351
                }
320
352
321
                // readonly?
353
                // readonly?
322
				Reference<XPropertySet> xProp(xStorage,UNO_QUERY);
354
				Reference<XPropertySet> xProp(xStorage,UNO_QUERY);
Lines 326-334 Link Here
326
					xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OpenMode"))) >>= nMode;
358
					xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OpenMode"))) >>= nMode;
327
					if ( (nMode & ElementModes::WRITE) != ElementModes::WRITE )
359
					if ( (nMode & ElementModes::WRITE) != ElementModes::WRITE )
328
					{
360
					{
329
                        aProperties.put( "readonly", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
361
                        bAskUser = true; // which means already added
362
                        //aProperties.put( "readonly", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
330
					}
363
					}
331
				}
364
				} // if ( xProp.is() )
365
                if ( bAskUser )
366
                    aProperties.put( "readonly", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
332
367
333
                Sequence< PropertyValue > aConnectionArgs;
368
                Sequence< PropertyValue > aConnectionArgs;
334
                aProperties >>= aConnectionArgs;
369
                aProperties >>= aConnectionArgs;
Lines 341-350 Link Here
341
                {
376
                {
342
                    xOrig = xDriver->connect( sConnectURL, aConnectionArgs );
377
                    xOrig = xDriver->connect( sConnectURL, aConnectionArgs );
343
                }
378
                }
379
				catch(const SQLException& e)
380
                {
381
                    StorageContainer::revokeStorage(sKey,NULL);
382
                    OSL_UNUSED(e);
383
                    throw;
384
                }
344
                catch(const Exception& e)
385
                catch(const Exception& e)
345
                {
386
                {
346
                    StorageContainer::revokeStorage(sKey,NULL);
387
                    StorageContainer::revokeStorage(sKey,NULL);
347
                    (void)e;
388
                    OSL_UNUSED(e);
348
                    throw;
389
                    throw;
349
                }
390
                }
350
391
(-)connectivity/source/drivers/hsqldb/HStorageAccess.cxx (+2 lines)
Lines 435-440 Link Here
435
		if ( xOut.is() )
439
		if ( xOut.is() )
436
		{
440
		{
437
			jbyte *buf = env->GetByteArrayElements(buffer,NULL);
441
			jbyte *buf = env->GetByteArrayElements(buffer,NULL);
442
            OSL_ENSURE(len <= env->GetArrayLength(buffer),"Length is greater than the buffer!");
443
438
			if (JNI_FALSE != env->ExceptionCheck())
444
			if (JNI_FALSE != env->ExceptionCheck())
439
            {
445
            {
440
                env->ExceptionClear();
446
                env->ExceptionClear();
(-)connectivity/source/drivers/hsqldb/HStorageMap.cxx (-2 / +3 lines)
Lines 57-64 Link Here
57
		{
61
		{
58
			try
62
			try
59
			{
63
			{
60
                m_xStream.clear();
64
				m_xStream.clear();
61
			    m_xSeek.clear();
65
				m_xSeek.clear();
66
				if ( m_xOutputStream.is() )
62
				if ( m_xInputStream.is() )
67
				if ( m_xInputStream.is() )
63
				{
68
				{
64
					m_xInputStream->closeInput();
69
					m_xInputStream->closeInput();
(-)connectivity/source/resource/conn_shared_res.src (-2 / +6 lines)
Lines 638-645 Link Here
638
{
638
{
639
    Text [ en-US ] = "The provided DocumentUI is not allowed to be NULL.";
639
    Text [ en-US ] = "The provided DocumentUI is not allowed to be NULL.";
640
};
640
};
641
String STR_ERROR_NEW_VERSION
641
String STR_CONVERT_TO_NEW_VERSION
642
{
642
{
643
    Text = "The connection could not be established. The database was created by a newer version of %PRODUCTNAME.";
643
    Text [ en-US ] = "The database file is stored in an old version. Do you want to convert into the new version?";
644
};
644
};
645
String STR_SHUTDOWN_REQUIRED
646
{
647
    Text [ en-US ] = "The database file was not stored correctly by a previous version of %PRODUCTNAME.\nPlease open the file with OpenOffice.org 3.3 or Oracle Open Office 3.3, then click the Tables icon and save.";
648
};
645
649
(-)dbaccess/source/core/api/KeySet.cxx (-1 / +1 lines)
Lines 1338-1344 Link Here
1338
        if ( i_bFetchRow )
1342
        if ( i_bFetchRow )
1339
		    refreshRow();
1343
		    refreshRow();
1340
	}
1344
	}
1341
	return m_aKeyIter != m_aKeyMap.begin();
1345
	return m_aKeyIter != m_aKeyMap.end() && m_aKeyIter != m_aKeyMap.begin();
1342
}
1346
}
1343
// -----------------------------------------------------------------------------
1347
// -----------------------------------------------------------------------------
1344
sal_Bool SAL_CALL OKeySet::previous(  ) throw(SQLException, RuntimeException)
1348
sal_Bool SAL_CALL OKeySet::previous(  ) throw(SQLException, RuntimeException)
(-)dbaccess/source/core/dataaccess/datasource.cxx (-1 / +3 lines)
Lines 752-763 Link Here
752
			if ( m_pImpl->isEmbeddedDatabase() )
756
			if ( m_pImpl->isEmbeddedDatabase() )
753
			{
757
			{
754
				sal_Int32 nCount = aDriverInfo.getLength();
758
				sal_Int32 nCount = aDriverInfo.getLength();
755
				aDriverInfo.realloc(nCount + 2 );
759
				aDriverInfo.realloc(nCount + 3 );
756
				aDriverInfo[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"));
760
				aDriverInfo[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"));
757
				aDriverInfo[nCount++].Value <<= m_pImpl->getURL();
761
				aDriverInfo[nCount++].Value <<= m_pImpl->getURL();
758
				aDriverInfo[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Storage"));
762
				aDriverInfo[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Storage"));
759
                Reference< css::document::XDocumentSubStorageSupplier> xDocSup( m_pImpl->getDocumentSubStorageSupplier() );
763
                Reference< css::document::XDocumentSubStorageSupplier> xDocSup( m_pImpl->getDocumentSubStorageSupplier() );
760
				aDriverInfo[nCount++].Value <<= xDocSup->getDocumentSubStorage(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("database")),ElementModes::READWRITE);
764
				aDriverInfo[nCount++].Value <<= xDocSup->getDocumentSubStorage(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("database")),ElementModes::READWRITE);
765
                aDriverInfo[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler"));
766
				aDriverInfo[nCount++].Value <<= m_pImpl->m_aContext.createComponent( "com.sun.star.task.InteractionHandler" );
761
			}
767
			}
762
			if (nAdditionalArgs)
768
			if (nAdditionalArgs)
763
				xReturn = xManager->getConnectionWithInfo(m_pImpl->m_sConnectURL, ::comphelper::concatSequences(aUserPwd,aDriverInfo));
769
				xReturn = xManager->getConnectionWithInfo(m_pImpl->m_sConnectURL, ::comphelper::concatSequences(aUserPwd,aDriverInfo));
(-)dbaccess/source/ui/browser/unodatbr.cxx (-4 / +4 lines)
Lines 761-766 Link Here
761
					case DataType::BINARY:
765
					case DataType::BINARY:
762
					case DataType::VARBINARY:
766
					case DataType::VARBINARY:
763
					case DataType::LONGVARBINARY:
767
					case DataType::LONGVARBINARY:
768
                    case DataType::BLOB:
764
						aCurrentModelType = ::rtl::OUString::createFromAscii("TextField");
769
						aCurrentModelType = ::rtl::OUString::createFromAscii("TextField");
765
						sDefaultProperty = PROPERTY_DEFAULTTEXT;
770
						sDefaultProperty = PROPERTY_DEFAULTTEXT;
766
						break;
771
						break;
Lines 2187-2199 Link Here
2187
		{
2192
		{
2188
			if( !m_pTreeView->getListBox().GetEntryPosByName(*pIter,_pParent))
2193
			if( !m_pTreeView->getListBox().GetEntryPosByName(*pIter,_pParent))
2189
			{
2194
			{
2195
                Reference<XNameAccess> xChild(_xNameAccess->getByName(*pIter),UNO_QUERY);
2190
				DBTreeListUserData* pEntryData = new DBTreeListUserData;
2196
				DBTreeListUserData* pEntryData = new DBTreeListUserData;
2191
				pEntryData->eType = _eEntryType;
2197
				pEntryData->eType = _eEntryType;
2192
                if ( _eEntryType == etQuery )
2198
                if ( _eEntryType == etQuery && xChild.is() )
2193
                {
2199
                {
2194
					Reference<XNameAccess> xChild(_xNameAccess->getByName(*pIter),UNO_QUERY);
2200
                    pEntryData->eType = etQueryContainer;
2195
					if ( xChild.is() )
2196
						pEntryData->eType = etQueryContainer;
2197
                }
2201
                }
2198
                implAppendEntry( _pParent, *pIter, pEntryData, pEntryData->eType );
2202
                implAppendEntry( _pParent, *pIter, pEntryData, pEntryData->eType );
2199
			}
2203
			}
(-)dbaccess/source/ui/control/FieldDescControl.cxx (-5 / +9 lines)
Lines 405-432 Link Here
405
	if (bNeedVScrollBar)
409
	if (bNeedVScrollBar)
406
	{
410
	{
407
		m_pVertScroll->Show();
411
		m_pVertScroll->Show();
408
		m_pVertScroll->SetRangeMax(nActive - nLastVisible);
412
		m_pVertScroll->SetRangeMax(nActive);
413
        m_pVertScroll->SetVisibleSize(nLastVisible);
409
//		m_pVertScroll->SetThumbPos(0);
414
//		m_pVertScroll->SetThumbPos(0);
410
415
411
		m_pVertScroll->SetPosSizePixel( Point(nNewHWidth, 0), Size(nVScrollWidth, szOverallSize.Height()) );
416
		m_pVertScroll->SetPosSizePixel( Point(nNewHWidth, 0), Size(nVScrollWidth, szOverallSize.Height()) );
412
	}
417
	}
413
	else
418
	else
414
	{
419
	{
420
        m_nOldVThumb = 0;
415
		m_pVertScroll->Hide();
421
		m_pVertScroll->Hide();
416
		m_pVertScroll->SetRangeMax(0);
422
		m_pVertScroll->SetRangeMax(0);
417
		m_pVertScroll->SetThumbPos(0);
423
		m_pVertScroll->SetThumbPos(0);
418
	}
424
	}
419
425
    m_nOldHThumb = 0;
420
	if (bNeedHScrollBar)
426
	if (bNeedHScrollBar)
421
	{
427
	{
422
		m_pHorzScroll->Show();
428
		m_pHorzScroll->Show();
423
		m_pHorzScroll->SetRangeMax((lMaxXPosition - lMaxXAvailable + HSCROLL_STEP - 1 )/HSCROLL_STEP);
429
		m_pHorzScroll->SetRangeMax((lMaxXPosition - lMaxXAvailable + HSCROLL_STEP + 1 )/HSCROLL_STEP + 1);
430
        m_pHorzScroll->SetVisibleSize(m_pHorzScroll->GetRangeMax() - 1);
424
//		m_pHorzScroll->SetThumbPos(0);
431
//		m_pHorzScroll->SetThumbPos(0);
425
432
426
		m_pHorzScroll->SetPosSizePixel( Point(0, nNewVHeight), Size(bNeedVScrollBar ? nNewHWidth : szOverallSize.Width(), nHScrollHeight) );
433
		m_pHorzScroll->SetPosSizePixel( Point(0, nNewVHeight), Size(bNeedVScrollBar ? nNewHWidth : szOverallSize.Width(), nHScrollHeight) );
427
	}
434
	}
428
	else
435
	else
429
	{
436
	{   
430
		m_pHorzScroll->Hide();
437
		m_pHorzScroll->Hide();
431
		m_pHorzScroll->SetRangeMax(0);
438
		m_pHorzScroll->SetRangeMax(0);
432
		m_pHorzScroll->SetThumbPos(0);
439
		m_pHorzScroll->SetThumbPos(0);
Lines 1209-1215 Link Here
1209
		if ( isRightAligned() )
1216
		if ( isRightAligned() )
1210
		{
1217
		{
1211
			Size aOwnSize = GetSizePixel();
1218
			Size aOwnSize = GetSizePixel();
1212
			aPosition.X() = aOwnSize.Width() - aSize.Width();
1219
            long nVScrollWidth = m_pVertScroll->GetSizePixel().Width();
1220
			aPosition.X() = aOwnSize.Width() - aSize.Width() - nVScrollWidth - LogicToPixel(Size(3, 0),MAP_APPFONT).Width();
1213
		}
1221
		}
1214
		else
1222
		else
1215
			aPosition.X() = CONTROL_WIDTH_1 + CONTROL_SPACING_X;
1223
			aPosition.X() = CONTROL_WIDTH_1 + CONTROL_SPACING_X;
(-)external_deps.lst (-3 / +3 lines)
Lines 60-68 Link Here
60
    URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
60
    URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
61
61
62
if (SOLAR_JAVA == TRUE)
62
if (SOLAR_JAVA == TRUE)
63
    MD5 = 17410483b5b5f267aa18b7e00b65e6e0
63
    MD5 = 2509a76ac18240ea4747468a0aef13e5
64
    name = hsqldb_1_8_0.zip
64
    name = hsqldb-2.2.6.zip
65
    URL1 = http://sourceforge.net/projects/hsqldb/files/hsqldb/hsqldb_1_8_0/hsqldb_1_8_0_10.zip/download
65
    URL1 = http://sourceforge.net/projects/hsqldb/files/hsqldb/hsqldb_2_2/hsqldb-2.2.6.zip/download
66
    URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
66
    URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
67
67
68
if ( true )
68
if ( true )
(-)hsqldb/makefile.mk (-14 / +26 lines)
Lines 20-26 Link Here
20
#**************************************************************
20
#**************************************************************
21
21
22
22
23
24
PRJ=.
23
PRJ=.
25
24
26
PRJNAME=hsqldb
25
PRJNAME=hsqldb
Lines 40-68 Link Here
40
.IF "$(SOLAR_JAVA)" != ""
39
.IF "$(SOLAR_JAVA)" != ""
41
# --- Files --------------------------------------------------------
40
# --- Files --------------------------------------------------------
42
41
43
TARFILE_NAME=hsqldb_$(HSQLDB_VERSION)
42
TARFILE_NAME=hsqldb-$(HSQLDB_VERSION)
44
TARFILE_MD5=17410483b5b5f267aa18b7e00b65e6e0
43
TARFILE_MD5=2509a76ac18240ea4747468a0aef13e5
45
44
46
TARFILE_ROOTDIR=hsqldb
45
TARFILE_ROOTDIR=hsqldb-$(HSQLDB_VERSION)$/$(PRJNAME)
47
46
48
CONVERTFILES=build$/build.xml \
47
CONVERTFILES=build$/build.xml
49
			src$/org$/hsqldb$/persist$/HsqlDatabaseProperties.java \
48
#			src$/org$/hsqldb$/persist$/HsqlDatabaseProperties.java \
50
			src$/org$/hsqldb$/Library.java
49
#			src$/org$/hsqldb$/Library.java
51
50
52
PATCH_FILES=patches$/i96823.patch \
51
#PATCH_FILES=patches$/hsqldb-2.2.6.patch
53
			patches$/i97032.patch \
54
			patches$/i103528.patch \
55
			patches$/i104901.patch
56
52
53
#ADDITIONAL_FILES=   src$/org$/hsqldb$/index$/IndexAVLMemory.java \
54
#					src$/org$/hsqldb$/persist$/ScaledRAFileSimple.java \
55
#					src$/org$/hsqldb$/lib$/ArraySort.java \
56
#					src$/org$/hsqldb$/result$/ResultProperties.java \
57
#					src$/org$/hsqldb$/navigator$/RowSetNavigatorDataTable.java
58
59
#                     src$/org$/hsqldb$/TxManager.java \
60
#                     src$/org$/hsqldb$/lib$/LongKeyIntValueHashMap.java \
61
#                     src$/org$/hsqldb$/persist$/ScaledRAFileInJar.java \
62
#                     src$/org$/hsqldb$/test$/TestCollation.java
63
57
.IF "$(JAVACISGCJ)"=="yes"
64
.IF "$(JAVACISGCJ)"=="yes"
58
JAVA_HOME=
65
JAVA_HOME=
59
.EXPORT : JAVA_HOME
66
.EXPORT : JAVA_HOME
60
BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
67
BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) $(PRJNAME)
61
.ELSE
68
.ELSE
62
.IF "$(debug)"!=""
69
.IF "$(debug)"!=""
63
BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.debug="on" -f $(ANT_BUILDFILE) jar
70
BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.debug="on" -f $(ANT_BUILDFILE) $(PRJNAME)
64
.ELSE
71
.ELSE
65
BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar
72
BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) $(PRJNAME)
66
.ENDIF
73
.ENDIF
67
.ENDIF
74
.ENDIF
68
75
Lines 75-79 Link Here
75
82
76
.IF "$(SOLAR_JAVA)" != ""
83
.IF "$(SOLAR_JAVA)" != ""
77
.INCLUDE : tg_ext.mk
84
.INCLUDE : tg_ext.mk
85
86
ALLTAR : $(CLASSDIR)$/$(PRJNAME).jar 
87
$(CLASSDIR)$/$(PRJNAME).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
88
	$(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/lib$/$(PRJNAME).jar $(CLASSDIR)$/$(PRJNAME).jar
89
78
.ENDIF
90
.ENDIF
79
91
(-)hsqldb/prj/d.lst (-1 / +1 lines)
Line 1 Link Here
1
..\%__SRC%\misc\build\hsqldb\lib\hsqldb.jar %_DEST%\bin%_EXT%\hsqldb.jar
1
..\%__SRC%\class\hsqldb.jar %_DEST%\bin%_EXT%\hsqldb.jar
(-)hsqldb/version.mk (-4 / +4 lines)
Lines 20-26 Link Here
20
# *************************************************************
20
# *************************************************************
21
# when you want to change the HSQLDB version, you must update the d.lst
21
# when you want to change the HSQLDB version, you must update the d.lst
22
# in the HSQLDB_thon project accordingly !!!
22
# in the HSQLDB_thon project accordingly !!!
23
HSQLDB_MAJOR=1
23
HSQLDB_MAJOR=2
24
HSQLDB_MINOR=8
24
HSQLDB_MINOR=2
25
HSQLDB_MICRO=0
25
HSQLDB_MICRO=6
26
HSQLDB_VERSION=$(HSQLDB_MAJOR)_$(HSQLDB_MINOR)_$(HSQLDB_MICRO)
26
HSQLDB_VERSION=$(HSQLDB_MAJOR).$(HSQLDB_MINOR).$(HSQLDB_MICRO)
(-)wizards/com/sun/star/wizards/table/FieldFormatter.java (-58 / +58 lines)
Lines 19-25 Link Here
19
 * 
19
 * 
20
 *************************************************************/
20
 *************************************************************/
21
21
22
23
package com.sun.star.wizards.table;
22
package com.sun.star.wizards.table;
24
23
25
import com.sun.star.awt.FontDescriptor;
24
import com.sun.star.awt.FontDescriptor;
Lines 28-35 Link Here
28
import com.sun.star.awt.XItemListener;
27
import com.sun.star.awt.XItemListener;
29
import com.sun.star.awt.XListBox;
28
import com.sun.star.awt.XListBox;
30
import com.sun.star.awt.XTextComponent;
29
import com.sun.star.awt.XTextComponent;
30
import com.sun.star.beans.PropertyChangeEvent;
31
import com.sun.star.beans.UnknownPropertyException;
32
import com.sun.star.beans.XPropertyChangeListener;
31
import com.sun.star.beans.XPropertySet;
33
import com.sun.star.beans.XPropertySet;
32
import com.sun.star.lang.EventObject;
34
import com.sun.star.lang.EventObject;
35
import com.sun.star.lang.WrappedTargetException;
33
import com.sun.star.uno.Exception;
36
import com.sun.star.uno.Exception;
34
import com.sun.star.uno.UnoRuntime;
37
import com.sun.star.uno.UnoRuntime;
35
import com.sun.star.wizards.common.Desktop;
38
import com.sun.star.wizards.common.Desktop;
Lines 38-51 Link Here
38
import com.sun.star.wizards.db.TableDescriptor;
41
import com.sun.star.wizards.db.TableDescriptor;
39
import com.sun.star.wizards.ui.UIConsts;
42
import com.sun.star.wizards.ui.UIConsts;
40
import com.sun.star.wizards.ui.UnoDialog;
43
import com.sun.star.wizards.ui.UnoDialog;
44
import java.util.logging.Level;
45
import java.util.logging.Logger;
41
46
42
public class FieldFormatter implements XItemListener
47
public class FieldFormatter implements XItemListener, XPropertyChangeListener
43
{
48
{
44
49
50
    private static final String COLUMN = "Column";
45
    TableWizard CurUnoDialog;
51
    TableWizard CurUnoDialog;
46
    TableDescriptor curTableDescriptor;
52
    TableDescriptor curTableDescriptor;
47
    Object oColumnDescriptorModel;
53
    Object oColumnDescriptorModel;
48
    XTextComponent txtfieldname;
49
    XListBox xlstFieldNames;
54
    XListBox xlstFieldNames;
50
    XButton btnplus;
55
    XButton btnplus;
51
    XButton btnminus;
56
    XButton btnminus;
Lines 55-61 Link Here
55
    String TOGGLEBUTTONS = "toggleButtons";
60
    String TOGGLEBUTTONS = "toggleButtons";
56
    String ADDFIELDNAME = "addFieldName";
61
    String ADDFIELDNAME = "addFieldName";
57
    String REMOVEFIELDNAME = "removeFieldName";
62
    String REMOVEFIELDNAME = "removeFieldName";
58
    String MODIFYFIELDNAME = "modifyFieldName";
59
    String[] fieldnames;
63
    String[] fieldnames;
60
    String suntitled;
64
    String suntitled;
61
    Integer IFieldFormatStep;
65
    Integer IFieldFormatStep;
Lines 155-181 Link Here
155
                    8, sfieldinfo, 0, 158, 27, IFieldFormatStep, new Short(curtabindex++), 165
159
                    8, sfieldinfo, 0, 158, 27, IFieldFormatStep, new Short(curtabindex++), 165
156
                });
160
                });
157
161
158
159
        CurUnoDialog.insertLabel("lblFieldName",
160
                new String[]
161
                {
162
                    PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
163
                },
164
                new Object[]
165
                {
166
                    UIConsts.INTEGERS[8], sFieldName, 158, 39, IFieldFormatStep, new Short(curtabindex++), 94
167
                });
168
169
        txtfieldname = CurUnoDialog.insertTextField("txtfieldname", MODIFYFIELDNAME, this,
170
                new String[]
171
                {
172
                    PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Text", PropertyNames.PROPERTY_WIDTH
173
                },
174
                new Object[]
175
                {
176
                    UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGTABLE_COLNAME", 274, 37, IFieldFormatStep, new Short(curtabindex++), PropertyNames.EMPTY_STRING, 50
177
                });
178
        txtfieldname.addTextListener(CurUnoDialog);
179
        CurUnoDialog.getPeerConfiguration().setAccessibleName(btnplus, sbtnplushelptext);
162
        CurUnoDialog.getPeerConfiguration().setAccessibleName(btnplus, sbtnplushelptext);
180
        CurUnoDialog.getPeerConfiguration().setAccessibleName(btnminus, sbtnminushelptext);
163
        CurUnoDialog.getPeerConfiguration().setAccessibleName(btnminus, sbtnminushelptext);
181
    }
164
    }
Lines 191-201 Link Here
191
                    }, // PropertyNames.PROPERTY_HELPURL
174
                    }, // PropertyNames.PROPERTY_HELPURL
192
                    new Object[]
175
                    new Object[]
193
                    {
176
                    {
194
                        85, 158, 49, IFieldFormatStep, new Short(curtabindex++), 166, 50
177
                        93, 158, 39, IFieldFormatStep, new Short(curtabindex++), 166, 50
195
                    });  //, "HID:WIZARDS_HID_DLGTABLE_COLMODIFIER"
178
                    });  //, "HID:WIZARDS_HID_DLGTABLE_COLMODIFIER"
196
            curTableDescriptor = _curTableDescriptor;
179
            curTableDescriptor = _curTableDescriptor;
197
            Helper.setUnoPropertyValue(oColumnDescriptorModel, PropertyNames.ACTIVE_CONNECTION, _curTableDescriptor.DBConnection);
180
            Helper.setUnoPropertyValue(oColumnDescriptorModel, PropertyNames.ACTIVE_CONNECTION, _curTableDescriptor.DBConnection);
198
            txtfieldname.setMaxTextLen((short) this.curTableDescriptor.getMaxColumnNameLength());
199
        }
181
        }
200
        else
182
        else
201
        {
183
        {
Lines 237-242 Link Here
237
219
238
    public void addFieldName()
220
    public void addFieldName()
239
    {
221
    {
222
240
        String snewfieldname = Desktop.getUniqueName(xlstFieldNames.getItems(), suntitled, PropertyNames.EMPTY_STRING);
223
        String snewfieldname = Desktop.getUniqueName(xlstFieldNames.getItems(), suntitled, PropertyNames.EMPTY_STRING);
241
        short icount = xlstFieldNames.getItemCount();
224
        short icount = xlstFieldNames.getItemCount();
242
        if (CurUnoDialog.verifyfieldcount(icount))
225
        if (CurUnoDialog.verifyfieldcount(icount))
Lines 293-300 Link Here
293
        }
276
        }
294
        else
277
        else
295
        {
278
        {
296
            Helper.setUnoPropertyValue(UnoDialog.getModel(txtfieldname), "Text", PropertyNames.EMPTY_STRING);
297
            Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(benable));
279
            Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(benable));
280
298
            CurUnoDialog.setcompleted(TableWizard.SOFIELDSFORMATPAGE, benable);
281
            CurUnoDialog.setcompleted(TableWizard.SOFIELDSFORMATPAGE, benable);
299
        }
282
        }
300
        Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(benable));
283
        Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(benable));
Lines 302-333 Link Here
302
        CurUnoDialog.repaintDialogStep();
285
        CurUnoDialog.repaintDialogStep();
303
    }
286
    }
304
287
305
    public void modifyFieldName()
306
    {
307
        String newfieldname = txtfieldname.getText();
308
        String oldfieldname = xlstFieldNames.getSelectedItem();
309
        if (!newfieldname.equals(oldfieldname))
310
        {
311
            if (curTableDescriptor.modifyColumnName(oldfieldname, newfieldname))
312
            {
313
                Object oColumn = Helper.getUnoPropertyValue(oColumnDescriptorModel, "Column");
314
                Helper.setUnoPropertyValue(oColumn, PropertyNames.PROPERTY_NAME, newfieldname);
315
                FieldDescription curfielddescription = (FieldDescription) CurUnoDialog.fielditems.get(oldfieldname);
316
                CurUnoDialog.fielditems.remove(oldfieldname);
317
                curfielddescription.setName(newfieldname);
318
                CurUnoDialog.fielditems.put(newfieldname, curfielddescription);
319
                String[] fieldnames = xlstFieldNames.getItems();
320
                short ipos = xlstFieldNames.getSelectedItemPos();
321
                fieldnames[ipos] = newfieldname;
322
                Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST, fieldnames);
323
                Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[]
324
                        {
325
                            ipos
326
                        });
327
            }
328
        }
329
    }
330
331
    public void shiftFieldNameUp()
288
    public void shiftFieldNameUp()
332
    {
289
    {
333
        short ipos = xlstFieldNames.getSelectedItemPos();
290
        short ipos = xlstFieldNames.getSelectedItemPos();
Lines 374-384 Link Here
374
331
375
    public boolean updateColumnofColumnDescriptor()
332
    public boolean updateColumnofColumnDescriptor()
376
    {
333
    {
377
        Object oColumn = Helper.getUnoPropertyValue(oColumnDescriptorModel, "Column");
334
        Object oColumn = Helper.getUnoPropertyValue(oColumnDescriptorModel, COLUMN);
378
        XPropertySet xColPropertySet = UnoRuntime.queryInterface(XPropertySet.class, oColumn);
335
        XPropertySet xColPropertySet = UnoRuntime.queryInterface(XPropertySet.class, oColumn);
379
        if (xColPropertySet != null)
336
        if (xColPropertySet != null)
380
        {
337
        {
381
            curTableDescriptor.modifyColumn(txtfieldname.getText(), xColPropertySet);
338
            try
339
            {
340
                curTableDescriptor.modifyColumn((String) xColPropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME), xColPropertySet);
341
            }
342
            catch (UnknownPropertyException ex)
343
            {
344
                Logger.getLogger(FieldFormatter.class.getName()).log(Level.SEVERE, null, ex);
345
            }
346
            catch (WrappedTargetException ex)
347
            {
348
                Logger.getLogger(FieldFormatter.class.getName()).log(Level.SEVERE, null, ex);
349
            }
382
            return true;
350
            return true;
383
        }
351
        }
384
        return false;
352
        return false;
Lines 390-398 Link Here
390
        XPropertySet xNewPropertySet = curTableDescriptor.clonePropertySet(_ColumnName, _xColumn);
358
        XPropertySet xNewPropertySet = curTableDescriptor.clonePropertySet(_ColumnName, _xColumn);
391
        if (xNewPropertySet != null)
359
        if (xNewPropertySet != null)
392
        {
360
        {
393
            Helper.setUnoPropertyValue(oColumnDescriptorModel, "Column", xNewPropertySet);
361
            try
362
            {
363
                xNewPropertySet.addPropertyChangeListener(PropertyNames.PROPERTY_NAME, this);
364
            }
365
            catch (UnknownPropertyException ex)
366
            {
367
                Logger.getLogger(FieldFormatter.class.getName()).log(Level.SEVERE, null, ex);
368
            }
369
            catch (WrappedTargetException ex)
370
            {
371
                Logger.getLogger(FieldFormatter.class.getName()).log(Level.SEVERE, null, ex);
372
            }
373
            Helper.setUnoPropertyValue(oColumnDescriptorModel, COLUMN, xNewPropertySet);
394
        }
374
        }
395
        txtfieldname.setText(_ColumnName);
396
    }
375
    }
397
376
398
    public XPropertySet clonePropertySet(XPropertySet _xPropertySet)
377
    public XPropertySet clonePropertySet(XPropertySet _xPropertySet)
Lines 426-429 Link Here
426
    {
405
    {
427
        // TODO Auto-generated method stub
406
        // TODO Auto-generated method stub
428
    }
407
    }
408
409
    public void propertyChange(PropertyChangeEvent pce)
410
    {
411
        String newfieldname = (String) pce.NewValue;
412
        String oldfieldname = xlstFieldNames.getSelectedItem();
413
        if (!newfieldname.equals(oldfieldname) && curTableDescriptor.modifyColumnName(oldfieldname, newfieldname))
414
        {
415
            FieldDescription curfielddescription = (FieldDescription) CurUnoDialog.fielditems.get(oldfieldname);
416
            CurUnoDialog.fielditems.remove(oldfieldname);
417
            curfielddescription.setName(newfieldname);
418
            CurUnoDialog.fielditems.put(newfieldname, curfielddescription);
419
            String[] currentFieldNames = xlstFieldNames.getItems();
420
            short ipos = xlstFieldNames.getSelectedItemPos();
421
            currentFieldNames[ipos] = newfieldname;
422
            Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST, currentFieldNames);
423
            Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[]
424
                    {
425
                        ipos
426
                    });
427
        }
428
    }
429
}
429
}

Return to issue 121837