summaryrefslogtreecommitdiff
path: root/reportdesign/source/ui/misc/UITools.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'reportdesign/source/ui/misc/UITools.cxx')
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx105
1 files changed, 51 insertions, 54 deletions
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index d226365cd88c..209017ed062e 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: UITools.cxx,v $
- * $Revision: 1.7.36.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -94,8 +91,8 @@
#include <comphelper/propmultiplex.hxx>
#include <comphelper/namedvaluecollection.hxx>
-#include <connectivity/dbexception.hxx>
-#include <connectivity/dbconversion.hxx>
+#include <connectivity/dbexception.hxx>
+#include <connectivity/dbconversion.hxx>
#include <connectivity/dbtools.hxx>
#include <com/sun/star/report/XGroups.hpp>
@@ -1031,56 +1028,56 @@ void setZoomFactor(const Fraction& _aZoom,Window& _rWindow)
_rWindow.SetMapMode(aMapMode);
}
// -----------------------------------------------------------------------------
-bool openDialogFormula_nothrow( ::rtl::OUString& _in_out_rFormula
- , const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext
- , const uno::Reference< awt::XWindow>& _xInspectorWindow
- , const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet >& _xRowSet
- )
-{
+bool openDialogFormula_nothrow( ::rtl::OUString& _in_out_rFormula
+ , const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext
+ , const uno::Reference< awt::XWindow>& _xInspectorWindow
+ , const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet >& _xRowSet
+ )
+{
OSL_PRECOND( _xInspectorWindow.is(), "openDialogFormula_nothrow: invalid parameters!" );
if ( !_xInspectorWindow.is() )
- return false;
- // _out_rFormula = ::rtl::OUString();
- bool bSuccess = false;
- ::dbtools::SQLExceptionInfo aErrorInfo;
- uno::Reference< awt::XWindow > xInspectorWindow;
- uno::Reference< lang::XMultiComponentFactory > xFactory;
- uno::Reference<lang::XMultiServiceFactory> xServiceFactory;
- try
- {
- xFactory = _xContext->getServiceManager();
- xServiceFactory.set(xFactory,uno::UNO_QUERY);
- Window* pParent = VCLUnoHelper::GetWindow( _xInspectorWindow );
-
- uno::Reference< report::meta::XFunctionManager> xMgr(xFactory->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOFunctionManager")),_xContext),uno::UNO_QUERY);
- if ( xMgr.is() )
- {
- ::boost::shared_ptr< formula::IFunctionManager > pFormulaManager(new FunctionManager(xMgr) );
- ReportFormula aFormula( _in_out_rFormula );
- FormulaDialog aDlg(pParent,xServiceFactory,pFormulaManager,aFormula.getUndecoratedContent(),_xRowSet);
- bSuccess = aDlg.Execute() == RET_OK;
- if ( bSuccess )
- {
- String sFormula = aDlg.getCurrentFormula();
- xub_StrLen nIndex = 0;
- if ( sFormula.GetChar(0) == '=' )
- nIndex = 1;
- _in_out_rFormula = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:")) + sFormula.Copy(nIndex);
- }
- }
- }
- catch (sdb::SQLContext& e) { aErrorInfo = e; }
- catch (sdbc::SQLWarning& e) { aErrorInfo = e; }
- catch (sdbc::SQLException& e) { aErrorInfo = e; }
- catch( const uno::Exception& )
- {
- OSL_ENSURE( sal_False, "GeometryHandler::impl_dialogFilter_nothrow: caught an exception!" );
- }
-
- if ( aErrorInfo.isValid() )
- ::dbtools::showError( aErrorInfo, xInspectorWindow, xServiceFactory );
-
- return bSuccess;
+ return false;
+ // _out_rFormula = ::rtl::OUString();
+ bool bSuccess = false;
+ ::dbtools::SQLExceptionInfo aErrorInfo;
+ uno::Reference< awt::XWindow > xInspectorWindow;
+ uno::Reference< lang::XMultiComponentFactory > xFactory;
+ uno::Reference<lang::XMultiServiceFactory> xServiceFactory;
+ try
+ {
+ xFactory = _xContext->getServiceManager();
+ xServiceFactory.set(xFactory,uno::UNO_QUERY);
+ Window* pParent = VCLUnoHelper::GetWindow( _xInspectorWindow );
+
+ uno::Reference< report::meta::XFunctionManager> xMgr(xFactory->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOFunctionManager")),_xContext),uno::UNO_QUERY);
+ if ( xMgr.is() )
+ {
+ ::boost::shared_ptr< formula::IFunctionManager > pFormulaManager(new FunctionManager(xMgr) );
+ ReportFormula aFormula( _in_out_rFormula );
+ FormulaDialog aDlg(pParent,xServiceFactory,pFormulaManager,aFormula.getUndecoratedContent(),_xRowSet);
+ bSuccess = aDlg.Execute() == RET_OK;
+ if ( bSuccess )
+ {
+ String sFormula = aDlg.getCurrentFormula();
+ xub_StrLen nIndex = 0;
+ if ( sFormula.GetChar(0) == '=' )
+ nIndex = 1;
+ _in_out_rFormula = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:")) + sFormula.Copy(nIndex);
+ }
+ }
+ }
+ catch (sdb::SQLContext& e) { aErrorInfo = e; }
+ catch (sdbc::SQLWarning& e) { aErrorInfo = e; }
+ catch (sdbc::SQLException& e) { aErrorInfo = e; }
+ catch( const uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "GeometryHandler::impl_dialogFilter_nothrow: caught an exception!" );
+ }
+
+ if ( aErrorInfo.isValid() )
+ ::dbtools::showError( aErrorInfo, xInspectorWindow, xServiceFactory );
+
+ return bSuccess;
}
// -----------------------------------------------------------------------------
} // namespace rptui