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.cxx162
1 files changed, 80 insertions, 82 deletions
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index dc507afab..6217b4062 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -1,14 +1,11 @@
/*************************************************************************
*
* 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
@@ -46,36 +43,37 @@
#include <com/sun/star/lang/NullPointerException.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <svx/svdpool.hxx>
-#include <svx/charscaleitem.hxx>
+#include <editeng/charscaleitem.hxx>
#include <svx/algitem.hxx>
#include <svx/svdpagv.hxx>
#include <svx/xtable.hxx> // XColorTable
-#include <svx/brshitem.hxx>
-#include <svx/fontitem.hxx>
-#include <svx/emphitem.hxx>
-#include <svx/postitem.hxx>
-#include <svx/udlnitem.hxx>
-#include <svx/crsditem.hxx>
-#include <svx/cntritem.hxx>
-#include <svx/langitem.hxx>
-#include <svx/wghtitem.hxx>
-#include <svx/fhgtitem.hxx>
-#include <svx/shdditem.hxx>
-#include <svx/escpitem.hxx>
-#include <svx/prszitem.hxx>
-#include <svx/wrlmitem.hxx>
-#include <svx/cmapitem.hxx>
-#include <svx/kernitem.hxx>
-#include <svx/blnkitem.hxx>
-#include <svx/flstitem.hxx>
-#include <svx/akrnitem.hxx>
-#include <svx/colritem.hxx>
+#include <editeng/brshitem.hxx>
+#include <editeng/fontitem.hxx>
+#include <editeng/emphitem.hxx>
+#include <editeng/postitem.hxx>
+#include <editeng/udlnitem.hxx>
+#include <editeng/crsditem.hxx>
+#include <editeng/cntritem.hxx>
+#include <editeng/langitem.hxx>
+#include <editeng/wghtitem.hxx>
+#include <editeng/fhgtitem.hxx>
+#include <editeng/shdditem.hxx>
+#include <editeng/escpitem.hxx>
+#include <editeng/prszitem.hxx>
+#include <editeng/wrlmitem.hxx>
+#include <editeng/cmapitem.hxx>
+#include <editeng/kernitem.hxx>
+#include <editeng/blnkitem.hxx>
+#include <editeng/flstitem.hxx>
+#include <editeng/akrnitem.hxx>
+#include <editeng/colritem.hxx>
#include <svx/drawitem.hxx>
-#include <svx/twolinesitem.hxx>
-#include <svx/charreliefitem.hxx>
-#include <svx/charrotateitem.hxx>
-#include <svx/charhiddenitem.hxx>
+#include <editeng/twolinesitem.hxx>
+#include <editeng/charreliefitem.hxx>
+#include <editeng/charrotateitem.hxx>
+#include <editeng/charhiddenitem.hxx>
#include <svx/xgrscit.hxx>
#include <svx/svditer.hxx>
#include <svx/xtable.hxx>
@@ -93,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>
@@ -273,7 +271,7 @@ namespace
{
uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
SvxUnoPropertyMapProvider aMap;
- const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE)->getPropertyMap();
+ const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
PropertyEntryVector_t aPropVector = pPropertyMap->getPropertyEntries();
PropertyEntryVector_t::const_iterator aIt = aPropVector.begin();
while( aIt != aPropVector.end() )
@@ -296,7 +294,7 @@ namespace
{
const uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
SvxUnoPropertyMapProvider aMap;
- const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE)->getPropertyMap();
+ const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
PropertyEntryVector_t aPropVector = pPropertyMap->getPropertyEntries();
PropertyEntryVector_t::const_iterator aIt = aPropVector.begin();
while( aIt != aPropVector.end() )
@@ -1030,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