summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-03-22 09:24:15 +0200
committerNoel Grandin <noel@peralex.com>2013-04-08 13:53:04 +0200
commitb248624126c271c88381d3dad6e04fc954f65779 (patch)
tree989f9131b865ea470ced1317834b91de06efd9e4 /dbaccess
parentc68b934cd03e60ab6e0579108089b0e834ac47ad (diff)
fdo#46808, Convert frame::Frame to new style
Change-Id: I74427d1e0059808f04960c648b93245b06c20f7f
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx39
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.hxx4
-rw-r--r--dbaccess/source/ui/inc/querycontainerwindow.hxx6
-rw-r--r--dbaccess/source/ui/querydesign/querycontainerwindow.cxx14
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx2
5 files changed, 30 insertions, 35 deletions
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 62ef52daf496..c7a23ad41f70 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -25,30 +25,30 @@
#include "tabletree.hxx"
#include "UITools.hxx"
#include "dbtreelistbox.hxx"
-#include <com/sun/star/frame/XLayoutManager.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/XTabController.hpp>
-#include <com/sun/star/sdbc/XConnection.hpp>
-#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#include <com/sun/star/sdbcx/XViewsSupplier.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/container/XContainer.hpp>
+#include <com/sun/star/form/XLoadable.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/frame/Frame.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/XFrames.hpp>
#include <com/sun/star/frame/XFramesSupplier.hpp>
-#include <com/sun/star/awt/XWindow.hpp>
-#include <toolkit/helper/vclunohelper.hxx>
-#include <com/sun/star/ucb/XCommandEnvironment.hpp>
-#include <com/sun/star/ucb/XCommandProcessor.hpp>
-#include <com/sun/star/ucb/Command.hpp>
-#include <com/sun/star/form/XLoadable.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/container/XContainer.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
-#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp>
#include <com/sun/star/sdb/application/DatabaseObject.hpp>
#include <com/sun/star/sdb/application/DatabaseObjectContainer.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
+#include <com/sun/star/sdbcx/XViewsSupplier.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/ucb/XCommandProcessor.hpp>
+#include <com/sun/star/ucb/Command.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
+#include <toolkit/helper/vclunohelper.hxx>
#include "AppView.hxx"
#include "dbaccess_helpid.hrc"
#include "dbu_app.hrc"
@@ -1141,20 +1141,19 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName,
{
try
{
- m_xFrame = Reference < XFrame > ( getBorderWin().getView()->getORB()->getServiceManager()->createInstanceWithContext( OUString("com.sun.star.frame.Frame"), getBorderWin().getView()->getORB() ), UNO_QUERY );
+ m_xFrame = Frame::create( getBorderWin().getView()->getORB() );
m_xFrame->initialize( m_xWindow );
// no layout manager (and thus no toolbars) in the preview
// Must be called after initialize ... but before any other call to this frame.
// Otherwise frame throws "life time exceptions" as e.g. NON_INITIALIZED
- Reference< XPropertySet > xFrameProps( m_xFrame, UNO_QUERY_THROW );
- xFrameProps->setPropertyValue( OUString( "LayoutManager" ), makeAny(Reference< XLayoutManager >()) );
+ m_xFrame->setLayoutManager( Reference< XLayoutManager >() );
Reference<XFramesSupplier> xSup(getBorderWin().getView()->getAppController().getXController()->getFrame(),UNO_QUERY);
if ( xSup.is() )
{
Reference<XFrames> xFrames = xSup->getFrames();
- xFrames->append(m_xFrame);
+ xFrames->append( Reference<XFrame>(m_xFrame,UNO_QUERY_THROW));
}
}
catch(const Exception&)
@@ -1169,7 +1168,7 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName,
xApplication, NULL, _bTable
) );
SAL_WNODEPRECATED_DECLARATIONS_POP
- pDispatcher->setTargetFrame( m_xFrame );
+ pDispatcher->setTargetFrame( Reference<XFrame>(m_xFrame,UNO_QUERY_THROW) );
::comphelper::NamedValueCollection aArgs;
aArgs.put( "Preview", sal_True );
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
index 486ca96a8baa..3f8df99c8240 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
@@ -37,7 +37,7 @@
#include <memory>
namespace com{ namespace sun { namespace star { namespace awt { class XWindow; } } } }
-namespace com{ namespace sun { namespace star { namespace frame { class XFrame; } } } }
+namespace com{ namespace sun { namespace star { namespace frame { class XFrame2; } } } }
namespace com{ namespace sun { namespace star { namespace io { class XPersist; } } } }
#define ELEMENT_COUNT size_t(E_ELEMENT_TYPE_COUNT)
@@ -90,7 +90,7 @@ namespace dbaui
Window* m_pTablePreview;
::std::auto_ptr<PopupMenu> m_aMenu;
PreviewMode m_ePreviewMode;
- ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame >
+ ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 >
m_xFrame;
::com::sun::star::uno::Reference < ::com::sun::star::io::XPersist >
m_xDocInfo;
diff --git a/dbaccess/source/ui/inc/querycontainerwindow.hxx b/dbaccess/source/ui/inc/querycontainerwindow.hxx
index 749493ea74c7..5fab032b3cfa 100644
--- a/dbaccess/source/ui/inc/querycontainerwindow.hxx
+++ b/dbaccess/source/ui/inc/querycontainerwindow.hxx
@@ -23,7 +23,7 @@
#include <vcl/window.hxx>
#include <vcl/split.hxx>
#include "dataview.hxx"
-#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XFrame2.hpp>
#include "QueryViewSwitch.hxx"
#include <vcl/dockwin.hxx>
@@ -50,7 +50,7 @@ namespace dbaui
OQueryViewSwitch* m_pViewSwitch;
OBeamer* m_pBeamer;
Splitter* m_pSplitter;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xBeamer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xBeamer;
DECL_LINK( SplitHdl, void* );
public:
@@ -66,7 +66,7 @@ namespace dbaui
// called when the beamer has been disposed
void disposingPreview();
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 >
getPreviewFrame() const { return m_xBeamer; }
OQueryDesignView* getDesignView() { return m_pViewSwitch->getDesignView(); }
diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
index 07ef8b711f5c..2c04309c68be 100644
--- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
+++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
@@ -28,8 +28,9 @@
#include <sfx2/sfxsids.hrc>
#include <vcl/fixed.hxx>
#include "UITools.hxx"
-#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/frame/Frame.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
//.........................................................................
namespace dbaui
@@ -195,18 +196,13 @@ namespace dbaui
::dbaui::notifySystemWindow(this,m_pBeamer,::comphelper::mem_fun(&TaskPaneList::AddWindow));
- Reference < XFrame > xBeamerFrame( m_pViewSwitch->getORB()->getServiceManager()->createInstanceWithContext(OUString("com.sun.star.frame.Frame"), m_pViewSwitch->getORB()),UNO_QUERY );
- m_xBeamer.set( xBeamerFrame );
- OSL_ENSURE(m_xBeamer.is(),"No frame created!");
+ m_xBeamer = Frame::create( m_pViewSwitch->getORB() );
m_xBeamer->initialize( VCLUnoHelper::GetInterface ( m_pBeamer ) );
// notify layout manager to not create internal toolbars
- Reference < XPropertySet > xPropSet( xBeamerFrame, UNO_QUERY );
try
{
- const OUString aLayoutManager( "LayoutManager" );
- Reference < XPropertySet > xLMPropSet(xPropSet->getPropertyValue( aLayoutManager ),UNO_QUERY);
-
+ Reference < XPropertySet > xLMPropSet(m_xBeamer->getLayoutManager(), UNO_QUERY);
if ( xLMPropSet.is() )
{
const OUString aAutomaticToolbars( "AutomaticToolbars" );
@@ -222,7 +218,7 @@ namespace dbaui
// append our frame
Reference < XFramesSupplier > xSup(_xFrame,UNO_QUERY);
Reference < XFrames > xFrames = xSup->getFrames();
- xFrames->append( m_xBeamer );
+ xFrames->append( Reference<XFrame>(m_xBeamer,UNO_QUERY_THROW) );
Size aSize = GetOutputSizePixel();
Size aBeamer(aSize.Width(),sal_Int32(aSize.Height()*0.33));
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index ca36ffec8a56..960c8a0d421a 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -1192,7 +1192,7 @@ void SAL_CALL OQueryController::disposing( const EventObject& Source ) throw(Run
{
if ( Source.Source == m_aCurrentFrame.getFrame() )
{ // our frame is being disposed -> close the preview window (if we have one)
- Reference< XFrame > xPreviewFrame( getContainer()->getPreviewFrame() );
+ Reference< XFrame2 > xPreviewFrame( getContainer()->getPreviewFrame() );
::comphelper::disposeComponent( xPreviewFrame );
}
else if ( Source.Source == getContainer()->getPreviewFrame() )