tdf#150789 - FILEOPEN PPTX: fix text in SmartArt vertically off
[LibreOffice.git] / connectivity / source / drivers / jdbc / JBigDecimal.cxx
blob7cbcd64860bc5075bf64e34a202f837e59286d22
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <java/math/BigDecimal.hxx>
21 #include <java/tools.hxx>
22 using namespace connectivity;
24 //************ Class: java.lang.Boolean
27 jclass java_math_BigDecimal::theClass = nullptr;
29 java_math_BigDecimal::~java_math_BigDecimal()
32 jclass java_math_BigDecimal::getMyClass() const
34 // the class must be fetched only once, therefore static
35 if( !theClass )
36 theClass = findMyClass("java/math/BigDecimal");
37 return theClass;
40 java_math_BigDecimal::java_math_BigDecimal( const OUString& _par0 ): java_lang_Object( nullptr, nullptr )
42 SDBThreadAttach t;
43 if( !t.pEnv )
44 return;
45 // Java-Call for the Constructor
46 // initialize temporary Variable
47 static const char * const cSignature = "(Ljava/lang/String;)V";
48 jobject tempObj;
49 static jmethodID mID(nullptr);
50 obtainMethodId_throwSQL(t.pEnv, "<init>",cSignature, mID);
52 jstring str = convertwchar_tToJavaString(t.pEnv,_par0.replace(',','.'));
53 tempObj = t.pEnv->NewObject( getMyClass(), mID, str );
54 t.pEnv->DeleteLocalRef(str);
55 saveRef( t.pEnv, tempObj );
56 t.pEnv->DeleteLocalRef( tempObj );
57 ThrowSQLException( t.pEnv, nullptr );
58 // and cleanup
61 java_math_BigDecimal::java_math_BigDecimal( const double& _par0 ): java_lang_Object( nullptr, nullptr )
63 SDBThreadAttach t;
64 if( !t.pEnv )
65 return;
66 // Java-Call for the Constructor
67 // initialize temporary Variable
68 static const char * const cSignature = "(D)V";
69 jobject tempObj;
70 static jmethodID mID(nullptr);
71 obtainMethodId_throwSQL(t.pEnv, "<init>",cSignature, mID);
72 tempObj = t.pEnv->NewObject( getMyClass(), mID, _par0 );
73 saveRef( t.pEnv, tempObj );
74 t.pEnv->DeleteLocalRef( tempObj );
75 ThrowSQLException( t.pEnv, nullptr );
76 // and cleanup
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */