summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-14 19:57:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-14 22:17:13 +0200
commit1c97e5ffa79ccb6ad6272b7044c008800b61da79 (patch)
tree711ceebf0e3b1966a72b93dbe2b23626c5dd84f0
parentd377c085627ac00268952d2401a8b8fde360336c (diff)
only vcl and toolkit need to use [G|S]etUnoWrapper
Change-Id: I47cdb47cceda32f0871fd2f713ea565852383ca7 Reviewed-on: https://gerrit.libreoffice.org/61765 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/vcl/svapp.hxx17
-rw-r--r--include/vcl/toolkit/unowrap.hxx17
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx2
-rw-r--r--vcl/source/app/salvtables.cxx2
-rw-r--r--vcl/source/app/svapp.cxx6
-rw-r--r--vcl/source/outdev/outdev.cxx4
-rw-r--r--vcl/source/window/menu.cxx2
-rw-r--r--vcl/source/window/window.cxx6
8 files changed, 28 insertions, 28 deletions
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 8fd852a5cb53..b1e9eb7c9a45 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1183,23 +1183,6 @@ public:
*/
static css::uno::Reference< css::awt::XToolkit > GetVCLToolkit();
- /** Get the application's UNO wrapper object.
-
- Note that this static function will only ever try to create UNO wrapper object once, and
- if it fails then it will not ever try again, even if the function is called multiple times.
-
- @param bCreateIfNotExists Create the UNO wrapper object if it doesn't exist when true.
-
- @return UNO wrapper object.
- */
- static UnoWrapperBase* GetUnoWrapper( bool bCreateIfNotExists = true );
-
- /** Sets the application's UNO Wrapper object.
-
- @param pWrapper Pointer to UNO wrapper object.
- */
- static void SetUnoWrapper( UnoWrapperBase* pWrapper );
-
///@}
diff --git a/include/vcl/toolkit/unowrap.hxx b/include/vcl/toolkit/unowrap.hxx
index bc4cc3ca848e..2146f27d3e19 100644
--- a/include/vcl/toolkit/unowrap.hxx
+++ b/include/vcl/toolkit/unowrap.hxx
@@ -78,6 +78,23 @@ public:
virtual css::uno::Reference< css::accessibility::XAccessible >
CreateAccessible( Menu* pMenu, bool bIsMenuBar ) = 0;
+ /** Get the application's UNO wrapper object.
+
+ Note that this static function will only ever try to create UNO wrapper object once, and
+ if it fails then it will not ever try again, even if the function is called multiple times.
+
+ @param bCreateIfNotExists Create the UNO wrapper object if it doesn't exist when true.
+
+ @return UNO wrapper object.
+ */
+ static UnoWrapperBase* GetUnoWrapper( bool bCreateIfNotExists = true );
+
+ /** Sets the application's UNO Wrapper object.
+
+ @param pWrapper Pointer to UNO wrapper object.
+ */
+ static void SetUnoWrapper( UnoWrapperBase* pWrapper );
+
protected:
~UnoWrapperBase() {}
};
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index a045fa430ed3..4f078e2968f5 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -899,7 +899,7 @@ static void ToolkitWorkerFunction( void* pArgs )
if( bInitedByVCLToolkit )
{
UnoWrapper* pUnoWrapper = new UnoWrapper( pTk );
- Application::SetUnoWrapper( pUnoWrapper );
+ UnoWrapperBase::SetUnoWrapper( pUnoWrapper );
}
getInitCondition().set();
if( bInitedByVCLToolkit )
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index efb5214ddb33..b5b2519482b0 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -2906,7 +2906,7 @@ weld::MessageDialog* SalInstance::CreateMessageDialog(weld::Widget* pParent, Vcl
weld::Window* SalInstance::GetFrameWeld(const css::uno::Reference<css::awt::XWindow>& rWindow)
{
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper();
+ UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper();
if (!pWrapper)
return nullptr;
VclPtr<vcl::Window> xWindow = pWrapper->GetWindow(rWindow);
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index cd4422f0ef89..2cd32996be86 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1394,7 +1394,7 @@ SystemWindowFlags Application::GetSystemWindowMode()
css::uno::Reference< css::awt::XToolkit > Application::GetVCLToolkit()
{
css::uno::Reference< css::awt::XToolkit > xT;
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper();
+ UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper();
if ( pWrapper )
xT = pWrapper->GetVCLToolkit();
return xT;
@@ -1410,7 +1410,7 @@ extern "C" { static void thisModule() {} }
#endif
-UnoWrapperBase* Application::GetUnoWrapper( bool bCreateIfNotExist )
+UnoWrapperBase* UnoWrapperBase::GetUnoWrapper( bool bCreateIfNotExist )
{
ImplSVData* pSVData = ImplGetSVData();
static bool bAlreadyTriedToCreate = false;
@@ -1437,7 +1437,7 @@ UnoWrapperBase* Application::GetUnoWrapper( bool bCreateIfNotExist )
return pSVData->mpUnoWrapper;
}
-void Application::SetUnoWrapper( UnoWrapperBase* pWrapper )
+void UnoWrapperBase::SetUnoWrapper( UnoWrapperBase* pWrapper )
{
ImplSVData* pSVData = ImplGetSVData();
SAL_WARN_IF( pSVData->mpUnoWrapper, "vcl", "SetUnoWrapper: Wrapper already exists" );
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index a58bc91779cc..ad56b6d36357 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -144,7 +144,7 @@ void OutputDevice::dispose()
{
if ( GetUnoGraphicsList() )
{
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper( false );
+ UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper( false );
if ( pWrapper )
pWrapper->ReleaseAllGraphics( this );
delete mpUnoGraphicsList;
@@ -357,7 +357,7 @@ void OutputDevice::SetOutOffYPixel(long nOutOffY)
css::uno::Reference< css::awt::XGraphics > OutputDevice::CreateUnoGraphics()
{
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper();
+ UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper();
return pWrapper ? pWrapper->CreateGraphics( this ) : css::uno::Reference< css::awt::XGraphics >();
}
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 4839f9e314c8..686694e8e0c0 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1310,7 +1310,7 @@ css::uno::Reference<css::accessibility::XAccessible> Menu::GetAccessible()
}
else if ( !mxAccessible.is() )
{
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper();
+ UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper();
if ( pWrapper )
mxAccessible = pWrapper->CreateAccessible(this, IsMenuBar());
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 32ff0470013e..7f229a94eddc 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -225,7 +225,7 @@ void Window::dispose()
}
}
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper( false );
+ UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper( false );
if ( pWrapper )
pWrapper->WindowDestroyed( this );
@@ -3159,7 +3159,7 @@ Reference< css::awt::XWindowPeer > Window::GetComponentInterface( bool bCreate )
{
if ( !mpWindowImpl->mxWindowPeer.is() && bCreate )
{
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper();
+ UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper();
if ( pWrapper )
mpWindowImpl->mxWindowPeer = pWrapper->GetWindowInterface( this );
}
@@ -3168,7 +3168,7 @@ Reference< css::awt::XWindowPeer > Window::GetComponentInterface( bool bCreate )
void Window::SetComponentInterface( Reference< css::awt::XWindowPeer > const & xIFace )
{
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper();
+ UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper();
SAL_WARN_IF( !pWrapper, "vcl.window", "SetComponentInterface: No Wrapper!" );
if ( pWrapper )
pWrapper->SetWindowInterface( this, xIFace );