[ooo-build-commit] patches/dev300

Radek Doulík rodo at kemper.freedesktop.org
Tue Aug 11 02:33:17 PDT 2009


 patches/dev300/sd-layoutcode.diff |  279 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 265 insertions(+), 14 deletions(-)

New commits:
commit 01c03f2435b3790a4bcce08013aade2e1ec89a41
Author: Dona Hertel <cocofan at mailbolt.com>
Date:   Sun Aug 9 22:30:59 2009 -0700

    added comments to layoutcode.
    
    * patches/dev300/sd-layoutcode.diff:

diff --git a/patches/dev300/sd-layoutcode.diff b/patches/dev300/sd-layoutcode.diff
index 4b59efc..fc0542e 100644
--- a/patches/dev300/sd-layoutcode.diff
+++ b/patches/dev300/sd-layoutcode.diff
@@ -689,7 +689,7 @@ diff -Nrup sd-m16/inc/pres.hxx sd/inc/pres.hxx
  	PK_STANDARD,
 diff -Nrup sd-m16/inc/sdpage.hxx sd/inc/sdpage.hxx
 --- sd-m16/inc/sdpage.hxx	2009-07-25 19:24:39.000000000 -0700
-+++ sd/inc/sdpage.hxx	2009-07-31 00:10:16.000000000 -0700
++++ sd/inc/sdpage.hxx	2009-08-06 18:01:33.000000000 -0700
 @@ -45,6 +45,8 @@
  #include <list>
  #include <functional>
@@ -2453,7 +2453,7 @@ diff -Nrup sd-m16/source/core/layoutlist.cxx sd/source/core/layoutlist.cxx
 +
 diff -Nrup sd-m16/source/core/layouttype.cxx sd/source/core/layouttype.cxx
 --- sd-m16/source/core/layouttype.cxx	1969-12-31 16:00:00.000000000 -0800
