merge the formfield patch from ooo-build
[ooovba.git] / connectivity / source / drivers / hsqldb / HTools.cxx
blob23eb183ac459f286fd560cd099b0e51baa8ed706
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: HTools.cxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_connectivity.hxx"
34 #include "hsqldb/HTools.hxx"
36 /** === begin UNO includes === **/
37 /** === end UNO includes === **/
39 //........................................................................
40 namespace connectivity { namespace hsqldb
42 //........................................................................
44 /** === begin UNO using === **/
45 /** === end UNO using === **/
47 //====================================================================
48 //= HTools
49 //====================================================================
50 //--------------------------------------------------------------------
51 void HTools::appendTableFilterCrit( ::rtl::OUStringBuffer& _inout_rBuffer, const ::rtl::OUString& _rCatalog,
52 const ::rtl::OUString _rSchema, const ::rtl::OUString _rName, bool _bShortForm )
54 _inout_rBuffer.appendAscii( " WHERE " );
55 if ( _rCatalog.getLength() )
57 _inout_rBuffer.appendAscii( _bShortForm ? "TABLE_CAT" : "TABLE_CATALOG" );
58 _inout_rBuffer.appendAscii( " = '" );
59 _inout_rBuffer.append ( _rCatalog );
60 _inout_rBuffer.appendAscii( "' AND " );
62 if ( _rSchema.getLength() )
64 _inout_rBuffer.appendAscii( _bShortForm ? "TABLE_SCHEM" : "TABLE_SCHEMA" );
65 _inout_rBuffer.appendAscii( " = '" );
66 _inout_rBuffer.append ( _rSchema );
67 _inout_rBuffer.appendAscii( "' AND " );
69 _inout_rBuffer.appendAscii( "TABLE_NAME = '" );
70 _inout_rBuffer.append ( _rName );
71 _inout_rBuffer.appendAscii( "'" );
74 //........................................................................
75 } } // namespace connectivity::hsqldb
76 //........................................................................