[Libreoffice-commits] .: 14 commits - automation/source basic/source connectivity/source dbaccess/source desktop/source lotuswordpro/source officecfg/Configuration_officecfg.mk officecfg/registry padmin/source sfx2/inc sfx2/source svx/source sw/source tools/inc tools/source unusedcode.easy xmloff/source
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Aug 19 01:31:14 PDT 2011
automation/source/server/server.cxx | 6
automation/source/testtool/objtest.cxx | 14
basic/source/app/app.cxx | 16
basic/source/app/appedit.cxx | 6
basic/source/app/apperror.cxx | 8
basic/source/app/brkpnts.cxx | 13
basic/source/app/dialogs.cxx | 10
connectivity/source/drivers/adabas/BCatalog.cxx | 169
connectivity/source/drivers/adabas/BColumns.cxx | 183 -
connectivity/source/drivers/adabas/BConnection.cxx | 274 -
connectivity/source/drivers/adabas/BDatabaseMetaData.cxx | 156
connectivity/source/drivers/adabas/BDriver.cxx | 1870 -----------
connectivity/source/drivers/adabas/BFunctions.cxx | 256 -
connectivity/source/drivers/adabas/BGroup.cxx | 93
connectivity/source/drivers/adabas/BGroups.cxx | 94
connectivity/source/drivers/adabas/BIndex.cxx | 105
connectivity/source/drivers/adabas/BIndexColumns.cxx | 123
connectivity/source/drivers/adabas/BIndexes.cxx | 194 -
connectivity/source/drivers/adabas/BKeys.cxx | 183 -
connectivity/source/drivers/adabas/BPreparedStatement.cxx | 78
connectivity/source/drivers/adabas/BResultSet.cxx | 225 -
connectivity/source/drivers/adabas/BResultSetMetaData.cxx | 87
connectivity/source/drivers/adabas/BStatement.cxx | 81
connectivity/source/drivers/adabas/BTable.cxx | 378 --
connectivity/source/drivers/adabas/BTables.cxx | 523 ---
connectivity/source/drivers/adabas/BUser.cxx | 332 -
connectivity/source/drivers/adabas/BUsers.cxx | 130
connectivity/source/drivers/adabas/BViews.cxx | 197 -
connectivity/source/drivers/adabas/Bservices.cxx | 115
connectivity/source/drivers/adabas/adabas.component | 35
connectivity/source/drivers/adabas/adabas.mxp.map | 146
connectivity/source/drivers/adabas/adabas.xcu | 130
connectivity/source/drivers/adabas/adabas.xml | 25
connectivity/source/drivers/adabas/exports.dxp | 1
connectivity/source/drivers/adabas/makefile.mk | 114
connectivity/source/drivers/dbase/DIndex.cxx | 2
dbaccess/source/ui/dlg/dbfindex.cxx | 2
desktop/source/app/app.cxx | 2
lotuswordpro/source/filter/bencont.cxx | 6
lotuswordpro/source/filter/bento.hxx | 1
lotuswordpro/source/filter/lwpgrfobj.cxx | 37
lotuswordpro/source/filter/lwpgrfobj.hxx | 1
lotuswordpro/source/filter/lwpnumberingoverride.cxx | 30
lotuswordpro/source/filter/lwpnumberingoverride.hxx | 3
officecfg/Configuration_officecfg.mk | 1
officecfg/registry/data/org/openoffice/Office/makefile.mk | 120
officecfg/registry/schema/org/openoffice/Office/Recovery.xcs | 2
padmin/source/fontentry.cxx | 2
padmin/source/newppdlg.cxx | 4
sfx2/inc/sfx2/sfxhtml.hxx | 5
sfx2/inc/sfx2/tabdlg.hxx | 2
sfx2/source/bastyp/sfxhtml.cxx | 38
sfx2/source/dialog/tabdlg.cxx | 26
sfx2/source/inc/virtmenu.hxx | 2
sfx2/source/menu/virtmenu.cxx | 15
svx/source/dialog/docrecovery.cxx | 2
svx/source/unodraw/recoveryui.cxx | 2
sw/source/core/tox/tox.cxx | 3
sw/source/filter/html/htmlcss1.cxx | 2
sw/source/filter/ww8/wrtw8esh.cxx | 12
sw/source/filter/ww8/wrtww8.cxx | 12
sw/source/ui/dochdl/swdtflvr.cxx | 23
sw/source/ui/vba/vbasystem.cxx | 2
tools/inc/tools/config.hxx | 24
tools/source/generic/config.cxx | 113
unusedcode.easy | 15
xmloff/source/chart/ColorPropertySet.cxx | 10
xmloff/source/chart/ColorPropertySet.hxx | 3
68 files changed, 146 insertions(+), 6748 deletions(-)
New commits:
commit 2f800d902f060fdb43a56e381264e0b626f1af2f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 09:29:20 2011 +0100
fdo#37206 toggle default config to false for crash-reporter installed
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 9f3ac9e..4a02c28 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1192,7 +1192,7 @@ void Desktop::retrieveCrashReporterState()
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- sal_Bool bEnabled( sal_True );
+ sal_Bool bEnabled(sal_False);
if ( xSMGR.is() )
{
css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
diff --git a/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs b/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs
index f424180..e08bf38 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs
@@ -127,7 +127,7 @@
<info>
<desc>Specifies if the crash reporter should be enabled or disabled.</desc>
</info>
- <value>true</value>
+ <value>false</value>
</prop>
</group>
<group oor:name="AutoSave">
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index ba1f9d8..8def4d8 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -1040,7 +1040,7 @@ RecoveryDialog::RecoveryDialog(Window* pParent,
::rtl::OUString CFG_PATH_CRASHREPORTER( RTL_CONSTASCII_USTRINGPARAM( "CrashReporter" ));
::rtl::OUString CFG_ENTRY_ENABLED( RTL_CONSTASCII_USTRINGPARAM ( "Enabled" ));
- sal_Bool bCrashRepEnabled( sal_True );
+ sal_Bool bCrashRepEnabled( sal_False );
css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
pCore->getSMGR(),
CFG_PACKAGE_RECOVERY,
diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx
index 00c8983..9a5c3b6 100644
--- a/svx/source/unodraw/recoveryui.cxx
+++ b/svx/source/unodraw/recoveryui.cxx
@@ -298,7 +298,7 @@ void RecoveryUI::impl_doRecovery()
::rtl::OUString CFG_PATH_CRASHREPORTER( RTL_CONSTASCII_USTRINGPARAM( "CrashReporter" ));
::rtl::OUString CFG_ENTRY_ENABLED( RTL_CONSTASCII_USTRINGPARAM ( "Enabled" ));
- sal_Bool bCrashRepEnabled( sal_True );
+ sal_Bool bCrashRepEnabled(sal_False);
css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
m_xSMGR,
CFG_PACKAGE_RECOVERY,
commit 00b764d9e924228582ac1fa2b9fb24c5b81403b2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 08:55:02 2011 +0100
callcatcher: regenerate list
diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx
index 85bcb7a..f7d1d24 100644
--- a/sfx2/inc/sfx2/tabdlg.hxx
+++ b/sfx2/inc/sfx2/tabdlg.hxx
@@ -133,7 +133,6 @@ protected:
SfxItemSet* GetInputSetImpl();
SfxTabPage* GetTabPage( sal_uInt16 nPageId ) const;
- sal_Bool IsInOK() const;
/** prepare to leace the current page. Calls the DeactivatePage method of the current page, (if necessary),
handles the item sets to copy.
@return sal_True if it is allowed to leave the current page, sal_False otherwise
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index a91251f..34caddf 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1017,13 +1017,6 @@ SfxTabPage* SfxTabDialog::GetTabPage( sal_uInt16 nPageId ) const
// -----------------------------------------------------------------------
-sal_Bool SfxTabDialog::IsInOK() const
-{
- return pImpl->bInOK;
-}
-
-// -----------------------------------------------------------------------
-
short SfxTabDialog::Ok()
/* [Description]
diff --git a/unusedcode.easy b/unusedcode.easy
index 3c61688..731b528 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -2639,6 +2639,8 @@ connectivity::odbc::ODatabaseMetaDataResultSet::openTablesTypes()
connectivity::odbc::OPreparedStatement::getDataBuf(int)
connectivity::odbc::OPreparedStatement::getParamLength(int)
connectivity::odbc::OPreparedStatement::getPrecision(int)
+connectivity::sdbcx::OGroup::OGroup(rtl::OUString const&, unsigned char)
+connectivity::sdbcx::OGroup::OGroup(unsigned char)
connectivity::toString(com::sun::star::uno::Any const&)
cppcanvas::BaseGfxFactory::createPolyPolygon(boost::shared_ptr<cppcanvas::Canvas> const&, basegfx::B2DPolyPolygon const&) const
cppcanvas::BaseGfxFactory::createText(boost::shared_ptr<cppcanvas::Canvas> const&, rtl::OUString const&) const
commit ed51a3a41670252cc2db95614f496b6559f02e0f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 08:54:42 2011 +0100
ByteString->rtl::OString
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index c7591f9..8da8d8c 100755
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -3505,21 +3505,22 @@ sal_Bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm )
return sal_False;
rtl_TextEncoding eEncoding = DDE_TXT_ENCODING;
- const ByteString aAppNm( GetpApp()->GetAppName(), eEncoding );
- const ByteString aTopic( pDocShell->GetTitle( SFX_TITLE_FULLNAME ),
- eEncoding );
- const ByteString aName( sName, eEncoding );
+ const rtl::OString aAppNm(rtl::OUStringToOString(
+ GetpApp()->GetAppName(), eEncoding));
+ const rtl::OString aTopic(rtl::OUStringToOString(
+ pDocShell->GetTitle(SFX_TITLE_FULLNAME), eEncoding));
+ const rtl::OString aName(rtl::OUStringToOString(sName, eEncoding));
- sal_Char* pMem = new char[ aAppNm.Len() + aTopic.Len() + aName.Len() + 4 ];
+ sal_Char* pMem = new sal_Char[ aAppNm.getLength() + aTopic.getLength() + aName.getLength() + 4 ];
- xub_StrLen nLen = aAppNm.Len();
- memcpy( pMem, aAppNm.GetBuffer(), nLen );
+ sal_Int32 nLen = aAppNm.getLength();
+ memcpy( pMem, aAppNm.getStr(), nLen );
pMem[ nLen++ ] = 0;
- memcpy( pMem + nLen, aTopic.GetBuffer(), aTopic.Len() );
- nLen = nLen + aTopic.Len();
+ memcpy( pMem + nLen, aTopic.getStr(), aTopic.getLength() );
+ nLen = nLen + aTopic.getLength();
pMem[ nLen++ ] = 0;
- memcpy( pMem + nLen, aName.GetBuffer(), aName.Len() );
- nLen = nLen + aName.Len();
+ memcpy( pMem + nLen, aName.getStr(), aName.getLength() );
+ nLen = nLen + aName.getLength();
pMem[ nLen++ ] = 0;
pMem[ nLen++ ] = 0;
commit 876083ba299ec3d8ccece11d44d21fc636d0630d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 00:45:56 2011 +0100
drop unused non-virtuals
diff --git a/unusedcode.easy b/unusedcode.easy
index 39f5479..3c61688 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -3756,5 +3756,3 @@ xmloff::OControlStyleContext::OControlStyleContext(SvXMLImport&, unsigned short,
xmloff::OFormLayerXMLExport::exportControlNumberStyles()
xmloff::OFormLayerXMLExport::initialize()
xmloff::OFormLayerXMLImport::seekPage(com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> const&)
-xmloff::chart::ColorPropertySet::getColor()
-xmloff::chart::ColorPropertySet::setColor(int)
diff --git a/xmloff/source/chart/ColorPropertySet.cxx b/xmloff/source/chart/ColorPropertySet.cxx
index e4a8525..d60a24d 100644
--- a/xmloff/source/chart/ColorPropertySet.cxx
+++ b/xmloff/source/chart/ColorPropertySet.cxx
@@ -112,16 +112,6 @@ ColorPropertySet::ColorPropertySet( sal_Int32 nColor, bool bFillColor /* = true
ColorPropertySet::~ColorPropertySet()
{}
-void ColorPropertySet::setColor( sal_Int32 nColor )
-{
- m_nColor = nColor;
-}
-
-sal_Int32 ColorPropertySet::getColor()
-{
- return m_nColor;
-}
-
// ____ XPropertySet ____
Reference< XPropertySetInfo > SAL_CALL ColorPropertySet::getPropertySetInfo()
diff --git a/xmloff/source/chart/ColorPropertySet.hxx b/xmloff/source/chart/ColorPropertySet.hxx
index 003c611..9a5d422 100644
--- a/xmloff/source/chart/ColorPropertySet.hxx
+++ b/xmloff/source/chart/ColorPropertySet.hxx
@@ -47,9 +47,6 @@ public:
explicit ColorPropertySet( sal_Int32 nColor, bool bFillColor = true );
virtual ~ColorPropertySet();
- void setColor( sal_Int32 nColor );
- sal_Int32 getColor();
-
protected:
// ____ XPropertySet ____
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
commit 2064934b26abdaa97ffe0983b3bef9ec772e42bd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 00:25:52 2011 +0100
pointless temp objects, stray debugging code ?
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index f38c061..ed7d495 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -606,9 +606,6 @@ void SwTOXBase::SetTitle(const String& rTitle)
SwTOXBase & SwTOXBase::operator = (const SwTOXBase & rSource)
{
- ByteString aTmpStr(aTitle, RTL_TEXTENCODING_ASCII_US);
- ByteString aTmpStr1(rSource.aTitle, RTL_TEXTENCODING_ASCII_US);
-
aForm = rSource.aForm;
aName = rSource.aName;
aTitle = rSource.aTitle;
commit 6b28a77e1b5d68f6e1bd1b473c66e4743651211d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 00:24:55 2011 +0100
ByteString->rtl::OString
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 6a7e9d9..01dc77d 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1419,9 +1419,9 @@ sal_Int32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrmFmt& rFmt, sal_uInt32 nSh
Graphic aGraphic(pGrfNd->GetGrf());
GraphicObject aGraphicObject( aGraphic );
- ByteString aUniqueId = aGraphicObject.GetUniqueID();
+ rtl::OString aUniqueId = aGraphicObject.GetUniqueID();
- if ( aUniqueId.Len() )
+ if (!aUniqueId.isEmpty())
{
const MapMode aMap100mm( MAP_100TH_MM );
Size aSize( aGraphic.GetPrefSize() );
@@ -1628,8 +1628,8 @@ void SwBasicEscherEx::WriteBrushAttr(const SvxBrushItem &rBrush,
sal_uInt32 nOpaque = 0;
if (const GraphicObject *pGraphicObject = rBrush.GetGraphicObject())
{
- ByteString aUniqueId = pGraphicObject->GetUniqueID();
- if (aUniqueId.Len())
+ rtl::OString aUniqueId = pGraphicObject->GetUniqueID();
+ if (!aUniqueId.isEmpty())
{
const Graphic &rGraphic = pGraphicObject->GetGraphic();
Size aSize(rGraphic.GetPrefSize());
@@ -2671,8 +2671,8 @@ void SwBasicEscherEx::WriteOLEPicture(EscherPropertyContainer &rPropOpt,
AddShape(ESCHER_ShpInst_PictureFrame, nShapeFlags, nShapeId);
GraphicObject aGraphicObject(rGraphic);
- ByteString aId = aGraphicObject.GetUniqueID();
- if (aId.Len())
+ rtl::OString aId = aGraphicObject.GetUniqueID();
+ if (!aId.getLength())
{
Rectangle aRect = rObj.GetLogicRect();
aRect.SetPos(Point(0,0));
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 9dac885..9f7eb84 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1548,10 +1548,10 @@ void SwWW8Writer::InsAsString16(ww::bytes &rO, const String& rStr)
void SwWW8Writer::InsAsString8(ww::bytes &rO, const String& rStr,
rtl_TextEncoding eCodeSet)
{
- ByteString sTmp(rStr, eCodeSet);
- const sal_Char *pStart = sTmp.GetBuffer();
- const sal_Char *pEnd = pStart + sTmp.Len();
- rO.reserve(rO.size() + sTmp.Len());
+ rtl::OString sTmp(rtl::OUStringToOString(rStr, eCodeSet));
+ const sal_Char *pStart = sTmp.getStr();
+ const sal_Char *pEnd = pStart + sTmp.getLength();
+ rO.reserve(rO.size() + sTmp.getLength());
std::copy(pStart, pEnd, std::inserter(rO, rO.end()));
}
@@ -1594,8 +1594,8 @@ void SwWW8Writer::InsAsString16( WW8Bytes& rO, const String& rStr )
void SwWW8Writer::InsAsString8( WW8Bytes& rO, const String& rStr,
rtl_TextEncoding eCodeSet )
{
- ByteString sTmp( rStr, eCodeSet );
- rO.Insert( (sal_uInt8*)sTmp.GetBuffer(), sTmp.Len(), rO.Count() );
+ rtl::OString sTmp(rtl::OUStringToOString(rStr, eCodeSet));
+ rO.Insert((sal_uInt8*)sTmp.getStr(), sTmp.getLength(), rO.Count());
}
void SwWW8Writer::WriteString16(SvStream& rStrm, const String& rStr,
commit 8d4b87b7b294d5538a539a9640a19a5b13c6da4f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 00:01:42 2011 +0100
use preferred tokenizer
diff --git a/basic/source/app/brkpnts.cxx b/basic/source/app/brkpnts.cxx
index 57406fe..920e5ad 100644
--- a/basic/source/app/brkpnts.cxx
+++ b/basic/source/app/brkpnts.cxx
@@ -220,15 +220,16 @@ void BreakpointWindow::LoadBreakpoints( String aFilename )
aConfig.SetGroup("Breakpoints");
- ByteString aBreakpoints;
- aBreakpoints = aConfig.ReadKey( ByteString( aFilename, RTL_TEXTENCODING_UTF8 ) );
+ rtl::OString aBreakpoints =
+ aConfig.ReadKey(rtl::OUStringToOString(aFilename, RTL_TEXTENCODING_UTF8));
- xub_StrLen i;
-
- for ( i = 0 ; i < aBreakpoints.GetTokenCount( ';' ) ; i++ )
+ sal_Int32 nIndex = 0;
+ do
{
- InsertBreakpoint( (sal_uInt16)aBreakpoints.GetToken( i, ';' ).ToInt32() );
+ rtl::OString aBreakpoint = aBreakpoints.getToken(0, ';', nIndex);
+ InsertBreakpoint(static_cast<sal_uInt16>(aBreakpoint.toInt32()));
}
+ while ( nIndex >= 0 );
}
commit d1fb13adf9ab73e53851e5d56cbbbe33bcdcd82c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 18 22:30:22 2011 +0100
convert tools::Config to rtl::OString
diff --git a/automation/source/server/server.cxx b/automation/source/server/server.cxx
index ccf0e7f..44c2c0d 100644
--- a/automation/source/server/server.cxx
+++ b/automation/source/server/server.cxx
@@ -216,17 +216,17 @@ sal_uLong RemoteControlCommunicationManager::GetPort()
aConf.WriteKey( aNoTesttoolKey, "something" );
}
- nPortIs = aConf.ReadKey("TTPort","0").ToInt32();
+ nPortIs = aConf.ReadKey("TTPort","0").toInt32();
// noch pr�fen ob dieses Office getestet werden soll.
if ( !bAutomate || aConf.ReadKey( aNoTesttoolKey, "" ) != "" )
nPortIs = 0;
- nComm = (sal_uInt16)aConf.ReadKey("Comm","0").ToInt32();
+ nComm = (sal_uInt16)aConf.ReadKey("Comm","0").toInt32();
if ( nComm )
aConf.DeleteKey("Comm");
- bQuiet = ( aConf.ReadKey("Quiet","no").CompareIgnoreCaseToAscii("yes") == COMPARE_EQUAL );
+ bQuiet = aConf.ReadKey("Quiet","no").equalsIgnoreAsciiCase("yes");
}
return nPortIs;
}
diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx
index 78a2928..1f2be28 100644
--- a/automation/source/testtool/objtest.cxx
+++ b/automation/source/testtool/objtest.cxx
@@ -362,11 +362,11 @@ void TestToolObj::LoadIniFile() // Laden der IniEinstellungen, die d
aVar = UniString( __##aVar##__, RTL_TEXTENCODING_UTF8 );\
}
-#define NEWOLD( NewKey, OldKey ) \
- { \
- ByteString aValue; \
- if ( ( (aValue = aConf.ReadKey( OldKey )).Len() ) && !aConf.ReadKey( NewKey ).Len() ) \
- aConf.WriteKey( NewKey, aValue ); \
+#define NEWOLD( NewKey, OldKey ) \
+ { \
+ rtl::OString aValue; \
+ if ( ( (aValue = aConf.ReadKey( OldKey )).getLength() ) && !aConf.ReadKey( NewKey ).getLength() ) \
+ aConf.WriteKey( NewKey, aValue ); \
}
@@ -381,8 +381,8 @@ void TestToolObj::LoadIniFile() // Laden der IniEinstellungen, die d
pImpl->aFileBase = DirEntry(aFB);
// remove old keys
- if ( aConf.ReadKey("KeyCodes + Classes").Len() != 0 ||
- aConf.ReadKey("KeyCodes + Classes + Res_Type").Len() != 0 )
+ if ( aConf.ReadKey("KeyCodes + Classes").getLength() != 0 ||
+ aConf.ReadKey("KeyCodes + Classes + Res_Type").getLength() != 0 )
{
aConf.DeleteKey("KeyCodes + Classes + Res_Type");
aConf.DeleteKey("KeyCodes + Classes");
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index 6509ad8..392d246 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -604,8 +604,8 @@ void BasicFrame::LoadIniFile()
for ( i = 0 ; i < aConf.GetGroupCount() ; i++ )
{
aConf.SetGroup( ByteString( aConf.GetGroupName( i ) ) );
- if ( ( aConf.ReadKey( "Aktuell" ).Len() || aConf.ReadKey( "Alle" ).Len() )
- &&( !aConf.ReadKey( "Current" ).Len() && !aConf.ReadKey( "All" ).Len() ) )
+ if ( ( aConf.ReadKey( "Aktuell" ).getLength() || aConf.ReadKey( "Alle" ).getLength() )
+ &&( !aConf.ReadKey( "Current" ).getLength() && !aConf.ReadKey( "All" ).getLength() ) )
{
aConf.WriteKey( "Current", aConf.ReadKey( "Aktuell" ) );
aConf.WriteKey( "All", aConf.ReadKey( "Alle" ) );
@@ -1061,13 +1061,13 @@ void BasicFrame::AddToLRU(String const& aFile)
PopupMenu *pPopup = GetMenuBar()->GetPopupMenu(RID_APPFILE);
aConfig.SetGroup("LRU");
- sal_uInt16 nMaxLRU = (sal_uInt16)aConfig.ReadKey("MaxLRU","4").ToInt32();
+ sal_uInt16 nMaxLRU = (sal_uInt16)aConfig.ReadKey("MaxLRU","4").toInt32();
DirEntry aFileEntry( aFile );
sal_uInt16 i,nLastMove = nMaxLRU;
for ( i = 1 ; i<nMaxLRU && nLastMove == nMaxLRU ; i++ )
{
- if ( DirEntry( UniString( aConfig.ReadKey(LRUNr(i),""), RTL_TEXTENCODING_UTF8 ) ) == aFileEntry )
+ if ( DirEntry( rtl::OStringToOUString(aConfig.ReadKey(LRUNr(i),""), RTL_TEXTENCODING_UTF8) ) == aFileEntry )
nLastMove = i;
}
@@ -1075,7 +1075,7 @@ void BasicFrame::AddToLRU(String const& aFile)
pPopup->InsertSeparator();
for ( i = nLastMove ; i>1 ; i-- )
{
- if ( aConfig.ReadKey(LRUNr(i-1),"").Len() )
+ if ( aConfig.ReadKey(LRUNr(i-1),"").getLength() )
{
aConfig.WriteKey(LRUNr(i), aConfig.ReadKey(LRUNr(i-1),""));
if ( pPopup->GetItemPos( IDM_FILE_LRU1 + i-1 ) == MENU_ITEM_NOTFOUND )
@@ -1098,7 +1098,7 @@ void BasicFrame::LoadLRU()
sal_Bool bAddSep = sal_True;
aConfig.SetGroup("LRU");
- sal_uInt16 nMaxLRU = (sal_uInt16)aConfig.ReadKey("MaxLRU","4").ToInt32();
+ sal_uInt16 nMaxLRU = (sal_uInt16)aConfig.ReadKey("MaxLRU","4").toInt32();
if ( pPopup )
bAddSep = pPopup->GetItemPos( IDM_FILE_LRU1 ) == MENU_ITEM_NOTFOUND;
@@ -1106,7 +1106,7 @@ void BasicFrame::LoadLRU()
sal_uInt16 i;
for ( i = 1; i <= nMaxLRU && pPopup != NULL; i++)
{
- String aFile = UniString( aConfig.ReadKey(LRUNr(i)), RTL_TEXTENCODING_UTF8 );
+ String aFile = rtl::OStringToOUString(aConfig.ReadKey(LRUNr(i)), RTL_TEXTENCODING_UTF8);
if (aFile.Len() != 0)
{
@@ -1698,7 +1698,7 @@ void NewFileDialog::FilterSelect()
aConf.SetGroup( "Misc" );
ByteString aCurrentProfile = aConf.ReadKey( "CurrentProfile", "Path" );
aConf.SetGroup( aCurrentProfile );
- aLastPath = UniString( aConf.ReadKey( aFilterType, aConf.ReadKey( "BaseDir" ) ), RTL_TEXTENCODING_UTF8 );
+ aLastPath = rtl::OStringToOUString(aConf.ReadKey(aFilterType, aConf.ReadKey( "BaseDir")), RTL_TEXTENCODING_UTF8);
SetPath( aLastPath );
}
diff --git a/basic/source/app/appedit.cxx b/basic/source/app/appedit.cxx
index 1cf75d1..1fffbc2 100644
--- a/basic/source/app/appedit.cxx
+++ b/basic/source/app/appedit.cxx
@@ -85,9 +85,9 @@ void AppEdit::LoadIniFile()
FontList aFontList( pFrame ); // Just some Window is needed
Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
aConf.SetGroup("Misc");
- String aFontName = String( aConf.ReadKey( "ScriptFontName", "Courier" ), RTL_TEXTENCODING_UTF8 );
- String aFontStyle = String( aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8 );
- String aFontSize = String( aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8 );
+ String aFontName = rtl::OStringToOUString(aConf.ReadKey( "ScriptFontName", "Courier" ), RTL_TEXTENCODING_UTF8);
+ String aFontStyle = rtl::OStringToOUString(aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8);
+ String aFontSize = rtl::OStringToOUString(aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8);
Font aFont = aFontList.Get( aFontName, aFontStyle );
sal_uIntPtr nFontSize = aFontSize.ToInt32();
aFont.SetHeight( nFontSize );
diff --git a/basic/source/app/apperror.cxx b/basic/source/app/apperror.cxx
index 04b9e8e..f6e3fc5 100644
--- a/basic/source/app/apperror.cxx
+++ b/basic/source/app/apperror.cxx
@@ -88,16 +88,16 @@ void AppError::LoadIniFile()
{
Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
aConf.SetGroup("Misc");
- ByteString aCurrentProfile = aConf.ReadKey( "CurrentProfile", "Path" );
+ rtl::OString aCurrentProfile = aConf.ReadKey( "CurrentProfile", "Path" );
aConf.SetGroup( aCurrentProfile );
aBaseDir = DirEntry( aConf.ReadKey("BaseDir") );
FontList aFontList( pFrame ); // Just some Window is needed
aConf.SetGroup("Misc");
- String aFontName = String( aConf.ReadKey( "ScriptFontName", "Courier" ), RTL_TEXTENCODING_UTF8 );
- String aFontStyle = String( aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8 );
- String aFontSize = String( aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8 );
+ String aFontName = rtl::OStringToOUString(aConf.ReadKey( "ScriptFontName", "Courier" ), RTL_TEXTENCODING_UTF8);
+ String aFontStyle = rtl::OStringToOUString(aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8);
+ String aFontSize = rtl::OStringToOUString(aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8);
Font aFont = aFontList.Get( aFontName, aFontStyle );
sal_uIntPtr nFontSize = aFontSize.ToInt32();
aFont.SetHeight( nFontSize );
diff --git a/basic/source/app/dialogs.cxx b/basic/source/app/dialogs.cxx
index 2f692ab..77e1e09 100644
--- a/basic/source/app/dialogs.cxx
+++ b/basic/source/app/dialogs.cxx
@@ -146,7 +146,7 @@ void ConfEdit::Init( Config &aConf )
ByteString aCurrentProfile = aConf.ReadKey( "CurrentProfile", "Path" );
aConf.SetGroup( aCurrentProfile );
- String aTemp = UniString( aConf.ReadKey( aKeyName ), RTL_TEXTENCODING_UTF8 );
+ String aTemp = rtl::OStringToOUString(aConf.ReadKey(aKeyName), RTL_TEXTENCODING_UTF8);
aEdit.SetText( aTemp );
}
@@ -182,7 +182,7 @@ void ConfEdit::Reload( Config &aConf )
aConf.SetGroup("Misc");
ByteString aCurrentProfile = aConf.ReadKey( "CurrentProfile", "Path" );
aConf.SetGroup( aCurrentProfile );
- String aValue = String( aConf.ReadKey( aKeyName ), RTL_TEXTENCODING_UTF8 );
+ String aValue = rtl::OStringToOUString(aConf.ReadKey(aKeyName), RTL_TEXTENCODING_UTF8);
aEdit.SetText( aValue );
}
@@ -817,7 +817,7 @@ void GenericOptions::LoadData()
{
String* pGroup = pGroups->at( i );
aConf.SetGroup( ByteString( *pGroup, RTL_TEXTENCODING_UTF8 ) );
- if ( aConf.ReadKey( C_KEY_AKTUELL ).Len() > 0 )
+ if ( aConf.ReadKey( C_KEY_AKTUELL ).getLength() > 0 )
aCbArea.InsertEntry( *pGroup );
delete pGroup;
}
@@ -882,7 +882,7 @@ IMPL_LINK( GenericOptions, MoveButtons, AutoTimer*, aTimer )
String GenericOptions::ReadKey( const ByteString &aGroup, const ByteString &aKey )
{
aConf.SetGroup( aGroup );
- return UniString( aConf.ReadKey( aKey ), RTL_TEXTENCODING_UTF8 );
+ return rtl::OStringToOUString(aConf.ReadKey(aKey), RTL_TEXTENCODING_UTF8);
}
IMPL_LINK( GenericOptions, LoadGroup, ComboBox*, EMPTYARG )
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index 64146fb..0e6efd7 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -456,7 +456,7 @@ sal_Bool ODbaseIndex::DropImpl()
aKeyName = aInfFile.GetKeyName( nKey );
if (aKeyName.Copy(0,3) == "NDX")
{
- if(sEntry == String(aInfFile.ReadKey(aKeyName),m_pTable->getConnection()->getTextEncoding()))
+ if(sEntry == String(rtl::OStringToOUString(aInfFile.ReadKey(aKeyName),m_pTable->getConnection()->getTextEncoding())))
{
aInfFile.DeleteKey(aKeyName);
break;
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx
index bd7532c..f15721a 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -395,7 +395,7 @@ void ODbaseIndexDialog::Init()
// yes -> add to the tables index list
if (aNDX == "NDX" )
{
- aEntry = String(aInfFile.ReadKey(aKeyName), gsl_getSystemTextEncoding());
+ aEntry = rtl::OStringToOUString(aInfFile.ReadKey(aKeyName), gsl_getSystemTextEncoding());
rTabInfo.aIndexList.push_back( OTableIndex( aEntry ) );
// and remove it from the free index list
diff --git a/padmin/source/fontentry.cxx b/padmin/source/fontentry.cxx
index ab84a54..7e92866 100644
--- a/padmin/source/fontentry.cxx
+++ b/padmin/source/fontentry.cxx
@@ -376,7 +376,7 @@ FontImportDialog::FontImportDialog( Window* pParent ) :
Config& rPadminRC( getPadminRC() );
rPadminRC.SetGroup( "FontImport" );
- m_aFromDirEdt.SetText( String( rPadminRC.ReadKey( "FromPath" ), RTL_TEXTENCODING_UTF8 ) );
+ m_aFromDirEdt.SetText( rtl::OStringToOUString(rPadminRC.ReadKey("FromPath"), RTL_TEXTENCODING_UTF8) );
RefreshTimeoutHdl( NULL );
}
diff --git a/padmin/source/newppdlg.cxx b/padmin/source/newppdlg.cxx
index 0da40ce..cde0720 100644
--- a/padmin/source/newppdlg.cxx
+++ b/padmin/source/newppdlg.cxx
@@ -76,7 +76,7 @@ PPDImportDialog::PPDImportDialog( Window* pParent ) :
Config& rConfig = getPadminRC();
rConfig.SetGroup( PPDIMPORT_GROUP );
- m_aPathBox.SetText( String( rConfig.ReadKey( "LastDir" ), RTL_TEXTENCODING_UTF8 ) );
+ m_aPathBox.SetText( rtl::OStringToOUString(rConfig.ReadKey("LastDir"), RTL_TEXTENCODING_UTF8) );
for (sal_Int32 i = 0; i < 11; ++i)
{
ByteString aEntry(rConfig.ReadKey(rtl::OString::valueOf(i)));
@@ -117,7 +117,7 @@ void PPDImportDialog::Import()
break;
if( nEntries < 0 )
{
- sal_Int32 nNextEntry = rConfig.ReadKey( "NextEntry" ).ToInt32();
+ sal_Int32 nNextEntry = rConfig.ReadKey("NextEntry").toInt32();
rConfig.WriteKey( rtl::OString::valueOf(nNextEntry), ByteString( aImportPath, RTL_TEXTENCODING_UTF8 ) );
nNextEntry = nNextEntry < 10 ? nNextEntry+1 : 0;
rConfig.WriteKey( "NextEntry", rtl::OString::valueOf(nNextEntry) );
diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx
index de4d8fd..b397c11 100644
--- a/sw/source/ui/vba/vbasystem.cxx
+++ b/sw/source/ui/vba/vbasystem.cxx
@@ -93,7 +93,7 @@ uno::Any PrivateProfileStringListener::getValueEvent()
// get key/value from a file
Config aCfg( maFileName );
aCfg.SetGroup( maGroupName );
- sValue = String( aCfg.ReadKey( maKey ), RTL_TEXTENCODING_DONTKNOW );
+ sValue = rtl::OStringToOUString(aCfg.ReadKey(maKey), RTL_TEXTENCODING_DONTKNOW);
}
else
{
diff --git a/tools/inc/tools/config.hxx b/tools/inc/tools/config.hxx
index a4af258..1c904b8 100644
--- a/tools/inc/tools/config.hxx
+++ b/tools/inc/tools/config.hxx
@@ -70,13 +70,13 @@ public:
sal_uInt16 GetGroupCount() const;
sal_Bool HasGroup(const rtl::OString& rGroup) const;
- ByteString ReadKey( const ByteString& rKey ) const;
- UniString ReadKey( const ByteString& rKey, rtl_TextEncoding eEncoding ) const;
- ByteString ReadKey( const ByteString& rKey, const ByteString& rDefault ) const;
+ rtl::OString ReadKey(const rtl::OString& rKey) const;
+ UniString ReadKey(const rtl::OString& rKey, rtl_TextEncoding eEncoding) const;
+ rtl::OString ReadKey(const rtl::OString& rKey, const rtl::OString& rDefault) const;
void WriteKey(const rtl::OString& rKey, const rtl::OString& rValue);
- void DeleteKey( const ByteString& rKey );
- ByteString GetKeyName( sal_uInt16 nKey ) const;
- ByteString ReadKey( sal_uInt16 nKey ) const;
+ void DeleteKey(const rtl::OString& rKey);
+ rtl::OString GetKeyName(sal_uInt16 nKey) const;
+ rtl::OString ReadKey(sal_uInt16 nKey) const;
sal_uInt16 GetKeyCount() const;
sal_Bool IsLocked() const { return (mnLockCount != 0); }
diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx
index 52d25c4..fb879ea 100644
--- a/tools/source/generic/config.cxx
+++ b/tools/source/generic/config.cxx
@@ -84,14 +84,6 @@ struct ImplConfigData
// =======================================================================
-static ByteString& getEmptyByteString()
-{
- static ByteString aEmpty;
- return aEmpty;
-}
-
-// =======================================================================
-
static String toUncPath( const String& rPath )
{
::rtl::OUString aFileURL;
@@ -261,17 +253,19 @@ static String ImplMakeConfigName( const XubString* pFileName,
namespace {
-ByteString makeByteString(sal_uInt8 const * p, sal_uInt64 n) {
- if (n > STRING_MAXLEN) {
+rtl::OString makeOString(const sal_uInt8* p, sal_uInt64 n)
+{
+ if (n > SAL_MAX_INT32)
+ {
#ifdef WNT
abort();
#else
::std::abort(); //TODO: handle this gracefully
#endif
}
- return ByteString(
+ return rtl::OString(
reinterpret_cast< char const * >(p),
- sal::static_int_cast< xub_StrLen >(n));
+ sal::static_int_cast< sal_Int32 >(n));
}
}
@@ -286,8 +280,8 @@ static void ImplMakeConfigList( ImplConfigData* pData,
// Buffer parsen und Liste zusammenbauen
sal_uInt64 nStart;
sal_uInt64 nLineLen;
- xub_StrLen nNameLen;
- xub_StrLen nKeyLen;
+ sal_uInt64 nNameLen;
+ sal_uInt64 nKeyLen;
sal_uInt64 i;
const sal_uInt8* pLine;
ImplKeyData* pPrevKey = NULL;
@@ -355,7 +349,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
while ( (pLine[nNameLen-1] == ' ') || (pLine[nNameLen-1] == '\t') )
nNameLen--;
}
- pGroup->maGroupName = ByteString( (const sal_Char*)pLine, nNameLen );
+ pGroup->maGroupName = makeOString(pLine, nNameLen);
}
else
{
@@ -400,7 +394,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
pPrevKey = pKey;
if ( pLine[0] == ';' )
{
- pKey->maValue = makeByteString(pLine, nLineLen);
+ pKey->maValue = makeOString(pLine, nLineLen);
pKey->mbIsComment = sal_True;
}
else
@@ -416,7 +410,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
while ( (pLine[nNameLen-1] == ' ') || (pLine[nNameLen-1] == '\t') )
nNameLen--;
}
- pKey->maKey = ByteString( (const sal_Char*)pLine, nNameLen );
+ pKey->maKey = makeOString(pLine, nNameLen);
nKeyLen++;
if ( nKeyLen < nLineLen )
{
@@ -432,7 +426,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
{
while ( (pLine[nLineLen-1] == ' ') || (pLine[nLineLen-1] == '\t') )
nLineLen--;
- pKey->maValue = makeByteString(pLine, nLineLen);
+ pKey->maValue = makeOString(pLine, nLineLen);
}
}
}
@@ -636,7 +630,7 @@ static void ImplWriteConfig( ImplConfigData* pData )
{
if ( pData->mnTimeStamp != ImplSysGetConfigTimeStamp( pData->maFileName ) )
{
- OSL_TRACE( "Config overwrites modified configfile:\n %s", ByteString( pData->maFileName, RTL_TEXTENCODING_UTF8 ).GetBuffer() );
+ OSL_TRACE( "Config overwrites modified configfile:\n %s", rtl::OUStringToOString(pData->maFileName, RTL_TEXTENCODING_UTF8).getStr() );
}
}
#endif
@@ -780,10 +774,11 @@ Config::Config( const XubString& rFileName )
mbPersistence = sal_True;
#ifdef DBG_UTIL
- ByteString aTraceStr( "Config::Config( " );
- aTraceStr += ByteString( maFileName, RTL_TEXTENCODING_UTF8 );
- aTraceStr += " )";
- OSL_TRACE( "%s", aTraceStr.GetBuffer() );
+ rtl::OStringBuffer aTraceStr(
+ RTL_CONSTASCII_STRINGPARAM("Config::Config( "));
+ aTraceStr.append(rtl::OUStringToOString(maFileName, RTL_TEXTENCODING_UTF8));
+ aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" )"));
+ OSL_TRACE("%s", aTraceStr.getStr());
#endif
}
@@ -959,32 +954,33 @@ sal_Bool Config::HasGroup(const rtl::OString& rGroup) const
// -----------------------------------------------------------------------
-ByteString Config::ReadKey( const ByteString& rKey ) const
+rtl::OString Config::ReadKey(const rtl::OString& rKey) const
{
- return ReadKey( rKey, getEmptyByteString() );
+ return ReadKey(rKey, rtl::OString());
}
// -----------------------------------------------------------------------
-UniString Config::ReadKey( const ByteString& rKey, rtl_TextEncoding eEncoding ) const
+UniString Config::ReadKey(const rtl::OString& rKey, rtl_TextEncoding eEncoding) const
{
if ( mpData->mbIsUTF8BOM )
eEncoding = RTL_TEXTENCODING_UTF8;
- return UniString( ReadKey( rKey ), eEncoding );
+ return rtl::OStringToOUString(ReadKey(rKey), eEncoding);
}
// -----------------------------------------------------------------------
-ByteString Config::ReadKey( const ByteString& rKey, const ByteString& rDefault ) const
+rtl::OString Config::ReadKey(const rtl::OString& rKey, const rtl::OString& rDefault) const
{
#ifdef DBG_UTIL
- ByteString aTraceStr( "Config::ReadKey( " );
- aTraceStr += rKey;
- aTraceStr += " ) from ";
- aTraceStr += ByteString(GetGroup());
- aTraceStr += " in ";
- aTraceStr += ByteString( maFileName, RTL_TEXTENCODING_UTF8 );
- OSL_TRACE( "%s", aTraceStr.GetBuffer() );
+ rtl::OStringBuffer aTraceStr(
+ RTL_CONSTASCII_STRINGPARAM("Config::ReadKey( "));
+ aTraceStr.append(rKey);
+ aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" ) from "));
+ aTraceStr.append(GetGroup());
+ aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" in "));
+ aTraceStr.append(rtl::OUStringToOString(maFileName, RTL_TEXTENCODING_UTF8));
+ OSL_TRACE("%s", aTraceStr.getStr());
#endif
// Config-Daten evt. updaten
@@ -1078,7 +1074,7 @@ void Config::WriteKey(const rtl::OString& rKey, const rtl::OString& rStr)
// -----------------------------------------------------------------------
-void Config::DeleteKey( const ByteString& rKey )
+void Config::DeleteKey(const rtl::OString& rKey)
{
// Config-Daten evt. updaten
if ( !mnLockCount || !mpData->mbRead )
@@ -1160,7 +1156,7 @@ sal_uInt16 Config::GetKeyCount() const
// -----------------------------------------------------------------------
-ByteString Config::GetKeyName( sal_uInt16 nKey ) const
+rtl::OString Config::GetKeyName(sal_uInt16 nKey) const
{
#ifdef DBG_UTIL
rtl::OStringBuffer aTraceStr(
@@ -1192,12 +1188,12 @@ ByteString Config::GetKeyName( sal_uInt16 nKey ) const
}
}
- return getEmptyByteString();
+ return rtl::OString();
}
// -----------------------------------------------------------------------
-ByteString Config::ReadKey( sal_uInt16 nKey ) const
+rtl::OString Config::ReadKey(sal_uInt16 nKey) const
{
#ifdef DBG_UTIL
rtl::OStringBuffer aTraceStr(
@@ -1229,7 +1225,7 @@ ByteString Config::ReadKey( sal_uInt16 nKey ) const
}
}
- return getEmptyByteString();
+ return rtl::OString();
}
void Config::Flush()
commit 2add3f0e5a6b6e5b818a9e41b19436c496aa4c66
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 18 21:41:45 2011 +0100
drop it completely
diff --git a/connectivity/source/drivers/adabas/BCatalog.cxx b/connectivity/source/drivers/adabas/BCatalog.cxx
deleted file mode 100644
index e04f4d3..0000000
--- a/connectivity/source/drivers/adabas/BCatalog.cxx
+++ /dev/null
@@ -1,169 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BCatalog.hxx"
-#include "adabas/BConnection.hxx"
-#include "adabas/BGroups.hxx"
-#include "adabas/BUsers.hxx"
-#include "adabas/BTables.hxx"
-#include "adabas/BViews.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <comphelper/types.hxx>
-
-
-// -------------------------------------------------------------------------
-using namespace connectivity;
-using namespace connectivity::adabas;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -----------------------------------------------------------------------------
-OAdabasCatalog::OAdabasCatalog(SQLHANDLE _aConnectionHdl, OAdabasConnection* _pCon) : connectivity::sdbcx::OCatalog(_pCon)
- ,m_pConnection(_pCon)
- ,m_aConnectionHdl(_aConnectionHdl)
-{
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OAdabasCatalog::buildName(const Reference< XRow >& _xRow)
-{
- ::rtl::OUString sName;
- sName = _xRow->getString(2);
- if ( sName.getLength() )
- sName += OAdabasCatalog::getDot();
- sName += _xRow->getString(3);
-
- return sName;
-}
-// -----------------------------------------------------------------------------
-void OAdabasCatalog::fillVector(const ::rtl::OUString& _sQuery,TStringVector& _rVector)
-{
- Reference< XStatement > xStmt = m_pConnection->createStatement( );
- OSL_ENSURE(xStmt.is(),"OAdabasCatalog::fillVector: Could not create a statement!");
- Reference< XResultSet > xResult = xStmt->executeQuery(_sQuery);
-
- fillNames(xResult,_rVector);
- ::comphelper::disposeComponent(xStmt);
-
-}
-// -------------------------------------------------------------------------
-void OAdabasCatalog::refreshTables()
-{
- TStringVector aVector;
- {
- Sequence< ::rtl::OUString > aTypes(1);
- aTypes[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%"));
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),
- aTypes);
- fillNames(xResult,aVector);
- }
-
- if(m_pTables)
- m_pTables->reFill(aVector);
- else
- m_pTables = new OTables(m_xMetaData,*this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-void OAdabasCatalog::refreshViews()
-{
- TStringVector aVector;
- static const ::rtl::OUString s_sView(RTL_CONSTASCII_USTRINGPARAM("SELECT DISTINCT NULL,DOMAIN.VIEWDEFS.OWNER, DOMAIN.VIEWDEFS.VIEWNAME FROM DOMAIN.VIEWDEFS"));
- fillVector(s_sView,aVector);
-
- if(m_pViews)
- m_pViews->reFill(aVector);
- else
- m_pViews = new OViews(m_xMetaData,*this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-void OAdabasCatalog::refreshGroups()
-{
- TStringVector aVector;
- static const ::rtl::OUString s_sGroup(RTL_CONSTASCII_USTRINGPARAM("SELECT DISTINCT NULL,NULL,GROUPNAME FROM DOMAIN.USERS WHERE GROUPNAME IS NOT NULL AND GROUPNAME <> ' '"));
- fillVector(s_sGroup,aVector);
- if(m_pGroups)
- m_pGroups->reFill(aVector);
- else
- m_pGroups = new OGroups(*this,m_aMutex,aVector,m_pConnection,this);
-}
-// -------------------------------------------------------------------------
-void OAdabasCatalog::refreshUsers()
-{
- TStringVector aVector;
- static const ::rtl::OUString s_sUsers(RTL_CONSTASCII_USTRINGPARAM("SELECT DISTINCT NULL,NULL,USERNAME FROM DOMAIN.USERS WHERE USERNAME IS NOT NULL AND USERNAME <> ' ' AND USERNAME <> 'CONTROL'"));
- fillVector(s_sUsers,aVector);
-
- if(m_pUsers)
- m_pUsers->reFill(aVector);
- else
- m_pUsers = new OUsers(*this,m_aMutex,aVector,m_pConnection,this);
-}
-// -------------------------------------------------------------------------
-const ::rtl::OUString& OAdabasCatalog::getDot()
-{
- static const ::rtl::OUString sDot(RTL_CONSTASCII_USTRINGPARAM("."));
- return sDot;
-}
-// -----------------------------------------------------------------------------
-void OAdabasCatalog::correctColumnProperties(sal_Int32 /*_nPrec*/, sal_Int32& _rnType,::rtl::OUString& _rsTypeName)
-{
- switch(_rnType)
- {
- case DataType::DECIMAL:
- {
- static const ::rtl::OUString sDecimal(RTL_CONSTASCII_USTRINGPARAM("DECIMAL"));
- if(_rnType == DataType::DECIMAL && _rsTypeName == sDecimal)
- _rnType = DataType::NUMERIC;
- }
- break;
- case DataType::FLOAT:
- // if(_nPrec >= 16)
- {
- static const ::rtl::OUString sDouble(RTL_CONSTASCII_USTRINGPARAM("DOUBLE PRECISION"));
- _rsTypeName = sDouble;
- _rnType = DataType::DOUBLE;
- }
-// else if(_nPrec > 15)
-// {
-// static const ::rtl::OUString sReal( RTL_CONSTASCII_USTRINGPARAM( "REAL" ));
-// _rsTypeName = sReal;
-// _rnType = DataType::REAL;
-// }
- break;
- }
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BColumns.cxx b/connectivity/source/drivers/adabas/BColumns.cxx
deleted file mode 100644
index 227646b..0000000
--- a/connectivity/source/drivers/adabas/BColumns.cxx
+++ /dev/null
@@ -1,183 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BColumns.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include "adabas/BTable.hxx"
-#include "adabas/BTables.hxx"
-#include "adabas/BCatalog.hxx"
-#include <comphelper/types.hxx>
-#include "connectivity/dbtools.hxx"
-#include <comphelper/property.hxx>
-
-using namespace ::comphelper;
-using namespace connectivity::adabas;
-using namespace connectivity::sdbcx;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
-{
- Reference< XResultSet > xResult = m_pTable->getMetaData()->getColumns(Any(),
- m_pTable->getSchema(),m_pTable->getTableName(),_rName);
-
- sdbcx::ObjectType xRet = NULL;
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- {
- if(xRow->getString(4) == _rName)
- {
- sal_Int32 nType = xRow->getInt(5);
- ::rtl::OUString sTypeName = xRow->getString(6);
- sal_Int32 nPrec = xRow->getInt(7);
- OAdabasCatalog::correctColumnProperties(nPrec,nType,sTypeName);
- sal_Bool bAutoIncrement = sal_False;
- if ( !_rName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DEFAULT")) && !m_pTable->getSchema().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DOMAIN")) && !m_pTable->getTableName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("COLUMNS")) )
- {
- Reference< XStatement > xStmt = m_pTable->getMetaData()->getConnection()->createStatement( );
- ::rtl::OUString sQuery(RTL_CONSTASCII_USTRINGPARAM("SELECT \"DEFAULT\" FROM DOMAIN.COLUMNS WHERE OWNER = '"));
- sQuery += m_pTable->getSchema();
- sQuery += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("' AND TABLENAME = '"));
- sQuery += m_pTable->getTableName() + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("' AND COLUMNNAME = '"));
- sQuery += _rName + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
- try
- {
- Reference< XResultSet > xResult2 = xStmt->executeQuery(sQuery);
- Reference< XRow > xRow2(xResult2,UNO_QUERY);
- if ( xRow2.is() && xResult2->next() )
- bAutoIncrement = xRow2->getString(1) == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DEFAULT STAMP"));
- }
- catch(const Exception&)
- {
- }
- }
-
- xRet = new OColumn(_rName,
- sTypeName,
- xRow->getString(13),
- xRow->getString(12),
- xRow->getInt(11),
- nPrec,
- xRow->getInt(9),
- nType,
- bAutoIncrement,sal_False,sal_False,sal_True);
- break;
- }
- }
- ::comphelper::disposeComponent(xResult);
- }
-
- return xRet;
-}
-
-// -------------------------------------------------------------------------
-void OColumns::impl_refresh() throw(RuntimeException)
-{
- m_pTable->refreshColumns();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OColumns::createDescriptor()
-{
- return new OColumn(sal_True);
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OColumns::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- ::osl::MutexGuard aGuard(m_rMutex);
- if ( m_pTable->isNew() )
- return cloneDescriptor( descriptor );
-
- ::rtl::OUString aSql(RTL_CONSTASCII_USTRINGPARAM("ALTER TABLE "));
- ::rtl::OUString sQuote = m_pTable->getMetaData()->getIdentifierQuoteString( );
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
-
- m_pTable->beginTransAction();
- try
- {
- aSql += ::dbtools::quoteName(sQuote,m_pTable->getSchema()) + sDot + ::dbtools::quoteName(sQuote,m_pTable->getTableName());
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ADD ("));
- aSql += ::dbtools::quoteName(sQuote,_rForName);
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
- aSql += OTables::getColumnSqlType(descriptor);
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" )"));
-
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement();
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
-
- m_pTable->alterNotNullValue(getINT32(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE))),_rForName);
- }
- catch(const Exception&)
- {
- m_pTable->rollbackTransAction();
- throw;
- }
- m_pTable->endTransAction();
-
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OColumns::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- OSL_ENSURE(m_pTable,"OColumns::dropByName: Table is null!");
- if(!m_pTable->isNew())
- {
- ::rtl::OUString aSql(RTL_CONSTASCII_USTRINGPARAM("ALTER TABLE "));
- ::rtl::OUString sQuote = m_pTable->getMetaData()->getIdentifierQuoteString( );
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
-
- aSql += ::dbtools::quoteName(sQuote,m_pTable->getSchema()) + sDot + ::dbtools::quoteName(sQuote,m_pTable->getTableName());
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP "));
- aSql += ::dbtools::quoteName(sQuote,_sElementName);
-
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BConnection.cxx b/connectivity/source/drivers/adabas/BConnection.cxx
deleted file mode 100644
index 33923c5..0000000
--- a/connectivity/source/drivers/adabas/BConnection.cxx
+++ /dev/null
@@ -1,274 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include "adabas/BConnection.hxx"
-#include "adabas/BDriver.hxx"
-#include "adabas/BCatalog.hxx"
-#include "odbc/OFunctions.hxx"
-#include "odbc/OTools.hxx"
-#include "adabas/BDatabaseMetaData.hxx"
-#include "adabas/BStatement.hxx"
-#include "adabas/BPreparedStatement.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <connectivity/dbcharset.hxx>
-#include "connectivity/sqliterator.hxx"
-#include <connectivity/sqlparse.hxx>
-
-#include <string.h>
-
-using namespace connectivity::adabas;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-
-//------------------------------------------------------------------------------
-namespace starlang = ::com::sun::star::lang;
-// --------------------------------------------------------------------------------
-OAdabasConnection::OAdabasConnection(const SQLHANDLE _pDriverHandle, connectivity::odbc::ODBCDriver* _pDriver)
- : OConnection_BASE2(_pDriverHandle,_pDriver)
-{
- m_bUseOldDateFormat = sal_True;
-}
-//-----------------------------------------------------------------------------
-SQLRETURN OAdabasConnection::Construct( const ::rtl::OUString& url,const Sequence< PropertyValue >& info) throw(SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- m_aConnectionHandle = SQL_NULL_HANDLE;
- setURL(url);
- setConnectionInfo(info);
-
- // Connection allozieren
- N3SQLAllocHandle(SQL_HANDLE_DBC,m_pDriverHandleCopy,&m_aConnectionHandle);
- if(m_aConnectionHandle == SQL_NULL_HANDLE)
- throw SQLException();
-
- const PropertyValue *pBegin = info.getConstArray();
- const PropertyValue *pEnd = pBegin + info.getLength();
- ::rtl::OUString sHostName;
-
- sal_Int32 nLen = url.indexOf(':');
- nLen = url.indexOf(':',nLen+1);
- ::rtl::OUString aDSN(url.copy(nLen+1)),aUID,aPWD;
- sal_Int32 nTimeout = 20;
- for(;pBegin != pEnd;++pBegin)
- {
- if ( !pBegin->Name.compareToAscii("Timeout") )
- pBegin->Value >>= nTimeout;
- else if(!pBegin->Name.compareToAscii("user"))
- pBegin->Value >>= aUID;
- else if(!pBegin->Name.compareToAscii("password"))
- pBegin->Value >>= aPWD;
- else if(!pBegin->Name.compareToAscii("HostName"))
- pBegin->Value >>= sHostName;
- else if(0 == pBegin->Name.compareToAscii("CharSet"))
- {
- ::rtl::OUString sIanaName;
- OSL_VERIFY( pBegin->Value >>= sIanaName );
-
- ::dbtools::OCharsetMap aLookupIanaName;
- ::dbtools::OCharsetMap::const_iterator aLookup = aLookupIanaName.find(sIanaName, ::dbtools::OCharsetMap::IANA());
- if (aLookup != aLookupIanaName.end())
- m_nTextEncoding = (*aLookup).getEncoding();
- else
- m_nTextEncoding = RTL_TEXTENCODING_DONTKNOW;
- if(m_nTextEncoding == RTL_TEXTENCODING_DONTKNOW)
- m_nTextEncoding = osl_getThreadTextEncoding();
- }
- }
- m_sUser = aUID;
-
- if ( sHostName.getLength() )
- aDSN = sHostName + rtl::OUString(static_cast<sal_Unicode>(':')) + aDSN;
- SQLRETURN nSQLRETURN = openConnectionWithAuth(aDSN,nTimeout, aUID,aPWD);
-
- return nSQLRETURN;
-}
-//-----------------------------------------------------------------------------
-SQLRETURN OAdabasConnection::openConnectionWithAuth(const ::rtl::OUString& aConnectStr,sal_Int32 nTimeOut, const ::rtl::OUString& _uid,const ::rtl::OUString& _pwd)
-{
- if (m_aConnectionHandle == SQL_NULL_HANDLE)
- return -1;
-
- SQLRETURN nSQLRETURN = 0;
- SDB_ODBC_CHAR szDSN[4096];
- SDB_ODBC_CHAR szUID[20];
- SDB_ODBC_CHAR szPWD[20];
-
- memset(szDSN,'\0',4096);
- memset(szUID,'\0',20);
- memset(szPWD,'\0',20);
-
- ::rtl::OString aConStr(::rtl::OUStringToOString(aConnectStr,getTextEncoding()));
- ::rtl::OString aUID(::rtl::OUStringToOString(_uid,getTextEncoding()));
- ::rtl::OString aPWD(::rtl::OUStringToOString(_pwd,getTextEncoding()));
- memcpy(szDSN, (SDB_ODBC_CHAR*) aConStr.getStr(), ::std::min<sal_Int32>((sal_Int32)2048,aConStr.getLength()));
- memcpy(szUID, (SDB_ODBC_CHAR*) aUID.getStr(), ::std::min<sal_Int32>((sal_Int32)20,aUID.getLength()));
- memcpy(szPWD, (SDB_ODBC_CHAR*) aPWD.getStr(), ::std::min<sal_Int32>((sal_Int32)20,aPWD.getLength()));
-
-
-
- N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_LOGIN_TIMEOUT,(SQLPOINTER)(sal_IntPtr)nTimeOut,SQL_IS_INTEGER);
- // Verbindung aufbauen
-
- nSQLRETURN = N3SQLConnect(m_aConnectionHandle,
- szDSN,
- (SQLSMALLINT) ::std::min<sal_Int32>((sal_Int32)2048,aConStr.getLength()),
- szUID,
- (SQLSMALLINT) ::std::min<sal_Int32>((sal_Int32)20,aUID.getLength()),
- szPWD,
- (SQLSMALLINT) ::std::min<sal_Int32>((sal_Int32)20,aPWD.getLength()));
- if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA)
- return nSQLRETURN;
-
- m_bClosed = sal_False;
-
- // autocoomit ist immer default
-
- N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_AUTOCOMMIT,(SQLPOINTER)SQL_AUTOCOMMIT_ON,SQL_IS_INTEGER);
-
- return nSQLRETURN;
-}
-
-//------------------------------------------------------------------------------
-void OAdabasConnection::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- Reference< XTablesSupplier > xTableSupplier(m_xCatalog);
- ::comphelper::disposeComponent(xTableSupplier);
-
- m_xCatalog = WeakReference< XTablesSupplier >();
-
- OConnection_BASE2::disposing();
-}
-//------------------------------------------------------------------------------
-Reference< XTablesSupplier > OAdabasConnection::createCatalog()
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- Reference< XTablesSupplier > xTab = m_xCatalog;
- if(!xTab.is())
- {
- xTab = new OAdabasCatalog(m_aConnectionHandle,this);
- m_xCatalog = xTab;
- }
- return xTab;
-}
-// --------------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL OAdabasConnection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE2::rBHelper.bDisposed);
-
-
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if(!xMetaData.is())
- {
- xMetaData = new OAdabasDatabaseMetaData(m_aConnectionHandle,this);
- m_xMetaData = xMetaData;
- }
-
- return xMetaData;
-}
-// --------------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL OAdabasConnection::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE2::rBHelper.bDisposed);
-
- Reference< XStatement > xReturn = new OAdabasStatement(this);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OAdabasConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE2::rBHelper.bDisposed);
-
- Reference< XPreparedStatement > xReturn = new OAdabasPreparedStatement(this,sql);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// -----------------------------------------------------------------------------
-sal_Int64 SAL_CALL OAdabasConnection::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw (::com::sun::star::uno::RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OConnection_BASE2::getSomething(rId);
-}
-// -----------------------------------------------------------------------------
-Sequence< sal_Int8 > OAdabasConnection::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-// -----------------------------------------------------------------------------
-::connectivity::odbc::OConnection* OAdabasConnection::cloneConnection()
-{
- return new OAdabasConnection(m_pDriverHandleCopy,m_pDriver);
-}
-// -----------------------------------------------------------------------------
-::rtl::Reference<OSQLColumns> OAdabasConnection::createSelectColumns(const ::rtl::OUString& _rSql)
-{
- ::rtl::Reference<OSQLColumns> aRet;
- OSQLParser aParser(getDriver()->getORB());
- ::rtl::OUString sErrorMessage;
- OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,_rSql);
- if(pNode)
- {
- Reference< XTablesSupplier> xCata = createCatalog();
- OSQLParseTreeIterator aParseIter(this, xCata->getTables(),
- aParser, pNode);
- aParseIter.traverseAll();
- aRet = aParseIter.getSelectColumns();
- }
- return aRet;
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BDatabaseMetaData.cxx b/connectivity/source/drivers/adabas/BDatabaseMetaData.cxx
deleted file mode 100644
index 2dbd6b2..0000000
--- a/connectivity/source/drivers/adabas/BDatabaseMetaData.cxx
+++ /dev/null
@@ -1,156 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "adabas/BDatabaseMetaData.hxx"
-#include "FDatabaseMetaDataResultSet.hxx"
-
-using namespace connectivity::adabas;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-::rtl::OUString SAL_CALL OAdabasDatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue(RTL_CONSTASCII_USTRINGPARAM("sdbc:adabas:"));
- aValue += OAdabasDatabaseMetaData_BASE::getURLImpl();
- return aValue;
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OAdabasDatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -----------------------------------------------------------------------------
-Reference< XResultSet > OAdabasDatabaseMetaData::impl_getTypeInfo_throw( )
-{
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
- Reference< XResultSet > xNewRes = pResult;
- static ::connectivity::ODatabaseMetaDataResultSet::ORows aRows;
- if(aRows.empty())
- {
- aRows.reserve(19);
- Reference< XResultSet > xRes = OAdabasDatabaseMetaData_BASE::impl_getTypeInfo_throw();
-
- if(xRes.is())
- {
- ::connectivity::ODatabaseMetaDataResultSet::ORow aRow(19);
-
- Reference< XRow> xRow(xRes,UNO_QUERY);
- while(xRes->next())
- {
- sal_Int32 nPos = 1;
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getString (1));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getInt (2));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getInt (3));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getString (4));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getString (5));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getString (6));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getInt (7));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getBoolean (8));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getShort (9));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getBoolean (10));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getInt (11));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getBoolean (12));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getString (13));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getShort (14));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getShort (15));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getInt (16));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getInt (17));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator((sal_Int16)xRow->getInt(18));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
-
- // we have to fix some incorrect entries
- if(!aRow[2]->getValue().isNull())
- {
- switch((sal_Int32)aRow[2]->getValue())
- {
- case DataType::FLOAT:
- case DataType::REAL:
- case DataType::DOUBLE:
- aRow[2]->setValue(DataType::DOUBLE);
- aRow[3]->setValue(sal_Int32(18));
- break;
- case DataType::TIMESTAMP:
- aRow[3]->setValue(sal_Int32(27));
- break;
- default:
- break;
- }
- }
- aRows.push_back(aRow);
- }
- }
- }
- pResult->setRows(aRows);
- return xNewRes;
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BDriver.cxx b/connectivity/source/drivers/adabas/BDriver.cxx
deleted file mode 100644
index 664ba0d..0000000
--- a/connectivity/source/drivers/adabas/BDriver.cxx
+++ /dev/null
@@ -1,1870 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#ifdef SYSTEM_ODBC_HEADERS
-#include <sqltypes.h>
-#else
-#include <odbc/sqltypes.h>
-#endif
-
-#include <unotools/tempfile.hxx>
-#include <sal/macros.h>
-#include "adabas/BDriver.hxx"
-#include "adabas/BConnection.hxx"
-#include "odbc/OFunctions.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "odbc/OTools.hxx"
-#include "connectivity/dbexception.hxx"
-#include "TConnection.hxx"
-#include "diagnose_ex.h"
-
-#include <osl/process.h>
-#include <unotools/ucbhelper.hxx>
-#include <unotools/ucbstreamhelper.hxx>
-#include <unotools/localfilehelper.hxx>
-#include "resource/adabas_res.hrc"
-#include "resource/sharedresources.hxx"
-
-
-#include <memory>
-#include <sys/stat.h>
-
-#if defined(UNX)
-const char sNewLine = '\012';
-#else
-const char sNewLine[] = "\015\012"; // \015\012 and not \n
-#endif
-#define ADABAS_DB_11 "11.02.00"
-#define ADABAS_KERNEL_11 "11.02"
-#define ADABAS_DB_12 "12.01.00"
-#define ADABAS_KERNEL_12 "12.01"
-#define CURRENT_DB_VERSION "13.01.00"
-#define CURRENT_KERNEL_VERSION "13.01"
-
-#define OPROCESS_ADABAS (osl_Process_HIDDEN | osl_Process_WAIT | osl_Process_SEARCHPATH)
-#define OPROCESS_ADABAS_DBG (osl_Process_WAIT | osl_Process_SEARCHPATH)
-
-
-using namespace connectivity;
-namespace connectivity
-{
- namespace adabas
- {
- // extern declaration of the function pointer
- extern T3SQLAllocHandle pODBC3SQLAllocHandle;
- extern T3SQLConnect pODBC3SQLConnect;
- extern T3SQLDriverConnect pODBC3SQLDriverConnect;
- extern T3SQLBrowseConnect pODBC3SQLBrowseConnect;
- extern T3SQLDataSources pODBC3SQLDataSources;
- extern T3SQLDrivers pODBC3SQLDrivers;
- extern T3SQLGetInfo pODBC3SQLGetInfo;
- extern T3SQLGetFunctions pODBC3SQLGetFunctions;
- extern T3SQLGetTypeInfo pODBC3SQLGetTypeInfo;
- extern T3SQLSetConnectAttr pODBC3SQLSetConnectAttr;
- extern T3SQLGetConnectAttr pODBC3SQLGetConnectAttr;
- extern T3SQLSetEnvAttr pODBC3SQLSetEnvAttr;
- extern T3SQLGetEnvAttr pODBC3SQLGetEnvAttr;
- extern T3SQLSetStmtAttr pODBC3SQLSetStmtAttr;
- extern T3SQLGetStmtAttr pODBC3SQLGetStmtAttr;
- extern T3SQLPrepare pODBC3SQLPrepare;
- extern T3SQLBindParameter pODBC3SQLBindParameter;
- extern T3SQLSetCursorName pODBC3SQLSetCursorName;
- extern T3SQLExecute pODBC3SQLExecute;
- extern T3SQLExecDirect pODBC3SQLExecDirect;
- extern T3SQLDescribeParam pODBC3SQLDescribeParam;
- extern T3SQLNumParams pODBC3SQLNumParams;
- extern T3SQLParamData pODBC3SQLParamData;
- extern T3SQLPutData pODBC3SQLPutData;
- extern T3SQLRowCount pODBC3SQLRowCount;
- extern T3SQLNumResultCols pODBC3SQLNumResultCols;
- extern T3SQLDescribeCol pODBC3SQLDescribeCol;
- extern T3SQLColAttribute pODBC3SQLColAttribute;
- extern T3SQLBindCol pODBC3SQLBindCol;
- extern T3SQLFetch pODBC3SQLFetch;
- extern T3SQLFetchScroll pODBC3SQLFetchScroll;
- extern T3SQLGetData pODBC3SQLGetData;
- extern T3SQLSetPos pODBC3SQLSetPos;
- extern T3SQLBulkOperations pODBC3SQLBulkOperations;
- extern T3SQLMoreResults pODBC3SQLMoreResults;
- extern T3SQLGetDiagRec pODBC3SQLGetDiagRec;
- extern T3SQLColumnPrivileges pODBC3SQLColumnPrivileges;
- extern T3SQLColumns pODBC3SQLColumns;
- extern T3SQLForeignKeys pODBC3SQLForeignKeys;
- extern T3SQLPrimaryKeys pODBC3SQLPrimaryKeys;
- extern T3SQLProcedureColumns pODBC3SQLProcedureColumns;
- extern T3SQLProcedures pODBC3SQLProcedures;
- extern T3SQLSpecialColumns pODBC3SQLSpecialColumns;
- extern T3SQLStatistics pODBC3SQLStatistics;
- extern T3SQLTablePrivileges pODBC3SQLTablePrivileges;
- extern T3SQLTables pODBC3SQLTables;
- extern T3SQLFreeStmt pODBC3SQLFreeStmt;
- extern T3SQLCloseCursor pODBC3SQLCloseCursor;
- extern T3SQLCancel pODBC3SQLCancel;
- extern T3SQLEndTran pODBC3SQLEndTran;
- extern T3SQLDisconnect pODBC3SQLDisconnect;
- extern T3SQLFreeHandle pODBC3SQLFreeHandle;
- extern T3SQLGetCursorName pODBC3SQLGetCursorName;
- extern T3SQLNativeSql pODBC3SQLNativeSql;
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace utl;
-using namespace osl;
-using namespace ::dbtools;
-
- sal_Bool LoadFunctions(oslModule pODBCso);
- sal_Bool LoadLibrary_ADABAS(::rtl::OUString &_rPath);
- // --------------------------------------------------------------------------------
-void ODriver::fillInfo(const Sequence< PropertyValue >& info, TDatabaseStruct& _rDBInfo)
-{
- const PropertyValue* pIter = info.getConstArray();
- const PropertyValue* pEnd = pIter + info.getLength();
- for(;pIter != pEnd;++pIter)
- {
- if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DatabaseName"))))
- {
- pIter->Value >>= _rDBInfo.sDBName;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlUser"))))
- {
- pIter->Value >>= _rDBInfo.sControlUser;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlPassword"))))
- {
- pIter->Value >>= _rDBInfo.sControlPassword;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataCacheSizeIncrement"))))
- pIter->Value >>= _rDBInfo.nDataIncrement;
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShutdownDatabase"))))
- pIter->Value >>= _rDBInfo.bShutDown;
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("User"))))
- {
- pIter->Value >>= _rDBInfo.sSysUser;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Password"))))
- {
- pIter->Value >>= _rDBInfo.sSysPassword;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DomainPassword"))))
- {
- pIter->Value >>= _rDBInfo.sDomainPassword;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CacheSize"))))
- {
- pIter->Value >>= _rDBInfo.sCacheSize;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RestoreDatabase"))))
- {
- pIter->Value >>= _rDBInfo.bRestoreDatabase;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Backup"))))
- {
- pIter->Value >>= _rDBInfo.sBackupFile;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataDevSpace"))))
- {
- pIter->Value >>= _rDBInfo.sDataDevName;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SYSDEVSPACE"))))
- {
- pIter->Value >>= _rDBInfo.sSysDevSpace;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TRANSACTION_LOG"))))
- {
- pIter->Value >>= _rDBInfo.sTransLogName;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataDevSize"))))
- {
- pIter->Value >>= _rDBInfo.nDataSize;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LogDevSize"))))
- {
- pIter->Value >>= _rDBInfo.nLogSize;
- }
- }
-}
-
-
-// --------------------------------------------------------------------------------
-ODriver::ODriver(const Reference< XMultiServiceFactory >& _rxFactory) : ODBCDriver(_rxFactory)
-{
- osl_incrementInterlockedCount(&m_refCount);
- fillEnvironmentVariables();
- Reference< XComponent > xComponent(m_xORB, UNO_QUERY);
- if (xComponent.is())
- {
- Reference< ::com::sun::star::lang::XEventListener> xEvtL((::cppu::OWeakObject*)this,UNO_QUERY);
- xComponent->addEventListener(xEvtL);
- }
- osl_decrementInterlockedCount(&m_refCount);
-}
-//------------------------------------------------------------------------------
-void ODriver::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- ODriver_BASE::disposing();
- Reference< XComponent > xComponent(m_xORB, UNO_QUERY);
- if (xComponent.is())
- {
- Reference< XEventListener> xEvtL((::cppu::OWeakObject*)this,UNO_QUERY);
- xComponent->removeEventListener(xEvtL);
- }
- m_xORB.clear();
-}
-
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString ODriver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdbcx.adabas.ODriver"));
-}
-//------------------------------------------------------------------------------
-Sequence< ::rtl::OUString > ODriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
-{
- Sequence< ::rtl::OUString > aSNS( 2 );
- aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.Driver"));
- aSNS[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Driver"));
- return aSNS;
-}
-//------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODriver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-
-//------------------------------------------------------------------
-sal_Bool SAL_CALL ODriver::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
-{
- const Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-//------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL ODriver::getSupportedServiceNames( ) throw(RuntimeException)
-{
- return getSupportedServiceNames_Static();
-}
-//------------------------------------------------------------------
-Any SAL_CALL ODriver::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ::cppu::queryInterface(rType, static_cast<XDataDefinitionSupplier*>(this));
- if ( !aRet.hasValue() )
- aRet = ODriver_BASE::queryInterface(rType);
- return aRet.hasValue() ? aRet : ODriver_BASE2::queryInterface(rType);
-}
-//------------------------------------------------------------------
-Reference< XInterface > SAL_CALL ODriver_CreateInstance(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFac) throw( Exception )
-{
- return *(new ODriver(_rxFac));
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODriver::disposing( const EventObject& Source ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if(m_xORB.is() && Reference< XMultiServiceFactory >(Source.Source,UNO_QUERY) == m_xORB)
- {
- TDatabaseMap::iterator aIter = m_aDatabaseMap.begin();
- for(;aIter != m_aDatabaseMap.end();++aIter)
- {
- if(aIter->second.bShutDown)
- {
- ::rtl::OUString sName;
- if(getDBName(aIter->first,sName))
- {
- XUTIL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SHUTDOWN QUICK")),sName,aIter->second.sControlUser,aIter->second.sControlPassword);
- X_STOP(sName);
- }
- }
- }
- m_xORB.clear();
- }
-}
-// --------------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL ODriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- if ( ! acceptsURL(url) )
- return NULL;
-
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- TDatabaseStruct aDBInfo;
- aDBInfo.bShutDown = sal_False;
- fillInfo(info,aDBInfo);
- aDBInfo.sControlUser = aDBInfo.sControlUser.toAsciiUpperCase();
- aDBInfo.sControlPassword = aDBInfo.sControlPassword.toAsciiUpperCase();
- aDBInfo.sSysUser = aDBInfo.sSysUser.toAsciiUpperCase();
- aDBInfo.sSysPassword = aDBInfo.sSysPassword.toAsciiUpperCase();
-
-
- TDatabaseMap::iterator aFind = m_aDatabaseMap.find(url);
- if(aFind == m_aDatabaseMap.end()) // only when not found yet
- m_aDatabaseMap[url] = aDBInfo;
- else
- {
- if(aFind->second.bShutDown != aDBInfo.bShutDown)
- aFind->second.bShutDown &= aDBInfo.bShutDown;
- }
-
- ::rtl::OUString sName;
- if(aDBInfo.sControlPassword.getLength() && aDBInfo.sControlUser.getLength() && getDBName(url,sName))
- {
- // check if we have to add a new data dev space
- checkAndInsertNewDevSpace(sName,aDBInfo);
-
- convertOldVersion(sName,aDBInfo);
- // check if we must restart the database
- checkAndRestart(sName,aDBInfo);
- }
-
-
- if(!m_pDriverHandle)
- {
- ::rtl::OUString aPath;
- if(!EnvironmentHandle(aPath))
- throw SQLException(aPath,*this,::rtl::OUString(),1000,Any());
- }
- OAdabasConnection* pCon = new OAdabasConnection(m_pDriverHandle,this);
- Reference< XConnection > xCon = pCon;
- SQLRETURN nSQLRETURN = pCon->Construct(url,info);
-
- if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA)
- {
- odbc::OTools::ThrowException(pCon,nSQLRETURN,pCon->getConnection(),SQL_HANDLE_DBC,*this);
- }
-
- m_xConnections.push_back(WeakReferenceHelper(*pCon));
-
- return xCon;
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODriver::getDBName(const ::rtl::OUString& _rName,::rtl::OUString& sDBName) const
-{
- sDBName = ::rtl::OUString();
- ::rtl::OUString sName = _rName.copy(12);
- sal_Int32 nPos = sName.indexOf(':');
- if(nPos != -1 && nPos < 1)
- sDBName = sName.copy(1);
- return (nPos != -1 && nPos < 1);
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL ODriver::acceptsURL( const ::rtl::OUString& url )
- throw(SQLException, RuntimeException)
-{
- return (!url.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:adabas:")),12));
-}
-// --------------------------------------------------------------------------------
-Sequence< DriverPropertyInfo > SAL_CALL ODriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/) throw(SQLException, RuntimeException)
-{
- if ( acceptsURL(url) )
- {
- ::std::vector< DriverPropertyInfo > aDriverInfo;
-
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShutdownDatabase"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Shut down service when closing."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlUser"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Control user name."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"))
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlPassword"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Control password."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataCacheSizeIncrement"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Data increment (MB)."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet of the database."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- return Sequence< DriverPropertyInfo >(&aDriverInfo[0],aDriverInfo.size());
- }
-
- SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- return Sequence< DriverPropertyInfo >();
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODriver::getMajorVersion( ) throw(RuntimeException)
-{
- return 1;
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODriver::getMinorVersion( ) throw(RuntimeException)
-{
- return 0;
-}
-// -----------------------------------------------------------------------------
-// XCreateCatalog
-void SAL_CALL ODriver::createCatalog( const Sequence< PropertyValue >& info ) throw(SQLException, ElementExistException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- try
- {
- TDatabaseStruct aDBInfo;
- fillInfo(info,aDBInfo);
-
- ::rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("DBSERVICE"));
- ::rtl::OUString envData(RTL_CONSTASCII_USTRINGPARAM("0"));
- osl_setEnvironment(envVar.pData, envData.pData);
-
- m_sDbRunDir = m_sDbWorkURL + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/wrk/")) + aDBInfo.sDBName;
- String sTemp;
- LocalFileHelper::ConvertURLToPhysicalName(m_sDbRunDir,sTemp);
- m_sDbRunDir = sTemp;
-
- createNeededDirs(aDBInfo.sDBName);
- if(CreateFiles(aDBInfo))
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_NO_DISK_SPACE,
- "$filename$",aDBInfo.sDBName
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- } // if(CreateFiles(aDBInfo))
-
- createDb(aDBInfo);
- }
- catch( SQLException&)
- {
- throw;
- }
- catch(Exception&)
- {
- throw SQLException();
- }
-
-}
-// -----------------------------------------------------------------------------
-// XDropCatalog
-void SAL_CALL ODriver::dropCatalog( const ::rtl::OUString& /*catalogName*/, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, NoSuchElementException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- ::dbtools::throwFeatureNotImplementedException( "!XDropCatalog::dropCatalog", *this );
-}
-//-----------------------------------------------------------------------------
-// ODBC Environment (common for all Connections):
-SQLHANDLE ODriver::EnvironmentHandle(::rtl::OUString &_rPath)
-{
- // Has an Environment already been created (for this Instance)?
- if (!m_pDriverHandle)
- {
- SQLHANDLE h = SQL_NULL_HANDLE;
- // allocate Environment
-
- // load ODBC-DLL now:
- if (! LoadLibrary_ADABAS(_rPath))
- return SQL_NULL_HANDLE;
-
- if (N3SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&h) != SQL_SUCCESS)
- return SQL_NULL_HANDLE;
-
- // Save in global Structure...
- m_pDriverHandle = h;
- SQLRETURN nError = N3SQLSetEnvAttr(h, SQL_ATTR_ODBC_VERSION,(SQLPOINTER) SQL_OV_ODBC3, SQL_IS_INTEGER);
- OSL_UNUSED( nError );
- //N3SQLSetEnvAttr(h, SQL_ATTR_CONNECTION_POOLING,(SQLPOINTER) SQL_CP_ONE_PER_HENV, SQL_IS_INTEGER);
- }
-
- return m_pDriverHandle;
-}
-// --------------------------------------------------------------------------------
-// XDataDefinitionSupplier
-Reference< XTablesSupplier > SAL_CALL ODriver::getDataDefinitionByConnection( const Reference< ::com::sun::star::sdbc::XConnection >& connection ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- Reference< XTablesSupplier > xTab;
- Reference< ::com::sun::star::lang::XUnoTunnel> xTunnel(connection,UNO_QUERY);
- if ( xTunnel.is() )
- {
-
- OAdabasConnection* pConnection = NULL;
- OAdabasConnection* pSearchConnection = reinterpret_cast< OAdabasConnection* >( xTunnel->getSomething(OAdabasConnection::getUnoTunnelImplementationId()) );
- for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
- {
- if ( (OAdabasConnection*) Reference< XConnection >::query(i->get().get()).get() == pSearchConnection )
- {
- pConnection = pSearchConnection;
- break;
- }
- }
-
-
- if ( pConnection )
- xTab = pConnection->createCatalog();
- }
- return xTab;
-}
-
-// --------------------------------------------------------------------------------
-Reference< XTablesSupplier > SAL_CALL ODriver::getDataDefinitionByURL( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- if ( ! acceptsURL(url) )
- {
- SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- } // if ( ! acceptsURL(url) )
-
- return getDataDefinitionByConnection(connect(url,info));
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODriver::acquire() throw()
-{
- ODriver_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODriver::release() throw()
-{
- ODriver_BASE::release();
-}
-ODriver::~ODriver()
-{
-}
-// -----------------------------------------------------------------------------
-oslGenericFunction ODriver::getOdbcFunction(sal_Int32 _nIndex) const
-{
- oslGenericFunction pFunction = NULL;
- switch(_nIndex)
- {
- case ODBC3SQLAllocHandle:
- pFunction = (oslGenericFunction)pODBC3SQLAllocHandle;;
- break;
- case ODBC3SQLConnect:
- pFunction = (oslGenericFunction)pODBC3SQLConnect;
- break;
- case ODBC3SQLDriverConnect:
- pFunction = (oslGenericFunction)pODBC3SQLDriverConnect;
- break;
- case ODBC3SQLBrowseConnect:
- pFunction = (oslGenericFunction)pODBC3SQLBrowseConnect;
- break;
- case ODBC3SQLDataSources:
- pFunction = (oslGenericFunction)pODBC3SQLDataSources;
- break;
- case ODBC3SQLDrivers:
- pFunction = (oslGenericFunction)pODBC3SQLDrivers;
- break;
- case ODBC3SQLGetInfo:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetInfo;
- break;
- case ODBC3SQLGetFunctions:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetFunctions;
- break;
- case ODBC3SQLGetTypeInfo:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetTypeInfo;
- break;
- case ODBC3SQLSetConnectAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetConnectAttr;
- break;
- case ODBC3SQLGetConnectAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetConnectAttr;
- break;
- case ODBC3SQLSetEnvAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetEnvAttr;
- break;
- case ODBC3SQLGetEnvAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetEnvAttr;
- break;
- case ODBC3SQLSetStmtAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetStmtAttr;
- break;
- case ODBC3SQLGetStmtAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetStmtAttr;
- break;
- case ODBC3SQLPrepare:
-
- pFunction = (oslGenericFunction)pODBC3SQLPrepare;
- break;
- case ODBC3SQLBindParameter:
-
- pFunction = (oslGenericFunction)pODBC3SQLBindParameter;
- break;
- case ODBC3SQLSetCursorName:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetCursorName;
- break;
- case ODBC3SQLExecute:
-
- pFunction = (oslGenericFunction)pODBC3SQLExecute;
- break;
- case ODBC3SQLExecDirect:
-
- pFunction = (oslGenericFunction)pODBC3SQLExecDirect;
- break;
- case ODBC3SQLDescribeParam:
-
- pFunction = (oslGenericFunction)pODBC3SQLDescribeParam;
- break;
- case ODBC3SQLNumParams:
-
- pFunction = (oslGenericFunction)pODBC3SQLNumParams;
- break;
- case ODBC3SQLParamData:
-
- pFunction = (oslGenericFunction)pODBC3SQLParamData;
- break;
- case ODBC3SQLPutData:
-
- pFunction = (oslGenericFunction)pODBC3SQLPutData;
- break;
- case ODBC3SQLRowCount:
-
- pFunction = (oslGenericFunction)pODBC3SQLRowCount;
- break;
- case ODBC3SQLNumResultCols:
-
- pFunction = (oslGenericFunction)pODBC3SQLNumResultCols;
- break;
- case ODBC3SQLDescribeCol:
-
- pFunction = (oslGenericFunction)pODBC3SQLDescribeCol;
- break;
- case ODBC3SQLColAttribute:
-
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list