-+++ sd/source/core/layouttype.cxx	2009-08-04 22:53:36.000000000 -0700
++++ sd/source/core/layouttype.cxx	2009-08-09 22:22:28.000000000 -0700
 @@ -0,0 +1,986 @@
 +/*************************************************************************
 + *
@@ -3441,6 +3441,237 @@ diff -Nrup sd-m16/source/core/layouttype.cxx sd/source/core/layouttype.cxx
 +
 +
 +
+diff -Nrup sd-m16/source/core/layouttype.hxx sd/source/core/layouttype.hxx
+--- sd-m16/source/core/layouttype.hxx	1969-12-31 16:00:00.000000000 -0800
++++ sd/source/core/layouttype.hxx	2009-08-09 22:22:34.000000000 -0700
+@@ -0,0 +1,227 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: layouttype.hxx,v $
++ * $Revision: 0.1 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++
++#ifndef _LAYOUTTYPE_HXX
++#define _LAYOUTTYPE_HXX
++
++#include <vector>
++#include <cppuhelper/implbase1.hxx>
++
++#include <com/sun/star/text/WritingMode.hpp>
++#include "sal/types.h"
++#include "tools/string.hxx"
++#include "tools/gen.hxx"
++#include "pres.hxx"
++#include <sax/fshelper.hxx>
++#include <com/sun/star/uno/Reference.hxx>
++#include <com/sun/star/xml/dom/XDocumentBuilder.hpp>
++
++
++
++using ::com::sun::star::uno::Reference;
++using namespace ::com::sun::star::xml;
++using namespace ::com::sun::star::text;
++using namespace ::sax_fastparser;
++
++namespace sd {
++  
++   typedef String LString;
++
++   /** RectType determines which
++    *  standard rectangle to use
++    *  to calculate bounding rects
++    *  and also determine the factors
++    *  used to calculate the custom
++    *  rects.
++    */
++    
++   enum RectType {
++	   RT_TITLE,  // a non-vertical title
++	   RT_VERTICAL_TITLE, // a vertical title
++	   RT_LAYOUT,  // a non-vertical non-title shape
++	   RT_VERTICAL_LAYOUT, // a vertical non-title shape
++	   RT_TEXT_ONLY, // for the text only layout
++	   RT_LAYOUT_SWITCH, // use if shapes need switching
++	                    // for right to left writing
++	   RT_MAX
++   };
++
++   /** ElemType defines the information for
++    *  one element (or pres. object) in
++    *  a layout.
++    */
++    
++   typedef struct {
++      PresObjKind kind;  // the type of pres. object
++	  bool isVertical;   // whether to make this obj. vertical
++	  double factorX;    // factor for calculating topleft x value
++                         //      X = Xstandard + WidthStandard*factorX
++	  double factorY;    // factor for calculating topleft y value
++                         //      Y = Ystandard + HeightStandard*factorY
++	  double factorHt;   // factor for calculating height
++                         //      Height = HeightStandard*factorHt
++	  double factorWt;   // factor for calculating width
++                         //      Width = WidthStandard*factorWt
++	  RectType recttype; // type of standard rect to use
++                         // for calculating rects.
++   } ElemType;
++	
++   /** LayoutType represents the information for one autolayout 
++    */
++   
++   class LayoutType
++   {
++   public:
++	   LayoutType();
++	   ~LayoutType();
++       
++      /** functions for writing this layout to a xml configuration file */
++       void writeLayoutToFile(FastSerializerHelper& fsh, sal_Int32 autolayout);
++       void writeElementTofile(FastSerializerHelper& fsh,
++                               const sal_uInt32 i,
++                               const char* sNumber,
++                               const ElemType* elem);
++
++      /** functions for reading this layout in from a xml configuration
++       *  file.  Passes back index to the layout list.
++       */ 
++       sal_Int32 getIntValue(const Reference<dom::XNode>& node);
++       double getDoubleValue(const Reference<dom::XNode>& node);
++       sal_Int32 readLayoutFromFile(const Reference<dom::XNode>& node);
++		
++		/** get functions for variables 
++         *  other than elements 
++         */
++	   LString getName();
++       sal_Int32 getStrId();
++	   WritingMode getWritingMode();
++	   sal_uInt32 getHBitmapId();
++	   sal_uInt32 getLBitmapId();
++       PageKind getPageKind();
++	   
++	   /** get functions for elements by index
++	    * and element list functions
++        */
++	   ElemType* getElemByIndex(const sal_uInt32& nIndex);
++	   sal_uInt32 length();
++	   PresObjKind getPresKind(const sal_uInt32& nIndex);
++	   bool isVertical(const sal_uInt32& nIndex);
++	   double factorX(const sal_uInt32& nIndex);
++	   double factorY(const sal_uInt32& nIndex);
++	   double factorHt(const sal_uInt32& nIndex);
++	   double factorWt(const sal_uInt32& nIndex);
++	   RectType recttype(const sal_uInt32& nIndex);
++	   
++	   /** set functions for variables other
++        *  than elements.
++        */
++        
++	   void setName(const LString& sName);
++       void setStrId(const sal_Int32 id);
++	   void setWritingMode(const WritingMode& wmode);
++	   void setHBitmapId(const sal_uInt32& id);
++	   void setLBitmapId(const sal_uInt32& id);
++       void setPageKind(const PageKind& kind);
++
++	   
++	   /** set functions for elements and list
++        */
++        
++	   void createDefaultElement();
++	   void setPresKind(const sal_uInt32& nIndex, PresObjKind nKind);
++	   void setVertical(const sal_uInt32& nIndex, bool bVertical);
++	   void setFactorX(const sal_uInt32& nIndex, double fx);
++	   void setFactorY(const sal_uInt32& nIndex, double fy);
++	   void setFactorHt(const sal_uInt32& nIndex, double ht);
++	   void setFactorWt(const sal_uInt32& nIndex, double wt);
++	   void setRecttype(const sal_uInt32& nIndex, RectType rect);
++       /** add a passed in element to the list */
++	   void addElemToList(ElemType& rElement);
++	   /** deletes element and also removes from list */
++	   void deleteElement(const sal_uInt32& nIndex);
++	   
++	   /** sets the bounding rectangle information
++	    *  for a custom layout.  rRect is the actual
++		*  rectangle from the pres object. rStandard
++		*  is the generic title or layout rectangle.
++		*  For all titles, use RT_TITLE
++		*  and pass in the generic title rect.
++		*  For all else, use RT_LAYOUT,
++		*  (or RT_LAYOUT_SWITCH if a switching of 
++		*  rectangles is needed for right to left
++		*  writing) and pass in a generic layout rect.
++		*/
++	   void setCustomRectInfo(const sal_uInt32& nIndex, 
++                              const RectType& rType,
++                              const Rectangle& rRect,
++			      const Rectangle& rStandard);
++                              
++        /** call this to calculation the bounding rectangles for
++         *  the elements in a layout
++         */
++       void calcAutoLayoutRectangles( const Rectangle& aTitleRect,
++                                      const Rectangle& aLayoutRect,
++				      const Size& aPageSize,
++				      const bool& bRightToLeft,
++				      Rectangle* pRectangle );
++                                      
++        /** initialize the rectInfo for builtin 
++         *  layout elements.
++         *  These functions may not be
++         *  needed after the configuration
++         *  file code is done. 
++         */
++		
++	   void initializeRectInfo(const sal_uInt32& nLayout);
++	   void initFromLayoutNumber(ElemType* elem,
++                                 const sal_uInt32& i,
++                                 const sal_uInt32& nLayout);									  
++	   
++   private: 
++	   LString name;  // String name of the layout
++           sal_Int32 nStrId;  // resource id for the string.
++	   WritingMode nWritingMode; // righttoleft or toptobottom
++	   sal_uInt32 nHBitmapId;  // resource id for the High Contrast? Bitmap
++	   sal_uInt32 nLBitmapId;  // resource id for the Low contrast? Bitmap
++           PageKind nPageKind;  // the page kind for this layout (PK_STANDARD, PK_NOTES, PK_HANDOUT)
++       
++           // list of elements which the pres. objects will be
++           // from for this layout.
++	   typedef std::vector< ElemType* > ListImpl;
++	   ListImpl elemList;
++	   
++	   
++   }; // Class LayoutType
++	
++} //namespace sd
++
++#endif	   // _LAYOUTTYPE_HXX
++
 diff -Nrup sd-m16/source/core/makefile.mk sd/source/core/makefile.mk
 --- sd-m16/source/core/makefile.mk	2009-07-25 19:25:13.000000000 -0700
 +++ sd/source/core/makefile.mk	2009-07-31 00:10:17.000000000 -0700
