Commits

Anonymous committed 029686e

dockingwindows: #i115802# Fixed gcc warnings, adaptation to new build system

Comments (0)

Files changed (6)

framework/Library_fwk.mk

 	framework/source/layoutmanager/helpers \
 	framework/source/layoutmanager/layoutmanager \
 	framework/source/layoutmanager/panel \
+	framework/source/layoutmanager/panelcontainerwindow \
 	framework/source/layoutmanager/panelmanager \
+	framework/source/layoutmanager/splitpanelcontainerwindow \
+	framework/source/layoutmanager/splitpanelmanager \
 	framework/source/layoutmanager/toolbarlayoutmanager \
 	framework/source/layoutmanager/uielement \
 	framework/source/loadenv/loadenv \

framework/source/layoutmanager/layoutmanager.cxx

         }
         else if ( aElementType.equalsIgnoreAsciiCaseAscii( "dockingwindow" ))
         {
-            ReadGuard aReadLock( m_aLock );
+            aReadLock.lock();
             uno::Reference< css::awt::XDockableWindowListener > xThis( m_xPanelManager );
             PanelManager* pPanelManager( m_pPanelManager );
             aReadLock.unlock();

framework/source/layoutmanager/panelmanager.cxx

 {
 }
 
-static ::Rectangle lcl_calcHotZoneRect( const ::Rectangle& rRect, sal_Int32 nHotZoneOffset )
-{
-    ::Rectangle aRect( rRect );
-
-    aRect.Left() -= nHotZoneOffset;
-    aRect.Top() -= nHotZoneOffset;
-    aRect.Right() += nHotZoneOffset;
-    aRect.Bottom() += nHotZoneOffset;
-    
-    return aRect;
-}
-
 bool PanelManager::implts_dockWindow( const sal_Int16 eDockingArea, const awt::Rectangle& rVirtDockSize, const uno::Reference< awt::XWindow >& xWindow )
 {
     if ( eDockingArea < 0 || eDockingArea >= SPLITPANEL_COUNT )
     {
         try
         {
-            sal_Int16 eDockingArea( -1 ); // none
             awt::Rectangle aNewTrackingRect( e.TrackingRectangle.X, e.TrackingRectangle.Y, e.TrackingRectangle.Width, e.TrackingRectangle.Height );
 
             SplitPanelManager::DockingInfo aInfo;
 throw (uno::RuntimeException)
 {
     UIElement aUIDockingElement;
-
+    
     ReadGuard aReadLock( m_aLock );
     bool bDockingInProgress( m_bDockingInProgress );
     if ( bDockingInProgress )
 
     if ( !bDockingInProgress )
     {
-        UIElement aUIDockingElement;
         if ( implts_findDockingWindow( e.Source, aUIDockingElement ))
         {
             aUIDockingElement.m_bFloating   = !aUIDockingElement.m_bFloating;

framework/source/layoutmanager/splitpanelmanager.cxx

             sal_uInt16 nItems = m_pSplitWindow->GetItemCount(nRowColId);
             if ( nItems > 0 )
             {
-                long nFixedSize( 0 );
-                long nSize = m_pSplitWindow->GetItemSize(nRowColId);
+                nSize = m_pSplitWindow->GetItemSize(nRowColId);
                 
                 if ( isHorizontal() )
                     aSize.setHeight( nSize );
     }
 }
 
-SplitPanelManager::DockedWinInfo* SplitPanelManager::impl_getDockedWinInfo( sal_uInt16 nId )
+SplitPanelManager::DockedWinInfo SplitPanelManager::implts_getDockedWinInfo( sal_uInt16 nId )
 {
+    DockedWinInfo aInfo;
+    
+    vos::OGuard aGuard( Application::GetSolarMutex() );
     DockedWindows::iterator pIter = m_aDockedWindows.begin();
     while ( pIter != m_aDockedWindows.end() )
     {
         if ( pIter->nId == nId )
-            return pIter;
+            aInfo = *pIter;
         ++pIter;
     }
     
-    return 0;
+    return aInfo;
 }
 
 ::Point SplitPanelManager::impl_calcDockingMousePos( const ::Point& aMousePos )
     bool      bHorz( isHorizontal() );
     ::Size    aOutSize( m_pSplitWindow->GetOutputSizePixel() );
     ::Point   aDockMousePos;
-    sal_Int32 nSplitSize( m_pSplitWindow->GetItemSize( nRowColId ));
     sal_Int32 nPosX( aMousePos.X() );
     sal_Int32 nPosY( aMousePos.Y() );
     
     const awt::Rectangle& rDockRect, 
     const uno::Reference< awt::XWindow >& xWindow )
 {
-    const sal_Int32 MAGNETIC_DISTANCE_UNDOCK = 25;
+//    const sal_Int32 MAGNETIC_DISTANCE_UNDOCK = 25;
     const sal_Int32 MAGNETIC_DISTANCE_DOCK   = 20;
 
     DockingInfo aDockingInfo;
             }
             else
             {
-                Window*        pDockWindow( VCLUnoHelper::GetWindow( xWindow ));
-                sal_uInt16     nCount = m_pSplitWindow->GetItemCount( nRowColId );
-                long           nSize = m_pSplitWindow->GetItemSize( nId, SWIB_FIXED );
-                long           nRowColSize = m_pSplitWindow->GetItemSize( nRowColId, SWIB_FIXED );
-                sal_uInt16     nPos = m_pSplitWindow->GetItemPos( nId, nRowColId );
-                DockedWinInfo* pInfo = impl_getDockedWinInfo( nId );
-                Window*        pWindow = m_pSplitWindow->GetItemWindow( nId );
-                sal_Int32      nItemsSize = implts_getItemsSize();
+                long       nRowColSize = m_pSplitWindow->GetItemSize( nRowColId, SWIB_FIXED );
+                sal_Int32  nItemsSize = implts_getItemsSize();
+                sal_uInt16 nPos = m_pSplitWindow->GetItemPos( nId, nRowColId );
+                Window*    pDockWindow( VCLUnoHelper::GetWindow( xWindow ));
+                Window*    pWindow = m_pSplitWindow->GetItemWindow( nId );
                 
                 if ( pWindow && pDockWindow == pWindow )
                 {
                         else
                             nDockPos = nPos+1;
                         nItemsSize += rDockRect.Width;
-                        double dScale = double( aOutSize.getWidth() ) / double( nItemsSize );
-                        double dRelSize = double( rDockRect.Width ) / double( nItemsSize );
-                        sal_Int32 nDockWidth = sal_Int32( nItemsSize * dRelSize * dScale );
+                        //                        double dScale = double( aOutSize.getWidth() ) / double( nItemsSize );
+                        //                        double dRelSize = double( rDockRect.Width ) / double( nItemsSize );
+                        //                        sal_Int32 nDockWidth = sal_Int32( nItemsSize * dRelSize * dScale );
                     }
                     else
                     {
                         {
                             if ( i < nDockPos )
                             {
-                                sal_uInt16 nId = m_pSplitWindow->GetItemId(i, nRowColId);
-			                    DockedWinInfo aDockedWinInfo( m_aDockedWindows[i] );
-                                nPosY += sal_Int32( double( m_pSplitWindow->GetItemSize( nId, SWIB_FIXED )) * dScale );
+                                sal_uInt16 nTmpId = m_pSplitWindow->GetItemId(i, nRowColId);
+                                DockedWinInfo aDockedWinInfo( m_aDockedWindows[i] );
+                                nPosY += sal_Int32( double( m_pSplitWindow->GetItemSize( nTmpId, SWIB_FIXED )) * dScale );
                             }
                             else
                                 break;
             else
             {
                 sal_Int32 nBottom = ( aWinRect.GetHeight() == 0 ) ? aWinRect.Top() : aWinRect.Bottom();
-                aDockingRect.Y = std::max( sal_Int32( aWinRect.Bottom() - nHeight ), sal_Int32( 0 ));
+                aDockingRect.Y = std::max( sal_Int32( nBottom - nHeight ), sal_Int32( 0 ));
             }
         }
         else
     if ( m_pSplitWindow )
     {
         DockingWindow* pDockWindow = dynamic_cast< DockingWindow* >( VCLUnoHelper::GetWindow( xWindow ));
-	    sal_uInt16     nId = m_pSplitWindow->GetItemId( pDockWindow );
-	    if ( nId > 0 )
+            sal_uInt16     nId = m_pSplitWindow->GetItemId( pDockWindow );
+            if ( nId > 0 )
         {
-	        m_pSplitWindow->RemoveItem( nId, TRUE );
-	        implts_removeDockedWindowInfo( nId );
-	        if ( m_pSplitWindow->GetItemCount( nRowColId ) == 0 )
-	        {
-	            m_pSplitWindow->Clear();
-	            
+                m_pSplitWindow->RemoveItem( nId, TRUE );
+                implts_removeDockedWindowInfo( nId );
+                if ( m_pSplitWindow->GetItemCount( nRowColId ) == 0 )
+                {
+                    m_pSplitWindow->Clear();
+                    
                 // Set width/height back to zero. This needs to be done manually
                 // as the SplitWindow uses the old size until forced!
-	            ::Size aSize = m_pSplitWindow->GetSizePixel();
-	            isHorizontal() ? aSize.setHeight(0) : aSize.setWidth(0);
-	            m_pSplitWindow->SetSizePixel( aSize );
-	        }
+                    ::Size aSize = m_pSplitWindow->GetSizePixel();
+                    isHorizontal() ? aSize.setHeight(0) : aSize.setWidth(0);
+                    m_pSplitWindow->SetSizePixel( aSize );
+                }
             return true;
-	    }
-	}
+            }
+        }
     
     return false;
 }
     vos::OGuard aGuard( Application::GetSolarMutex() );
     if ( m_pSplitWindow )
     {
-		sal_uInt16 nId( nStartID );
-		for ( USHORT n=0; n < m_pSplitWindow->GetItemCount(nRowColId); n++ )
-		{
-			sal_uInt16 nItemId = m_pSplitWindow->GetItemId(n, nRowColId);
-			if ( nItemId >= nId )
-				nId = nItemId+1;
-		}
-		
-		return nId;
+        sal_uInt16 nId( nStartID );
+        for ( USHORT n=0; n < m_pSplitWindow->GetItemCount(nRowColId); n++ )
+        {
+            sal_uInt16 nItemId = m_pSplitWindow->GetItemId(n, nRowColId);
+            if ( nItemId >= nId )
+                nId = nItemId+1;
+        }
+                
+        return nId;
     }
     
     return 0;
     
     if ( m_pSplitWindow )
     {
-		sal_uInt16 nId( nStartID );
-		for ( USHORT n=0; n < m_pSplitWindow->GetItemCount(nRowColId); n++ )
-		{
-			sal_uInt16 nItemId = m_pSplitWindow->GetItemId(n, nRowColId);
-			sal_Int32 nSize    = m_pSplitWindow->GetItemSize( nItemId, SWIB_FIXED );
-			nSizeSum += nSize;
-		}
+        for ( USHORT n=0; n < m_pSplitWindow->GetItemCount(nRowColId); n++ )
+        {
+            sal_uInt16 nItemId = m_pSplitWindow->GetItemId(n, nRowColId);
+            sal_Int32  nSize   = m_pSplitWindow->GetItemSize( nItemId, SWIB_FIXED );
+            nSizeSum += nSize;
+        }
     }
     
     return nSizeSum;

framework/source/layoutmanager/splitpanelmanager.hxx

 
 enum SplitPanelPosition
 {
-	SPLITPANEL_TOP,
-	SPLITPANEL_BOTTOM,
-	SPLITPANEL_LEFT,
-	SPLITPANEL_RIGHT,
-	SPLITPANEL_COUNT
+        SPLITPANEL_TOP,
+        SPLITPANEL_BOTTOM,
+        SPLITPANEL_LEFT,
+        SPLITPANEL_RIGHT,
+        SPLITPANEL_COUNT
 };
 
 class SplitPanelManager : public ::cppu::WeakImplHelper1< css::lang::XComponent >
         DECL_LINK( StartSplit, SplitWindow * );
         DECL_LINK( Split, SplitWindow * );
         DECL_LINK( SplitResize, SplitWindow * );
-	    DECL_LINK( FadeIn, SplitWindow * );
-	    DECL_LINK( FadeOut, SplitWindow * );
+            DECL_LINK( FadeIn, SplitWindow * );
+            DECL_LINK( FadeOut, SplitWindow * );
     
         //---------------------------------------------------------------------------------------------------------
         // XInterface
         struct DockedWinInfo
         {
             sal_uInt16                               nId;
-	        css::uno::Reference< css::awt::XWindow > xWindow;
-	        long                                     nSize;
-	    };
-	    
-	    sal_uInt16     implts_getUniqueItemid();
-	    DockedWinInfo* impl_getDockedWinInfo( sal_uInt16 nId );
-	    sal_Int32      implts_getItemsSize();
-        ::Point        impl_calcDockingMousePos( const ::Point& aOutputMousePos );
-        bool           implts_removeDockedWindowInfo( sal_uInt16 nId );
-        void           implts_setLayoutDirty();
-        DockingInfo    implts_getDockingInfoForEmptyContainer( const Rectangle& rDockRect );
+            css::uno::Reference< css::awt::XWindow > xWindow;
+            long                                     nSize;
+        };
+            
+        sal_uInt16    implts_getUniqueItemid();
+        DockedWinInfo implts_getDockedWinInfo( sal_uInt16 nId );
+        sal_Int32     implts_getItemsSize();
+        ::Point       impl_calcDockingMousePos( const ::Point& aOutputMousePos );
+        bool          implts_removeDockedWindowInfo( sal_uInt16 nId );
+        void          implts_setLayoutDirty();
+        DockingInfo   implts_getDockingInfoForEmptyContainer( const Rectangle& rDockRect );
 
         typedef std::vector< DockedWinInfo > DockedWindows;
         

framework/source/uielement/panelwindow.cxx

 #include "precompiled_framework.hxx"
 
 //_________________________________________________________________________________________________________________
-//	my own includes
+//      my own includes
 //_________________________________________________________________________________________________________________
 
 #include <uielement/panelwindow.hxx>
     
     Rectangle aRect = ImplGetCloserRect();
     
-	if ( bHighlight )
-	{
-	    SetLineColor( rStyleSettings.GetHighlightColor() );
-	    SetFillColor( rStyleSettings.GetHighlightColor() );
-	}
-	else
-	{
-	    SetLineColor( rStyleSettings.GetFaceColor() );
-	    SetFillColor( rStyleSettings.GetFaceColor() );
-	}
+        if ( bHighlight )
+        {
+            SetLineColor( rStyleSettings.GetHighlightColor() );
+            SetFillColor( rStyleSettings.GetHighlightColor() );
+        }
+        else
+        {
+            SetLineColor( rStyleSettings.GetFaceColor() );
+            SetFillColor( rStyleSettings.GetFaceColor() );
+        }
     
     Rectangle aRedrawRect = ImplGetCloserSensitiveRect();
     DrawRect( aRedrawRect );
         sal_Int32 nWidth  = GetOutputSizePixel().getWidth();
         
         ::Rectangle aInRect( 0, 0, nWidth, nHeight );
-		SetLineColor( rStyleSettings.GetFaceColor() );
-		SetFillColor( rStyleSettings.GetFaceColor() );
-		SetTextColor( rStyleSettings.GetButtonTextColor() );
+                SetLineColor( rStyleSettings.GetFaceColor() );
+                SetFillColor( rStyleSettings.GetFaceColor() );
+                SetTextColor( rStyleSettings.GetButtonTextColor() );
         DrawRect( aInRect );
 
         ImplDrawGrip( ::Size( nWidth, nHeight ));
         aInRect.SetSize( Size( nTextWidth, nTextHeight ));
         
         TextRectInfo aInfo;
-		GetTextRect( aInRect, GetText(), nTextStyle, &aInfo );
-		DrawText( aInRect, GetText(), nTextStyle );
+                GetTextRect( aInRect, GetText(), nTextStyle, &aInfo );
+                DrawText( aInRect, GetText(), nTextStyle );
         
         ImplDrawCloser( m_bCloserHighlight );
     }
 
 BOOL PanelWindow::Close()
 {
-	::com::sun::star::lang::EventObject aEvent;
-	aEvent.Source = GetComponentInterface();
+        ::com::sun::star::lang::EventObject aEvent;
+        aEvent.Source = GetComponentInterface();
     
     try
     {
     m_pContentWindow = pContentWindow;
     if ( m_pContentWindow != NULL )
     {
-		m_pContentWindow->SetParent(this);
-		m_pContentWindow->SetSizePixel( GetOutputSizePixel() );
-		m_pContentWindow->Show();
+                m_pContentWindow->SetParent(this);
+                m_pContentWindow->SetSizePixel( GetOutputSizePixel() );
+                m_pContentWindow->Show();
     }
 }
 
 void PanelWindow::Command( const CommandEvent& rCEvt )
 {
-	if ( m_aCommandHandler.IsSet() )
-		m_aCommandHandler.Call( (void *)( &rCEvt ));
+        if ( m_aCommandHandler.IsSet() )
+                m_aCommandHandler.Call( (void *)( &rCEvt ));
     DockingWindow::Command( rCEvt );
 }
 
     
     if ( m_pContentWindow )
     {
-		m_pContentWindow->SetPosPixel( aPos );
-		m_pContentWindow->SetSizePixel( aSize );
-	}
+                m_pContentWindow->SetPosPixel( aPos );
+                m_pContentWindow->SetSizePixel( aSize );
+        }
 }
 
 BOOL PanelWindow::PrepareToggleFloatingMode()
 {
-	::com::sun::star::lang::EventObject aEvent;
-	aEvent.Source = GetComponentInterface();
+        ::com::sun::star::lang::EventObject aEvent;
+        aEvent.Source = GetComponentInterface();
     
     try
     {
 
 void PanelWindow::ToggleFloatingMode()
 {
-	::com::sun::star::lang::EventObject aEvent;
-	aEvent.Source = GetComponentInterface();
+        ::com::sun::star::lang::EventObject aEvent;
+        aEvent.Source = GetComponentInterface();
     
     try
     {
     bool bFloating( true );
     try
     {
-	    ::com::sun::star::awt::DockingEvent aEvent;
-	    aEvent.Source = GetComponentInterface();
+            ::com::sun::star::awt::DockingEvent aEvent;
+            aEvent.Source = GetComponentInterface();
         aEvent.TrackingRectangle = AWTRectangle( rRect );
         aEvent.MousePos.X = rPos.X();
         aEvent.MousePos.Y = rPos.Y();
     return bFloating;
 }
 
-void PanelWindow::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
+void PanelWindow::EndDocking( const Rectangle& rRect, BOOL /*bFloatMode*/ )
 {
     try
     {
-	    awt::EndDockingEvent aEvent;
-	    aEvent.Source = GetComponentInterface();
+        awt::EndDockingEvent aEvent;
+        aEvent.Source = GetComponentInterface();
         aEvent.WindowRectangle = AWTRectangle( rRect );
         aEvent.bFloating = IsFloatingMode();
         aEvent.bCancelled = IsDockingCanceled();