diff options
Diffstat (limited to 'UnoControls/source/controls/progressmonitor.cxx')
-rw-r--r-- | UnoControls/source/controls/progressmonitor.cxx | 514 |
1 files changed, 257 insertions, 257 deletions
diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx index 3a19291abdc3..c650dbed0ffe 100644 --- a/UnoControls/source/controls/progressmonitor.cxx +++ b/UnoControls/source/controls/progressmonitor.cxx @@ -31,12 +31,12 @@ #include "progressbar.hxx" -using namespace ::cppu ; -using namespace ::osl ; -using namespace ::rtl ; -using namespace ::com::sun::star::uno ; -using namespace ::com::sun::star::lang ; -using namespace ::com::sun::star::awt ; +using namespace ::cppu; +using namespace ::osl; +using namespace ::rtl; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::awt; using ::std::vector; using ::std::find; @@ -48,38 +48,38 @@ ProgressMonitor::ProgressMonitor( const css::uno::Reference< XComponentContext > { // Its not allowed to work with member in this method (refcounter !!!) // But with a HACK (++refcount) its "OK" :-( - ++m_refCount ; + ++m_refCount; // Create instances for fixedtext, button and progress ... - m_xTopic_Top = css::uno::Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ) ; - m_xText_Top = css::uno::Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ) ; - m_xTopic_Bottom = css::uno::Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ) ; - m_xText_Bottom = css::uno::Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ) ; - m_xButton = css::uno::Reference< XButton > ( rxContext->getServiceManager()->createInstanceWithContext( BUTTON_SERVICENAME, rxContext ), UNO_QUERY ) ; + m_xTopic_Top = css::uno::Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ); + m_xText_Top = css::uno::Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ); + m_xTopic_Bottom = css::uno::Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ); + m_xText_Bottom = css::uno::Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ); + m_xButton = css::uno::Reference< XButton > ( rxContext->getServiceManager()->createInstanceWithContext( BUTTON_SERVICENAME, rxContext ), UNO_QUERY ); m_xProgressBar = new ProgressBar(rxContext); // ... cast controls to Reference< XControl > (for "setModel"!) ... - css::uno::Reference< XControl > xRef_Topic_Top ( m_xTopic_Top , UNO_QUERY ) ; - css::uno::Reference< XControl > xRef_Text_Top ( m_xText_Top , UNO_QUERY ) ; - css::uno::Reference< XControl > xRef_Topic_Bottom ( m_xTopic_Bottom , UNO_QUERY ) ; - css::uno::Reference< XControl > xRef_Text_Bottom ( m_xText_Bottom , UNO_QUERY ) ; - css::uno::Reference< XControl > xRef_Button ( m_xButton , UNO_QUERY ) ; + css::uno::Reference< XControl > xRef_Topic_Top ( m_xTopic_Top , UNO_QUERY ); + css::uno::Reference< XControl > xRef_Text_Top ( m_xText_Top , UNO_QUERY ); + css::uno::Reference< XControl > xRef_Topic_Bottom ( m_xTopic_Bottom , UNO_QUERY ); + css::uno::Reference< XControl > xRef_Text_Bottom ( m_xText_Bottom , UNO_QUERY ); + css::uno::Reference< XControl > xRef_Button ( m_xButton , UNO_QUERY ); // ... set models ... - xRef_Topic_Top->setModel ( css::uno::Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ) ; - xRef_Text_Top->setModel ( css::uno::Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ) ; - xRef_Topic_Bottom->setModel ( css::uno::Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ) ; - xRef_Text_Bottom->setModel ( css::uno::Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ) ; - xRef_Button->setModel ( css::uno::Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( BUTTON_MODELNAME, rxContext ), UNO_QUERY ) ) ; + xRef_Topic_Top->setModel ( css::uno::Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ); + xRef_Text_Top->setModel ( css::uno::Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ); + xRef_Topic_Bottom->setModel ( css::uno::Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ); + xRef_Text_Bottom->setModel ( css::uno::Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ); + xRef_Button->setModel ( css::uno::Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( BUTTON_MODELNAME, rxContext ), UNO_QUERY ) ); // ProgressBar has no model !!! // ... and add controls to basecontainercontrol! - addControl ( CONTROLNAME_TEXT, xRef_Topic_Top ) ; - addControl ( CONTROLNAME_TEXT, xRef_Text_Top ) ; - addControl ( CONTROLNAME_TEXT, xRef_Topic_Bottom ) ; - addControl ( CONTROLNAME_TEXT, xRef_Text_Bottom ) ; - addControl ( CONTROLNAME_BUTTON, xRef_Button ) ; + addControl ( CONTROLNAME_TEXT, xRef_Topic_Top ); + addControl ( CONTROLNAME_TEXT, xRef_Text_Top ); + addControl ( CONTROLNAME_TEXT, xRef_Topic_Bottom ); + addControl ( CONTROLNAME_TEXT, xRef_Text_Bottom ); + addControl ( CONTROLNAME_BUTTON, xRef_Button ); addControl ( CONTROLNAME_PROGRESSBAR, m_xProgressBar.get() ); // FixedText make it automaticly visible by himself ... but not the progressbar !!! @@ -88,18 +88,18 @@ ProgressMonitor::ProgressMonitor( const css::uno::Reference< XComponentContext > // Reset to defaults !!! // (progressbar take automaticly its own defaults) - m_xButton->setLabel ( DEFAULT_BUTTONLABEL ) ; - m_xTopic_Top->setText ( PROGRESSMONITOR_DEFAULT_TOPIC ) ; - m_xText_Top->setText ( PROGRESSMONITOR_DEFAULT_TEXT ) ; - m_xTopic_Bottom->setText ( PROGRESSMONITOR_DEFAULT_TOPIC ) ; - m_xText_Bottom->setText ( PROGRESSMONITOR_DEFAULT_TEXT ) ; + m_xButton->setLabel ( DEFAULT_BUTTONLABEL ); + m_xTopic_Top->setText ( PROGRESSMONITOR_DEFAULT_TOPIC ); + m_xText_Top->setText ( PROGRESSMONITOR_DEFAULT_TEXT ); + m_xTopic_Bottom->setText ( PROGRESSMONITOR_DEFAULT_TOPIC ); + m_xText_Bottom->setText ( PROGRESSMONITOR_DEFAULT_TEXT ); - --m_refCount ; + --m_refCount; } ProgressMonitor::~ProgressMonitor() { - impl_cleanMemory () ; + impl_cleanMemory (); } // XInterface @@ -107,7 +107,7 @@ Any SAL_CALL ProgressMonitor::queryInterface( const Type& rType ) throw( Runtime { // Attention: // Don't use mutex or guard in this method!!! Is a method of XInterface. - Any aReturn ; + Any aReturn; css::uno::Reference< XInterface > xDel = BaseContainerControl::impl_getDelegator(); if ( xDel.is() ) { @@ -121,7 +121,7 @@ Any SAL_CALL ProgressMonitor::queryInterface( const Type& rType ) throw( Runtime aReturn = queryAggregation( rType ); } - return aReturn ; + return aReturn; } // XInterface @@ -150,7 +150,7 @@ Sequence< Type > SAL_CALL ProgressMonitor::getTypes() throw( RuntimeException, s // Optimize this method ! // We initialize a static variable only one time. And we don't must use a mutex at every call! // For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL! - static OTypeCollection* pTypeCollection = NULL ; + static OTypeCollection* pTypeCollection = NULL; if ( pTypeCollection == NULL ) { @@ -167,7 +167,7 @@ Sequence< Type > SAL_CALL ProgressMonitor::getTypes() throw( RuntimeException, s BaseContainerControl::getTypes() ); // ... and set his address to static pointer! - pTypeCollection = &aTypeCollection ; + pTypeCollection = &aTypeCollection; } } @@ -193,7 +193,7 @@ Any SAL_CALL ProgressMonitor::queryAggregation( const Type& aType ) throw( Runti aReturn = BaseControl::queryAggregation( aType ); } - return aReturn ; + return aReturn; } // XProgressMonitor @@ -205,26 +205,26 @@ void SAL_CALL ProgressMonitor::addText( { // Safe impossible cases // Check valid call of this method. - DBG_ASSERT ( impl_debug_checkParameter ( rTopic, rText, bbeforeProgress ) , "ProgressMonitor::addText()\nCall without valid parameters!\n") ; - DBG_ASSERT ( !(impl_searchTopic ( rTopic, bbeforeProgress ) != NULL ) , "ProgresMonitor::addText()\nThe text already exist.\n" ) ; + DBG_ASSERT ( impl_debug_checkParameter ( rTopic, rText, bbeforeProgress ) , "ProgressMonitor::addText()\nCall without valid parameters!\n"); + DBG_ASSERT ( !(impl_searchTopic ( rTopic, bbeforeProgress ) != NULL ) , "ProgresMonitor::addText()\nThe text already exist.\n" ); // Do nothing (in Release), if topic already exist. if ( impl_searchTopic ( rTopic, bbeforeProgress ) != NULL ) { - return ; + return; } // Else ... take memory for new item ... - IMPL_TextlistItem* pTextItem = new IMPL_TextlistItem ; + IMPL_TextlistItem* pTextItem = new IMPL_TextlistItem; if ( pTextItem != NULL ) { // Set values ... - pTextItem->sTopic = rTopic ; - pTextItem->sText = rText ; + pTextItem->sTopic = rTopic; + pTextItem->sText = rText; // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); // ... and insert it in right list. if ( bbeforeProgress == sal_True ) @@ -238,8 +238,8 @@ void SAL_CALL ProgressMonitor::addText( } // ... update window - impl_rebuildFixedText () ; - impl_recalcLayout () ; + impl_rebuildFixedText (); + impl_recalcLayout (); } // XProgressMonitor @@ -247,15 +247,15 @@ void SAL_CALL ProgressMonitor::removeText ( const OUString& rTopic, sal_Bool bbe { // Safe impossible cases // Check valid call of this method. - DBG_ASSERT ( impl_debug_checkParameter ( rTopic, bbeforeProgress ), "ProgressMonitor::removeText()\nCall without valid parameters!\n" ) ; + DBG_ASSERT ( impl_debug_checkParameter ( rTopic, bbeforeProgress ), "ProgressMonitor::removeText()\nCall without valid parameters!\n" ); // Search the topic ... - IMPL_TextlistItem* pSearchItem = impl_searchTopic ( rTopic, bbeforeProgress ) ; + IMPL_TextlistItem* pSearchItem = impl_searchTopic ( rTopic, bbeforeProgress ); if ( pSearchItem != NULL ) { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); // ... delete item from right list ... if ( bbeforeProgress == sal_True ) @@ -273,11 +273,11 @@ void SAL_CALL ProgressMonitor::removeText ( const OUString& rTopic, sal_Bool bbe maTextlist_Bottom.erase(itr); } - delete pSearchItem ; + delete pSearchItem; // ... and update window. - impl_rebuildFixedText () ; - impl_recalcLayout () ; + impl_rebuildFixedText (); + impl_recalcLayout (); } } @@ -290,22 +290,22 @@ void SAL_CALL ProgressMonitor::updateText ( { // Safe impossible cases // Check valid call of this method. - DBG_ASSERT ( impl_debug_checkParameter ( rTopic, rText, bbeforeProgress ), "ProgressMonitor::updateText()\nCall without valid parameters!\n" ) ; + DBG_ASSERT ( impl_debug_checkParameter ( rTopic, rText, bbeforeProgress ), "ProgressMonitor::updateText()\nCall without valid parameters!\n" ); // Search topic ... - IMPL_TextlistItem* pSearchItem = impl_searchTopic ( rTopic, bbeforeProgress ) ; + IMPL_TextlistItem* pSearchItem = impl_searchTopic ( rTopic, bbeforeProgress ); if ( pSearchItem != NULL ) { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); // ... update text ... - pSearchItem->sText = rText ; + pSearchItem->sText = rText; // ... and update window. - impl_rebuildFixedText () ; - impl_recalcLayout () ; + impl_rebuildFixedText (); + impl_recalcLayout (); } } @@ -313,56 +313,56 @@ void SAL_CALL ProgressMonitor::updateText ( void SAL_CALL ProgressMonitor::setForegroundColor ( sal_Int32 nColor ) throw( RuntimeException, std::exception ) { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); - m_xProgressBar->setForegroundColor ( nColor ) ; + m_xProgressBar->setForegroundColor ( nColor ); } // XProgressBar void SAL_CALL ProgressMonitor::setBackgroundColor ( sal_Int32 nColor ) throw( RuntimeException, std::exception ) { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); - m_xProgressBar->setBackgroundColor ( nColor ) ; + m_xProgressBar->setBackgroundColor ( nColor ); } // XProgressBar void SAL_CALL ProgressMonitor::setValue ( sal_Int32 nValue ) throw( RuntimeException, std::exception ) { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); - m_xProgressBar->setValue ( nValue ) ; + m_xProgressBar->setValue ( nValue ); } // XProgressBar void SAL_CALL ProgressMonitor::setRange ( sal_Int32 nMin, sal_Int32 nMax ) throw( RuntimeException, std::exception ) { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); - m_xProgressBar->setRange ( nMin, nMax ) ; + m_xProgressBar->setRange ( nMin, nMax ); } // XProgressBar sal_Int32 SAL_CALL ProgressMonitor::getValue () throw( RuntimeException, std::exception ) { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); - return m_xProgressBar->getValue () ; + return m_xProgressBar->getValue (); } // XButton void SAL_CALL ProgressMonitor::addActionListener ( const css::uno::Reference< XActionListener > & rListener ) throw( RuntimeException, std::exception ) { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); if ( m_xButton.is () ) { - m_xButton->addActionListener ( rListener ) ; + m_xButton->addActionListener ( rListener ); } } @@ -370,11 +370,11 @@ void SAL_CALL ProgressMonitor::addActionListener ( const css::uno::Reference< XA void SAL_CALL ProgressMonitor::removeActionListener ( const css::uno::Reference< XActionListener > & rListener ) throw( RuntimeException, std::exception ) { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); if ( m_xButton.is () ) { - m_xButton->removeActionListener ( rListener ) ; + m_xButton->removeActionListener ( rListener ); } } @@ -382,11 +382,11 @@ void SAL_CALL ProgressMonitor::removeActionListener ( const css::uno::Reference< void SAL_CALL ProgressMonitor::setLabel ( const OUString& rLabel ) throw( RuntimeException, std::exception ) { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); if ( m_xButton.is () ) { - m_xButton->setLabel ( rLabel ) ; + m_xButton->setLabel ( rLabel ); } } @@ -394,30 +394,30 @@ void SAL_CALL ProgressMonitor::setLabel ( const OUString& rLabel ) throw( Runtim void SAL_CALL ProgressMonitor::setActionCommand ( const OUString& rCommand ) throw( RuntimeException, std::exception ) { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); if ( m_xButton.is () ) { - m_xButton->setActionCommand ( rCommand ) ; + m_xButton->setActionCommand ( rCommand ); } } // XLayoutConstrains Size SAL_CALL ProgressMonitor::getMinimumSize () throw( RuntimeException, std::exception ) { - return Size (PROGRESSMONITOR_DEFAULT_WIDTH, PROGRESSMONITOR_DEFAULT_HEIGHT) ; + return Size (PROGRESSMONITOR_DEFAULT_WIDTH, PROGRESSMONITOR_DEFAULT_HEIGHT); } // XLayoutConstrains Size SAL_CALL ProgressMonitor::getPreferredSize () throw( RuntimeException, std::exception ) { // Ready for multithreading - ClearableMutexGuard aGuard ( m_aMutex ) ; + ClearableMutexGuard aGuard ( m_aMutex ); // get information about required place of child controls - css::uno::Reference< XLayoutConstrains > xTopicLayout_Top ( m_xTopic_Top , UNO_QUERY ) ; - css::uno::Reference< XLayoutConstrains > xTopicLayout_Bottom ( m_xTopic_Bottom , UNO_QUERY ) ; - css::uno::Reference< XLayoutConstrains > xButtonLayout ( m_xButton , UNO_QUERY ) ; + css::uno::Reference< XLayoutConstrains > xTopicLayout_Top ( m_xTopic_Top , UNO_QUERY ); + css::uno::Reference< XLayoutConstrains > xTopicLayout_Bottom ( m_xTopic_Bottom , UNO_QUERY ); + css::uno::Reference< XLayoutConstrains > xButtonLayout ( m_xButton , UNO_QUERY ); Size aTopicSize_Top = xTopicLayout_Top->getPreferredSize (); Size aTopicSize_Bottom = xTopicLayout_Bottom->getPreferredSize (); @@ -425,37 +425,37 @@ Size SAL_CALL ProgressMonitor::getPreferredSize () throw( RuntimeException, std: Rectangle aTempRectangle = m_xProgressBar->getPosSize(); Size aProgressBarSize = Size( aTempRectangle.Width, aTempRectangle.Height ); - aGuard.clear () ; + aGuard.clear (); // calc preferred size of progressmonitor - sal_Int32 nWidth = 3 * PROGRESSMONITOR_FREEBORDER ; - nWidth += aProgressBarSize.Width ; + sal_Int32 nWidth = 3 * PROGRESSMONITOR_FREEBORDER; + nWidth += aProgressBarSize.Width; - sal_Int32 nHeight = 6 * PROGRESSMONITOR_FREEBORDER ; - nHeight += aTopicSize_Top.Height ; - nHeight += aProgressBarSize.Height ; + sal_Int32 nHeight = 6 * PROGRESSMONITOR_FREEBORDER; + nHeight += aTopicSize_Top.Height; + nHeight += aProgressBarSize.Height; nHeight += aTopicSize_Bottom.Height; - nHeight += 2 ; // 1 for black line, 1 for white line = 3D-Line! - nHeight += aButtonSize.Height ; + nHeight += 2; // 1 for black line, 1 for white line = 3D-Line! + nHeight += aButtonSize.Height; // norm to minimum if ( nWidth < PROGRESSMONITOR_DEFAULT_WIDTH ) { - nWidth = PROGRESSMONITOR_DEFAULT_WIDTH ; + nWidth = PROGRESSMONITOR_DEFAULT_WIDTH; } if ( nHeight < PROGRESSMONITOR_DEFAULT_HEIGHT ) { - nHeight = PROGRESSMONITOR_DEFAULT_HEIGHT ; + nHeight = PROGRESSMONITOR_DEFAULT_HEIGHT; } // return to caller - return Size ( nWidth, nHeight ) ; + return Size ( nWidth, nHeight ); } // XLayoutConstrains Size SAL_CALL ProgressMonitor::calcAdjustedSize ( const Size& /*rNewSize*/ ) throw( RuntimeException, std::exception ) { - return getPreferredSize () ; + return getPreferredSize (); } // XControl @@ -463,13 +463,13 @@ void SAL_CALL ProgressMonitor::createPeer ( const css::uno::Reference< XToolkit { if (!getPeer().is()) { - BaseContainerControl::createPeer ( rToolkit, rParent ) ; + BaseContainerControl::createPeer ( rToolkit, rParent ); // If user forget to call "setPosSize()", we have still a correct size. // And a "MinimumSize" IS A "MinimumSize"! // We change not the position of control at this point. - Size aDefaultSize = getMinimumSize () ; - setPosSize ( 0, 0, aDefaultSize.Width, aDefaultSize.Height, PosSize::SIZE ) ; + Size aDefaultSize = getMinimumSize (); + setPosSize ( 0, 0, aDefaultSize.Width, aDefaultSize.Height, PosSize::SIZE ); } } @@ -477,54 +477,54 @@ void SAL_CALL ProgressMonitor::createPeer ( const css::uno::Reference< XToolkit sal_Bool SAL_CALL ProgressMonitor::setModel ( const css::uno::Reference< XControlModel > & /*rModel*/ ) throw( RuntimeException, std::exception ) { // We have no model. - return sal_False ; + return sal_False; } // XControl css::uno::Reference< XControlModel > SAL_CALL ProgressMonitor::getModel () throw( RuntimeException, std::exception ) { // We have no model. - // return (XControlModel*)this ; - return css::uno::Reference< XControlModel > () ; + // return (XControlModel*)this; + return css::uno::Reference< XControlModel > (); } // XComponent void SAL_CALL ProgressMonitor::dispose () throw( RuntimeException, std::exception ) { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); // "removeControl()" control the state of a reference - css::uno::Reference< XControl > xRef_Topic_Top ( m_xTopic_Top , UNO_QUERY ) ; - css::uno::Reference< XControl > xRef_Text_Top ( m_xText_Top , UNO_QUERY ) ; - css::uno::Reference< XControl > xRef_Topic_Bottom ( m_xTopic_Bottom , UNO_QUERY ) ; - css::uno::Reference< XControl > xRef_Text_Bottom ( m_xText_Bottom , UNO_QUERY ) ; - css::uno::Reference< XControl > xRef_Button ( m_xButton , UNO_QUERY ) ; - - removeControl ( xRef_Topic_Top ) ; - removeControl ( xRef_Text_Top ) ; - removeControl ( xRef_Topic_Bottom ) ; - removeControl ( xRef_Text_Bottom ) ; - removeControl ( xRef_Button ) ; + css::uno::Reference< XControl > xRef_Topic_Top ( m_xTopic_Top , UNO_QUERY ); + css::uno::Reference< XControl > xRef_Text_Top ( m_xText_Top , UNO_QUERY ); + css::uno::Reference< XControl > xRef_Topic_Bottom ( m_xTopic_Bottom , UNO_QUERY ); + css::uno::Reference< XControl > xRef_Text_Bottom ( m_xText_Bottom , UNO_QUERY ); + css::uno::Reference< XControl > xRef_Button ( m_xButton , UNO_QUERY ); + + removeControl ( xRef_Topic_Top ); + removeControl ( xRef_Text_Top ); + removeControl ( xRef_Topic_Bottom ); + removeControl ( xRef_Text_Bottom ); + removeControl ( xRef_Button ); removeControl ( m_xProgressBar.get() ); // do'nt use "...->clear ()" or "... = XFixedText ()" // when other hold a reference at this object !!! - xRef_Topic_Top->dispose () ; - xRef_Text_Top->dispose () ; - xRef_Topic_Bottom->dispose () ; - xRef_Text_Bottom->dispose () ; - xRef_Button->dispose () ; + xRef_Topic_Top->dispose (); + xRef_Text_Top->dispose (); + xRef_Topic_Bottom->dispose (); + xRef_Text_Bottom->dispose (); + xRef_Button->dispose (); m_xProgressBar->dispose(); - BaseContainerControl::dispose () ; + BaseContainerControl::dispose (); } // XWindow void SAL_CALL ProgressMonitor::setPosSize ( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nFlags ) throw( RuntimeException, std::exception ) { - Rectangle aBasePosSize = getPosSize () ; - BaseContainerControl::setPosSize (nX, nY, nWidth, nHeight, nFlags) ; + Rectangle aBasePosSize = getPosSize (); + BaseContainerControl::setPosSize (nX, nY, nWidth, nHeight, nFlags); // if position or size changed if ( @@ -533,12 +533,12 @@ void SAL_CALL ProgressMonitor::setPosSize ( sal_Int32 nX, sal_Int32 nY, sal_Int3 ) { // calc new layout for controls - impl_recalcLayout () ; + impl_recalcLayout (); // clear background (!) // [Children were repainted in "recalcLayout" by setPosSize() automaticly!] getPeer()->invalidate(2); // and repaint the control - impl_paint ( 0, 0, impl_getGraphicsPeer() ) ; + impl_paint ( 0, 0, impl_getGraphicsPeer() ); } } @@ -560,217 +560,217 @@ void ProgressMonitor::impl_paint ( sal_Int32 nX, sal_Int32 nY, const css::uno::R if (rGraphics.is()) { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); // paint shadowed border around the progressmonitor - rGraphics->setLineColor ( PROGRESSMONITOR_LINECOLOR_SHADOW ) ; - rGraphics->drawLine ( impl_getWidth()-1, impl_getHeight()-1, impl_getWidth()-1, nY ) ; - rGraphics->drawLine ( impl_getWidth()-1, impl_getHeight()-1, nX , impl_getHeight()-1 ) ; + rGraphics->setLineColor ( PROGRESSMONITOR_LINECOLOR_SHADOW ); + rGraphics->drawLine ( impl_getWidth()-1, impl_getHeight()-1, impl_getWidth()-1, nY ); + rGraphics->drawLine ( impl_getWidth()-1, impl_getHeight()-1, nX , impl_getHeight()-1 ); - rGraphics->setLineColor ( PROGRESSMONITOR_LINECOLOR_BRIGHT ) ; - rGraphics->drawLine ( nX, nY, impl_getWidth(), nY ) ; - rGraphics->drawLine ( nX, nY, nX , impl_getHeight() ) ; + rGraphics->setLineColor ( PROGRESSMONITOR_LINECOLOR_BRIGHT ); + rGraphics->drawLine ( nX, nY, impl_getWidth(), nY ); + rGraphics->drawLine ( nX, nY, nX , impl_getHeight() ); // Paint 3D-line - rGraphics->setLineColor ( PROGRESSMONITOR_LINECOLOR_SHADOW ) ; - rGraphics->drawLine ( m_a3DLine.X, m_a3DLine.Y, m_a3DLine.X+m_a3DLine.Width, m_a3DLine.Y ) ; + rGraphics->setLineColor ( PROGRESSMONITOR_LINECOLOR_SHADOW ); + rGraphics->drawLine ( m_a3DLine.X, m_a3DLine.Y, m_a3DLine.X+m_a3DLine.Width, m_a3DLine.Y ); - rGraphics->setLineColor ( PROGRESSMONITOR_LINECOLOR_BRIGHT ) ; - rGraphics->drawLine ( m_a3DLine.X, m_a3DLine.Y+1, m_a3DLine.X+m_a3DLine.Width, m_a3DLine.Y+1 ) ; + rGraphics->setLineColor ( PROGRESSMONITOR_LINECOLOR_BRIGHT ); + rGraphics->drawLine ( m_a3DLine.X, m_a3DLine.Y+1, m_a3DLine.X+m_a3DLine.Width, m_a3DLine.Y+1 ); } } // private method void ProgressMonitor::impl_recalcLayout () { - sal_Int32 nX_Button ; - sal_Int32 nY_Button ; - sal_Int32 nWidth_Button ; - sal_Int32 nHeight_Button ; + sal_Int32 nX_Button; + sal_Int32 nY_Button; + sal_Int32 nWidth_Button; + sal_Int32 nHeight_Button; - sal_Int32 nX_ProgressBar ; - sal_Int32 nY_ProgressBar ; - sal_Int32 nWidth_ProgressBar ; - sal_Int32 nHeight_ProgressBar ; + sal_Int32 nX_ProgressBar; + sal_Int32 nY_ProgressBar; + sal_Int32 nWidth_ProgressBar; + sal_Int32 nHeight_ProgressBar; - sal_Int32 nX_Text_Top ; - sal_Int32 nY_Text_Top ; - sal_Int32 nWidth_Text_Top ; - sal_Int32 nHeight_Text_Top ; + sal_Int32 nX_Text_Top; + sal_Int32 nY_Text_Top; + sal_Int32 nWidth_Text_Top; + sal_Int32 nHeight_Text_Top; - sal_Int32 nX_Topic_Top ; - sal_Int32 nY_Topic_Top ; - sal_Int32 nWidth_Topic_Top ; - sal_Int32 nHeight_Topic_Top ; + sal_Int32 nX_Topic_Top; + sal_Int32 nY_Topic_Top; + sal_Int32 nWidth_Topic_Top; + sal_Int32 nHeight_Topic_Top; - sal_Int32 nX_Text_Bottom ; - sal_Int32 nY_Text_Bottom ; - sal_Int32 nWidth_Text_Bottom ; - sal_Int32 nHeight_Text_Bottom ; + sal_Int32 nX_Text_Bottom; + sal_Int32 nY_Text_Bottom; + sal_Int32 nWidth_Text_Bottom; + sal_Int32 nHeight_Text_Bottom; - sal_Int32 nX_Topic_Bottom ; - sal_Int32 nY_Topic_Bottom ; - sal_Int32 nWidth_Topic_Bottom ; - sal_Int32 nHeight_Topic_Bottom ; + sal_Int32 nX_Topic_Bottom; + sal_Int32 nY_Topic_Bottom; + sal_Int32 nWidth_Topic_Bottom; + sal_Int32 nHeight_Topic_Bottom; // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); // get information about required place of child controls - css::uno::Reference< XLayoutConstrains > xTopicLayout_Top ( m_xTopic_Top , UNO_QUERY ) ; - css::uno::Reference< XLayoutConstrains > xTextLayout_Top ( m_xText_Top , UNO_QUERY ) ; - css::uno::Reference< XLayoutConstrains > xTopicLayout_Bottom ( m_xTopic_Bottom , UNO_QUERY ) ; - css::uno::Reference< XLayoutConstrains > xTextLayout_Bottom ( m_xText_Bottom , UNO_QUERY ) ; - css::uno::Reference< XLayoutConstrains > xButtonLayout ( m_xButton , UNO_QUERY ) ; - - Size aTopicSize_Top = xTopicLayout_Top->getPreferredSize () ; - Size aTextSize_Top = xTextLayout_Top->getPreferredSize () ; - Size aTopicSize_Bottom = xTopicLayout_Bottom->getPreferredSize () ; - Size aTextSize_Bottom = xTextLayout_Bottom->getPreferredSize () ; - Size aButtonSize = xButtonLayout->getPreferredSize () ; + css::uno::Reference< XLayoutConstrains > xTopicLayout_Top ( m_xTopic_Top , UNO_QUERY ); + css::uno::Reference< XLayoutConstrains > xTextLayout_Top ( m_xText_Top , UNO_QUERY ); + css::uno::Reference< XLayoutConstrains > xTopicLayout_Bottom ( m_xTopic_Bottom , UNO_QUERY ); + css::uno::Reference< XLayoutConstrains > xTextLayout_Bottom ( m_xText_Bottom , UNO_QUERY ); + css::uno::Reference< XLayoutConstrains > xButtonLayout ( m_xButton , UNO_QUERY ); + + Size aTopicSize_Top = xTopicLayout_Top->getPreferredSize (); + Size aTextSize_Top = xTextLayout_Top->getPreferredSize (); + Size aTopicSize_Bottom = xTopicLayout_Bottom->getPreferredSize (); + Size aTextSize_Bottom = xTextLayout_Bottom->getPreferredSize (); + Size aButtonSize = xButtonLayout->getPreferredSize (); // calc position and size of child controls // Button has preferred size! - nWidth_Button = aButtonSize.Width ; - nHeight_Button = aButtonSize.Height ; + nWidth_Button = aButtonSize.Width; + nHeight_Button = aButtonSize.Height; // Left column before progressbar has preferred size and fixed position. // But "Width" is oriented on left column below progressbar to!!! "max(...)" - nX_Topic_Top = PROGRESSMONITOR_FREEBORDER ; - nY_Topic_Top = PROGRESSMONITOR_FREEBORDER ; - nWidth_Topic_Top = std::max( aTopicSize_Top.Width, aTopicSize_Bottom.Width ) ; - nHeight_Topic_Top = aTopicSize_Top.Height ; + nX_Topic_Top = PROGRESSMONITOR_FREEBORDER; + nY_Topic_Top = PROGRESSMONITOR_FREEBORDER; + nWidth_Topic_Top = std::max( aTopicSize_Top.Width, aTopicSize_Bottom.Width ); + nHeight_Topic_Top = aTopicSize_Top.Height; // Right column before progressbar has relativ position to left column ... // ... and a size as rest of dialog size! nX_Text_Top = nX_Topic_Top+nWidth_Topic_Top+PROGRESSMONITOR_FREEBORDER; - nY_Text_Top = nY_Topic_Top ; - nWidth_Text_Top = std::max ( aTextSize_Top.Width, aTextSize_Bottom.Width ) ; + nY_Text_Top = nY_Topic_Top; + nWidth_Text_Top = std::max ( aTextSize_Top.Width, aTextSize_Bottom.Width ); // Fix size of this column to minimum! - sal_Int32 nSummaryWidth = nWidth_Text_Top+nWidth_Topic_Top+(3*PROGRESSMONITOR_FREEBORDER) ; + sal_Int32 nSummaryWidth = nWidth_Text_Top+nWidth_Topic_Top+(3*PROGRESSMONITOR_FREEBORDER); if ( nSummaryWidth < PROGRESSMONITOR_DEFAULT_WIDTH ) nWidth_Text_Top = PROGRESSMONITOR_DEFAULT_WIDTH-nWidth_Topic_Top-(3*PROGRESSMONITOR_FREEBORDER); // Fix size of column to maximum! if ( nSummaryWidth > impl_getWidth() ) - nWidth_Text_Top = impl_getWidth()-nWidth_Topic_Top-(3*PROGRESSMONITOR_FREEBORDER) ; - nHeight_Text_Top = nHeight_Topic_Top ; + nWidth_Text_Top = impl_getWidth()-nWidth_Topic_Top-(3*PROGRESSMONITOR_FREEBORDER); + nHeight_Text_Top = nHeight_Topic_Top; // Position of progressbar is relativ to columns before. // Progressbar.Width = Dialog.Width !!! // Progressbar.Height = Button.Height - nX_ProgressBar = nX_Topic_Top ; - nY_ProgressBar = nY_Topic_Top+nHeight_Topic_Top+PROGRESSMONITOR_FREEBORDER ; - nWidth_ProgressBar = PROGRESSMONITOR_FREEBORDER+nWidth_Topic_Top+nWidth_Text_Top ; - nHeight_ProgressBar = nHeight_Button ; + nX_ProgressBar = nX_Topic_Top; + nY_ProgressBar = nY_Topic_Top+nHeight_Topic_Top+PROGRESSMONITOR_FREEBORDER; + nWidth_ProgressBar = PROGRESSMONITOR_FREEBORDER+nWidth_Topic_Top+nWidth_Text_Top; + nHeight_ProgressBar = nHeight_Button; // Oriented by left column before progressbar. - nX_Topic_Bottom = nX_Topic_Top ; - nY_Topic_Bottom = nY_ProgressBar+nHeight_ProgressBar+PROGRESSMONITOR_FREEBORDER ; - nWidth_Topic_Bottom = nWidth_Topic_Top ; - nHeight_Topic_Bottom = aTopicSize_Bottom.Height ; + nX_Topic_Bottom = nX_Topic_Top; + nY_Topic_Bottom = nY_ProgressBar+nHeight_ProgressBar+PROGRESSMONITOR_FREEBORDER; + nWidth_Topic_Bottom = nWidth_Topic_Top; + nHeight_Topic_Bottom = aTopicSize_Bottom.Height; // Oriented by right column before progressbar. - nX_Text_Bottom = nX_Topic_Bottom+nWidth_Topic_Bottom+PROGRESSMONITOR_FREEBORDER ; - nY_Text_Bottom = nY_Topic_Bottom ; - nWidth_Text_Bottom = nWidth_Text_Top ; - nHeight_Text_Bottom = nHeight_Topic_Bottom ; + nX_Text_Bottom = nX_Topic_Bottom+nWidth_Topic_Bottom+PROGRESSMONITOR_FREEBORDER; + nY_Text_Bottom = nY_Topic_Bottom; + nWidth_Text_Bottom = nWidth_Text_Top; + nHeight_Text_Bottom = nHeight_Topic_Bottom; // Oriented by progressbar. - nX_Button = nX_ProgressBar+nWidth_ProgressBar-nWidth_Button ; - nY_Button = nY_Topic_Bottom+nHeight_Topic_Bottom+PROGRESSMONITOR_FREEBORDER ; + nX_Button = nX_ProgressBar+nWidth_ProgressBar-nWidth_Button; + nY_Button = nY_Topic_Bottom+nHeight_Topic_Bottom+PROGRESSMONITOR_FREEBORDER; // Calc offsets to center controls - sal_Int32 nDx ; - sal_Int32 nDy ; + sal_Int32 nDx; + sal_Int32 nDy; - nDx = ( (2*PROGRESSMONITOR_FREEBORDER)+nWidth_ProgressBar ) ; - nDy = ( (6*PROGRESSMONITOR_FREEBORDER)+nHeight_Topic_Top+nHeight_ProgressBar+nHeight_Topic_Bottom+2+nHeight_Button ) ; + nDx = ( (2*PROGRESSMONITOR_FREEBORDER)+nWidth_ProgressBar ); + nDy = ( (6*PROGRESSMONITOR_FREEBORDER)+nHeight_Topic_Top+nHeight_ProgressBar+nHeight_Topic_Bottom+2+nHeight_Button ); // At this point use original dialog size to center controls! - nDx = (impl_getWidth ()/2)-(nDx/2) ; - nDy = (impl_getHeight()/2)-(nDy/2) ; + nDx = (impl_getWidth ()/2)-(nDx/2); + nDy = (impl_getHeight()/2)-(nDy/2); if ( nDx<0 ) { - nDx=0 ; + nDx=0; } if ( nDy<0 ) { - nDy=0 ; + nDy=0; } // Set new position and size on all controls - css::uno::Reference< XWindow > xRef_Topic_Top ( m_xTopic_Top , UNO_QUERY ) ; - css::uno::Reference< XWindow > xRef_Text_Top ( m_xText_Top , UNO_QUERY ) ; - css::uno::Reference< XWindow > xRef_Topic_Bottom ( m_xTopic_Bottom , UNO_QUERY ) ; - css::uno::Reference< XWindow > xRef_Text_Bottom ( m_xText_Bottom , UNO_QUERY ) ; - css::uno::Reference< XWindow > xRef_Button ( m_xButton , UNO_QUERY ) ; - - xRef_Topic_Top->setPosSize ( nDx+nX_Topic_Top , nDy+nY_Topic_Top , nWidth_Topic_Top , nHeight_Topic_Top , 15 ) ; - xRef_Text_Top->setPosSize ( nDx+nX_Text_Top , nDy+nY_Text_Top , nWidth_Text_Top , nHeight_Text_Top , 15 ) ; - xRef_Topic_Bottom->setPosSize ( nDx+nX_Topic_Bottom , nDy+nY_Topic_Bottom , nWidth_Topic_Bottom , nHeight_Topic_Bottom , 15 ) ; - xRef_Text_Bottom->setPosSize ( nDx+nX_Text_Bottom , nDy+nY_Text_Bottom , nWidth_Text_Bottom , nHeight_Text_Bottom , 15 ) ; - xRef_Button->setPosSize ( nDx+nX_Button , nDy+nY_Button , nWidth_Button , nHeight_Button , 15 ) ; + css::uno::Reference< XWindow > xRef_Topic_Top ( m_xTopic_Top , UNO_QUERY ); + css::uno::Reference< XWindow > xRef_Text_Top ( m_xText_Top , UNO_QUERY ); + css::uno::Reference< XWindow > xRef_Topic_Bottom ( m_xTopic_Bottom , UNO_QUERY ); + css::uno::Reference< XWindow > xRef_Text_Bottom ( m_xText_Bottom , UNO_QUERY ); + css::uno::Reference< XWindow > xRef_Button ( m_xButton , UNO_QUERY ); + + xRef_Topic_Top->setPosSize ( nDx+nX_Topic_Top , nDy+nY_Topic_Top , nWidth_Topic_Top , nHeight_Topic_Top , 15 ); + xRef_Text_Top->setPosSize ( nDx+nX_Text_Top , nDy+nY_Text_Top , nWidth_Text_Top , nHeight_Text_Top , 15 ); + xRef_Topic_Bottom->setPosSize ( nDx+nX_Topic_Bottom , nDy+nY_Topic_Bottom , nWidth_Topic_Bottom , nHeight_Topic_Bottom , 15 ); + xRef_Text_Bottom->setPosSize ( nDx+nX_Text_Bottom , nDy+nY_Text_Bottom , nWidth_Text_Bottom , nHeight_Text_Bottom , 15 ); + xRef_Button->setPosSize ( nDx+nX_Button , nDy+nY_Button , nWidth_Button , nHeight_Button , 15 ); m_xProgressBar->setPosSize( nDx+nX_ProgressBar, nDy+nY_ProgressBar, nWidth_ProgressBar, nHeight_ProgressBar, 15 ); - m_a3DLine.X = nDx+nX_Topic_Top ; - m_a3DLine.Y = nDy+nY_Topic_Bottom+nHeight_Topic_Bottom+(PROGRESSMONITOR_FREEBORDER/2) ; - m_a3DLine.Width = nWidth_ProgressBar ; - m_a3DLine.Height = nHeight_ProgressBar ; + m_a3DLine.X = nDx+nX_Topic_Top; + m_a3DLine.Y = nDy+nY_Topic_Bottom+nHeight_Topic_Bottom+(PROGRESSMONITOR_FREEBORDER/2); + m_a3DLine.Width = nWidth_ProgressBar; + m_a3DLine.Height = nHeight_ProgressBar; // All childcontrols make an implicit repaint in setPosSize()! // Make it also for this 3D-line ... - css::uno::Reference< XGraphics > xGraphics = impl_getGraphicsPeer () ; + css::uno::Reference< XGraphics > xGraphics = impl_getGraphicsPeer (); - xGraphics->setLineColor ( PROGRESSMONITOR_LINECOLOR_SHADOW ) ; - xGraphics->drawLine ( m_a3DLine.X, m_a3DLine.Y, m_a3DLine.X+m_a3DLine.Width, m_a3DLine.Y ) ; + xGraphics->setLineColor ( PROGRESSMONITOR_LINECOLOR_SHADOW ); + xGraphics->drawLine ( m_a3DLine.X, m_a3DLine.Y, m_a3DLine.X+m_a3DLine.Width, m_a3DLine.Y ); - xGraphics->setLineColor ( PROGRESSMONITOR_LINECOLOR_BRIGHT ) ; - xGraphics->drawLine ( m_a3DLine.X, m_a3DLine.Y+1, m_a3DLine.X+m_a3DLine.Width, m_a3DLine.Y+1 ) ; + xGraphics->setLineColor ( PROGRESSMONITOR_LINECOLOR_BRIGHT ); + xGraphics->drawLine ( m_a3DLine.X, m_a3DLine.Y+1, m_a3DLine.X+m_a3DLine.Width, m_a3DLine.Y+1 ); } // private method void ProgressMonitor::impl_rebuildFixedText () { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); // Rebuild fixedtext before progress // Rebuild left site of text if (m_xTopic_Top.is()) { - OUString aCollectString ; + OUString aCollectString; // Collect all topics from list and format text. // "\n" MUST BE at the end of line!!! => Else ... topic and his text are not in the same line!!! for ( size_t n = 0; n < maTextlist_Top.size(); ++n ) { IMPL_TextlistItem* pSearchItem = maTextlist_Top[ n ]; - aCollectString += pSearchItem->sTopic ; + aCollectString += pSearchItem->sTopic; aCollectString += "\n"; } aCollectString += "\0"; // It's better :-) - m_xTopic_Top->setText ( aCollectString ) ; + m_xTopic_Top->setText ( aCollectString ); } // Rebuild right site of text if (m_xText_Top.is()) { - OUString aCollectString ; + OUString aCollectString; // Collect all topics from list and format text. // "\n" MUST BE at the end of line!!! => Else ... topic and his text are not in the same line!!! for ( size_t n = 0; n < maTextlist_Top.size(); ++n ) { IMPL_TextlistItem* pSearchItem = maTextlist_Top[ n ]; - aCollectString += pSearchItem->sText ; + aCollectString += pSearchItem->sText; aCollectString += "\n"; } aCollectString += "\0"; // It's better :-) - m_xText_Top->setText ( aCollectString ) ; + m_xText_Top->setText ( aCollectString ); } // Rebuild fixedtext below progress @@ -778,37 +778,37 @@ void ProgressMonitor::impl_rebuildFixedText () // Rebuild left site of text if (m_xTopic_Bottom.is()) { - OUString aCollectString ; + OUString aCollectString; // Collect all topics from list and format text. // "\n" MUST BE at the end of line!!! => Else ... topic and his text are not in the same line!!! for ( size_t n = 0; n < maTextlist_Bottom.size(); ++n ) { IMPL_TextlistItem* pSearchItem = maTextlist_Bottom[ n ]; - aCollectString += pSearchItem->sTopic ; + aCollectString += pSearchItem->sTopic; aCollectString += "\n"; } aCollectString += "\0"; // It's better :-) - m_xTopic_Bottom->setText ( aCollectString ) ; + m_xTopic_Bottom->setText ( aCollectString ); } // Rebuild right site of text if (m_xText_Bottom.is()) { - OUString aCollectString ; + OUString aCollectString; // Collect all topics from list and format text. // "\n" MUST BE at the end of line!!! => Else ... topic and his text are not in the same line!!! for ( size_t n = 0; n < maTextlist_Bottom.size(); ++n ) { IMPL_TextlistItem* pSearchItem = maTextlist_Bottom[ n ]; - aCollectString += pSearchItem->sText ; + aCollectString += pSearchItem->sText; aCollectString += "\n"; } aCollectString += "\0"; // It's better :-) - m_xText_Bottom->setText ( aCollectString ) ; + m_xText_Bottom->setText ( aCollectString ); } } @@ -816,21 +816,21 @@ void ProgressMonitor::impl_rebuildFixedText () void ProgressMonitor::impl_cleanMemory () { // Ready for multithreading - MutexGuard aGuard ( m_aMutex ) ; + MutexGuard aGuard ( m_aMutex ); // Delete all of lists. - for ( size_t nPosition = 0; nPosition < maTextlist_Top.size() ; ++nPosition ) + for ( size_t nPosition = 0; nPosition < maTextlist_Top.size(); ++nPosition ) { IMPL_TextlistItem* pSearchItem = maTextlist_Top[ nPosition ]; - delete pSearchItem ; + delete pSearchItem; } maTextlist_Top.clear(); - for ( size_t nPosition = 0; nPosition < maTextlist_Bottom.size() ; ++nPosition ) + for ( size_t nPosition = 0; nPosition < maTextlist_Bottom.size(); ++nPosition ) { IMPL_TextlistItem* pSearchItem = maTextlist_Bottom[ nPosition ]; - delete pSearchItem ; + delete pSearchItem; } maTextlist_Bottom.clear(); } @@ -839,40 +839,40 @@ void ProgressMonitor::impl_cleanMemory () IMPL_TextlistItem* ProgressMonitor::impl_searchTopic ( const OUString& rTopic, bool bbeforeProgress ) { // Get right textlist for following operations. - ::std::vector< IMPL_TextlistItem* >* pTextList ; + ::std::vector< IMPL_TextlistItem* >* pTextList; // Ready for multithreading - ClearableMutexGuard aGuard ( m_aMutex ) ; + ClearableMutexGuard aGuard ( m_aMutex ); if ( bbeforeProgress ) { - pTextList = &maTextlist_Top ; + pTextList = &maTextlist_Top; } else { - pTextList = &maTextlist_Bottom ; + pTextList = &maTextlist_Bottom; } // Switch off guard. - aGuard.clear () ; + aGuard.clear (); // Search the topic in textlist. size_t nPosition = 0; size_t nCount = pTextList->size(); - for ( nPosition = 0; nPosition < nCount ; ++nPosition ) + for ( nPosition = 0; nPosition < nCount; ++nPosition ) { IMPL_TextlistItem* pSearchItem = pTextList->at( nPosition ); if ( pSearchItem->sTopic == rTopic ) { // We have found this topic ... return a valid pointer. - return pSearchItem ; + return pSearchItem; } } // We have'nt found this topic ... return a nonvalid pointer. - return NULL ; + return NULL; } // debug methods @@ -885,30 +885,30 @@ bool ProgressMonitor::impl_debug_checkParameter ( bool /*bbeforeProgress*/ ) { // Check "rTopic" - if ( &rTopic == NULL ) return false ; // NULL-pointer for reference ???!!! - if ( rTopic.isEmpty() ) return false ; // "" + if ( &rTopic == NULL ) return false; // NULL-pointer for reference ???!!! + if ( rTopic.isEmpty() ) return false; // "" // Check "rText" - if ( &rText == NULL ) return false ; // NULL-pointer for reference ???!!! - if ( rText.isEmpty() ) return false ; // "" + if ( &rText == NULL ) return false; // NULL-pointer for reference ???!!! + if ( rText.isEmpty() ) return false; // "" // "bbeforeProgress" is valid in everyway! // Parameter OK ... return sal_True. - return true ; + return true; } // removeText bool ProgressMonitor::impl_debug_checkParameter ( const OUString& rTopic, bool /*bbeforeProgress*/ ) { // Check "rTopic" - if ( &rTopic == NULL ) return false ; // NULL-pointer for reference ???!!! - if ( rTopic.isEmpty() ) return false ; // "" + if ( &rTopic == NULL ) return false; // NULL-pointer for reference ???!!! + if ( rTopic.isEmpty() ) return false; // "" // "bbeforeProgress" is valid in everyway! // Parameter OK ... return sal_True. - return true ; + return true; } #endif // #ifdef DBG_UTIL |