@@ -3455,7 +3686,7 @@ diff -Nrup sd-m16/source/core/makefile.mk sd/source/core/makefile.mk
  		   $(SLO)$/sdattr.obj \
 diff -Nrup sd-m16/source/core/sdpage.cxx sd/source/core/sdpage.cxx
 --- sd-m16/source/core/sdpage.cxx	2009-07-25 19:25:13.000000000 -0700
-+++ sd/source/core/sdpage.cxx	2009-07-31 00:10:16.000000000 -0700
++++ sd/source/core/sdpage.cxx	2009-08-06 18:01:31.000000000 -0700
 @@ -1058,261 +1058,10 @@ Rectangle SdPage::GetLayoutRect() const
  |*
  \*************************************************************************/
@@ -3977,6 +4208,14 @@ diff -Nrup sd-m16/source/core/sdpage.cxx sd/source/core/sdpage.cxx
  }
  
  /*************************************************************************
+@@ -2918,6 +2720,7 @@ bool SdPage::RestoreDefaultText( SdrObje
+ 	return bRet;
+ }
+ 
++
+ void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, bool bHorizontal, std::vector< Rectangle >& rAreas )
+ {
+ 	SdPage& rHandoutMaster = *rModel.GetMasterSdPage( 0, PK_HANDOUT );
 diff -Nrup sd-m16/source/filter/ppt/pptin.cxx sd/source/filter/ppt/pptin.cxx
 --- sd-m16/source/filter/ppt/pptin.cxx	2009-07-25 19:25:17.000000000 -0700
 +++ sd/source/filter/ppt/pptin.cxx	2009-07-31 00:10:17.000000000 -0700
@@ -4114,7 +4353,7 @@ diff -Nrup sd-m16/source/ui/slidesorter/controller/SlsSlotManager.cxx sd/source/
          break;
 diff -Nrup sd-m16/source/ui/toolpanel/LayoutMenu.cxx sd/source/ui/toolpanel/LayoutMenu.cxx
 --- sd-m16/source/ui/toolpanel/LayoutMenu.cxx	2009-07-25 19:25:16.000000000 -0700
-+++ sd/source/ui/toolpanel/LayoutMenu.cxx	2009-08-04 23:40:41.000000000 -0700
++++ sd/source/ui/toolpanel/LayoutMenu.cxx	2009-08-09 22:22:50.000000000 -0700
 @@ -129,99 +129,6 @@ SFX_IMPL_INTERFACE(LayoutMenu, SfxShell,
  
  TYPEINIT1(LayoutMenu, SfxShell);
@@ -4215,16 +4454,19 @@ diff -Nrup sd-m16/source/ui/toolpanel/LayoutMenu.cxx sd/source/ui/toolpanel/Layo
  LayoutMenu::LayoutMenu (
      TreeNode* pParent,
      DrawDocShell& rDocumentShell,
-@@ -763,43 +670,77 @@ void LayoutMenu::Fill (void)
+@@ -763,43 +670,89 @@ void LayoutMenu::Fill (void)
      catch (RuntimeException&)
      {}
      
 -	snewfoil_value_info* pInfo = NULL;
++    // Get layoutlist 
 +    LayoutList* list = GetLayoutList();
 +	PageKind eMenu;
 +	bool aViewExists = true;
 +	LayoutType* layout;
 +
++    // determine which view (PageKind) so we can set the right
++    // menu
      if (sCenterPaneViewName.equals(framework::FrameworkHelper::msNotesViewURL))
      {
 -        pInfo = notes;
@@ -4248,6 +4490,7 @@ diff -Nrup sd-m16/source/ui/toolpanel/LayoutMenu.cxx sd/source/ui/toolpanel/Layo
 +		aViewExists = false;
  	}
  
++   
      Clear();
 -    int n = 0;
 -	for (sal_uInt16 i=1; pInfo!=NULL&&pInfo->mnBmpResId!=0; i++,pInfo++)
@@ -4276,37 +4519,45 @@ diff -Nrup sd-m16/source/ui/toolpanel/LayoutMenu.cxx sd/source/ui/toolpanel/Layo
 +    
 +	sal_uInt32 size = list->getMenuLength(eMenu);
 +	
++    // for each entry in the menu order list
 +	index = 1;
 +	if (aViewExists) {
 +	   for (sal_uInt16 i=0; i < size; i++)
 +	   {
++           // get the LayoutType for this menu entry
 +		   layout = list->getLayoutAtMenuIndex(i,eMenu);
-+		   if(layout) 
++		   if(layout) // some layouts can be NULL
 +		   {
-+		      name = layout->getName();
-+		      lnum = list->getLayoutIndex(name);
-+			  if(lnum == LL_NOT_FOUND)
++		      name = layout->getName();  // get string name
++		      lnum = list->getLayoutIndex(name); // get index in list
++			  if(lnum == LL_NOT_FOUND) // no layout at this index, so skip
 +              {
 +                 continue;
 +              }
-+              resId = layout->getStrId();
++              resId = layout->getStrId(); // get resource ID string if there
 +              if(resId != -1) // if it has an ID, pull string from resource.
 +              {
 +                  name = SdResId(resId);
 +              }
-+	          wm = layout->getWritingMode();
++	          wm = layout->getWritingMode();  
 +		      Hbitmap = layout->getHBitmapId();
-+		      Lbitmap = layout->getLBitmapId(); 
++		      Lbitmap = layout->getLBitmapId();
++              // if its vertical but not Right to Left
 +		      if((wm != WritingMode_TB_RL) || bVertical)
 +		      {
++                  // set which bitmap for the icon to use.
 +		         BitmapEx aBmp (SdResId (bHighContrast 
 +                               ? Hbitmap
 +                              : Lbitmap));
++                // need to reverse the bitmap image for right to left
 +		         if(bRightToLeft && (wm != WritingMode_TB_RL))
 +		            aBmp.Mirror(BMP_MIRROR_HORZ);
++                  // insert into the menu
 +		          InsertItem (index, aBmp, name);
++                  // set the index into the layout list to
++                  // be passed back to SdPage.
 +                  SetItemData (index, new AutoLayout(lnum));
-+                  index++;
++                  index++; // go to next menu item
 +		       
 +		      } //if wm...
 +	       } //if layout..
@@ -4315,7 +4566,7 @@ diff -Nrup sd-m16/source/ui/toolpanel/LayoutMenu.cxx sd/source/ui/toolpanel/Layo
  
      mbSelectionUpdatePending = true;
  }
-@@ -904,9 +845,7 @@ void LayoutMenu::UpdateSelection (void)
+@@ -904,9 +857,7 @@ void LayoutMenu::UpdateSelection (void)
  
          // Get layout of current page.
          AutoLayout aLayout (pCurrentPage->GetAutoLayout());


More information about the ooo-build-commit mailing list