diff options
Diffstat (limited to 'forms/source/richtext/richtextcontrol.cxx')
-rw-r--r-- | forms/source/richtext/richtextcontrol.cxx | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx index 4cf1f3912f89..1c96b9870361 100644 --- a/forms/source/richtext/richtextcontrol.cxx +++ b/forms/source/richtext/richtextcontrol.cxx @@ -168,51 +168,51 @@ namespace frm SolarMutexGuard aGuard; - if (!getPeer().is()) - { - mbCreatingPeer = true; + if (getPeer().is()) + return; - // determine the VLC window for the parent - vcl::Window* pParentWin = nullptr; - if ( _rParentPeer.is() ) - { - VCLXWindow* pParentXWin = comphelper::getUnoTunnelImplementation<VCLXWindow>( _rParentPeer ); - if ( pParentXWin ) - pParentWin = pParentXWin->GetWindow().get(); - DBG_ASSERT( pParentWin, "ORichTextControl::createPeer: could not obtain the VCL-level parent window!" ); - } + mbCreatingPeer = true; - // create the peer - Reference< XControlModel > xModel( getModel() ); - rtl::Reference<ORichTextPeer> pPeer = ORichTextPeer::Create( xModel, pParentWin, getWinBits( xModel ) ); - DBG_ASSERT( pPeer, "ORichTextControl::createPeer: invalid peer returned!" ); - if ( pPeer ) - { - // announce the peer to the base class - setPeer( pPeer.get() ); + // determine the VLC window for the parent + vcl::Window* pParentWin = nullptr; + if ( _rParentPeer.is() ) + { + VCLXWindow* pParentXWin = comphelper::getUnoTunnelImplementation<VCLXWindow>( _rParentPeer ); + if ( pParentXWin ) + pParentWin = pParentXWin->GetWindow().get(); + DBG_ASSERT( pParentWin, "ORichTextControl::createPeer: could not obtain the VCL-level parent window!" ); + } - // initialize ourself (and thus the peer) with the model properties - updateFromModel(); + // create the peer + Reference< XControlModel > xModel( getModel() ); + rtl::Reference<ORichTextPeer> pPeer = ORichTextPeer::Create( xModel, pParentWin, getWinBits( xModel ) ); + DBG_ASSERT( pPeer, "ORichTextControl::createPeer: invalid peer returned!" ); + if ( pPeer ) + { + // announce the peer to the base class + setPeer( pPeer.get() ); - Reference< XView > xPeerView( getPeer(), UNO_QUERY ); - if ( xPeerView.is() ) - { - xPeerView->setZoom( maComponentInfos.nZoomX, maComponentInfos.nZoomY ); - xPeerView->setGraphics( mxGraphics ); - } + // initialize ourself (and thus the peer) with the model properties + updateFromModel(); - // a lot of initial settings from our component infos - setPosSize( maComponentInfos.nX, maComponentInfos.nY, maComponentInfos.nWidth, maComponentInfos.nHeight, PosSize::POSSIZE ); + Reference< XView > xPeerView( getPeer(), UNO_QUERY ); + if ( xPeerView.is() ) + { + xPeerView->setZoom( maComponentInfos.nZoomX, maComponentInfos.nZoomY ); + xPeerView->setGraphics( mxGraphics ); + } - pPeer->setVisible ( maComponentInfos.bVisible && !mbDesignMode ); - pPeer->setEnable ( maComponentInfos.bEnable ); - pPeer->setDesignMode( mbDesignMode ); + // a lot of initial settings from our component infos + setPosSize( maComponentInfos.nX, maComponentInfos.nY, maComponentInfos.nWidth, maComponentInfos.nHeight, PosSize::POSSIZE ); - peerCreated(); - } + pPeer->setVisible ( maComponentInfos.bVisible && !mbDesignMode ); + pPeer->setEnable ( maComponentInfos.bEnable ); + pPeer->setDesignMode( mbDesignMode ); - mbCreatingPeer = false; + peerCreated(); } + + mbCreatingPeer = false; } OUString SAL_CALL ORichTextControl::getImplementationName() |