[Uml-devel] kdesdk/umbrello/umbrello

Jonathan Riddell jri at jriddell.org
Tue Feb 4 15:33:05 UTC 2003


CVS commit by jriddell: 

Added zoom and canvas size to serialisation, so carried over when cutting and pasteing


  M +2 -0      umlview.cpp   1.15
  M +11 -2     umlviewdata.cpp   1.4


--- kdesdk/umbrello/umbrello/umlview.cpp  #1.14:1.15
@@ -1750,4 +1750,6 @@ bool UMLView::activateAfterSerialize( bo
                         endPartialWidgetPaste();
                 }
+                resizeCanvasToItems();
+                setZoom( m_pData->getZoom() );
         }//end if active
         if(status) {

--- kdesdk/umbrello/umbrello/umlviewdata.cpp  #1.3:1.4
@@ -100,4 +100,7 @@ bool UMLViewData::serialize( QDataStream
                 << m_nSnapX
                 << m_nSnapY
+                << m_nZoom
+                << m_nCanvasWidth
+                << m_nCanvasHeight
                 << (int)m_bShowSnapGrid
                 << (int)m_bUseSnapToGrid
@@ -120,11 +123,15 @@ bool UMLViewData::serialize( QDataStream
                 >>      m_Options.uiState.fillColor
                 >>      m_Options.uiState.lineColor;
-                if (fileversion > 4)
+                if (fileversion > 4) {
                         *stream >> m_Options.uiState.font
                         >> nUseFC
                         >> m_nSnapX
                         >> m_nSnapY
+                        >> m_nZoom
+                        >> m_nCanvasWidth
+                        >> m_nCanvasHeight
                         >> nShowsnap
                         >> nSnapgrid;
+                }
                 *stream >> nTemp;
                 if (fileversion < 5)
@@ -152,5 +159,4 @@ bool UMLViewData::serialize( QDataStream
                 m_bUseSnapToGrid = nSnapgrid;
                 m_bShowSnapGrid = nShowsnap;
-                //FIXME serialise zoom, canvas height & width
 
                 if (fileversion > 4)
@@ -197,4 +203,7 @@ long UMLViewData::getClipSizeOf() {
         l_size += sizeof( m_nSnapX );
         l_size += sizeof( m_nSnapY );
+        l_size += sizeof( m_nZoom );
+        l_size += sizeof( m_nCanvasWidth );
+        l_size += sizeof( m_nCanvasHeight );
         l_size += sizeof( int) * 2; //m_bUseSnapToGrid m_bShowSnapGrid
 






More information about the umbrello-devel mailing list